78#ifndef PY_SSIZE_T_CLEAN
79#define PY_SSIZE_T_CLEAN
82#if defined(Py_LIMITED_API)
83 #if !defined(CYTHON_LIMITED_API)
84 #define CYTHON_LIMITED_API 1
86#elif defined(CYTHON_LIMITED_API)
88 #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.")
90 #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.
96 #error Python headers needed to compile C extensions, please install development version of Python.
97#elif PY_VERSION_HEX < 0x03090000
98 #error Cython requires Python 3.9+.
99#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
100 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
102#define __PYX_ABI_VERSION "3_3_0"
103#define CYTHON_HEX_VERSION 0x030300F0
104#define CYTHON_FUTURE_DIVISION 1
108 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
110#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
122 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
124 #define __Pyx_has_cbuiltin(name) (0)
127 #define DL_IMPORT(t) t
130 #define DL_EXPORT(t) t
134 #define PY_LONG_LONG LONG_LONG
137 #define Py_HUGE_VAL HUGE_VAL
139#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
140#if defined(CYTHON_LIMITED_API)
141 #ifdef Py_LIMITED_API
142 #undef __PYX_LIMITED_VERSION_HEX
143 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
144 #if Py_LIMITED_API < 0x03090000
145 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
148 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
150 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
151 code for PyPy and GraalPy and is unlikely to work.")
153 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
154 code for PyPy and GraalPy and is unlikely to work."
157 #define CYTHON_COMPILING_IN_PYPY 0
158 #define CYTHON_COMPILING_IN_CPYTHON 0
159 #define CYTHON_COMPILING_IN_LIMITED_API 1
160 #define CYTHON_COMPILING_IN_GRAAL 0
161 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
162 #undef CYTHON_USE_TYPE_SLOTS
163 #define CYTHON_USE_TYPE_SLOTS 0
164 #undef CYTHON_USE_TYPE_SPECS
165 #define CYTHON_USE_TYPE_SPECS 1
166 #undef CYTHON_USE_PYTYPE_LOOKUP
167 #define CYTHON_USE_PYTYPE_LOOKUP 0
168 #undef CYTHON_USE_PYLIST_INTERNALS
169 #define CYTHON_USE_PYLIST_INTERNALS 0
170 #undef CYTHON_USE_UNICODE_INTERNALS
171 #define CYTHON_USE_UNICODE_INTERNALS 0
172 #ifndef CYTHON_USE_UNICODE_WRITER
173 #define CYTHON_USE_UNICODE_WRITER 0
175 #undef CYTHON_USE_PYLONG_INTERNALS
176 #define CYTHON_USE_PYLONG_INTERNALS 0
177 #ifndef CYTHON_AVOID_BORROWED_REFS
178 #define CYTHON_AVOID_BORROWED_REFS 0
180 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
181 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
183 #undef CYTHON_ASSUME_SAFE_MACROS
184 #define CYTHON_ASSUME_SAFE_MACROS 0
185 #undef CYTHON_ASSUME_SAFE_SIZE
186 #define CYTHON_ASSUME_SAFE_SIZE 0
187 #undef CYTHON_UNPACK_METHODS
188 #define CYTHON_UNPACK_METHODS 0
189 #undef CYTHON_FAST_THREAD_STATE
190 #define CYTHON_FAST_THREAD_STATE 0
191 #undef CYTHON_FAST_GIL
192 #define CYTHON_FAST_GIL 0
193 #undef CYTHON_VECTORCALL
194 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
195 #ifndef CYTHON_VECTORCALL_TPNEW
196 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
198 #ifndef CYTHON_PEP487_INIT_SUBCLASS
199 #define CYTHON_PEP487_INIT_SUBCLASS 1
201 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
202 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
204 #ifndef CYTHON_USE_MODULE_STATE
205 #define CYTHON_USE_MODULE_STATE 0
207 #undef CYTHON_USE_SYS_MONITORING
208 #define CYTHON_USE_SYS_MONITORING 0
209 #ifndef CYTHON_USE_TP_FINALIZE
210 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
212 #ifndef CYTHON_USE_AM_SEND
213 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
215 #undef CYTHON_USE_DICT_VERSIONS
216 #define CYTHON_USE_DICT_VERSIONS 0
217 #undef CYTHON_USE_EXC_INFO_STACK
218 #define CYTHON_USE_EXC_INFO_STACK 0
219 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
220 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
222 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
223 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
225 #ifndef CYTHON_USE_FREELISTS
226 #define CYTHON_USE_FREELISTS 1
228 #undef CYTHON_IMMORTAL_CONSTANTS
229 #define CYTHON_IMMORTAL_CONSTANTS 0
230 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
231 #undef CYTHON_OPAQUE_OBJECTS
232 #define CYTHON_OPAQUE_OBJECTS 0
233 #elif !defined(CYTHON_OPAQUE_OBJECTS)
234 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
236#elif defined(GRAALVM_PYTHON)
239 #define CYTHON_COMPILING_IN_PYPY 0
240 #define CYTHON_COMPILING_IN_CPYTHON 0
241 #define CYTHON_COMPILING_IN_LIMITED_API 0
242 #define CYTHON_COMPILING_IN_GRAAL 1
243 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
244 #ifndef CYTHON_USE_TYPE_SLOTS
245 #define CYTHON_USE_TYPE_SLOTS 0
247 #undef CYTHON_USE_TYPE_SPECS
248 #define CYTHON_USE_TYPE_SPECS 0
249 #undef CYTHON_USE_PYTYPE_LOOKUP
250 #define CYTHON_USE_PYTYPE_LOOKUP 0
251 #undef CYTHON_USE_PYLIST_INTERNALS
252 #define CYTHON_USE_PYLIST_INTERNALS 0
253 #undef CYTHON_USE_UNICODE_INTERNALS
254 #define CYTHON_USE_UNICODE_INTERNALS 0
255 #undef CYTHON_USE_UNICODE_WRITER
256 #define CYTHON_USE_UNICODE_WRITER 0
257 #undef CYTHON_USE_PYLONG_INTERNALS
258 #define CYTHON_USE_PYLONG_INTERNALS 0
259 #undef CYTHON_AVOID_BORROWED_REFS
260 #define CYTHON_AVOID_BORROWED_REFS 1
261 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
262 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
263 #undef CYTHON_ASSUME_SAFE_MACROS
264 #define CYTHON_ASSUME_SAFE_MACROS 0
265 #undef CYTHON_ASSUME_SAFE_SIZE
266 #define CYTHON_ASSUME_SAFE_SIZE 0
267 #undef CYTHON_UNPACK_METHODS
268 #define CYTHON_UNPACK_METHODS 0
269 #undef CYTHON_FAST_THREAD_STATE
270 #define CYTHON_FAST_THREAD_STATE 0
271 #undef CYTHON_FAST_GIL
272 #define CYTHON_FAST_GIL 0
273 #ifndef CYTHON_VECTORCALL
274 #define CYTHON_VECTORCALL 1
276 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
277 #undef CYTHON_VECTORCALL_TPNEW
278 #define CYTHON_VECTORCALL_TPNEW 0
279 #elif !defined(CYTHON_VECTORCALL_TPNEW)
280 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
282 #ifndef CYTHON_PEP487_INIT_SUBCLASS
283 #define CYTHON_PEP487_INIT_SUBCLASS 1
285 #undef CYTHON_PEP489_MULTI_PHASE_INIT
286 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
287 #undef CYTHON_USE_MODULE_STATE
288 #define CYTHON_USE_MODULE_STATE 0
289 #undef CYTHON_USE_SYS_MONITORING
290 #define CYTHON_USE_SYS_MONITORING 0
291 #undef CYTHON_USE_TP_FINALIZE
292 #define CYTHON_USE_TP_FINALIZE 0
293 #undef CYTHON_USE_AM_SEND
294 #define CYTHON_USE_AM_SEND 0
295 #undef CYTHON_USE_DICT_VERSIONS
296 #define CYTHON_USE_DICT_VERSIONS 0
297 #undef CYTHON_USE_EXC_INFO_STACK
298 #define CYTHON_USE_EXC_INFO_STACK 1
299 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
300 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
302 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
303 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
305 #undef CYTHON_USE_FREELISTS
306 #define CYTHON_USE_FREELISTS 0
307 #undef CYTHON_IMMORTAL_CONSTANTS
308 #define CYTHON_IMMORTAL_CONSTANTS 0
309 #undef CYTHON_OPAQUE_OBJECTS
310 #define CYTHON_OPAQUE_OBJECTS 0
311#elif defined(PYPY_VERSION)
312 #define CYTHON_COMPILING_IN_PYPY 1
313 #define CYTHON_COMPILING_IN_CPYTHON 0
314 #define CYTHON_COMPILING_IN_LIMITED_API 0
315 #define CYTHON_COMPILING_IN_GRAAL 0
316 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
317 #undef CYTHON_USE_TYPE_SLOTS
318 #define CYTHON_USE_TYPE_SLOTS 1
319 #ifndef CYTHON_USE_TYPE_SPECS
320 #define CYTHON_USE_TYPE_SPECS 0
322 #undef CYTHON_USE_PYTYPE_LOOKUP
323 #define CYTHON_USE_PYTYPE_LOOKUP 0
324 #undef CYTHON_USE_PYLIST_INTERNALS
325 #define CYTHON_USE_PYLIST_INTERNALS 0
326 #undef CYTHON_USE_UNICODE_INTERNALS
327 #define CYTHON_USE_UNICODE_INTERNALS 0
328 #undef CYTHON_USE_UNICODE_WRITER
329 #define CYTHON_USE_UNICODE_WRITER 0
330 #undef CYTHON_USE_PYLONG_INTERNALS
331 #define CYTHON_USE_PYLONG_INTERNALS 0
332 #undef CYTHON_AVOID_BORROWED_REFS
333 #define CYTHON_AVOID_BORROWED_REFS 1
334 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
335 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
336 #undef CYTHON_ASSUME_SAFE_MACROS
337 #define CYTHON_ASSUME_SAFE_MACROS 0
338 #ifndef CYTHON_ASSUME_SAFE_SIZE
339 #define CYTHON_ASSUME_SAFE_SIZE 1
341 #undef CYTHON_UNPACK_METHODS
342 #define CYTHON_UNPACK_METHODS 0
343 #undef CYTHON_FAST_THREAD_STATE
344 #define CYTHON_FAST_THREAD_STATE 0
345 #undef CYTHON_FAST_GIL
346 #define CYTHON_FAST_GIL 0
347 #ifndef CYTHON_VECTORCALL
348 #define CYTHON_VECTORCALL 1
350 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
351 #undef CYTHON_VECTORCALL_TPNEW
352 #define CYTHON_VECTORCALL_TPNEW 0
353 #elif !defined(CYTHON_VECTORCALL_TPNEW)
354 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
356 #ifndef CYTHON_PEP487_INIT_SUBCLASS
357 #define CYTHON_PEP487_INIT_SUBCLASS 1
359 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
360 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
362 #undef CYTHON_USE_MODULE_STATE
363 #define CYTHON_USE_MODULE_STATE 0
364 #undef CYTHON_USE_SYS_MONITORING
365 #define CYTHON_USE_SYS_MONITORING 0
366 #ifndef CYTHON_USE_TP_FINALIZE
367 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
369 #undef CYTHON_USE_AM_SEND
370 #define CYTHON_USE_AM_SEND 0
371 #undef CYTHON_USE_DICT_VERSIONS
372 #define CYTHON_USE_DICT_VERSIONS 0
373 #undef CYTHON_USE_EXC_INFO_STACK
374 #define CYTHON_USE_EXC_INFO_STACK 0
375 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
376 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
378 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
379 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
381 #undef CYTHON_USE_FREELISTS
382 #define CYTHON_USE_FREELISTS 0
383 #undef CYTHON_IMMORTAL_CONSTANTS
384 #define CYTHON_IMMORTAL_CONSTANTS 0
385 #undef CYTHON_OPAQUE_OBJECTS
386 #define CYTHON_OPAQUE_OBJECTS 0
388 #define CYTHON_COMPILING_IN_PYPY 0
389 #define CYTHON_COMPILING_IN_CPYTHON 1
390 #define CYTHON_COMPILING_IN_LIMITED_API 0
391 #define CYTHON_COMPILING_IN_GRAAL 0
392 #ifdef Py_GIL_DISABLED
393 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
395 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
397 #if PY_VERSION_HEX < 0x030A0000
398 #undef CYTHON_USE_TYPE_SLOTS
399 #define CYTHON_USE_TYPE_SLOTS 1
400 #elif !defined(CYTHON_USE_TYPE_SLOTS)
401 #define CYTHON_USE_TYPE_SLOTS 1
403 #ifndef CYTHON_USE_TYPE_SPECS
404 #define CYTHON_USE_TYPE_SPECS 0
406 #ifndef CYTHON_USE_PYTYPE_LOOKUP
407 #define CYTHON_USE_PYTYPE_LOOKUP 1
409 #ifndef CYTHON_USE_PYLONG_INTERNALS
410 #define CYTHON_USE_PYLONG_INTERNALS 1
412 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
413 #undef CYTHON_USE_PYLIST_INTERNALS
414 #define CYTHON_USE_PYLIST_INTERNALS 0
415 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
416 #define CYTHON_USE_PYLIST_INTERNALS 1
418 #ifndef CYTHON_USE_UNICODE_INTERNALS
419 #define CYTHON_USE_UNICODE_INTERNALS 1
421 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
422 #undef CYTHON_USE_UNICODE_WRITER
423 #define CYTHON_USE_UNICODE_WRITER 0
424 #elif !defined(CYTHON_USE_UNICODE_WRITER)
425 #define CYTHON_USE_UNICODE_WRITER 1
427 #ifndef CYTHON_AVOID_BORROWED_REFS
428 #define CYTHON_AVOID_BORROWED_REFS 0
430 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
431 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
432 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
433 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
434 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
436 #ifndef CYTHON_ASSUME_SAFE_MACROS
437 #define CYTHON_ASSUME_SAFE_MACROS 1
439 #ifndef CYTHON_ASSUME_SAFE_SIZE
440 #define CYTHON_ASSUME_SAFE_SIZE 1
442 #ifndef CYTHON_UNPACK_METHODS
443 #define CYTHON_UNPACK_METHODS 1
445 #ifndef CYTHON_FAST_THREAD_STATE
446 #define CYTHON_FAST_THREAD_STATE 1
448 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
449 #undef CYTHON_FAST_GIL
450 #define CYTHON_FAST_GIL 0
451 #elif !defined(CYTHON_FAST_GIL)
452 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
454 #ifndef CYTHON_VECTORCALL
455 #define CYTHON_VECTORCALL 1
457 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
458 #undef CYTHON_VECTORCALL_TPNEW
459 #define CYTHON_VECTORCALL_TPNEW 0
460 #elif !defined(CYTHON_VECTORCALL_TPNEW)
461 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
463 #ifndef CYTHON_PEP487_INIT_SUBCLASS
464 #define CYTHON_PEP487_INIT_SUBCLASS 1
466 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
467 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
469 #ifndef CYTHON_USE_MODULE_STATE
470 #define CYTHON_USE_MODULE_STATE 0
472 #ifndef CYTHON_USE_SYS_MONITORING
473 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
475 #ifndef CYTHON_USE_TP_FINALIZE
476 #define CYTHON_USE_TP_FINALIZE 1
478 #ifndef CYTHON_USE_AM_SEND
479 #define CYTHON_USE_AM_SEND 1
481 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
482 #undef CYTHON_USE_DICT_VERSIONS
483 #define CYTHON_USE_DICT_VERSIONS 0
484 #elif !defined(CYTHON_USE_DICT_VERSIONS)
485 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
487 #ifndef CYTHON_USE_EXC_INFO_STACK
488 #define CYTHON_USE_EXC_INFO_STACK 1
490 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
491 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
493 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
494 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
496 #ifndef CYTHON_USE_FREELISTS
497 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
499 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
500 #undef CYTHON_IMMORTAL_CONSTANTS
501 #define CYTHON_IMMORTAL_CONSTANTS 0
502 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
503 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
505 #ifndef CYTHON_OPAQUE_OBJECTS
506 #define CYTHON_OPAQUE_OBJECTS 0
509#if CYTHON_USE_PYLONG_INTERNALS
514 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
517#ifndef __has_attribute
518 #define __has_attribute(x) 0
520#ifndef __has_cpp_attribute
521 #define __has_cpp_attribute(x) 0
523#ifndef CYTHON_RESTRICT
524 #if defined(__GNUC__)
525 #define CYTHON_RESTRICT __restrict__
526 #elif defined(_MSC_VER) && _MSC_VER >= 1400
527 #define CYTHON_RESTRICT __restrict
528 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
529 #define CYTHON_RESTRICT restrict
531 #define CYTHON_RESTRICT
535 #if defined(__cplusplus)
538 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
539 #if __has_cpp_attribute(maybe_unused)
540 #define CYTHON_UNUSED [[maybe_unused]]
543 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
544 #define CYTHON_UNUSED [[maybe_unused]]
548# if defined(__GNUC__)
549# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
550# define CYTHON_UNUSED __attribute__ ((__unused__))
552# define CYTHON_UNUSED
554# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
555# define CYTHON_UNUSED __attribute__ ((__unused__))
557# define CYTHON_UNUSED
560#ifndef CYTHON_UNUSED_VAR
561# if defined(__cplusplus)
562 template<
class T>
void CYTHON_UNUSED_VAR(
const T& ) { }
564# define CYTHON_UNUSED_VAR(x) (void)(x)
567#ifndef CYTHON_MAYBE_UNUSED_VAR
568 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
570#ifndef CYTHON_NCP_UNUSED
571# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
572# define CYTHON_NCP_UNUSED
574# define CYTHON_NCP_UNUSED CYTHON_UNUSED
577#ifndef CYTHON_USE_CPP_STD_MOVE
578 #if defined(__cplusplus) && (\
579 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
580 #define CYTHON_USE_CPP_STD_MOVE 1
582 #define CYTHON_USE_CPP_STD_MOVE 0
585#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
587typedef uintptr_t __pyx_uintptr_t;
588#ifndef CYTHON_FALLTHROUGH
589 #if defined(__cplusplus)
592 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
593 #if __has_cpp_attribute(fallthrough)
594 #define CYTHON_FALLTHROUGH [[fallthrough]]
597 #ifndef CYTHON_FALLTHROUGH
598 #if __has_cpp_attribute(clang::fallthrough)
599 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
600 #elif __has_cpp_attribute(gnu::fallthrough)
601 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
605 #ifndef CYTHON_FALLTHROUGH
606 #if __has_attribute(fallthrough)
607 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
609 #define CYTHON_FALLTHROUGH
612 #if defined(__clang__) && defined(__apple_build_version__)
613 #if __apple_build_version__ < 7000000
614 #undef CYTHON_FALLTHROUGH
615 #define CYTHON_FALLTHROUGH
620 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
621#elif __Pyx_has_cbuiltin(__builtin_unreachable)
622 #define __Pyx_UNREACHABLE() __builtin_unreachable()
623#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
624 #define __Pyx_UNREACHABLE() __builtin_unreachable()
625#elif defined(_MSC_VER)
626 #define __Pyx_UNREACHABLE() __assume(0)
628 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
630#ifndef Py_UNREACHABLE
631 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
634 template <
typename T>
635 struct __PYX_IS_UNSIGNED_IMPL {
static const bool value =
T(0) <
T(-1);};
636 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
638 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
640#if CYTHON_COMPILING_IN_PYPY == 1
641 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
643 #define __PYX_NEED_TP_PRINT_SLOT 0
645#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
646#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
647#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
648#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
650#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
651#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
656 #if defined(__clang__)
657 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
658 #elif defined(__GNUC__)
659 #define CYTHON_INLINE __inline__
660 #elif defined(_MSC_VER)
661 #define CYTHON_INLINE __inline
662 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
663 #define CYTHON_INLINE inline
665 #define CYTHON_INLINE
670#define __PYX_BUILD_PY_SSIZE_T "n"
671#define CYTHON_FORMAT_SSIZE_T "z"
672#define __Pyx_BUILTIN_MODULE_NAME "builtins"
673#define __Pyx_DefaultClassType PyType_Type
674#if CYTHON_COMPILING_IN_LIMITED_API
676 static int CO_OPTIMIZED;
679 static int CO_NEWLOCALS;
682 static int CO_VARARGS;
684 #ifndef CO_VARKEYWORDS
685 static int CO_VARKEYWORDS;
687 #ifndef CO_ASYNC_GENERATOR
688 static int CO_ASYNC_GENERATOR;
691 static int CO_GENERATOR;
694 static int CO_COROUTINE;
698 #define CO_COROUTINE 0x80
700 #ifndef CO_ASYNC_GENERATOR
701 #define CO_ASYNC_GENERATOR 0x200
704static int __Pyx_init_co_variables(
void);
705#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
706 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
708 #define __Pyx_Py_Is(x, y) ((x) == (y))
710#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
711 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
713 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
715#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
716 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
718 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
720#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
721 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
723 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
725#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
726#if CYTHON_COMPILING_IN_PYPY
727 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
729 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
731#if CYTHON_COMPILING_IN_LIMITED_API
732static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
733static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
735#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
736#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
738static int __Pyx_init_tpflags_variables(
void);
739#ifndef Py_TPFLAGS_HAVE_FINALIZE
740 #define Py_TPFLAGS_HAVE_FINALIZE 0
742#ifndef Py_TPFLAGS_SEQUENCE
743 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
745#ifndef Py_TPFLAGS_MAPPING
746 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
748#ifndef Py_TPFLAGS_IMMUTABLETYPE
749 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
751#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
752 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
754#ifndef METH_STACKLESS
755 #define METH_STACKLESS 0
757#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
758 #ifndef METH_FASTCALL
759 #define METH_FASTCALL 0x80
761 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *
const *args, Py_ssize_t nargs);
762 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *
const *args,
763 Py_ssize_t nargs, PyObject *kwnames);
765 #if PY_VERSION_HEX >= 0x030d00A4
766 # define __Pyx_PyCFunctionFast PyCFunctionFast
767 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
769 # define __Pyx_PyCFunctionFast _PyCFunctionFast
770 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
774 #define __Pyx_METH_FASTCALL METH_FASTCALL
775 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
776 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
778 #define __Pyx_METH_FASTCALL METH_VARARGS
779 #define __Pyx_PyCFunction_FastCall PyCFunction
780 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
783 #define __pyx_vectorcallfunc vectorcallfunc
784 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
785 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
787 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
788 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
790#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
791#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
792#if CYTHON_COMPILING_IN_CPYTHON
793#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
794#elif !CYTHON_COMPILING_IN_LIMITED_API
795#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
797#if CYTHON_COMPILING_IN_CPYTHON
798#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
799static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
800 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
803static CYTHON_INLINE
int __Pyx__IsSameCFunction(PyObject *func,
void (*cfunc)(
void)) {
804#if CYTHON_COMPILING_IN_LIMITED_API
805 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
807 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
810#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
811#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
812 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
814 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
816#if CYTHON_COMPILING_IN_PYPY
817 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *
const *, size_t, PyObject *);
819 #define __Pyx_PyCMethod PyCMethod
822 #define METH_METHOD 0x200
824#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
825 #define PyObject_Malloc(s) PyMem_Malloc(s)
826 #define PyObject_Free(p) PyMem_Free(p)
827 #define PyObject_Realloc(p) PyMem_Realloc(p)
829#if CYTHON_COMPILING_IN_LIMITED_API
830 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
831#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
832 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
833 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
834#elif CYTHON_COMPILING_IN_GRAAL
835 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
836 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
838 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
839 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
841#if CYTHON_COMPILING_IN_LIMITED_API
842 #define __Pyx_PyThreadState_Current PyThreadState_Get()
843#elif !CYTHON_FAST_THREAD_STATE
844 #define __Pyx_PyThreadState_Current PyThreadState_GET()
845#elif PY_VERSION_HEX >= 0x030d00A1
846 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
848 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
850#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
851 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
852 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
853 #define CYTHON_OPAQUE_SHARED_TYPES 1
855 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
856 #define __PYX_SHARED_RELATIVE_OFFSET 0
857 #define CYTHON_OPAQUE_SHARED_TYPES 0
859#if CYTHON_USE_MODULE_STATE
860static CYTHON_INLINE
void *__Pyx__PyModule_GetState(PyObject *op)
863 result = PyModule_GetState(op);
865 Py_FatalError(
"Couldn't find the module state");
868#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
870#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
872#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
873#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
874#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
875#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
876#if CYTHON_USE_TYPE_SLOTS
877 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
878 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
879 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
880 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
882 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
883 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
884 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
885 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
886 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
887 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
888 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
890#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
891#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
893#define __Pyx_PyDict_NewPresized(n) PyDict_New()
895#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
896#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
897#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
898#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
899static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
900 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
901 if (res == NULL && PyErr_Occurred()) {
902 PyErr_WriteUnraisable(NULL);
906#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
907#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
908#define __Pyx_PyDict_GetItemStr PyDict_GetItem
910static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
911#if CYTHON_COMPILING_IN_PYPY
912 return PyDict_GetItem(dict, name);
915 PyDictObject *mp = (PyDictObject*) dict;
916 long hash = ((PyStringObject *) name)->ob_shash;
918 ep = (mp->ma_lookup)(mp, name, hash);
925#define __Pyx_PyDict_GetItemStr PyDict_GetItem
927#if CYTHON_USE_TYPE_SLOTS
928 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
929 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
931 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
932 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
934#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
935#if CYTHON_USE_TYPE_SPECS
936#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
937 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
938 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
939 PyObject_GC_Del(obj);\
943#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
945#if CYTHON_COMPILING_IN_LIMITED_API
946 #define __Pyx_PyUnicode_READY(op) (0)
947 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
948 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
949 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
950 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
951 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
952 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
953 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
955 #if PY_VERSION_HEX >= 0x030C0000
956 #define __Pyx_PyUnicode_READY(op) (0)
958 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
959 0 : _PyUnicode_Ready((PyObject *)(op)))
961 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
962 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
963 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
964 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
965 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
966 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
967 #if PY_VERSION_HEX >= 0x030C0000
968 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
970 #if CYTHON_COMPILING_IN_CPYTHON
971 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
973 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
976 static CYTHON_INLINE
int __Pyx_PyUnicode_KIND_04(PyObject *o) {
977 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
980#if CYTHON_COMPILING_IN_PYPY
981 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
982 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
984 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
985 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
986 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
988#if CYTHON_COMPILING_IN_PYPY
989 #if !defined(PyUnicode_DecodeUnicodeEscape)
990 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
992 #if !defined(PyUnicode_Contains)
993 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
995 #if !defined(PyByteArray_Check)
996 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
998 #if !defined(PyObject_Format)
999 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1002#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1003#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
1004 #define __Pyx_PySequence_ListKeepNew(obj)\
1005 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1006#elif CYTHON_COMPILING_IN_CPYTHON
1007 #define __Pyx_PySequence_ListKeepNew(obj)\
1008 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1010 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1012#ifndef PySet_CheckExact
1013 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
1015enum __Pyx_ReferenceSharing {
1016 __Pyx_ReferenceSharing_DefinitelyUnique,
1017 __Pyx_ReferenceSharing_OwnStrongReference,
1018 __Pyx_ReferenceSharing_FunctionArgument,
1019 __Pyx_ReferenceSharing_SharedReference,
1021#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
1022#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
1023 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
1024 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
1025 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
1026#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
1027#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
1029#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1031#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1032 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1033#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1034 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1035 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1037 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1039#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1040 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1042 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1043 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1045#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1046 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1047 __Pyx_PyList_GetItemRef(o, i))
1048#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1049 #if CYTHON_ASSUME_SAFE_MACROS
1050 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1051 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1052 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1054 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1055 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1056 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1058#elif CYTHON_ASSUME_SAFE_MACROS
1059 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1060 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1062 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1063 __Pyx_XNewRef(PyList_GetItem(o, i)))
1065#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1066#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1067#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1068static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1069 *result = PyObject_GetItem(dict, key);
1070 if (*result == NULL) {
1071 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1080static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1081 *result = PyDict_GetItemWithError(dict, key);
1082 if (*result == NULL) {
1083 return PyErr_Occurred() ? -1 : 0;
1089#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1090 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1092 #define __Pyx_VISIT_CONST(obj)
1094#if CYTHON_ASSUME_SAFE_MACROS
1095 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1096 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1097 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1098 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1099 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1100 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1102 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1103 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1104 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1105 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1106 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1107 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1109#if CYTHON_ASSUME_SAFE_SIZE
1110 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1111 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1112 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1113 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1114 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1115 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1116 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1118 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1119 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1120 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1121 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1122 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1123 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1124 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1126#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1127 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1129#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1130#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1131#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1132 #define __Pyx_PySendResult PySendResult
1138 } __Pyx_PySendResult;
1140#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1141 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1143 #define __Pyx_pyiter_sendfunc sendfunc
1145#if !CYTHON_USE_AM_SEND
1146#define __PYX_HAS_PY_AM_SEND 0
1147#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1148#define __PYX_HAS_PY_AM_SEND 1
1150#define __PYX_HAS_PY_AM_SEND 2
1152#if __PYX_HAS_PY_AM_SEND < 2
1153 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1159 __Pyx_pyiter_sendfunc am_send;
1160 } __Pyx_PyAsyncMethodsStruct;
1161 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1163#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1164 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1166 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1168#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1172PyAPI_FUNC(
void *) PyMem_Calloc(
size_t nelem,
size_t elsize);
1174#if CYTHON_COMPILING_IN_LIMITED_API
1175static int __Pyx_init_co_variable(PyObject *inspect,
const char* name,
int *write_to) {
1177 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1178 if (!py_value)
return 0;
1179 value = (int) PyLong_AsLong(py_value);
1180 Py_DECREF(py_value);
1182 return value != -1 || !PyErr_Occurred();
1184static int __Pyx_init_co_variables(
void) {
1187 inspect = PyImport_ImportModule(
"inspect");
1189#if !defined(CO_OPTIMIZED)
1190 __Pyx_init_co_variable(inspect,
"CO_OPTIMIZED", &CO_OPTIMIZED) &&
1192#if !defined(CO_NEWLOCALS)
1193 __Pyx_init_co_variable(inspect,
"CO_NEWLOCALS", &CO_NEWLOCALS) &&
1195#if !defined(CO_VARARGS)
1196 __Pyx_init_co_variable(inspect,
"CO_VARARGS", &CO_VARARGS) &&
1198#if !defined(CO_VARKEYWORDS)
1199 __Pyx_init_co_variable(inspect,
"CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1201#if !defined(CO_ASYNC_GENERATOR)
1202 __Pyx_init_co_variable(inspect,
"CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1204#if !defined(CO_GENERATOR)
1205 __Pyx_init_co_variable(inspect,
"CO_GENERATOR", &CO_GENERATOR) &&
1207#if !defined(CO_COROUTINE)
1208 __Pyx_init_co_variable(inspect,
"CO_COROUTINE", &CO_COROUTINE) &&
1212 return result ? 0 : -1;
1214static int __Pyx_init_tpflags_bitcount(
unsigned long flag) {
1217 count += (int) (flag & 1);
1222static int __Pyx_init_tpflags_variables(
void) {
1223 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1226 PyObject *collections_abc = PyImport_ImportModule(
"collections.abc");
1227 if (!collections_abc)
return -1;
1229 PyObject *sequence = NULL, *mapping = NULL;
1230#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1231 if (PyObject_GetOptionalAttrString(collections_abc,
"Sequence", &sequence) != 1)
goto fail;
1232 if (PyObject_GetOptionalAttrString(collections_abc,
"Mapping", &mapping) != 1)
goto fail;
1234 sequence = PyObject_GetAttrString(collections_abc,
"Sequence");
1235 if (!sequence)
goto fail_attr_lookup;
1236 mapping = PyObject_GetAttrString(collections_abc,
"Mapping");
1237 if (!mapping)
goto fail_attr_lookup;
1239 if (!PyType_Check(sequence) || !PyType_Check(mapping))
goto fail;
1241 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1242 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1243 unsigned long mutual_flags = sequence_flags & mapping_flags;
1244 sequence_flags = sequence_flags ^ mutual_flags;
1245 mapping_flags = mapping_flags ^ mutual_flags;
1246 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1247 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1249 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1250 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1254 Py_XDECREF(mapping);
1255 Py_XDECREF(sequence);
1256 Py_DECREF(collections_abc);
1258#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1260 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1265 result = PyErr_Occurred() ? -1 : 0;
1269static int __Pyx_init_co_variables(
void) {
1272static int __Pyx_init_tpflags_variables(
void) {
1278#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1279 #ifndef _USE_MATH_DEFINES
1280 #define _USE_MATH_DEFINES
1284#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1285#define __Pyx_truncl trunc
1287#define __Pyx_truncl truncl
1290#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1291#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1293#ifndef CYTHON_CLINE_IN_TRACEBACK
1294#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1296#if CYTHON_CLINE_IN_TRACEBACK
1297#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; }
1299#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; }
1301#define __PYX_ERR(f_index, lineno, Ln_error) \
1302 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1304#ifdef CYTHON_EXTERN_C
1305 #undef __PYX_EXTERN_C
1306 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1307#elif defined(__PYX_EXTERN_C)
1309 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1311 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1315 #define __PYX_EXTERN_C extern "C"
1317 #define __PYX_EXTERN_C extern
1321#define __PYX_HAVE__csmoothers
1322#define __PYX_HAVE_API__csmoothers
1329#include "numpy/arrayobject.h"
1330#include "numpy/ndarrayobject.h"
1331#include "numpy/ndarraytypes.h"
1332#include "numpy/arrayscalars.h"
1333#include "numpy/ufuncobject.h"
1336#include "pythread.h"
1338 typedef int (*__pyx_memoryview_to_dtype_func_type)(
char*, PyObject*);
1345#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1346#define CYTHON_WITHOUT_ASSERTIONS
1349#ifdef CYTHON_FREETHREADING_COMPATIBLE
1350#if CYTHON_FREETHREADING_COMPATIBLE
1351#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1353#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1356#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1358#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1359#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1360#define __PYX_DEFAULT_STRING_ENCODING ""
1361#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1362#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1363#define __Pyx_uchar_cast(c) ((unsigned char)c)
1364#define __Pyx_long_cast(x) ((long)x)
1365#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1366 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1367 (sizeof(type) > sizeof(Py_ssize_t) &&\
1368 likely(v < (type)PY_SSIZE_T_MAX ||\
1369 v == (type)PY_SSIZE_T_MAX) &&\
1370 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1371 v == (type)PY_SSIZE_T_MIN))) ||\
1372 (sizeof(type) == sizeof(Py_ssize_t) &&\
1373 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1374 v == (type)PY_SSIZE_T_MAX))) )
1375static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1376 return (
size_t) i < (size_t) limit;
1378#if defined (__cplusplus) && __cplusplus >= 201103L
1380 #define __Pyx_sst_abs(value) std::abs(value)
1381#elif SIZEOF_INT >= SIZEOF_SIZE_T
1382 #define __Pyx_sst_abs(value) abs(value)
1383#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1384 #define __Pyx_sst_abs(value) labs(value)
1385#elif defined (_MSC_VER)
1386 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1387#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1388 #define __Pyx_sst_abs(value) llabs(value)
1389#elif defined (__GNUC__)
1390 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1392 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1394static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s);
1395static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
1396static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1397static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char*);
1398#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1399#define __Pyx_PyBytes_FromString PyBytes_FromString
1400#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1401static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
1402#if CYTHON_ASSUME_SAFE_MACROS
1403 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1404 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1405 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1406 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1407 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1408 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1409 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1411 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1412 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1413 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1414 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1415 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1416 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1417 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1419#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1420#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1421#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1422#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1423#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1424#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1425#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1426#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1427#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1428#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1429#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1430static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1431#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1432 return Py_NewRef(obj);
1438static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1439#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1440 return Py_XNewRef(obj);
1446static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b);
1447static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1448static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1449static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1450static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1451#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1452#define __Pyx_PySequence_Tuple(obj)\
1453 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1454static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1455static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t);
1456static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1457#if CYTHON_ASSUME_SAFE_MACROS
1458#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1459#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1460#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1462#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1463#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1464#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1466#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1467#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1468#if CYTHON_USE_PYLONG_INTERNALS
1469 #if PY_VERSION_HEX >= 0x030C00A7
1470 #ifndef _PyLong_SIGN_MASK
1471 #define _PyLong_SIGN_MASK 3
1473 #ifndef _PyLong_NON_SIZE_BITS
1474 #define _PyLong_NON_SIZE_BITS 3
1476 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1477 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1478 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1479 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1480 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1481 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1482 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1483 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1484 #define __Pyx_PyLong_SignedDigitCount(x)\
1485 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1486 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1487 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1488 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1490 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1491 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1493 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1494 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1495 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1496 if (tag_a == tag_b)
return 0;
1497 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1498 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1499 if (sign_a > sign_b)
return -1;
1500 if (sign_a < sign_b)
return 1;
1501 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1502 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1503 return (1 - sign_a) * (size_a - size_b);
1505 typedef Py_ssize_t __Pyx_compact_pylong;
1506 typedef size_t __Pyx_compact_upylong;
1508 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1509 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1510 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1511 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1512 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1513 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1514 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1515 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1516 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1517 #define __Pyx_PyLong_CompactValue(x)\
1518 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1519 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1520 typedef sdigit __Pyx_compact_pylong;
1521 typedef digit __Pyx_compact_upylong;
1523 #if PY_VERSION_HEX >= 0x030C00A5
1524 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1526 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1528 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1530 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1532#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1533 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1534#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1535 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1537 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1542#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1543 #define likely(x) __builtin_expect(!!(x), 1)
1544 #define unlikely(x) __builtin_expect(!!(x), 0)
1546 #define likely(x) (x)
1547 #define unlikely(x) (x)
1551#if __cplusplus > 201103L
1552#include <type_traits>
1554template <
typename T>
1555static void __Pyx_pretend_to_initialize(
T* ptr) {
1556#if __cplusplus > 201103L
1557 if ((std::is_trivially_default_constructible<T>::value))
1563static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1567#if !CYTHON_USE_MODULE_STATE
1568static PyObject *__pyx_m = NULL;
1570static const char *
const __pyx_cfilenm = __FILE__;
1573#if !defined(CYTHON_CCOMPLEX)
1574 #if defined(__cplusplus)
1575 #define CYTHON_CCOMPLEX 1
1576 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1577 #define CYTHON_CCOMPLEX 1
1579 #define CYTHON_CCOMPLEX 0
1586 #include <complex.h>
1589#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1591 #define _Complex_I 1.0fj
1596static const char*
const __pyx_f[] = {
1597 "proteus/csmoothers.pyx",
1599 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1601 "proteus/superluWrappers.pxd",
1605#include <pythread.h>
1606#ifndef CYTHON_ATOMICS
1607 #define CYTHON_ATOMICS 1
1609#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1610#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1611#define __pyx_atomic_int_type int
1612#define __pyx_nonatomic_int_type int
1613#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1614 (__STDC_VERSION__ >= 201112L) &&\
1615 !defined(__STDC_NO_ATOMICS__))
1616 #include <stdatomic.h>
1617#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1618 (__cplusplus >= 201103L) ||\
1619 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1622#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1623 (__STDC_VERSION__ >= 201112L) &&\
1624 !defined(__STDC_NO_ATOMICS__) &&\
1625 ATOMIC_INT_LOCK_FREE == 2)
1626 #undef __pyx_atomic_int_type
1627 #define __pyx_atomic_int_type atomic_int
1628 #define __pyx_atomic_ptr_type atomic_uintptr_t
1629 #define __pyx_nonatomic_ptr_type uintptr_t
1630 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1631 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1632 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1633 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1634 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1635 #define __pyx_atomic_load(value) atomic_load(value)
1636 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1637 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1638 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1639 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1640 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1641 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1642 #pragma message ("Using standard C atomics")
1643 #elif defined(__PYX_DEBUG_ATOMICS)
1644 #warning "Using standard C atomics"
1646#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1647 (__cplusplus >= 201103L) ||\
1649 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1650 ATOMIC_INT_LOCK_FREE == 2)
1651 #undef __pyx_atomic_int_type
1652 #define __pyx_atomic_int_type std::atomic_int
1653 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1654 #define __pyx_nonatomic_ptr_type uintptr_t
1655 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1656 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1657 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1658 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1659 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1660 #define __pyx_atomic_load(value) std::atomic_load(value)
1661 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1662 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1663 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1664 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1665 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1666 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1667 #pragma message ("Using standard C++ atomics")
1668 #elif defined(__PYX_DEBUG_ATOMICS)
1669 #warning "Using standard C++ atomics"
1671#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1672 (__GNUC_MINOR__ > 1 ||\
1673 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1674 #define __pyx_atomic_ptr_type void*
1675 #define __pyx_nonatomic_ptr_type void*
1676 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1677 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1678 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1679 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1680 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1681 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1682 int result = old == *expected;
1686 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1687 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1688 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1689 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1690 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1691 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1692 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1693 int result = old == *expected;
1697 #ifdef __PYX_DEBUG_ATOMICS
1698 #warning "Using GNU atomics"
1700#elif CYTHON_ATOMICS && defined(_MSC_VER)
1702 #undef __pyx_atomic_int_type
1703 #define __pyx_atomic_int_type long
1704 #define __pyx_atomic_ptr_type void*
1705 #undef __pyx_nonatomic_int_type
1706 #define __pyx_nonatomic_int_type long
1707 #define __pyx_nonatomic_ptr_type void*
1708 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1709 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1710 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1711 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1712 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1713 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1714 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1715 int result = old == *expected;
1719 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1720 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1721 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1722 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1723 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1724 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1725 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1726 int result = old == *expected;
1730 #ifdef __PYX_DEBUG_ATOMICS
1731 #pragma message ("Using MSVC atomics")
1734 #undef CYTHON_ATOMICS
1735 #define CYTHON_ATOMICS 0
1736 #ifdef __PYX_DEBUG_ATOMICS
1737 #warning "Not using atomics"
1742#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1743#define __Pyx_PyCriticalSection void*
1744#define __Pyx_PyCriticalSection2 void*
1745#define __Pyx_PyCriticalSection_End(cs)
1746#define __Pyx_PyCriticalSection2_End(cs)
1748#define __Pyx_PyCriticalSection PyCriticalSection
1749#define __Pyx_PyCriticalSection2 PyCriticalSection2
1750#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1751#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1755#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1756#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1757#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1759#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1760#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1762#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1763#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1764#define __Pyx_END_CRITICAL_SECTION() }
1766#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1767#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1771#ifndef __PYX_FORCE_INIT_THREADS
1772 #define __PYX_FORCE_INIT_THREADS 0
1776#define __Pyx_PyGILState_Ensure PyGILState_Ensure
1777#define __Pyx_PyGILState_Release PyGILState_Release
1778#define __Pyx_FastGIL_Remember()
1779#define __Pyx_FastGIL_Forget()
1780#define __Pyx_FastGilFuncInit()
1783#include <structmember.h>
1786struct __Pyx_StructField_;
1787#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1790 const struct __Pyx_StructField_* fields;
1792 size_t arraysize[8];
1798typedef struct __Pyx_StructField_ {
1799 const __Pyx_TypeInfo* type;
1804 const __Pyx_StructField* field;
1805 size_t parent_offset;
1806} __Pyx_BufFmt_StackElem;
1808 __Pyx_StructField root;
1809 __Pyx_BufFmt_StackElem* head;
1811 size_t new_count, enc_count;
1812 size_t struct_alignment;
1817 char is_valid_array;
1818} __Pyx_BufFmt_Context;
1821struct __pyx_memoryview_obj;
1823 struct __pyx_memoryview_obj *memview;
1825 Py_ssize_t shape[8];
1826 Py_ssize_t strides[8];
1827 Py_ssize_t suboffsets[8];
1828} __Pyx_memviewslice;
1829#define __Pyx_MemoryView_Len(m) (m.shape[0])
1830#define __Pyx_MEMVIEW_DIRECT 1
1831#define __Pyx_MEMVIEW_PTR 2
1832#define __Pyx_MEMVIEW_FULL 4
1833#define __Pyx_MEMVIEW_CONTIG 8
1834#define __Pyx_MEMVIEW_STRIDED 16
1835#define __Pyx_MEMVIEW_FOLLOW 32
1836#define __Pyx_IS_C_CONTIG 1
1837#define __Pyx_IS_F_CONTIG 2
1838#define __Pyx_MEMSLICE_INIT { 0, 0, { 0 }, { 0 }, { 0 } }
1840 #define __pyx_add_acquisition_count(memview)\
1841 __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
1842 #define __pyx_sub_acquisition_count(memview)\
1843 __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
1845 #define __pyx_add_acquisition_count(memview)\
1846 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1847 #define __pyx_sub_acquisition_count(memview)\
1848 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1860typedef npy_int8 __pyx_t_5numpy_int8_t;
1869typedef npy_int16 __pyx_t_5numpy_int16_t;
1878typedef npy_int32 __pyx_t_5numpy_int32_t;
1887typedef npy_int64 __pyx_t_5numpy_int64_t;
1896typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1905typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1914typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1923typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1932typedef npy_float32 __pyx_t_5numpy_float32_t;
1941typedef npy_float64 __pyx_t_5numpy_float64_t;
1950typedef npy_longlong __pyx_t_5numpy_longlong_t;
1959typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1968typedef npy_intp __pyx_t_5numpy_intp_t;
1977typedef npy_uintp __pyx_t_5numpy_uintp_t;
1986typedef npy_double __pyx_t_5numpy_float_t;
1995typedef npy_double __pyx_t_5numpy_double_t;
2004typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
2013typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
2016#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2018 typedef ::std::complex< float > __pyx_t_float_complex;
2020 typedef float _Complex __pyx_t_float_complex;
2023 typedef struct {
float real, imag; } __pyx_t_float_complex;
2025static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
2028#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2030 typedef ::std::complex< double > __pyx_t_double_complex;
2032 typedef double _Complex __pyx_t_double_complex;
2035 typedef struct {
double real, imag; } __pyx_t_double_complex;
2037static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
2040#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2042 typedef ::std::complex< long double > __pyx_t_long_double_complex;
2044 typedef long double _Complex __pyx_t_long_double_complex;
2047 typedef struct {
long double real, imag; } __pyx_t_long_double_complex;
2049static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double,
long double);
2054struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
2055struct __pyx_obj_10csmoothers_cASMFactor;
2056struct __pyx_obj_10csmoothers_cBASMFactor;
2057struct __pyx_array_obj;
2058struct __pyx_MemviewEnum_obj;
2059struct __pyx_memoryview_obj;
2060struct __pyx_memoryviewslice_obj;
2061struct __pyx_t_7proteus_15superluWrappers__NRformat;
2070struct __pyx_t_7proteus_15superluWrappers__NRformat {
2071 __pyx_t_5numpy_int32_t
nnz;
2072 __pyx_t_5numpy_float64_t *nzval;
2073 __pyx_t_5numpy_int32_t *colind;
2074 __pyx_t_5numpy_int32_t *rowptr;
2084typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
2093typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
2102typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
2111struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
2113 __pyx_t_5numpy_int32_t dim[2];
2114 struct __pyx_t_7proteus_15superluWrappers__NRformat A;
2125struct __pyx_obj_10csmoothers_cASMFactor {
2130 double **subdomain_L;
2131 double **subdomain_R;
2132 double **subdomain_dX;
2133 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
2144struct __pyx_obj_10csmoothers_cBASMFactor {
2150 double **subdomain_L;
2151 double **subdomain_R;
2152 double **subdomain_dX;
2153 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
2154 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
2165struct __pyx_array_obj {
2167 struct __pyx_vtabstruct_array *__pyx_vtab;
2173 Py_ssize_t *_strides;
2174 Py_ssize_t itemsize;
2177 void (*callback_free_data)(
void *);
2179 int dtype_is_object;
2190struct __pyx_MemviewEnum_obj {
2203struct __pyx_memoryview_obj {
2205 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2209 PyThread_type_lock lock;
2210 __pyx_atomic_int_type acquisition_count;
2213 int dtype_is_object;
2214 __Pyx_TypeInfo
const *typeinfo;
2225struct __pyx_memoryviewslice_obj {
2226 struct __pyx_memoryview_obj __pyx_base;
2227 __Pyx_memviewslice from_slice;
2228 PyObject *from_object;
2229 PyObject *(*to_object_func)(
char *);
2230 __pyx_memoryview_to_dtype_func_type to_dtype_func;
2243struct __pyx_vtabstruct_array {
2244 PyObject *(*get_memview)(
struct __pyx_array_obj *);
2246static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2257struct __pyx_vtabstruct_memoryview {
2258 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
2259 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
2260 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2261 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
2262 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2263 PyObject *(*setitem_indexed1)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2264 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
2265 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
2266 PyObject *(*_get_base)(
struct __pyx_memoryview_obj *);
2268static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2279struct __pyx_vtabstruct__memoryviewslice {
2280 struct __pyx_vtabstruct_memoryview __pyx_base;
2282static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2287#ifndef CYTHON_REFNANNY
2288 #define CYTHON_REFNANNY 0
2292 void (*INCREF)(
void*, PyObject*, Py_ssize_t);
2293 void (*DECREF)(
void*, PyObject*, Py_ssize_t);
2294 void (*GOTREF)(
void*, PyObject*, Py_ssize_t);
2295 void (*GIVEREF)(
void*, PyObject*, Py_ssize_t);
2296 void* (*SetupContext)(
const char*, Py_ssize_t,
const char*);
2297 void (*FinishContext)(
void**);
2298 } __Pyx_RefNannyAPIStruct;
2299 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2300 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
2301 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2302 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2304 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2305 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2306 PyGILState_Release(__pyx_gilstate_save);\
2308 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2310 #define __Pyx_RefNannyFinishContextNogil() {\
2311 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2312 __Pyx_RefNannyFinishContext();\
2313 PyGILState_Release(__pyx_gilstate_save);\
2315 #define __Pyx_RefNannyFinishContextNogil() {\
2316 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2317 __Pyx_RefNannyFinishContext();\
2318 PyGILState_Release(__pyx_gilstate_save);\
2320 #define __Pyx_RefNannyFinishContext()\
2321 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2322 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2323 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2324 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2325 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2326 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2327 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2328 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2329 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2331 #define __Pyx_RefNannyDeclarations
2332 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2333 #define __Pyx_RefNannyFinishContextNogil()
2334 #define __Pyx_RefNannyFinishContext()
2335 #define __Pyx_INCREF(r) Py_INCREF(r)
2336 #define __Pyx_DECREF(r) Py_DECREF(r)
2337 #define __Pyx_GOTREF(r)
2338 #define __Pyx_GIVEREF(r)
2339 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2340 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2341 #define __Pyx_XGOTREF(r)
2342 #define __Pyx_XGIVEREF(r)
2344#define __Pyx_Py_XDECREF_SET(r, v) do {\
2345 PyObject *tmp = (PyObject *) r;\
2346 r = v; Py_XDECREF(tmp);\
2348#define __Pyx_XDECREF_SET(r, v) do {\
2349 PyObject *tmp = (PyObject *) r;\
2350 r = v; __Pyx_XDECREF(tmp);\
2352#define __Pyx_DECREF_SET(r, v) do {\
2353 PyObject *tmp = (PyObject *) r;\
2354 r = v; __Pyx_DECREF(tmp);\
2356#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2357#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2360#if CYTHON_COMPILING_IN_CPYTHON
2361#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2362#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2363static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2364static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2365#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2367#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2368#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2369#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2373#if CYTHON_FAST_THREAD_STATE
2374#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2375#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2376#if PY_VERSION_HEX >= 0x030C00A6
2377#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2378#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2380#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2381#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2384#define __Pyx_PyThreadState_declare
2385#define __Pyx_PyThreadState_assign
2386#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2387#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2391#if CYTHON_FAST_THREAD_STATE
2392#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2393#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2394#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2395#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2396#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2397static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2398static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2399#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2400#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2402#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2405#define __Pyx_PyErr_Clear() PyErr_Clear()
2406#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2407#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2408#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2409#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2410#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2411#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2412#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2416#if CYTHON_COMPILING_IN_CPYTHON
2417static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2418static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2420#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2421static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2422 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2425#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2428#if CYTHON_FAST_THREAD_STATE
2429#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2430static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2432#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2436#if CYTHON_USE_TYPE_SLOTS
2437static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2439#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2443static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2446static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2449#if CYTHON_COMPILING_IN_CPYTHON
2450static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2454#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2455#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2457CYTHON_UNUSED
static PyObject *
2458__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n);
2468static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop);
2471#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2474#if CYTHON_AVOID_BORROWED_REFS
2475 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2476#elif CYTHON_ASSUME_SAFE_MACROS
2477 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2479 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2481#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2482#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2483#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2484#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2485#if CYTHON_VECTORCALL
2486 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2487 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2488 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2489 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s);
2490 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2491 CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues);
2493 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2496 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2497 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2498 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2499 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2500 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2502#if CYTHON_VECTORCALL_TPNEW
2503 #if !CYTHON_VECTORCALL
2504 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2506 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2507 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2508 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2509 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2510 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2512 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2513 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2514 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2515 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2516 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2518#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2519#if CYTHON_VECTORCALL
2520#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2522#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2526#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2527#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2528#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2529static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2532#define __Pyx_CallCFunction(cfunc, self, args)\
2533 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2534#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2535 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2536#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2537 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2538#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2539 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2542#if CYTHON_COMPILING_IN_CPYTHON
2543static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2545#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2549#if CYTHON_COMPILING_IN_CPYTHON
2550static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2554#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2555static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const*args,
size_t nargsf, PyObject *kwargs);
2558static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2563 PyObject **method_name;
2567#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2568 __pyx_atomic_int_type initialized;
2570} __Pyx_CachedCFunction;
2573static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2574#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2577static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2580#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2581static CYTHON_INLINE
int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2585 __pyx_nonatomic_int_type expected = 0;
2586 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2592static CYTHON_INLINE
void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2594 __pyx_atomic_store(&cfunc->initialized, 2);
2598#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2599#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2604static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2605#if CYTHON_COMPILING_IN_CPYTHON
2606static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2608#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2612#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2613#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2614#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2615static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2618#if CYTHON_AVOID_BORROWED_REFS
2619static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2622static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2626static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
2629static int __Pyx_ParseKeywordsTuple(
2631 PyObject *
const *kwvalues,
2632 PyObject **
const argnames[],
2635 Py_ssize_t num_pos_args,
2636 Py_ssize_t num_kwargs,
2637 const char* function_name,
2638 int ignore_unknown_kwargs
2640static int __Pyx_ParseKeywordDictToDict(
2642 PyObject **
const argnames[],
2645 Py_ssize_t num_pos_args,
2646 const char* function_name
2648static int __Pyx_ParseKeywordDict(
2650 PyObject **
const argnames[],
2652 Py_ssize_t num_pos_args,
2653 Py_ssize_t num_kwargs,
2654 const char* function_name,
2655 int ignore_unknown_kwargs
2660static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2661#if CYTHON_COMPILING_IN_CPYTHON
2662static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2664#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2668static CYTHON_INLINE
int __Pyx_ParseKeywords(
2669 PyObject *kwds, PyObject *
const *kwvalues, PyObject **
const argnames[],
2670 PyObject *kwds2, PyObject *values[],
2671 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2672 const char* function_name,
2673 int ignore_unknown_kwargs
2677static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
2678 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2681static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2684static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
const char *name,
int exact);
2687#if CYTHON_VECTORCALL
2688#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
2690static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *
const *args,
size_t nargsf);
2694#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2695typedef PyObject *__Pyx_TypeName;
2696#define __Pyx_FMT_TYPENAME "%N"
2697#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2698#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2699#elif CYTHON_COMPILING_IN_LIMITED_API
2700typedef PyObject *__Pyx_TypeName;
2701#define __Pyx_FMT_TYPENAME "%U"
2702#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2703static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2705typedef const char *__Pyx_TypeName;
2706#define __Pyx_FMT_TYPENAME "%.200s"
2707#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2708#define __Pyx_DECREF_TypeName(obj)
2712#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
2713#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
2715static void __Pyx_RaiseErrorWithType1(PyObject* exc_type,
const char* message,
const char *arg, PyTypeObject *type_obj);
2719static int __Pyx_RaiseUnexpectedTypeError(
const char *expected, PyObject *obj);
2722#define __Pyx_PyExc_MemoryError_Check(obj) __Pyx_TypeCheck(obj, PyExc_MemoryError)
2725static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2728#define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError)
2731static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength,
const char* chars,
int clength,
2732 int prepend_sign,
char padding_char);
2735static CYTHON_INLINE
int __Pyx_CheckUnicodeValue(
int value);
2736static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(
int value, Py_ssize_t width,
char padding_char);
2739#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2740#define __Pyx_HAS_GCC_DIAGNOSTIC
2747#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\
2748 ((format_char) == ('c')) ?\
2749 __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\
2750 __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\
2752static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(
int value, Py_ssize_t width,
char padding_char);
2753static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(
int value, Py_ssize_t width,
char padding_char,
char format_char);
2756#define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\
2757 ((format_char) == ('c')) ?\
2758 __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
2759 __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
2761static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width,
char padding_char);
2762static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width,
char padding_char,
char format_char);
2765#define __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH\
2766 (!CYTHON_COMPILING_IN_GRAAL && !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API)
2769static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
int kind);
2772#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
2773#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2774 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2775 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2776 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2779#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2780 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2781 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2782 (likely((s1_is_str) || PyUnicode_CheckExact(s1)) ?\
2783 __Pyx__PyUnicode_EqualsUCS4(s1, ch2, equals) :\
2784 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2786static CYTHON_INLINE
int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2,
int equals);
2790#define __Pyx_PyObject_Equals_obj_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 0)
2793static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2,
int pyop);
2796#if CYTHON_COMPILING_IN_PYPY
2797 #define __Pyx_PyObject_FormatSimple(s, f) (\
2798 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2799 PyObject_Format(s, f))
2800#elif CYTHON_USE_TYPE_SLOTS
2801 #define __Pyx_PyObject_FormatSimple(s, f) (\
2802 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2803 likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2804 likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2805 PyObject_Format(s, f))
2807 #define __Pyx_PyObject_FormatSimple(s, f) (\
2808 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2809 PyObject_Format(s, f))
2813static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2,
int pyop);
2815CYTHON_UNUSED
static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2817#define __Pyx_PyObject_Equals_str_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 1)
2819static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2821static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2824#if CYTHON_COMPILING_IN_LIMITED_API
2825#define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
2826#define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
2827static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
2828#define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
2829#define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
2830#define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
2831#define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
2832static CYTHON_INLINE
int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
2833 return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
2835#define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
2836static CYTHON_INLINE
int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
2837 return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
2839#elif PY_VERSION_HEX >= 0x030f00a6 ||\
2840 (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
2841#define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
2842#define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
2843#define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
2844#define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
2845#define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
2846#define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
2847#define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
2849#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
2850static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
2852 return PyDict_New();
2853 }
else if (PyDict_Check(it)) {
2854 return PyDict_Copy(it);
2856 PyObject *dict = PyDict_New();
2857 if (!dict)
return NULL;
2858 PyObject *result = PyNumber_InPlaceOr(dict, it);
2863#define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
2864#define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
2865#define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
2866#define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
2867#define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
2871#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2872 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2873 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2874 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
2875#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2876 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2877 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2878 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2879static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2880 int wraparound,
int boundscheck,
int unsafe_shared);
2881#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2882 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2883 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2884 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2885static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2886 int wraparound,
int boundscheck,
int unsafe_shared);
2887static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2888static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2889 int wraparound,
int boundscheck,
int unsafe_shared);
2892#define __Pyx_RaiseTypeErrorWithObjectType(message, obj) __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
2893#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj) __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
2895static void __Pyx_RaiseErrorWithType(PyObject* exc_type,
const char* message, PyTypeObject *type_obj);
2898#if CYTHON_USE_TYPE_SLOTS
2899static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2901#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2905static void __Pyx_RejectKeywords(
const char* function_name, PyObject *kwds);
2908#define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError)
2911static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t,
int b_is_constant);
2914#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2915 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2918static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2921#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2922#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2923#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2924#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2925 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2926 (cache_var) = (value);
2927#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2928 static PY_UINT64_T __pyx_dict_version = 0;\
2929 static PyObject *__pyx_dict_cached_value = NULL;\
2930 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2931 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2933 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2934 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2937static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2938static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2939static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2941#define __PYX_GET_DICT_VERSION(dict) (0)
2942#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2943#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2947#if CYTHON_USE_DICT_VERSIONS
2948#define __Pyx_GetModuleGlobalName(var, name) do {\
2949 static PY_UINT64_T __pyx_dict_version = 0;\
2950 static PyObject *__pyx_dict_cached_value = NULL;\
2951 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
2952 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2953 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2955#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2956 PY_UINT64_T __pyx_dict_version;\
2957 PyObject *__pyx_dict_cached_value;\
2958 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2960static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2962#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2963#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2964static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2968#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
2969 static int __pyx_assertions_enabled_flag;
2970 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2971 #if __clang__ || __GNUC__
2972 __attribute__((no_sanitize(
"thread")))
2974 static int __Pyx_init_assertions_enabled(
void) {
2975 PyObject *builtins, *debug, *debug_str;
2977 builtins = PyEval_GetBuiltins();
2978 if (!builtins)
goto bad;
2979 debug_str = PyUnicode_FromStringAndSize(
"__debug__", 9);
2980 if (!debug_str)
goto bad;
2981 debug = PyObject_GetItem(builtins, debug_str);
2982 Py_DECREF(debug_str);
2983 if (!debug)
goto bad;
2984 flag = PyObject_IsTrue(debug);
2986 if (flag == -1)
goto bad;
2987 __pyx_assertions_enabled_flag = flag;
2990 __pyx_assertions_enabled_flag = 1;
2994 #define __Pyx_init_assertions_enabled() (0)
2995 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2999#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
3002static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
3005static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
3008static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
3011#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
3012static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
3016#if CYTHON_FAST_THREAD_STATE
3017#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
3018static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3019#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
3020static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
3022#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
3023#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
3027#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
3028#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
3029#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
3031static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type,
const char *message,
const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
3034static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
3037#if CYTHON_FAST_THREAD_STATE
3038#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
3039static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3041static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
3045#if CYTHON_FAST_THREAD_STATE
3046#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
3047static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3049static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
3053#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
3054#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
3056static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
3060CYTHON_UNUSED
static PyObject *
3061__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n);
3067static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level);
3070static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level);
3072CYTHON_UNUSED
static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
3074static CYTHON_INLINE
int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x);
3077#define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
3078#if !CYTHON_USE_TYPE_SLOTS
3079#define __Pyx_PySequence_Multiply PySequence_Repeat
3081static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
3085#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
3086#define __Pyx_PyNumber_Multiply_object_int(op1, op2) PyNumber_Multiply(op1, op2)
3087#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
3089#define __Pyx_PyNumber_Multiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 0)
3090#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 1)
3091static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2,
int inplace);
3095static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject*
s, PyObject*
f);
3096static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject*
s, PyObject*
f);
3099#if CYTHON_USE_UNICODE_WRITER
3100static PyObject* __Pyx_PyObject_Format(PyObject*
s, PyObject*
f);
3102#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
3106#define __Pyx_PyObject_Unicode(obj)\
3107 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
3110#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
3111 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3112 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, wraparound, boundscheck, unsafe_shared) :\
3113 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
3114static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v);
3115static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *
v,
3116 int wraparound,
int boundscheck,
int unsafe_shared);
3119static void __Pyx_RaiseUnboundLocalError(
const char *varname);
3122static CYTHON_INLINE
long __Pyx_div_long(
long,
long,
int b_is_constant);
3125#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3128#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
3131#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
3132#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
3134#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
3138#if CYTHON_USE_TYPE_SLOTS
3139#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
3140static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
3142#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n)
3143#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
3147static void __Pyx_RaiseBufferIndexError(
int axis);
3150static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t,
int is_final);
3153#if CYTHON_VECTORCALL_TPNEW
3154typedef PyObject * (*__Pyx_tpnewvectorcallfunc)(PyTypeObject* o, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames);
3155static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc
f, PyTypeObject* o, PyObject *a, PyObject *k);
3159#if CYTHON_VECTORCALL_TPNEW
3160static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3164#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3165#define __Pyx_DeallocKeepAliveBegin(o) do {\
3166 _Py_atomic_store_uintptr_relaxed(&(o)->ob_tid, _Py_ThreadId());\
3167 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 1);\
3168 _Py_atomic_store_ssize_relaxed(&(o)->ob_ref_shared, 0);\
3170#define __Pyx_DeallocKeepAliveEnd(o)\
3171 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 0)
3173#define __Pyx_DeallocKeepAliveBegin(o) Py_SET_REFCNT(o, Py_REFCNT(o) + 1)
3174#define __Pyx_DeallocKeepAliveEnd(o) Py_SET_REFCNT(o, Py_REFCNT(o) - 1)
3178#if CYTHON_VECTORCALL_TPNEW
3179typedef int (*__Pyx_tpinitvectorcallfunc)(PyObject* o, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames);
3180static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc
f, PyObject* o, PyObject *a, PyObject *k);
3184#if !CYTHON_USE_TYPE_SPECS
3185#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
3187static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg);
3191static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
3194#if !CYTHON_USE_TYPE_SLOTS
3195CYTHON_UNUSED
static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp,
int require_cython_valid_result);
3199#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
3200static int __Pyx_validate_bases_tuple(
const char *type_name,
int has_dictoffset, PyObject *bases);
3204CYTHON_UNUSED
static int __Pyx_PyType_Ready(PyTypeObject *t);
3207#if CYTHON_COMPILING_IN_LIMITED_API
3208static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp);
3212#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)
3215static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
3218#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
3221static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *
v);
3224static int __Pyx_setup_reduce(PyObject* type_obj);
3227#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3228int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp,
int is_sequence);
3230#define __Pyx_ApplySequenceOrMappingFlag(tp, is_sequence) (0)
3234static int __Pyx_GetVtable(PyTypeObject *type,
void** table);
3237static int __Pyx_MergeVtables(PyTypeObject *type);
3240static int __Pyx_SetVtable(PyTypeObject* typeptr ,
void* vtable);
3243#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
3244#define __PYX_HAVE_RT_ImportType_proto_3_3_0
3245#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
3246#include <stdalign.h>
3248#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
3249#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
3251#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
3253enum __Pyx_ImportType_CheckSize_3_3_0 {
3254 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
3255 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
3256 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
3258static 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);
3262static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);
3265static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
3268static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
3271#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
3272 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
3273 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name);
3275 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
3279static PyObject *__Pyx_FetchSharedCythonABIModule(
void);
3282static int __Pyx_VerifyCachedType(PyObject *cached_type,
3284 Py_ssize_t expected_basicsize);
3287static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
3290static int __pyx_CommonTypesMetaclass_init(PyObject *module);
3291#define __Pyx_CommonTypesMetaclass_USED
3294#define __Pyx_CyFunction_USED
3295#if CYTHON_OPAQUE_SHARED_TYPES
3296#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
3298#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
3300#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
3301#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
3302#define __Pyx_CYFUNCTION_CCLASS 0x04
3303#define __Pyx_CYFUNCTION_COROUTINE 0x08
3304#define __Pyx_CyFunction_GetClosure(f)\
3305 ((__Pyx_as_CyFunctionObject(f))->func_closure)
3306#if CYTHON_COMPILING_IN_LIMITED_API
3307 #define __Pyx__CyFunction_GetClassObj(f)\
3308 ((f)->func_classobj)
3310 #define __Pyx__CyFunction_GetClassObj(f)\
3311 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
3313#define __Pyx_CyFunction_GetClassObj(f)\
3314 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
3315#define __Pyx_CyFunction_SetClassObj(f, classobj)\
3316 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
3317#define __Pyx_CyFunction_Defaults(type, f)\
3318 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
3319#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
3320 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
3322#if CYTHON_COMPILING_IN_LIMITED_API
3323#if !CYTHON_OPAQUE_OBJECTS
3326 PyMethodDef *func_methoddef;
3327 PyObject *func_module;
3329 PyCMethodObject func;
3331#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
3332 __pyx_vectorcallfunc func_vectorcall;
3334#if CYTHON_COMPILING_IN_LIMITED_API
3335 PyObject *func_weakreflist;
3337#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
3338 PyObject *func_dict;
3340 PyObject *func_name;
3341 PyObject *func_qualname;
3343 PyObject *func_globals;
3344 PyObject *func_code;
3345 PyObject *func_closure;
3346#if CYTHON_COMPILING_IN_LIMITED_API
3347 PyObject *func_classobj;
3351 PyObject *defaults_tuple;
3352 PyObject *defaults_kwdict;
3353 PyObject *(*defaults_getter)(PyObject *);
3354 PyObject *func_annotations;
3355#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
3356 PyObject *func_is_coroutine;
3358} __pyx_CyFunctionObject;
3359#undef __Pyx_CyOrPyCFunction_Check
3360#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3361#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
3362#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3363static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void));
3364#undef __Pyx_IsSameCFunction
3365#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
3366static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj);
3367static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
3368 PyTypeObject *defaults_type);
3369static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
3371static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3373static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
3375static int __pyx_CyFunction_init(PyObject *module);
3376#if CYTHON_VECTORCALL
3377#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3378#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
3380#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3385static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
3388#if CYTHON_VECTORCALL
3389static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw);
3393static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
3394 int flags, PyObject* qualname,
3396 PyObject *module, PyObject *globals,
3398#if CYTHON_VECTORCALL
3399static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3400static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3401static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3402static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3406static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3407 int flags, PyObject* qualname,
3409 PyObject *module, PyObject *globals,
3411static PyTypeObject *__Pyx_Get_CyFunction_Type(
void);
3414#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
3415#define __Pyx_SetNameInClass(ns, name, value)\
3416 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
3417#elif CYTHON_COMPILING_IN_CPYTHON
3418#define __Pyx_SetNameInClass(ns, name, value)\
3419 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
3421#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
3425static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
3428#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3429#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
3430#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
3431static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name,
int with_error);
3433#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
3434#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
3438static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
3439 PyObject *mkw, PyObject *modname, PyObject *doc);
3440static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
3441 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
3444#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
3445static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
3447#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3451#if CYTHON_COMPILING_IN_LIMITED_API
3452typedef PyObject __Pyx_CachedCodeObjectType;
3454typedef PyCodeObject __Pyx_CachedCodeObjectType;
3457 __Pyx_CachedCodeObjectType* code_object;
3459} __Pyx_CodeObjectCacheEntry;
3460struct __Pyx_CodeObjectCache {
3463 __Pyx_CodeObjectCacheEntry* entries;
3464 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3465 __pyx_atomic_int_type accessor_count;
3468static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
3469static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line);
3470static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object);
3473static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
3474 int py_line,
const char *filename);
3478 Py_ssize_t shape, strides, suboffsets;
3485 __Pyx_Buffer *rcbuffer;
3487 __Pyx_Buf_DimInfo diminfo[8];
3491static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
3492 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3493static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
3494 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3495#define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3496#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3497#define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3498static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
3499static CYTHON_INLINE
void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *,
int,
int);
3502static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
3505static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3506 __Pyx_memviewslice *slice2,
3507 int ndim,
size_t itemsize);
3510static int __Pyx_init_memviewslice(
3511 struct __pyx_memoryview_obj *memview,
3513 __Pyx_memviewslice *memviewslice,
3514 int memview_is_new_reference);
3517static CYTHON_INLINE
int __pyx_memoryview_slice_memviewslice(
3518 __Pyx_memviewslice *dst,
3519 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
3520 int dim,
int new_ndim,
int *suboffset_dim,
3521 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
3522 int have_start,
int have_stop,
int have_step,
3526static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
3529static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
3530static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
3531 __Pyx_BufFmt_StackElem* stack,
3532 const __Pyx_TypeInfo* type);
3535static int __pyx_typeinfo_cmp(
const __Pyx_TypeInfo *a,
const __Pyx_TypeInfo *b);
3538static int __Pyx_ValidateAndInit_memviewslice(
3543 const __Pyx_TypeInfo *dtype,
3544 __Pyx_BufFmt_StackElem stack[],
3545 __Pyx_memviewslice *memviewslice,
3546 PyObject *original_obj);
3549static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
3552static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
3557 #define __Pyx_CREAL(z) ((z).real())
3558 #define __Pyx_CIMAG(z) ((z).imag())
3560 #define __Pyx_CREAL(z) (__real__(z))
3561 #define __Pyx_CIMAG(z) (__imag__(z))
3564 #define __Pyx_CREAL(z) ((z).real)
3565 #define __Pyx_CIMAG(z) ((z).imag)
3567#if defined(__cplusplus) && CYTHON_CCOMPLEX\
3568 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3569 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3570 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3572 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3573 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3577#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3578 #define __Pyx_c_eq_float(a, b) ((a)==(b))
3579 #define __Pyx_c_sum_float(a, b) ((a)+(b))
3580 #define __Pyx_c_diff_float(a, b) ((a)-(b))
3581 #define __Pyx_c_prod_float(a, b) ((a)*(b))
3582 #define __Pyx_c_quot_float(a, b) ((a)/(b))
3583 #define __Pyx_c_neg_float(a) (-(a))
3585 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3586 #define __Pyx_c_conj_float(z) (::std::conj(z))
3588 #define __Pyx_c_abs_float(z) (::std::abs(z))
3589 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3592 #define __Pyx_c_is_zero_float(z) ((z)==0)
3593 #define __Pyx_c_conj_float(z) (conjf(z))
3595 #define __Pyx_c_abs_float(z) (cabsf(z))
3596 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3600 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3601 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3602 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3603 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3604 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3605 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3606 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3607 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3609 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
3610 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3615#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3616 #define __Pyx_c_eq_double(a, b) ((a)==(b))
3617 #define __Pyx_c_sum_double(a, b) ((a)+(b))
3618 #define __Pyx_c_diff_double(a, b) ((a)-(b))
3619 #define __Pyx_c_prod_double(a, b) ((a)*(b))
3620 #define __Pyx_c_quot_double(a, b) ((a)/(b))
3621 #define __Pyx_c_neg_double(a) (-(a))
3623 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3624 #define __Pyx_c_conj_double(z) (::std::conj(z))
3626 #define __Pyx_c_abs_double(z) (::std::abs(z))
3627 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3630 #define __Pyx_c_is_zero_double(z) ((z)==0)
3631 #define __Pyx_c_conj_double(z) (conj(z))
3633 #define __Pyx_c_abs_double(z) (cabs(z))
3634 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3638 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3639 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3640 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3641 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3642 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3643 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3644 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3645 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3647 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
3648 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3653#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3654 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3655 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3656 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3657 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3658 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3659 #define __Pyx_c_neg_long__double(a) (-(a))
3661 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3662 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3664 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3665 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3668 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3669 #define __Pyx_c_conj_long__double(z) (conjl(z))
3671 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3672 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3676 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3677 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3678 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3679 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3680 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3681 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3682 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3683 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3685 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3686 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3691static __Pyx_memviewslice
3692__pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
3693 const char *mode,
int ndim,
3694 Py_ssize_t sizeof_dtype,
int contig_flag,
3695 int dtype_is_object);
3698static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *);
3701static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3704static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);
3707static void __Pyx_RaiseUnpickleChecksumError(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members);
3710static CYTHON_INLINE
int __Pyx_CheckUnpickleChecksum(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members);
3713static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *);
3716#if CYTHON_VECTORCALL
3717#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
3718CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
3720#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
3721CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n);
3722CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
3726#if CYTHON_VECTORCALL
3727#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
3729static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3733static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(
int value);
3736static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value);
3739static CYTHON_INLINE
char __Pyx_PyLong_As_char(PyObject *);
3742#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
3743static unsigned long __Pyx_cached_runtime_version = 0;
3744static void __Pyx_init_runtime_version(
void);
3746#define __Pyx_init_runtime_version()
3748static unsigned long __Pyx_get_runtime_version(
void);
3751static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer);
3754static PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo);
3757static PyObject *__Pyx_DecompressString_LZSS(
const char *
s,
size_t compressed_length,
size_t uncompressed_length);
3760#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
3762static PyObject *__Pyx_State_FindModule(
void*);
3763static int __Pyx_State_AddModule(PyObject* module,
void*);
3764static int __Pyx_State_RemoveModule(
void*);
3765#elif CYTHON_USE_MODULE_STATE
3766#define __Pyx_State_FindModule PyState_FindModule
3767#define __Pyx_State_AddModule PyState_AddModule
3768#define __Pyx_State_RemoveModule PyState_RemoveModule
3773#if CYTHON_COMPILING_IN_LIMITED_API
3774 #if CYTHON_VECTORCALL
3775 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
3777 #define __PYX_VECTORCALL_ABI_SUFFIX
3779 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
3781 #define __PYX_LIMITED_ABI_SUFFIX
3783#if __PYX_HAS_PY_AM_SEND == 1
3784 #define __PYX_AM_SEND_ABI_SUFFIX
3785#elif __PYX_HAS_PY_AM_SEND == 2
3786 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
3788 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
3790#ifndef __PYX_MONITORING_ABI_SUFFIX
3791 #define __PYX_MONITORING_ABI_SUFFIX
3793#if CYTHON_USE_TP_FINALIZE
3794 #define __PYX_TP_FINALIZE_ABI_SUFFIX
3796 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
3798#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
3799 #define __PYX_FREELISTS_ABI_SUFFIX
3801 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
3803#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
3804 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
3806 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3808#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
3809#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
3810#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
3812static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
3813static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
3814static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
3815static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
3816static 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);
3817static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value);
3818static PyObject *__pyx_memoryview_setitem_indexed1(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
3819static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
3820static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
3821static PyObject *__pyx_memoryview__get_base(
struct __pyx_memoryview_obj *__pyx_v_self);
3822static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
3823static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
3824static PyObject *__pyx_memoryviewslice__get_base(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3825static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self);
3826static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self);
3827static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self);
3828static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self);
3829static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self);
3830static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self);
3831static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self);
3832static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self);
3833static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self);
3834static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self);
3835static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self);
3836static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self);
3837static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self);
3838static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self);
3839static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self);
3840static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self);
3841static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self);
3842static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self);
3843static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self);
3844static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self);
3845static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self);
3846static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self);
3847static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self);
3848static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self);
3849static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self);
3850static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self);
3851static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self);
3852static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self);
3853static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self);
3854static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self);
3855static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self);
3856static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self);
3857static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self);
3858static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self);
3859static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self);
3890static PyObject *__pyx_collections_abc_Sequence = 0;
3891static PyObject *
generic = 0;
3892static PyObject *strided = 0;
3893static PyObject *indirect = 0;
3894static PyObject *contiguous = 0;
3895static PyObject *indirect_contiguous = 0;
3896static int __pyx_memoryview_thread_locks_used;
3897static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3898static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
double, __pyx_t_10csmoothers_DDATA);
3899static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA);
3900static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA,
double,
double, __pyx_t_10csmoothers_DDATA);
3901static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
double, __pyx_t_10csmoothers_DDATA);
3902static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA);
3903static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA,
double,
double, __pyx_t_10csmoothers_DDATA);
3904static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_10csmoothers_cASMFactor *);
3905static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA);
3906static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_10csmoothers_cBASMFactor *);
3907static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA);
3908static int __pyx_array_allocate_buffer(
struct __pyx_array_obj *);
3909static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char const *,
char *);
3910static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo
const *);
3911static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
3912static int __pyx_memoryview_err_invalid_index(PyObject *);
3913static PyObject *_unellipsify_index_tuple(PyObject *,
int);
3914static PyObject *_unellipsify(PyObject *,
int);
3915static int assert_direct_dimensions(Py_ssize_t *,
int);
3916static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
3917static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
3918static int __pyx_memslice_transpose(__Pyx_memviewslice *);
3919static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *), __pyx_memoryview_to_dtype_func_type,
int);
3920static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
3921static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
3922static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
3923static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
3924static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
3925static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
3926static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
3927static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
3928static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
3929static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
3930static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
3931static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
3932static int __pyx_memoryview_err_dim(PyObject *,
char const *,
int);
3933static int __pyx_memoryview_err(PyObject *,
char const *);
3934static int __pyx_memoryview_err_no_memory(
void);
3935static int __pyx_memoryview_err_ValueError(
char const *);
3936static int __pyx_memoryview_err_IndexError(
char const *, Py_ssize_t);
3937static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
3938static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
3939static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
3940static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
3941static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
3942static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
3943static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
3944static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
3946static const __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
3947static const __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, __PYX_IS_UNSIGNED(
int) ?
'U' :
'I', __PYX_IS_UNSIGNED(
int), 0 };
3949#define __Pyx_MODULE_NAME "csmoothers"
3950extern int __pyx_module_is_main_csmoothers;
3951int __pyx_module_is_main_csmoothers = 0;
3955static PyObject *__pyx_builtin_object;
3956static PyObject *__pyx_builtin___import__;
3957static PyObject *__pyx_builtin_enumerate;
3958static PyObject *__pyx_builtin_Ellipsis;
3959static PyObject *__pyx_builtin_id;
3961static const char __pyx_k_c[] =
"c";
3962static const char __pyx_k_name[] =
"name";
3963static const char __pyx_k_fortran[] =
"fortran";
3964static const char __pyx_k_Dimension_d_is_not_direct[] =
"Dimension %d is not direct";
3965static const char __pyx_k_Cannot_index_with_type_200U[] =
"Cannot index with type \047%.200U\047";
3966static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
3967static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
3968static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
3969static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
3970static const char __pyx_k_Cannot_transpose_memoryview_with[] =
"Cannot transpose memoryview with indirect dimensions";
3971static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
3972static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
3973static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %zd)";
3974static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
3975static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %zd and %zd)";
3977static 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);
3978static 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);
3979static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
3980static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
3981static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
3982static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
3983static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
3984static 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);
3985static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
3986static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3987static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
3988static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3989static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3990static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3991static 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);
3992static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
3993static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
3994static 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);
3995static 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);
3996static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3997static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3998static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3999static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4000static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4001static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4002static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4003static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4004static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4005static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
4006static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
4007static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
4008static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
4009static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
4010static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
4011static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
4012static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
4013static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
4014static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
4015static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
4016static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
4017static 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);
4018static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L);
4019static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L);
4020static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self);
4021static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self);
4022static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
4023static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs);
4024static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L,
int __pyx_v_bs);
4025static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self);
4026static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self);
4027static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
4028static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M);
4029static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX);
4030static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX);
4031static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M);
4032static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX);
4033static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX);
4034static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor);
4035static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX);
4036static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor);
4037static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX);
4038static PyObject *__pyx_tp_new__initialisation_10csmoothers_cASMFactor(PyObject *o,
4039#
if CYTHON_VECTORCALL_TPNEW
4040 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4042 PyObject *a, PyObject *k
4045static PyObject *__pyx_tp_new_vectorcall_10csmoothers_cASMFactor(PyTypeObject *t,
4046#
if CYTHON_VECTORCALL_TPNEW
4047 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4049 PyObject *a, PyObject *k
4052#if CYTHON_VECTORCALL_TPNEW
4053static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k);
4055#if !CYTHON_VECTORCALL_TPNEW
4056#define __pyx_tp_new_10csmoothers_cASMFactor __pyx_tp_new_vectorcall_10csmoothers_cASMFactor
4058#if CYTHON_VECTORCALL_TPNEW
4059static PyObject *__pyx_tp_vectorcall_10csmoothers_cASMFactor(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
4061static PyObject *__pyx_tp_new__initialisation_10csmoothers_cBASMFactor(PyObject *o,
4062#
if CYTHON_VECTORCALL_TPNEW
4063 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4065 PyObject *a, PyObject *k
4068static PyObject *__pyx_tp_new_vectorcall_10csmoothers_cBASMFactor(PyTypeObject *t,
4069#
if CYTHON_VECTORCALL_TPNEW
4070 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4072 PyObject *a, PyObject *k
4075#if CYTHON_VECTORCALL_TPNEW
4076static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k);
4078#if !CYTHON_VECTORCALL_TPNEW
4079#define __pyx_tp_new_10csmoothers_cBASMFactor __pyx_tp_new_vectorcall_10csmoothers_cBASMFactor
4081#if CYTHON_VECTORCALL_TPNEW
4082static PyObject *__pyx_tp_vectorcall_10csmoothers_cBASMFactor(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
4084static PyObject *__pyx_tp_new__initialisation_array(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_array(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_array(PyTypeObject *t, PyObject *a, PyObject *k);
4101#if !CYTHON_VECTORCALL_TPNEW
4102#define __pyx_tp_new_array __pyx_tp_new_vectorcall_array
4104#if CYTHON_VECTORCALL_TPNEW
4105static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
4107static PyObject *__pyx_tp_new__initialisation_Enum(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_Enum(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_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
4124#if !CYTHON_VECTORCALL_TPNEW
4125#define __pyx_tp_new_Enum __pyx_tp_new_vectorcall_Enum
4127#if CYTHON_VECTORCALL_TPNEW
4128static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
4130#if CYTHON_VECTORCALL_TPNEW
4131static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds);
4133#if !CYTHON_VECTORCALL_TPNEW
4134#define __pyx_tp_init_Enum __pyx_MemviewEnum___init__
4136static PyObject *__pyx_tp_new__initialisation_memoryview(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_memoryview(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_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
4153#if !CYTHON_VECTORCALL_TPNEW
4154#define __pyx_tp_new_memoryview __pyx_tp_new_vectorcall_memoryview
4156#if CYTHON_VECTORCALL_TPNEW
4157static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
4159static PyObject *__pyx_tp_new__initialisation__memoryviewslice(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__memoryviewslice(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__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
4176#if !CYTHON_VECTORCALL_TPNEW
4177#define __pyx_tp_new__memoryviewslice __pyx_tp_new_vectorcall__memoryviewslice
4179#if CYTHON_VECTORCALL_TPNEW
4180static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
4185#ifndef CYTHON_SMALL_CODE
4186#if defined(__clang__)
4187 #define CYTHON_SMALL_CODE
4188#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
4189 #define CYTHON_SMALL_CODE __attribute__((cold))
4191 #define CYTHON_SMALL_CODE
4201 PyObject *__pyx_cython_runtime;
4202 PyObject *__pyx_empty_tuple;
4203 PyObject *__pyx_empty_bytes;
4204 PyObject *__pyx_empty_unicode;
4205 PyTypeObject *__pyx_ptype_7cpython_4type_type;
4206 PyTypeObject *__pyx_ptype_5numpy_dtype;
4207 PyTypeObject *__pyx_ptype_5numpy_flatiter;
4208 PyTypeObject *__pyx_ptype_5numpy_broadcast;
4209 PyTypeObject *__pyx_ptype_5numpy_ndarray;
4210 PyTypeObject *__pyx_ptype_5numpy_generic;
4211 PyTypeObject *__pyx_ptype_5numpy_number;
4212 PyTypeObject *__pyx_ptype_5numpy_integer;
4213 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
4214 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
4215 PyTypeObject *__pyx_ptype_5numpy_inexact;
4216 PyTypeObject *__pyx_ptype_5numpy_floating;
4217 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
4218 PyTypeObject *__pyx_ptype_5numpy_flexible;
4219 PyTypeObject *__pyx_ptype_5numpy_character;
4220 PyTypeObject *__pyx_ptype_5numpy_ufunc;
4221 PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix;
4222 PyObject *__pyx_type_10csmoothers_cASMFactor;
4223 PyObject *__pyx_type_10csmoothers_cBASMFactor;
4224 PyObject *__pyx_type___pyx_array;
4225 PyObject *__pyx_type___pyx_MemviewEnum;
4226 PyObject *__pyx_type___pyx_memoryview;
4227 PyObject *__pyx_type___pyx_memoryviewslice;
4228 PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor;
4229 PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor;
4230 PyTypeObject *__pyx_array_type;
4231 PyTypeObject *__pyx_MemviewEnum_type;
4232 PyTypeObject *__pyx_memoryview_type;
4233 PyTypeObject *__pyx_memoryviewslice_type;
4234 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
4235 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
4236 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
4237 PyObject *__pyx_slice[1];
4238 PyObject *__pyx_tuple[6];
4239 PyObject *__pyx_codeobj_tab[16];
4240 PyObject *__pyx_string_tab[156];
4241 PyObject *__pyx_number_tab[3];
4244#if CYTHON_COMPILING_IN_LIMITED_API
4245PyObject *__Pyx_PyFrozenDictType;
4249PyTypeObject *__pyx_CommonTypesMetaclassType;
4252#if CYTHON_COMPILING_IN_LIMITED_API
4253PyObject *__Pyx_CachedMethodType;
4257PyTypeObject *__pyx_CyFunctionType;
4260struct __Pyx_CodeObjectCache __pyx_code_cache;
4268#if CYTHON_USE_MODULE_STATE
4271extern struct PyModuleDef __pyx_moduledef;
4274static struct PyModuleDef __pyx_moduledef;
4277#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
4279#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
4281static __pyx_mstatetype __pyx_mstate_global_static =
4287static __pyx_mstatetype *
const __pyx_mstate_global = &__pyx_mstate_global_static;
4290#define __pyx_kp_u_at_0x __pyx_string_tab[0]
4291#define __pyx_kp_u_object_2 __pyx_string_tab[1]
4292#define __pyx_kp_u_tree_fragment __pyx_string_tab[2]
4293#define __pyx_kp_u__3 __pyx_string_tab[3]
4294#define __pyx_kp_u__2 __pyx_string_tab[4]
4295#define __pyx_kp_u_MemoryView_of __pyx_string_tab[5]
4296#define __pyx_kp_u_contiguous_and_direct __pyx_string_tab[6]
4297#define __pyx_kp_u_contiguous_and_indirect __pyx_string_tab[7]
4298#define __pyx_kp_u_strided_and_direct_or_indirect __pyx_string_tab[8]
4299#define __pyx_kp_u_strided_and_direct __pyx_string_tab[9]
4300#define __pyx_kp_u_strided_and_indirect __pyx_string_tab[10]
4301#define __pyx_kp_u__4 __pyx_string_tab[11]
4302#define __pyx_kp_u_ __pyx_string_tab[12]
4303#define __pyx_kp_u_Cannot_assign_to_read_only_memor __pyx_string_tab[13]
4304#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_string_tab[14]
4305#define __pyx_kp_u_Invalid_shape_in_axis __pyx_string_tab[15]
4306#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[16]
4307#define __pyx_kp_u_add_note __pyx_string_tab[17]
4308#define __pyx_kp_u_collections_abc __pyx_string_tab[18]
4309#define __pyx_kp_u_disable __pyx_string_tab[19]
4310#define __pyx_kp_u_enable __pyx_string_tab[20]
4311#define __pyx_kp_u_gc __pyx_string_tab[21]
4312#define __pyx_kp_u_isenabled __pyx_string_tab[22]
4313#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[23]
4314#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[24]
4315#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[25]
4316#define __pyx_kp_u_proteus_csmoothers_pyx __pyx_string_tab[26]
4317#define __pyx_kp_u_unable_to_allocate_array_data __pyx_string_tab[27]
4318#define __pyx_kp_u_unable_to_allocate_shape_and_str __pyx_string_tab[28]
4319#define __pyx_n_u_A __pyx_string_tab[29]
4320#define __pyx_n_u_ASCII __pyx_string_tab[30]
4321#define __pyx_n_u_ASMFactor __pyx_string_tab[31]
4322#define __pyx_n_u_ASMFactor___init __pyx_string_tab[32]
4323#define __pyx_n_u_BASMFactor __pyx_string_tab[33]
4324#define __pyx_n_u_BASMFactor___init __pyx_string_tab[34]
4325#define __pyx_n_u_Ellipsis __pyx_string_tab[35]
4326#define __pyx_n_u_L __pyx_string_tab[36]
4327#define __pyx_n_u_M __pyx_string_tab[37]
4328#define __pyx_n_u_R __pyx_string_tab[38]
4329#define __pyx_n_u_Sequence __pyx_string_tab[39]
4330#define __pyx_n_u_View_MemoryView __pyx_string_tab[40]
4331#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[41]
4332#define __pyx_n_u_annotate __pyx_string_tab[42]
4333#define __pyx_n_u_class __pyx_string_tab[43]
4334#define __pyx_n_u_class_getitem __pyx_string_tab[44]
4335#define __pyx_n_u_dict __pyx_string_tab[45]
4336#define __pyx_n_u_doc __pyx_string_tab[46]
4337#define __pyx_n_u_func __pyx_string_tab[47]
4338#define __pyx_n_u_getstate __pyx_string_tab[48]
4339#define __pyx_n_u_import __pyx_string_tab[49]
4340#define __pyx_n_u_init __pyx_string_tab[50]
4341#define __pyx_n_u_main __pyx_string_tab[51]
4342#define __pyx_n_u_metaclass __pyx_string_tab[52]
4343#define __pyx_n_u_module __pyx_string_tab[53]
4344#define __pyx_n_u_mro_entries __pyx_string_tab[54]
4345#define __pyx_n_u_name_2 __pyx_string_tab[55]
4346#define __pyx_n_u_new __pyx_string_tab[56]
4347#define __pyx_n_u_prepare __pyx_string_tab[57]
4348#define __pyx_n_u_pyx_checksum __pyx_string_tab[58]
4349#define __pyx_n_u_pyx_state __pyx_string_tab[59]
4350#define __pyx_n_u_pyx_type __pyx_string_tab[60]
4351#define __pyx_n_u_pyx_unpickle_Enum __pyx_string_tab[61]
4352#define __pyx_n_u_pyx_vtable __pyx_string_tab[62]
4353#define __pyx_n_u_qualname __pyx_string_tab[63]
4354#define __pyx_n_u_reduce __pyx_string_tab[64]
4355#define __pyx_n_u_reduce_cython __pyx_string_tab[65]
4356#define __pyx_n_u_reduce_ex __pyx_string_tab[66]
4357#define __pyx_n_u_set_name __pyx_string_tab[67]
4358#define __pyx_n_u_setstate __pyx_string_tab[68]
4359#define __pyx_n_u_setstate_cython __pyx_string_tab[69]
4360#define __pyx_n_u_test __pyx_string_tab[70]
4361#define __pyx_n_u_cASMFactor __pyx_string_tab[71]
4362#define __pyx_n_u_cBASMFactor __pyx_string_tab[72]
4363#define __pyx_n_u_cSparseMatrix __pyx_string_tab[73]
4364#define __pyx_n_u_is_coroutine __pyx_string_tab[74]
4365#define __pyx_n_u_abc __pyx_string_tab[75]
4366#define __pyx_n_u_allocate_buffer __pyx_string_tab[76]
4367#define __pyx_n_u_asmFactor __pyx_string_tab[77]
4368#define __pyx_n_u_asm_NR_prepare __pyx_string_tab[78]
4369#define __pyx_n_u_asm_NR_solve __pyx_string_tab[79]
4370#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[80]
4371#define __pyx_n_u_base __pyx_string_tab[81]
4372#define __pyx_n_u_basmFactor __pyx_string_tab[82]
4373#define __pyx_n_u_basm_NR_prepare __pyx_string_tab[83]
4374#define __pyx_n_u_basm_NR_solve __pyx_string_tab[84]
4375#define __pyx_n_u_bs __pyx_string_tab[85]
4376#define __pyx_n_u_c __pyx_string_tab[86]
4377#define __pyx_n_u_cASMFactor_2 __pyx_string_tab[87]
4378#define __pyx_n_u_cASMFactor___reduce_cython __pyx_string_tab[88]
4379#define __pyx_n_u_cASMFactor___setstate_cython __pyx_string_tab[89]
4380#define __pyx_n_u_cBASMFactor_2 __pyx_string_tab[90]
4381#define __pyx_n_u_cBASMFactor___reduce_cython __pyx_string_tab[91]
4382#define __pyx_n_u_cBASMFactor___setstate_cython __pyx_string_tab[92]
4383#define __pyx_n_u_cline_in_traceback __pyx_string_tab[93]
4384#define __pyx_n_u_count __pyx_string_tab[94]
4385#define __pyx_n_u_csmoothers __pyx_string_tab[95]
4386#define __pyx_n_u_dX __pyx_string_tab[96]
4387#define __pyx_n_u_dtype_is_object __pyx_string_tab[97]
4388#define __pyx_n_u_encode __pyx_string_tab[98]
4389#define __pyx_n_u_enumerate __pyx_string_tab[99]
4390#define __pyx_n_u_error __pyx_string_tab[100]
4391#define __pyx_n_u_flags __pyx_string_tab[101]
4392#define __pyx_n_u_format __pyx_string_tab[102]
4393#define __pyx_n_u_fortran __pyx_string_tab[103]
4394#define __pyx_n_u_gauss_seidel_NR_preare __pyx_string_tab[104]
4395#define __pyx_n_u_gauss_seidel_NR_solve __pyx_string_tab[105]
4396#define __pyx_n_u_id __pyx_string_tab[106]
4397#define __pyx_n_u_index __pyx_string_tab[107]
4398#define __pyx_n_u_items __pyx_string_tab[108]
4399#define __pyx_n_u_itemsize __pyx_string_tab[109]
4400#define __pyx_n_u_jacobi_NR_prepare __pyx_string_tab[110]
4401#define __pyx_n_u_jacobi_NR_solve __pyx_string_tab[111]
4402#define __pyx_n_u_memview __pyx_string_tab[112]
4403#define __pyx_n_u_mode __pyx_string_tab[113]
4404#define __pyx_n_u_name __pyx_string_tab[114]
4405#define __pyx_n_u_nc __pyx_string_tab[115]
4406#define __pyx_n_u_ndim __pyx_string_tab[116]
4407#define __pyx_n_u_nl_gauss_seidel_NR_solve __pyx_string_tab[117]
4408#define __pyx_n_u_nl_jacobi_NR_solve __pyx_string_tab[118]
4409#define __pyx_n_u_node_order __pyx_string_tab[119]
4410#define __pyx_n_u_np __pyx_string_tab[120]
4411#define __pyx_n_u_nr __pyx_string_tab[121]
4412#define __pyx_n_u_numpy __pyx_string_tab[122]
4413#define __pyx_n_u_obj __pyx_string_tab[123]
4414#define __pyx_n_u_object __pyx_string_tab[124]
4415#define __pyx_n_u_pack __pyx_string_tab[125]
4416#define __pyx_n_u_pop __pyx_string_tab[126]
4417#define __pyx_n_u_register __pyx_string_tab[127]
4418#define __pyx_n_u_self __pyx_string_tab[128]
4419#define __pyx_n_u_setdefault __pyx_string_tab[129]
4420#define __pyx_n_u_shape __pyx_string_tab[130]
4421#define __pyx_n_u_size __pyx_string_tab[131]
4422#define __pyx_n_u_start __pyx_string_tab[132]
4423#define __pyx_n_u_step __pyx_string_tab[133]
4424#define __pyx_n_u_stop __pyx_string_tab[134]
4425#define __pyx_n_u_struct __pyx_string_tab[135]
4426#define __pyx_n_u_tol __pyx_string_tab[136]
4427#define __pyx_n_u_unpack __pyx_string_tab[137]
4428#define __pyx_n_u_update __pyx_string_tab[138]
4429#define __pyx_n_u_values __pyx_string_tab[139]
4430#define __pyx_n_u_w __pyx_string_tab[140]
4431#define __pyx_n_u_x __pyx_string_tab[141]
4432#define __pyx_n_b_O __pyx_string_tab[142]
4433#define __pyx_kp_b_iso88591_Q __pyx_string_tab[143]
4434#define __pyx_kp_b_iso88591_1AQ_Q __pyx_string_tab[144]
4435#define __pyx_kp_b_iso88591_AQa_q __pyx_string_tab[145]
4436#define __pyx_kp_b_iso88591_Qa_8_5 __pyx_string_tab[146]
4437#define __pyx_kp_b_iso88591_1A_c_a __pyx_string_tab[147]
4438#define __pyx_kp_b_iso88591_1A_6c_L __pyx_string_tab[148]
4439#define __pyx_kp_b_iso88591_Cs_a __pyx_string_tab[149]
4440#define __pyx_kp_b_iso88591_1_1 __pyx_string_tab[150]
4441#define __pyx_kp_b_iso88591_1A_Q __pyx_string_tab[151]
4442#define __pyx_kp_b_iso88591_aq_9_L_5PQ __pyx_string_tab[152]
4443#define __pyx_kp_b_iso88591_Qaq __pyx_string_tab[153]
4444#define __pyx_kp_b_iso88591_A_E_F_Kq_Ba_A __pyx_string_tab[154]
4445#define __pyx_kp_b_iso88591_A_E_O_Qd_A __pyx_string_tab[155]
4446#define __pyx_int_0 __pyx_number_tab[0]
4447#define __pyx_int_neg_1 __pyx_number_tab[1]
4448#define __pyx_int_136983863 __pyx_number_tab[2]
4450#if CYTHON_USE_MODULE_STATE
4451static CYTHON_SMALL_CODE
int __pyx_m_clear(PyObject *m) {
4452 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
4453 if (!clear_module_state)
return 0;
4454 Py_CLEAR(clear_module_state->__pyx_d);
4455 Py_CLEAR(clear_module_state->__pyx_b);
4456 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4457 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4458 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4459 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4460 #if CYTHON_PEP489_MULTI_PHASE_INIT
4461 __Pyx_State_RemoveModule(NULL);
4463 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4464 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4465 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4466 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4467 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4468 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4469 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4470 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4471 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4472 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4473 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4474 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4475 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4476 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4477 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4478 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4479 Py_CLEAR(clear_module_state->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix);
4480 Py_CLEAR(clear_module_state->__pyx_ptype_10csmoothers_cASMFactor);
4481 Py_CLEAR(clear_module_state->__pyx_type_10csmoothers_cASMFactor);
4482 Py_CLEAR(clear_module_state->__pyx_ptype_10csmoothers_cBASMFactor);
4483 Py_CLEAR(clear_module_state->__pyx_type_10csmoothers_cBASMFactor);
4484 Py_CLEAR(clear_module_state->__pyx_array_type);
4485 Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
4486 Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
4487 Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
4488 Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4489 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4490 Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4491 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4492 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
4493 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
4494 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
4495 for (
int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
4496 for (
int i=0; i<6; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
4497 for (
int i=0; i<16; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
4498 for (
int i=0; i<156; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
4499 for (
int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
4502Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
4505Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4512#if CYTHON_USE_MODULE_STATE
4513static CYTHON_SMALL_CODE
int __pyx_m_traverse(PyObject *m, visitproc visit,
void *arg) {
4514 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
4515 if (!traverse_module_state)
return 0;
4516 Py_VISIT(traverse_module_state->__pyx_d);
4517 Py_VISIT(traverse_module_state->__pyx_b);
4518 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4519 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
4520 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
4521 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
4522 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4523 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4524 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4525 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4526 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4527 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4528 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4529 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4530 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4531 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4532 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4533 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4534 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4535 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4536 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4537 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4538 Py_VISIT(traverse_module_state->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix);
4539 Py_VISIT(traverse_module_state->__pyx_ptype_10csmoothers_cASMFactor);
4540 Py_VISIT(traverse_module_state->__pyx_type_10csmoothers_cASMFactor);
4541 Py_VISIT(traverse_module_state->__pyx_ptype_10csmoothers_cBASMFactor);
4542 Py_VISIT(traverse_module_state->__pyx_type_10csmoothers_cBASMFactor);
4543 Py_VISIT(traverse_module_state->__pyx_array_type);
4544 Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4545 Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4546 Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4547 Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4548 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4549 Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4550 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4551 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
4552 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
4553 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
4554 for (
int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
4555 for (
int i=0; i<6; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
4556 for (
int i=0; i<16; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
4557 for (
int i=0; i<156; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4558 for (
int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
4561Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
4564Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4581static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4582#
if CYTHON_VECTORCALL_TPNEW
4583PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4585PyObject *__pyx_args, PyObject *__pyx_kwds
4588static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4589#
if CYTHON_VECTORCALL_TPNEW
4590PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4592PyObject *__pyx_args, PyObject *__pyx_kwds
4595 PyObject *__pyx_v_shape = 0;
4596 Py_ssize_t __pyx_v_itemsize;
4597 PyObject *__pyx_v_format = 0;
4598 PyObject *__pyx_v_mode = 0;
4599 int __pyx_v_allocate_buffer;
4600 #if !CYTHON_VECTORCALL_TPNEW
4601 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
4603 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
4604 PyObject* values[5] = {0,0,0,0,0};
4605 int __pyx_lineno = 0;
4606 const char *__pyx_filename = NULL;
4607 int __pyx_clineno = 0;
4609 __Pyx_RefNannyDeclarations
4610 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
4611 #if !CYTHON_VECTORCALL_TPNEW
4612 #if CYTHON_ASSUME_SAFE_SIZE
4613 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
4615 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
4618 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
4620 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};
4621 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
4622 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 147, __pyx_L3_error)
4623 if (__pyx_kwds_len > 0) {
4624 switch (__pyx_nargs) {
4626 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4627 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4630 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4631 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4634 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4635 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4638 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4639 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4642 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4643 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4646 default:
goto __pyx_L5_argtuple_error;
4648 const Py_ssize_t kwd_pos_args = __pyx_nargs;
4649 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)
4650 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4651 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
4652 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, i); __PYX_ERR(1, 147, __pyx_L3_error) }
4655 switch (__pyx_nargs) {
4657 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4658 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4661 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4662 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4665 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4666 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4667 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4668 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4669 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4670 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4672 default:
goto __pyx_L5_argtuple_error;
4674 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4676 __pyx_v_shape = ((PyObject*)values[0]);
4677 __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)
4678 __pyx_v_format = values[2];
4679 __pyx_v_mode = values[3];
4681 __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)
4691 __pyx_v_allocate_buffer = ((int)1);
4695 __pyx_L5_argtuple_error:;
4696 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 147, __pyx_L3_error)
4698 goto __pyx_L4_argument_unpacking_done;
4700 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
4701 Py_XDECREF(values[__pyx_temp]);
4703 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4704 __Pyx_RefNannyFinishContext();
4706 __pyx_L4_argument_unpacking_done:;
4707 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 147, __pyx_L1_error)
4708 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
4709 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 147, __pyx_L1_error)
4711 __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);
4725 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
4726 Py_XDECREF(values[__pyx_temp]);
4728 goto __pyx_L7_cleaned_up;
4730 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
4731 Py_XDECREF(values[__pyx_temp]);
4733 __pyx_L7_cleaned_up:;
4736 __Pyx_RefNannyFinishContext();
4740static 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) {
4742 Py_ssize_t __pyx_v_dim;
4745 __Pyx_RefNannyDeclarations
4746 Py_ssize_t __pyx_t_1;
4750 PyObject *__pyx_t_5 = NULL;
4751 PyObject *__pyx_t_6 = NULL;
4754 Py_ssize_t __pyx_t_9;
4755 PyObject *__pyx_t_10 = NULL;
4756 PyObject *__pyx_t_11[5];
4758 PyObject *__pyx_t_13 = NULL;
4759 int __pyx_lineno = 0;
4760 const char *__pyx_filename = NULL;
4761 int __pyx_clineno = 0;
4762 __Pyx_RefNannySetupContext(
"__cinit__", 0);
4763 __Pyx_INCREF(__pyx_v_format);
4772 if (unlikely(__pyx_v_shape == Py_None)) {
4773 PyErr_SetString(PyExc_TypeError,
"object of type \047NoneType\047 has no len()");
4774 __PYX_ERR(1, 153, __pyx_L1_error)
4776 __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)
4777 __pyx_v_self->ndim = ((int)__pyx_t_1);
4787 __pyx_v_self->itemsize = __pyx_v_itemsize;
4796 __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
4798 if (unlikely(__pyx_t_2)) {
4808 __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)
4827 __pyx_t_2 = (__pyx_v_itemsize <= 0);
4829 if (unlikely(__pyx_t_2)) {
4839 __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)
4858 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
4859 __pyx_t_4 = (!__pyx_t_2);
4872 __pyx_t_6 = __pyx_v_format;
4873 __Pyx_INCREF(__pyx_t_6);
4876 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ASCII};
4877 __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));
4878 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4879 if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
4880 __Pyx_GOTREF(__pyx_t_5);
4882 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
4901 __pyx_t_5 = __pyx_v_format;
4902 __Pyx_INCREF(__pyx_t_5);
4903 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)
4904 __Pyx_GIVEREF(__pyx_t_5);
4905 __Pyx_GOTREF(__pyx_v_self->_format);
4906 __Pyx_DECREF(__pyx_v_self->_format);
4907 __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
4917 if (unlikely(__pyx_v_self->_format == Py_None)) {
4918 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
4919 __PYX_ERR(1, 165, __pyx_L1_error)
4921 __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 165, __pyx_L1_error)
4922 __pyx_v_self->format = __pyx_t_8;
4931 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * 2) * ((
size_t)__pyx_v_self->ndim))));
4940 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
4949 __pyx_t_4 = (!(__pyx_v_self->_shape != 0));
4951 if (unlikely(__pyx_t_4)) {
4961 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_shape_and_str, 0, 0);
4962 __PYX_ERR(1, 172, __pyx_L1_error)
4982 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5);
4986 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
4987 #if !CYTHON_ASSUME_SAFE_SIZE
4988 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 175, __pyx_L1_error)
4990 if (__pyx_t_1 >= __pyx_temp)
break;
4992 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4993 __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1));
4995 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_1);
4998 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 175, __pyx_L1_error)
4999 __Pyx_GOTREF(__pyx_t_6);
5000 __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)
5001 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5002 __pyx_v_dim = __pyx_t_9;
5003 __pyx_v_idx = __pyx_t_3;
5004 __pyx_t_3 = (__pyx_t_3 + 1);
5013 __pyx_t_4 = (__pyx_v_dim <= 0);
5015 if (unlikely(__pyx_t_4)) {
5025 __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0,
' ',
'd');
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
5026 __Pyx_GOTREF(__pyx_t_6);
5027 __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)
5028 __Pyx_GOTREF(__pyx_t_10);
5029 __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis;
5030 __pyx_t_11[1] = __pyx_t_6;
5031 __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u__2;
5032 __pyx_t_11[3] = __pyx_t_10;
5033 __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__3;
5035 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
5036 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]);
5039 __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_9, __pyx_t_12);
5040 if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 177, __pyx_L1_error)
5041 __Pyx_GOTREF(__pyx_t_13);
5042 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5043 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5044 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
5045 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5046 __PYX_ERR(1, 177, __pyx_L1_error)
5064 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
5074 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5083 __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)
5094 __pyx_v_order =
'C';
5103 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
5104 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_c);
5105 __Pyx_GOTREF(__pyx_v_self->mode);
5106 __Pyx_DECREF(__pyx_v_self->mode);
5107 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_c;
5126 __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)
5127 if (likely(__pyx_t_4)) {
5137 __pyx_v_order =
'F';
5146 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
5147 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fortran);
5148 __Pyx_GOTREF(__pyx_v_self->mode);
5149 __Pyx_DECREF(__pyx_v_self->mode);
5150 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_fortran;
5170 __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)
5171 __Pyx_GOTREF(__pyx_t_5);
5172 __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)
5173 __Pyx_GOTREF(__pyx_t_13);
5174 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5175 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
5176 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5177 __PYX_ERR(1, 188, __pyx_L1_error)
5188 __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);
5197 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
5206 __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)
5207 __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)
5208 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5209 __pyx_v_self->dtype_is_object = __pyx_t_4;
5218 if (__pyx_v_allocate_buffer) {
5227 __pyx_t_3 = __pyx_array_allocate_buffer(__pyx_v_self);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 196, __pyx_L1_error)
5251 __Pyx_XDECREF(__pyx_t_5);
5252 __Pyx_XDECREF(__pyx_t_6);
5253 __Pyx_XDECREF(__pyx_t_10);
5254 __Pyx_XDECREF(__pyx_t_13);
5255 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5261 __Pyx_XDECREF(__pyx_v_format);
5263 __Pyx_RefNannyFinishContext();
5276CYTHON_UNUSED
static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
5277CYTHON_UNUSED
static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
5278 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5280 __Pyx_RefNannyDeclarations
5281 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
5282 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5283 __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));
5288 __Pyx_RefNannyFinishContext();
5292static 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) {
5293 int __pyx_v_bufmode;
5295 __Pyx_RefNannyDeclarations
5299 Py_ssize_t __pyx_t_4;
5300 Py_ssize_t *__pyx_t_5;
5301 int __pyx_lineno = 0;
5302 const char *__pyx_filename = NULL;
5303 int __pyx_clineno = 0;
5304 if (unlikely(__pyx_v_info == NULL)) {
5305 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
5308 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
5309 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5310 __Pyx_GIVEREF(__pyx_v_info->obj);
5319 __pyx_v_bufmode = -1;
5328 __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
5340 __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)
5351 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5370 __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)
5381 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5400 __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5402 if (unlikely(__pyx_t_1)) {
5412 __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)
5440 __pyx_t_3 = __pyx_v_self->data;
5442 __pyx_v_info->buf = __pyx_t_3;
5451 __pyx_t_4 = __pyx_v_self->len;
5453 __pyx_v_info->len = __pyx_t_4;
5462 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5474 __pyx_t_2 = __pyx_v_self->ndim;
5476 __pyx_v_info->ndim = __pyx_t_2;
5485 __pyx_t_5 = __pyx_v_self->_shape;
5487 __pyx_v_info->shape = __pyx_t_5;
5496 __pyx_t_5 = __pyx_v_self->_strides;
5498 __pyx_v_info->strides = __pyx_t_5;
5518 __pyx_v_info->ndim = 1;
5527 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5531 __pyx_t_5 = (&__pyx_v_self->len);
5537 __pyx_v_info->shape = __pyx_t_5;
5546 __pyx_v_info->strides = NULL;
5557 __pyx_v_info->suboffsets = NULL;
5566 __pyx_t_4 = __pyx_v_self->itemsize;
5568 __pyx_v_info->itemsize = __pyx_t_4;
5577 __pyx_v_info->readonly = 0;
5586 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5590 __pyx_t_3 = __pyx_v_self->format;
5596 __pyx_v_info->format = __pyx_t_3;
5605 __Pyx_INCREF((PyObject *)__pyx_v_self);
5606 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5607 __Pyx_GOTREF(__pyx_v_info->obj);
5608 __Pyx_DECREF(__pyx_v_info->obj);
5609 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5623 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5625 if (__pyx_v_info->obj != NULL) {
5626 __Pyx_GOTREF(__pyx_v_info->obj);
5627 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5631 if (__pyx_v_info->obj == Py_None) {
5632 __Pyx_GOTREF(__pyx_v_info->obj);
5633 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5638 __Pyx_RefNannyFinishContext();
5651static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
5652static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
5653 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5654 __Pyx_RefNannyDeclarations
5655 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
5656 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5657 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
5660 __Pyx_RefNannyFinishContext();
5663static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
5674 __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
5686 __pyx_v_self->callback_free_data(__pyx_v_self->data);
5705 if (__pyx_v_self->free_data) {
5708 __pyx_t_1 = __pyx_v_self->free_data;
5709 goto __pyx_L4_bool_binop_done;
5711 __pyx_t_2 = (__pyx_v_self->data != NULL);
5714 __pyx_t_1 = __pyx_t_2;
5716 __pyx_L4_bool_binop_done:;
5727 if (__pyx_v_self->dtype_is_object) {
5736 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
5754 free(__pyx_v_self->data);
5773 PyObject_Free(__pyx_v_self->_shape);
5796static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
5797static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
5798 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5799 PyObject *__pyx_r = 0;
5800 __Pyx_RefNannyDeclarations
5801 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
5802 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5803 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
5806 __Pyx_RefNannyFinishContext();
5810static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
5811 PyObject *__pyx_r = NULL;
5812 __Pyx_RefNannyDeclarations
5813 PyObject *__pyx_t_1 = NULL;
5814 int __pyx_lineno = 0;
5815 const char *__pyx_filename = NULL;
5816 int __pyx_clineno = 0;
5817 __Pyx_RefNannySetupContext(
"__get__", 0);
5826 __pyx_t_1 = __pyx_array_get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
5827 __Pyx_GOTREF(__pyx_t_1);
5829 PyObject *__pyx_temp;
5831 __pyx_temp = __pyx_r;
5832 __pyx_r = __pyx_t_1;
5834 __Pyx_XDECREF(__pyx_temp);
5849 __Pyx_XDECREF(__pyx_t_1);
5850 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5853 __Pyx_XGIVEREF(__pyx_r);
5854 __Pyx_RefNannyFinishContext();
5866static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
5868 PyObject *__pyx_r = NULL;
5869 __Pyx_RefNannyDeclarations
5870 PyObject *__pyx_t_1 = NULL;
5871 PyObject *__pyx_t_2 = NULL;
5872 PyObject *__pyx_t_3 = NULL;
5873 PyObject *__pyx_t_4 = NULL;
5875 int __pyx_lineno = 0;
5876 const char *__pyx_filename = NULL;
5877 int __pyx_clineno = 0;
5878 __Pyx_RefNannySetupContext(
"get_memview", 0);
5887 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
5897 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 243, __pyx_L1_error)
5898 __Pyx_GOTREF(__pyx_t_3);
5899 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 243, __pyx_L1_error)
5900 __Pyx_GOTREF(__pyx_t_4);
5903 PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4};
5904 __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));
5905 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5906 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5907 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5908 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
5909 __Pyx_GOTREF((PyObject *)__pyx_t_1);
5912 PyObject *__pyx_temp;
5914 __pyx_temp = __pyx_r;
5915 __pyx_r = ((PyObject *)__pyx_t_1);
5917 __Pyx_XDECREF(__pyx_temp);
5932 __Pyx_XDECREF(__pyx_t_1);
5933 __Pyx_XDECREF(__pyx_t_2);
5934 __Pyx_XDECREF(__pyx_t_3);
5935 __Pyx_XDECREF(__pyx_t_4);
5936 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
5940 __Pyx_XGIVEREF(__pyx_r);
5941 __Pyx_RefNannyFinishContext();
5954static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
5955static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
5956 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5958 __Pyx_RefNannyDeclarations
5959 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
5960 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5961 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
5964 __Pyx_RefNannyFinishContext();
5968static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
5980 __pyx_r = (__pyx_v_self->_shape[0]);
6007static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
6008static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
6009 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6010 PyObject *__pyx_r = 0;
6011 __Pyx_RefNannyDeclarations
6012 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
6013 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6014 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
6017 __Pyx_RefNannyFinishContext();
6021static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
6022 PyObject *__pyx_r = NULL;
6023 __Pyx_RefNannyDeclarations
6024 PyObject *__pyx_t_1 = NULL;
6025 PyObject *__pyx_t_2 = NULL;
6026 int __pyx_lineno = 0;
6027 const char *__pyx_filename = NULL;
6028 int __pyx_clineno = 0;
6029 __Pyx_RefNannySetupContext(
"__getattr__", 0);
6038 __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)
6039 __Pyx_GOTREF(__pyx_t_1);
6040 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
6041 __Pyx_GOTREF(__pyx_t_2);
6042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6044 PyObject *__pyx_temp;
6046 __pyx_temp = __pyx_r;
6047 __pyx_r = __pyx_t_2;
6049 __Pyx_XDECREF(__pyx_temp);
6064 __Pyx_XDECREF(__pyx_t_1);
6065 __Pyx_XDECREF(__pyx_t_2);
6066 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6069 __Pyx_XGIVEREF(__pyx_r);
6070 __Pyx_RefNannyFinishContext();
6083static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
6084static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
6085 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6086 PyObject *__pyx_r = 0;
6087 __Pyx_RefNannyDeclarations
6088 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
6089 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6090 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
6093 __Pyx_RefNannyFinishContext();
6097static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
6098 PyObject *__pyx_r = NULL;
6099 __Pyx_RefNannyDeclarations
6100 PyObject *__pyx_t_1 = NULL;
6101 PyObject *__pyx_t_2 = NULL;
6102 int __pyx_lineno = 0;
6103 const char *__pyx_filename = NULL;
6104 int __pyx_clineno = 0;
6105 __Pyx_RefNannySetupContext(
"__getitem__", 0);
6114 __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)
6115 __Pyx_GOTREF(__pyx_t_1);
6116 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
6117 __Pyx_GOTREF(__pyx_t_2);
6118 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6120 PyObject *__pyx_temp;
6122 __pyx_temp = __pyx_r;
6123 __pyx_r = __pyx_t_2;
6125 __Pyx_XDECREF(__pyx_temp);
6140 __Pyx_XDECREF(__pyx_t_1);
6141 __Pyx_XDECREF(__pyx_t_2);
6142 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6145 __Pyx_XGIVEREF(__pyx_r);
6146 __Pyx_RefNannyFinishContext();
6159static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
6160static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6161 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6163 __Pyx_RefNannyDeclarations
6164 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
6165 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6166 __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));
6169 __Pyx_RefNannyFinishContext();
6173static 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) {
6175 __Pyx_RefNannyDeclarations
6176 PyObject *__pyx_t_1 = NULL;
6177 int __pyx_lineno = 0;
6178 const char *__pyx_filename = NULL;
6179 int __pyx_clineno = 0;
6180 __Pyx_RefNannySetupContext(
"__setitem__", 0);
6189 __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)
6190 __Pyx_GOTREF(__pyx_t_1);
6191 if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 255, __pyx_L1_error)
6192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6206 __Pyx_XDECREF(__pyx_t_1);
6207 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6211 __Pyx_RefNannyFinishContext();
6222static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6223#
if CYTHON_VECTORCALL
6224PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6226PyObject *__pyx_args, PyObject *__pyx_kwds
6229static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6230#
if CYTHON_VECTORCALL
6231PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6233PyObject *__pyx_args, PyObject *__pyx_kwds
6236 #if !CYTHON_VECTORCALL
6237 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6239 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6240 PyObject *__pyx_r = 0;
6241 __Pyx_RefNannyDeclarations
6242 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
6243 #if !CYTHON_VECTORCALL
6244 #if CYTHON_ASSUME_SAFE_SIZE
6245 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6247 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6250 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6251 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
6252 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6253 if (unlikely(__pyx_kwds_len < 0))
return NULL;
6254 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
6255 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
6258 __Pyx_RefNannyFinishContext();
6262static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
6263 PyObject *__pyx_r = NULL;
6264 __Pyx_RefNannyDeclarations
6265 int __pyx_lineno = 0;
6266 const char *__pyx_filename = NULL;
6267 int __pyx_clineno = 0;
6268 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
6276 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6277 __PYX_ERR(1, 2, __pyx_L1_error)
6287 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6289 __Pyx_XGIVEREF(__pyx_r);
6290 __Pyx_RefNannyFinishContext();
6302static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6303#
if CYTHON_VECTORCALL
6304PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6306PyObject *__pyx_args, PyObject *__pyx_kwds
6309static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6310#
if CYTHON_VECTORCALL
6311PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6313PyObject *__pyx_args, PyObject *__pyx_kwds
6316 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6317 #if !CYTHON_VECTORCALL
6318 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6320 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6321 PyObject* values[1] = {0};
6322 int __pyx_lineno = 0;
6323 const char *__pyx_filename = NULL;
6324 int __pyx_clineno = 0;
6325 PyObject *__pyx_r = 0;
6326 __Pyx_RefNannyDeclarations
6327 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
6328 #if !CYTHON_VECTORCALL
6329 #if CYTHON_ASSUME_SAFE_SIZE
6330 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6332 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6335 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6337 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
6338 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6339 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
6340 if (__pyx_kwds_len > 0) {
6341 switch (__pyx_nargs) {
6343 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6344 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6347 default:
goto __pyx_L5_argtuple_error;
6349 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6350 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)
6351 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6352 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
6354 }
else if (unlikely(__pyx_nargs != 1)) {
6355 goto __pyx_L5_argtuple_error;
6357 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6358 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6360 __pyx_v___pyx_state = values[0];
6363 __pyx_L5_argtuple_error:;
6364 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6366 goto __pyx_L4_argument_unpacking_done;
6368 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6369 Py_XDECREF(values[__pyx_temp]);
6371 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6372 __Pyx_RefNannyFinishContext();
6374 __pyx_L4_argument_unpacking_done:;
6375 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
6378 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6379 Py_XDECREF(values[__pyx_temp]);
6381 __Pyx_RefNannyFinishContext();
6385static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6386 PyObject *__pyx_r = NULL;
6387 __Pyx_RefNannyDeclarations
6388 int __pyx_lineno = 0;
6389 const char *__pyx_filename = NULL;
6390 int __pyx_clineno = 0;
6391 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
6398 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6399 __PYX_ERR(1, 4, __pyx_L1_error)
6410 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6412 __Pyx_XGIVEREF(__pyx_r);
6413 __Pyx_RefNannyFinishContext();
6425static int __pyx_array_allocate_buffer(
struct __pyx_array_obj *__pyx_v_self) {
6426 Py_ssize_t __pyx_v_i;
6427 PyObject **__pyx_v_p;
6430 Py_ssize_t __pyx_t_2;
6431 Py_ssize_t __pyx_t_3;
6432 Py_ssize_t __pyx_t_4;
6433 int __pyx_lineno = 0;
6434 const char *__pyx_filename = NULL;
6435 int __pyx_clineno = 0;
6444 __pyx_v_self->free_data = 1;
6453 __pyx_v_self->data = ((
char *)malloc(((
size_t)__pyx_v_self->len)));
6462 __pyx_t_1 = (!(__pyx_v_self->data != 0));
6464 if (unlikely(__pyx_t_1)) {
6474 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_array_data, 0, 0);
6475 __PYX_ERR(1, 274, __pyx_L1_error)
6493 if (__pyx_v_self->dtype_is_object) {
6502 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6511 if (unlikely(__pyx_v_self->itemsize == 0)) {
6512 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
6513 __PYX_ERR(1, 278, __pyx_L1_error)
6515 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))) {
6516 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
6517 __PYX_ERR(1, 278, __pyx_L1_error)
6520 __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize, 0);
6521 __pyx_t_3 = __pyx_t_2;
6523 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6524 __pyx_v_i = __pyx_t_4;
6533 (__pyx_v_p[__pyx_v_i]) = Py_None;
6578 __Pyx_AddTraceback(
"View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6595static 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) {
6596 struct __pyx_array_obj *__pyx_v_result = 0;
6597 PyObject *__pyx_v_mode = 0;
6598 struct __pyx_array_obj *__pyx_r = NULL;
6599 __Pyx_RefNannyDeclarations
6600 PyObject *__pyx_t_1 = NULL;
6602 PyObject *__pyx_t_3 = NULL;
6603 PyObject *__pyx_t_4 = NULL;
6604 int __pyx_lineno = 0;
6605 const char *__pyx_filename = NULL;
6606 int __pyx_clineno = 0;
6607 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
6616 __pyx_t_2 = ((__pyx_v_c_mode[0]) ==
'f');
6619 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
6620 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
6622 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
6623 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
6626 __pyx_v_mode = ((PyObject*)__pyx_t_1);
6636 __pyx_t_2 = (__pyx_v_buf == NULL);
6648 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
6649 __Pyx_GOTREF(__pyx_t_1);
6650 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
6651 __Pyx_GOTREF(__pyx_t_3);
6652 __pyx_t_4 = PyTuple_New(4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 290, __pyx_L1_error)
6653 __Pyx_GOTREF(__pyx_t_4);
6654 __Pyx_INCREF(__pyx_v_shape);
6655 __Pyx_GIVEREF(__pyx_v_shape);
6656 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6657 __Pyx_GIVEREF(__pyx_t_1);
6658 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6659 __Pyx_GIVEREF(__pyx_t_3);
6660 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6661 __Pyx_INCREF(__pyx_v_mode);
6662 __Pyx_GIVEREF(__pyx_v_mode);
6663 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6666 __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)
6667 __Pyx_GOTREF(__pyx_t_3);
6668 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6669 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_3);
6690 __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
6691 __Pyx_GOTREF(__pyx_t_3);
6692 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6693 __Pyx_GOTREF(__pyx_t_4);
6694 __pyx_t_1 = PyTuple_New(4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
6695 __Pyx_GOTREF(__pyx_t_1);
6696 __Pyx_INCREF(__pyx_v_shape);
6697 __Pyx_GIVEREF(__pyx_v_shape);
6698 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6699 __Pyx_GIVEREF(__pyx_t_3);
6700 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6701 __Pyx_GIVEREF(__pyx_t_4);
6702 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6703 __Pyx_INCREF(__pyx_v_mode);
6704 __Pyx_GIVEREF(__pyx_v_mode);
6705 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6708 __pyx_t_4 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6709 __Pyx_GOTREF(__pyx_t_4);
6710 if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_allocate_buffer, Py_False) < (0)) __PYX_ERR(1, 292, __pyx_L1_error)
6711 __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)
6712 __Pyx_GOTREF(__pyx_t_3);
6713 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6714 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6715 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_3);
6725 __pyx_v_result->data = __pyx_v_buf;
6737 struct __pyx_array_obj *__pyx_temp;
6739 __pyx_temp = __pyx_r;
6740 __Pyx_INCREF((PyObject *)__pyx_v_result);
6741 __pyx_r = __pyx_v_result;
6743 __Pyx_XDECREF((PyObject *)__pyx_temp);
6757 __Pyx_XDECREF(__pyx_t_1);
6758 __Pyx_XDECREF(__pyx_t_3);
6759 __Pyx_XDECREF(__pyx_t_4);
6760 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
6763 __Pyx_XDECREF((PyObject *)__pyx_v_result);
6764 __Pyx_XDECREF(__pyx_v_mode);
6765 __Pyx_XGIVEREF((PyObject *)__pyx_r);
6766 __Pyx_RefNannyFinishContext();
6779static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6780#
if CYTHON_VECTORCALL_TPNEW
6781PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6783PyObject *__pyx_args, PyObject *__pyx_kwds
6786static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6787#
if CYTHON_VECTORCALL_TPNEW
6788PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6790PyObject *__pyx_args, PyObject *__pyx_kwds
6793 PyObject *__pyx_v_name = 0;
6794 #if !CYTHON_VECTORCALL_TPNEW
6795 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6797 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6798 PyObject* values[1] = {0};
6799 int __pyx_lineno = 0;
6800 const char *__pyx_filename = NULL;
6801 int __pyx_clineno = 0;
6803 __Pyx_RefNannyDeclarations
6804 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
6805 #if !CYTHON_VECTORCALL_TPNEW
6806 #if CYTHON_ASSUME_SAFE_SIZE
6807 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6809 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
6812 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
6814 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
6815 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
6816 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 321, __pyx_L3_error)
6817 if (__pyx_kwds_len > 0) {
6818 switch (__pyx_nargs) {
6820 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6821 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6824 default:
goto __pyx_L5_argtuple_error;
6826 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6827 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)
6828 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6829 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, i); __PYX_ERR(1, 321, __pyx_L3_error) }
6831 }
else if (unlikely(__pyx_nargs != 1)) {
6832 goto __pyx_L5_argtuple_error;
6834 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6835 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6837 __pyx_v_name = values[0];
6840 __pyx_L5_argtuple_error:;
6841 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 321, __pyx_L3_error)
6843 goto __pyx_L4_argument_unpacking_done;
6845 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6846 Py_XDECREF(values[__pyx_temp]);
6848 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6849 __Pyx_RefNannyFinishContext();
6851 __pyx_L4_argument_unpacking_done:;
6852 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
6855 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6856 Py_XDECREF(values[__pyx_temp]);
6858 __Pyx_RefNannyFinishContext();
6862static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
6864 __Pyx_RefNannyDeclarations
6865 __Pyx_RefNannySetupContext(
"__init__", 0);
6874 __Pyx_INCREF(__pyx_v_name);
6875 __Pyx_GIVEREF(__pyx_v_name);
6876 __Pyx_GOTREF(__pyx_v_self->name);
6877 __Pyx_DECREF(__pyx_v_self->name);
6878 __pyx_v_self->name = __pyx_v_name;
6891 __Pyx_RefNannyFinishContext();
6904static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
6905static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
6906 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6907 PyObject *__pyx_r = 0;
6908 __Pyx_RefNannyDeclarations
6909 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
6910 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6911 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6914 __Pyx_RefNannyFinishContext();
6918static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6919 PyObject *__pyx_r = NULL;
6920 __Pyx_RefNannyDeclarations
6921 __Pyx_RefNannySetupContext(
"__repr__", 0);
6931 PyObject *__pyx_temp;
6933 __pyx_temp = __pyx_r;
6934 __Pyx_INCREF(__pyx_v_self->name);
6935 __pyx_r = __pyx_v_self->name;
6937 __Pyx_XDECREF(__pyx_temp);
6951 __Pyx_XGIVEREF(__pyx_r);
6952 __Pyx_RefNannyFinishContext();
6963static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
6964#
if CYTHON_VECTORCALL
6965PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6967PyObject *__pyx_args, PyObject *__pyx_kwds
6970static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
6971#
if CYTHON_VECTORCALL
6972PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6974PyObject *__pyx_args, PyObject *__pyx_kwds
6977 #if !CYTHON_VECTORCALL
6978 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6980 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6981 PyObject *__pyx_r = 0;
6982 __Pyx_RefNannyDeclarations
6983 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
6984 #if !CYTHON_VECTORCALL
6985 #if CYTHON_ASSUME_SAFE_SIZE
6986 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6988 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6991 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6992 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
6993 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6994 if (unlikely(__pyx_kwds_len < 0))
return NULL;
6995 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
6996 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6999 __Pyx_RefNannyFinishContext();
7003static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7004 PyObject *__pyx_v_state = 0;
7005 PyObject *__pyx_v__dict = 0;
7006 int __pyx_v_use_setstate;
7007 PyObject *__pyx_r = NULL;
7008 __Pyx_RefNannyDeclarations
7009 PyObject *__pyx_t_1 = NULL;
7010 PyObject *__pyx_t_2 = NULL;
7013 PyObject *__pyx_t_5 = NULL;
7014 int __pyx_lineno = 0;
7015 const char *__pyx_filename = NULL;
7016 int __pyx_clineno = 0;
7017 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
7027 __Pyx_PyCriticalSection __pyx_cs;
7028 __pyx_t_1 = ((PyObject *)__pyx_v_self);
7029 __Pyx_INCREF(__pyx_t_1);
7030 __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
7040 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L4_error)
7041 __Pyx_GOTREF(__pyx_t_2);
7042 __Pyx_INCREF(__pyx_v_self->name);
7043 __Pyx_GIVEREF(__pyx_v_self->name);
7044 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name) != (0)) __PYX_ERR(1, 6, __pyx_L4_error);
7045 __pyx_v_state = ((PyObject*)__pyx_t_2);
7055 __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)
7056 __Pyx_GOTREF(__pyx_t_2);
7057 __pyx_v__dict = __pyx_t_2;
7070 __Pyx_PyCriticalSection_End(&__pyx_cs);
7074 __Pyx_PyCriticalSection_End(&__pyx_cs);
7075 goto __pyx_L1_error;
7079 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7089 __pyx_t_4 = (__pyx_v__dict != Py_None);
7094 __pyx_t_3 = __pyx_t_4;
7096 goto __pyx_L7_bool_binop_done;
7098 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict);
if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 8, __pyx_L1_error)
7100 __pyx_t_3 = __pyx_t_4;
7102 __pyx_L7_bool_binop_done:;
7113 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
7114 __Pyx_GOTREF(__pyx_t_1);
7115 __Pyx_INCREF(__pyx_v__dict);
7116 __Pyx_GIVEREF(__pyx_v__dict);
7117 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 9, __pyx_L1_error);
7118 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
7119 __Pyx_GOTREF(__pyx_t_2);
7120 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7121 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
7131 __pyx_v_use_setstate = 1;
7151 __pyx_t_3 = (__pyx_v_self->name != Py_None);
7152 __pyx_v_use_setstate = __pyx_t_3;
7163 if (__pyx_v_use_setstate) {
7172 __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)
7173 __Pyx_GOTREF(__pyx_t_2);
7174 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
7175 __Pyx_GOTREF(__pyx_t_1);
7176 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7177 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7178 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7179 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
7180 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
7181 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7182 __Pyx_INCREF(Py_None);
7183 __Pyx_GIVEREF(Py_None);
7184 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7185 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
7186 __Pyx_GOTREF(__pyx_t_5);
7187 __Pyx_GIVEREF(__pyx_t_2);
7188 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7189 __Pyx_GIVEREF(__pyx_t_1);
7190 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7191 __Pyx_INCREF(__pyx_v_state);
7192 __Pyx_GIVEREF(__pyx_v_state);
7193 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7197 PyObject *__pyx_temp;
7199 __pyx_temp = __pyx_r;
7200 __pyx_r = __pyx_t_5;
7202 __Pyx_XDECREF(__pyx_temp);
7224 __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)
7225 __Pyx_GOTREF(__pyx_t_5);
7226 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
7227 __Pyx_GOTREF(__pyx_t_1);
7228 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7229 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7230 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7231 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
7232 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
7233 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7234 __Pyx_INCREF(__pyx_v_state);
7235 __Pyx_GIVEREF(__pyx_v_state);
7236 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7237 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
7238 __Pyx_GOTREF(__pyx_t_2);
7239 __Pyx_GIVEREF(__pyx_t_5);
7240 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7241 __Pyx_GIVEREF(__pyx_t_1);
7242 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7246 PyObject *__pyx_temp;
7248 __pyx_temp = __pyx_r;
7249 __pyx_r = __pyx_t_2;
7251 __Pyx_XDECREF(__pyx_temp);
7265 __Pyx_XDECREF(__pyx_t_1);
7266 __Pyx_XDECREF(__pyx_t_2);
7267 __Pyx_XDECREF(__pyx_t_5);
7268 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7271 __Pyx_XDECREF(__pyx_v_state);
7272 __Pyx_XDECREF(__pyx_v__dict);
7274 __Pyx_XGIVEREF(__pyx_r);
7275 __Pyx_RefNannyFinishContext();
7287static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7288#
if CYTHON_VECTORCALL
7289PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7291PyObject *__pyx_args, PyObject *__pyx_kwds
7294static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7295#
if CYTHON_VECTORCALL
7296PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7298PyObject *__pyx_args, PyObject *__pyx_kwds
7301 PyObject *__pyx_v___pyx_state = 0;
7302 #if !CYTHON_VECTORCALL
7303 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7305 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7306 PyObject* values[1] = {0};
7307 int __pyx_lineno = 0;
7308 const char *__pyx_filename = NULL;
7309 int __pyx_clineno = 0;
7310 PyObject *__pyx_r = 0;
7311 __Pyx_RefNannyDeclarations
7312 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
7313 #if !CYTHON_VECTORCALL
7314 #if CYTHON_ASSUME_SAFE_SIZE
7315 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7317 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
7320 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7322 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
7323 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7324 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 17, __pyx_L3_error)
7325 if (__pyx_kwds_len > 0) {
7326 switch (__pyx_nargs) {
7328 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7329 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7332 default:
goto __pyx_L5_argtuple_error;
7334 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7335 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)
7336 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
7337 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 17, __pyx_L3_error) }
7339 }
else if (unlikely(__pyx_nargs != 1)) {
7340 goto __pyx_L5_argtuple_error;
7342 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7343 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7345 __pyx_v___pyx_state = values[0];
7348 __pyx_L5_argtuple_error:;
7349 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 17, __pyx_L3_error)
7351 goto __pyx_L4_argument_unpacking_done;
7353 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7354 Py_XDECREF(values[__pyx_temp]);
7356 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7357 __Pyx_RefNannyFinishContext();
7359 __pyx_L4_argument_unpacking_done:;
7360 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
7363 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7364 Py_XDECREF(values[__pyx_temp]);
7366 __Pyx_RefNannyFinishContext();
7370static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7371 PyObject *__pyx_r = NULL;
7372 __Pyx_RefNannyDeclarations
7373 PyObject *__pyx_t_1 = NULL;
7374 PyObject *__pyx_t_2 = NULL;
7375 int __pyx_lineno = 0;
7376 const char *__pyx_filename = NULL;
7377 int __pyx_clineno = 0;
7378 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
7385 __pyx_t_1 = __pyx_v___pyx_state;
7386 __Pyx_INCREF(__pyx_t_1);
7387 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)
7388 if (unlikely(__pyx_t_1 == Py_None)) {
7389 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
7390 __PYX_ERR(1, 18, __pyx_L1_error)
7392 __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)
7393 __Pyx_GOTREF(__pyx_t_2);
7394 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7395 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7405 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7408 __Pyx_XDECREF(__pyx_t_1);
7409 __Pyx_XDECREF(__pyx_t_2);
7410 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7413 __Pyx_XGIVEREF(__pyx_r);
7414 __Pyx_RefNannyFinishContext();
7427static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7428#
if CYTHON_VECTORCALL_TPNEW
7429PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7431PyObject *__pyx_args, PyObject *__pyx_kwds
7434static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7435#
if CYTHON_VECTORCALL_TPNEW
7436PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7438PyObject *__pyx_args, PyObject *__pyx_kwds
7441 PyObject *__pyx_v_obj = 0;
7443 int __pyx_v_dtype_is_object;
7444 #if !CYTHON_VECTORCALL_TPNEW
7445 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7447 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7448 PyObject* values[3] = {0,0,0};
7449 int __pyx_lineno = 0;
7450 const char *__pyx_filename = NULL;
7451 int __pyx_clineno = 0;
7453 __Pyx_RefNannyDeclarations
7454 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
7455 #if !CYTHON_VECTORCALL_TPNEW
7456 #if CYTHON_ASSUME_SAFE_SIZE
7457 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7459 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
7462 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
7464 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};
7465 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
7466 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 367, __pyx_L3_error)
7467 if (__pyx_kwds_len > 0) {
7468 switch (__pyx_nargs) {
7470 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7471 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7474 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7475 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7478 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7479 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7482 default:
goto __pyx_L5_argtuple_error;
7484 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7485 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)
7486 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
7487 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, i); __PYX_ERR(1, 367, __pyx_L3_error) }
7490 switch (__pyx_nargs) {
7492 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7493 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7496 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7497 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7498 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7499 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7501 default:
goto __pyx_L5_argtuple_error;
7504 __pyx_v_obj = values[0];
7505 __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)
7507 __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)
7509 __pyx_v_dtype_is_object = ((int)0);
7513 __pyx_L5_argtuple_error:;
7514 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 367, __pyx_L3_error)
7516 goto __pyx_L4_argument_unpacking_done;
7518 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7519 Py_XDECREF(values[__pyx_temp]);
7521 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7522 __Pyx_RefNannyFinishContext();
7524 __pyx_L4_argument_unpacking_done:;
7525 __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);
7528 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7529 Py_XDECREF(values[__pyx_temp]);
7533 __Pyx_RefNannyFinishContext();
7537static 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) {
7539 __Pyx_RefNannyDeclarations
7543 int __pyx_lineno = 0;
7544 const char *__pyx_filename = NULL;
7545 int __pyx_clineno = 0;
7546 __Pyx_RefNannySetupContext(
"__cinit__", 0);
7555 __Pyx_INCREF(__pyx_v_obj);
7556 __Pyx_GIVEREF(__pyx_v_obj);
7557 __Pyx_GOTREF(__pyx_v_self->obj);
7558 __Pyx_DECREF(__pyx_v_self->obj);
7559 __pyx_v_self->obj = __pyx_v_obj;
7568 __pyx_v_self->flags = __pyx_v_flags;
7577 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type));
7582 __pyx_t_1 = __pyx_t_2;
7584 goto __pyx_L4_bool_binop_done;
7586 __pyx_t_2 = (__pyx_v_obj != Py_None);
7588 __pyx_t_1 = __pyx_t_2;
7590 __pyx_L4_bool_binop_done:;
7601 __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)
7611 __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
7623 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7659 __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
7671 __pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
7677 __pyx_t_1 = __pyx_t_2;
7679 goto __pyx_L9_bool_binop_done;
7689 __pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
7692 __pyx_t_1 = __pyx_t_2;
7694 __pyx_L9_bool_binop_done:;
7713 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7722 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
7740 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7752 __pyx_v_self->lock = PyThread_allocate_lock();
7761 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7763 if (unlikely(__pyx_t_1)) {
7773 PyErr_NoMemory(); __PYX_ERR(1, 386, __pyx_L1_error)
7809 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7821 __pyx_t_2 = ((__pyx_v_self->view.format[0]) ==
'O');
7827 __pyx_t_1 = __pyx_t_2;
7829 goto __pyx_L14_bool_binop_done;
7831 __pyx_t_2 = ((__pyx_v_self->view.format[1]) ==
'\x00');
7834 __pyx_t_1 = __pyx_t_2;
7836 __pyx_L14_bool_binop_done:;
7837 __pyx_v_self->dtype_is_object = __pyx_t_1;
7857 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
7868 #ifndef CYTHON_WITHOUT_ASSERTIONS
7869 if (unlikely(__pyx_assertions_enabled())) {
7870 __pyx_t_1 = ((((__pyx_uintptr_t)(&__pyx_v_self->acquisition_count)) % (
sizeof(__pyx_atomic_int_type))) == 0);
7872 if (unlikely(!__pyx_t_1)) {
7873 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
7874 __PYX_ERR(1, 394, __pyx_L1_error)
7879 if ((1));
else __PYX_ERR(1, 394, __pyx_L1_error)
7889 __pyx_v_self->typeinfo = NULL;
7903 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7907 __Pyx_RefNannyFinishContext();
7920static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
7921static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
7922 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7923 __Pyx_RefNannyDeclarations
7924 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7925 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7926 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
7929 __Pyx_RefNannyFinishContext();
7932static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
7935 Py_ssize_t __pyx_t_2;
7936 Py_ssize_t __pyx_t_3;
7938 PyThread_type_lock __pyx_t_5;
7939 PyThread_type_lock __pyx_t_6;
7948 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
7959 PyBuffer_Release((&__pyx_v_self->view));
7978 __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
7990 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
8018 __pyx_t_1 = (__pyx_v_self->lock != NULL);
8030 __pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
8037 __pyx_t_2 = __pyx_memoryview_thread_locks_used;
8040 __pyx_t_3 = __pyx_t_2;
8042 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
8043 __pyx_v_i = __pyx_t_4;
8052 __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
8064 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8073 __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
8085 __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8087 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8097 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
8099 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
8118 goto __pyx_L6_break;
8138 PyThread_free_lock(__pyx_v_self->lock);
8174static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8175 Py_ssize_t __pyx_v_dim;
8176 char *__pyx_v_itemp;
8177 PyObject *__pyx_v_idx = NULL;
8179 __Pyx_RefNannyDeclarations
8180 Py_ssize_t __pyx_t_1;
8181 PyObject *__pyx_t_2 = NULL;
8182 Py_ssize_t __pyx_t_3;
8183 PyObject *__pyx_t_4 = NULL;
8184 Py_ssize_t __pyx_t_5;
8186 int __pyx_lineno = 0;
8187 const char *__pyx_filename = NULL;
8188 int __pyx_clineno = 0;
8189 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
8198 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
8209 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
8213 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
8214 #if !CYTHON_ASSUME_SAFE_SIZE
8215 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 423, __pyx_L1_error)
8217 if (__pyx_t_3 >= __pyx_temp)
break;
8219 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8220 __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
8222 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
8225 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
8226 __Pyx_GOTREF(__pyx_t_4);
8227 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
8229 __pyx_v_dim = __pyx_t_1;
8230 __pyx_t_1 = (__pyx_t_1 + 1);
8239 __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)
8240 __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)
8241 __pyx_v_itemp = __pyx_t_6;
8252 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8263 __pyx_r = __pyx_v_itemp;
8277 __Pyx_XDECREF(__pyx_t_2);
8278 __Pyx_XDECREF(__pyx_t_4);
8279 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8284 __Pyx_XDECREF(__pyx_v_idx);
8286 __Pyx_RefNannyFinishContext();
8299static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
8300static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8301 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
8302 PyObject *__pyx_r = 0;
8303 __Pyx_RefNannyDeclarations
8304 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
8305 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8306 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8309 __Pyx_RefNannyFinishContext();
8313static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8314 char *__pyx_v_buffer;
8315 int __pyx_v_have_slices;
8316 PyObject *__pyx_v_indices = NULL;
8317 char *__pyx_v_itemp;
8318 PyObject *__pyx_r = NULL;
8319 __Pyx_RefNannyDeclarations
8322 Py_ssize_t __pyx_t_3;
8324 PyObject *__pyx_t_5 = NULL;
8325 PyObject *__pyx_t_6 = NULL;
8326 PyObject *__pyx_t_7 = NULL;
8327 int __pyx_lineno = 0;
8328 const char *__pyx_filename = NULL;
8329 int __pyx_clineno = 0;
8330 __Pyx_RefNannySetupContext(
"__getitem__", 0);
8339 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8345 __pyx_t_1 = __pyx_t_2;
8347 goto __pyx_L4_bool_binop_done;
8349 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8351 __pyx_t_1 = __pyx_t_2;
8353 __pyx_L4_bool_binop_done:;
8364 __pyx_v_buffer = ((
char *)__pyx_v_self->view.buf);
8373 __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)
8374 __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)
8383 __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)
8384 __Pyx_GOTREF(__pyx_t_5);
8388 PyObject *__pyx_temp;
8390 __pyx_temp = __pyx_r;
8391 __pyx_r = __pyx_t_5;
8393 __Pyx_XDECREF(__pyx_temp);
8414 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8426 PyObject *__pyx_temp;
8428 __pyx_temp = __pyx_r;
8429 __Pyx_INCREF((PyObject *)__pyx_v_self);
8430 __pyx_r = ((PyObject *)__pyx_v_self);
8432 __Pyx_XDECREF(__pyx_temp);
8452 __pyx_t_5 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 439, __pyx_L1_error)
8453 __Pyx_GOTREF(__pyx_t_5);
8454 if (likely(__pyx_t_5 != Py_None)) {
8455 PyObject* sequence = __pyx_t_5;
8456 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8457 if (unlikely(size != 2)) {
8458 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8459 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8460 __PYX_ERR(1, 439, __pyx_L1_error)
8462 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8463 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
8464 __Pyx_INCREF(__pyx_t_6);
8465 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
8466 __Pyx_INCREF(__pyx_t_7);
8468 __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 439, __pyx_L1_error)
8469 __Pyx_GOTREF(__pyx_t_6);
8470 __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L1_error)
8471 __Pyx_GOTREF(__pyx_t_7);
8473 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8475 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 439, __pyx_L1_error)
8477 __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)
8478 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8479 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)
8480 __pyx_v_have_slices = __pyx_t_1;
8481 __pyx_v_indices = ((PyObject*)__pyx_t_7);
8491 if (__pyx_v_have_slices) {
8500 __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)
8501 __Pyx_GOTREF(__pyx_t_5);
8503 PyObject *__pyx_temp;
8505 __pyx_temp = __pyx_r;
8506 __pyx_r = __pyx_t_5;
8508 __Pyx_XDECREF(__pyx_temp);
8530 if (unlikely(__pyx_v_indices == Py_None)) {
8531 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
8532 __PYX_ERR(1, 445, __pyx_L1_error)
8534 __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)
8535 __pyx_v_itemp = __pyx_t_4;
8544 __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)
8545 __Pyx_GOTREF(__pyx_t_5);
8547 PyObject *__pyx_temp;
8549 __pyx_temp = __pyx_r;
8550 __pyx_r = __pyx_t_5;
8552 __Pyx_XDECREF(__pyx_temp);
8568 __Pyx_XDECREF(__pyx_t_5);
8569 __Pyx_XDECREF(__pyx_t_6);
8570 __Pyx_XDECREF(__pyx_t_7);
8571 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8576 __Pyx_XDECREF(__pyx_v_indices);
8578 __Pyx_XGIVEREF(__pyx_r);
8579 __Pyx_RefNannyFinishContext();
8592static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
8593static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8594 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
8596 __Pyx_RefNannyDeclarations
8597 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
8598 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8599 __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));
8602 __Pyx_RefNannyFinishContext();
8606static 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) {
8607 int __pyx_v_have_slices;
8608 PyObject *__pyx_v_indices = NULL;
8609 PyObject *__pyx_v_obj = NULL;
8610 struct __pyx_memoryview_obj *__pyx_v_target_slice = NULL;
8612 __Pyx_RefNannyDeclarations
8615 PyObject *__pyx_t_3 = NULL;
8616 PyObject *__pyx_t_4 = NULL;
8617 PyObject *__pyx_t_5 = NULL;
8618 int __pyx_lineno = 0;
8619 const char *__pyx_filename = NULL;
8620 int __pyx_clineno = 0;
8621 __Pyx_RefNannySetupContext(
"__setitem__", 0);
8630 if (unlikely(__pyx_v_self->view.readonly)) {
8639 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_read_only_memor, 0, 0);
8640 __PYX_ERR(1, 450, __pyx_L1_error)
8658 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8664 __pyx_t_1 = __pyx_t_2;
8666 goto __pyx_L5_bool_binop_done;
8668 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8670 __pyx_t_1 = __pyx_t_2;
8672 __pyx_L5_bool_binop_done:;
8683 __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)
8684 __Pyx_GOTREF(__pyx_t_3);
8685 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8715 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 456, __pyx_L1_error)
8716 __Pyx_GOTREF(__pyx_t_3);
8717 if (likely(__pyx_t_3 != Py_None)) {
8718 PyObject* sequence = __pyx_t_3;
8719 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8720 if (unlikely(size != 2)) {
8721 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8722 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8723 __PYX_ERR(1, 456, __pyx_L1_error)
8725 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8726 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
8727 __Pyx_INCREF(__pyx_t_4);
8728 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
8729 __Pyx_INCREF(__pyx_t_5);
8731 __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 456, __pyx_L1_error)
8732 __Pyx_GOTREF(__pyx_t_4);
8733 __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error)
8734 __Pyx_GOTREF(__pyx_t_5);
8736 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8738 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 456, __pyx_L1_error)
8740 __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)
8741 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8742 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)
8743 __pyx_v_have_slices = __pyx_t_1;
8744 __pyx_v_indices = ((PyObject*)__pyx_t_5);
8754 if (__pyx_v_have_slices) {
8763 __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)
8764 __Pyx_GOTREF(__pyx_t_3);
8765 __pyx_v_obj = __pyx_t_3;
8775 __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)
8776 __Pyx_GOTREF(__pyx_t_3);
8777 __pyx_v_target_slice = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
8787 __pyx_t_1 = (__pyx_v_obj != Py_None);
8798 __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)
8799 __Pyx_GOTREF(__pyx_t_3);
8800 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8820 __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)
8821 __Pyx_GOTREF(__pyx_t_3);
8822 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8844 if (unlikely(__pyx_v_indices == Py_None)) {
8845 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
8846 __PYX_ERR(1, 466, __pyx_L1_error)
8848 __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)
8849 __Pyx_GOTREF(__pyx_t_3);
8850 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8866 __Pyx_XDECREF(__pyx_t_3);
8867 __Pyx_XDECREF(__pyx_t_4);
8868 __Pyx_XDECREF(__pyx_t_5);
8869 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8873 __Pyx_XDECREF(__pyx_v_indices);
8874 __Pyx_XDECREF(__pyx_v_obj);
8875 __Pyx_XDECREF((PyObject *)__pyx_v_target_slice);
8877 __Pyx_RefNannyFinishContext();
8889static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
8890 PyObject *__pyx_r = NULL;
8891 __Pyx_RefNannyDeclarations
8894 PyObject *__pyx_t_3 = NULL;
8895 PyObject *__pyx_t_4 = NULL;
8896 PyObject *__pyx_t_5 = NULL;
8897 PyObject *__pyx_t_6 = NULL;
8898 PyObject *__pyx_t_7 = NULL;
8899 PyObject *__pyx_t_8 = NULL;
8900 PyObject *__pyx_t_9 = NULL;
8903 int __pyx_lineno = 0;
8904 const char *__pyx_filename = NULL;
8905 int __pyx_clineno = 0;
8906 __Pyx_RefNannySetupContext(
"is_slice", 0);
8907 __Pyx_INCREF(__pyx_v_obj);
8916 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_memoryview_type);
8917 __pyx_t_2 = (!__pyx_t_1);
8931 __Pyx_PyThreadState_declare
8932 __Pyx_PyThreadState_assign
8933 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8934 __Pyx_XGOTREF(__pyx_t_3);
8935 __Pyx_XGOTREF(__pyx_t_4);
8936 __Pyx_XGOTREF(__pyx_t_5);
8947 __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)
8948 __Pyx_GOTREF(__pyx_t_8);
8957 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 473, __pyx_L4_error)
8958 __Pyx_GOTREF(__pyx_t_9);
8961 PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_obj, __pyx_t_8, __pyx_t_9};
8962 __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));
8963 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8964 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8965 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8966 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 472, __pyx_L4_error)
8967 __Pyx_GOTREF((PyObject *)__pyx_t_6);
8969 __Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
8980 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8981 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8982 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8983 goto __pyx_L9_try_end;
8985 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8986 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8987 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8988 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8997 __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
8999 __Pyx_ErrRestore(0,0,0);
9009 PyObject *__pyx_temp;
9011 __pyx_temp = __pyx_r;
9012 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9014 __Pyx_XDECREF(__pyx_temp);
9016 goto __pyx_L7_except_return;
9018 goto __pyx_L6_except_error;
9027 __pyx_L6_except_error:;
9028 __Pyx_XGIVEREF(__pyx_t_3);
9029 __Pyx_XGIVEREF(__pyx_t_4);
9030 __Pyx_XGIVEREF(__pyx_t_5);
9031 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9032 goto __pyx_L1_error;
9033 __pyx_L7_except_return:;
9034 __Pyx_XGIVEREF(__pyx_t_3);
9035 __Pyx_XGIVEREF(__pyx_t_4);
9036 __Pyx_XGIVEREF(__pyx_t_5);
9037 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9059 PyObject *__pyx_temp;
9061 __pyx_temp = __pyx_r;
9062 __Pyx_INCREF(__pyx_v_obj);
9063 __pyx_r = __pyx_v_obj;
9065 __Pyx_XDECREF(__pyx_temp);
9079 __Pyx_XDECREF(__pyx_t_6);
9080 __Pyx_XDECREF(__pyx_t_7);
9081 __Pyx_XDECREF(__pyx_t_8);
9082 __Pyx_XDECREF(__pyx_t_9);
9083 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9086 __Pyx_XDECREF(__pyx_v_obj);
9087 __Pyx_XGIVEREF(__pyx_r);
9088 __Pyx_RefNannyFinishContext();
9100static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
9101 __Pyx_memviewslice __pyx_v_dst_slice;
9102 __Pyx_memviewslice __pyx_v_src_slice;
9103 __Pyx_memviewslice __pyx_v_msrc;
9104 __Pyx_memviewslice __pyx_v_mdst;
9105 PyObject *__pyx_r = NULL;
9106 __Pyx_RefNannyDeclarations
9107 __Pyx_memviewslice *__pyx_t_1;
9108 PyObject *__pyx_t_2 = NULL;
9112 int __pyx_lineno = 0;
9113 const char *__pyx_filename = NULL;
9114 int __pyx_clineno = 0;
9115 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
9124 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)
9125 __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)
9126 __pyx_v_msrc = (__pyx_t_1[0]);
9136 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)
9137 __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)
9138 __pyx_v_mdst = (__pyx_t_1[0]);
9148 __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)
9149 __Pyx_GOTREF(__pyx_t_2);
9150 __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)
9151 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9152 __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)
9153 __Pyx_GOTREF(__pyx_t_2);
9154 __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)
9155 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9156 __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)
9170 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9173 __Pyx_XDECREF(__pyx_t_2);
9174 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9181 __Pyx_XGIVEREF(__pyx_r);
9182 __Pyx_RefNannyFinishContext();
9194static 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) {
9195 int __pyx_v_array[128];
9198 __Pyx_memviewslice *__pyx_v_dst_slice;
9199 __Pyx_memviewslice __pyx_v_tmp_slice;
9200 PyObject *__pyx_r = NULL;
9201 __Pyx_RefNannyDeclarations
9202 __Pyx_memviewslice *__pyx_t_1;
9204 PyObject *__pyx_t_3 = NULL;
9207 char const *__pyx_t_6;
9208 PyObject *__pyx_t_7 = NULL;
9209 PyObject *__pyx_t_8 = NULL;
9210 PyObject *__pyx_t_9 = NULL;
9211 PyObject *__pyx_t_10 = NULL;
9212 PyObject *__pyx_t_11 = NULL;
9213 PyObject *__pyx_t_12 = NULL;
9214 int __pyx_lineno = 0;
9215 const char *__pyx_filename = NULL;
9216 int __pyx_clineno = 0;
9217 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
9235 __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)
9236 __pyx_v_dst_slice = __pyx_t_1;
9245 __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array)));
9257 __pyx_v_tmp = PyMem_Malloc(((
size_t)__pyx_v_self->view.itemsize));
9266 __pyx_t_2 = (__pyx_v_tmp == NULL);
9268 if (unlikely(__pyx_t_2)) {
9278 PyErr_NoMemory(); __PYX_ERR(1, 501, __pyx_L1_error)
9296 __pyx_v_item = __pyx_v_tmp;
9316 __pyx_v_item = ((
void *)__pyx_v_array);
9336 if (__pyx_v_self->dtype_is_object) {
9345 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9365 __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)
9366 __Pyx_GOTREF(__pyx_t_3);
9367 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9378 __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9390 __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)
9409 __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);
9421 PyMem_Free(__pyx_v_tmp);
9426 __Pyx_PyThreadState_declare
9427 __Pyx_PyThreadState_assign
9428 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9429 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9430 __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9431 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);
9432 __Pyx_XGOTREF(__pyx_t_7);
9433 __Pyx_XGOTREF(__pyx_t_8);
9434 __Pyx_XGOTREF(__pyx_t_9);
9435 __Pyx_XGOTREF(__pyx_t_10);
9436 __Pyx_XGOTREF(__pyx_t_11);
9437 __Pyx_XGOTREF(__pyx_t_12);
9438 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9440 PyMem_Free(__pyx_v_tmp);
9442 __Pyx_XGIVEREF(__pyx_t_10);
9443 __Pyx_XGIVEREF(__pyx_t_11);
9444 __Pyx_XGIVEREF(__pyx_t_12);
9445 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9446 __Pyx_XGIVEREF(__pyx_t_7);
9447 __Pyx_XGIVEREF(__pyx_t_8);
9448 __Pyx_XGIVEREF(__pyx_t_9);
9449 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9450 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9451 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9452 goto __pyx_L1_error;
9466 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9469 __Pyx_XDECREF(__pyx_t_3);
9470 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9478 __Pyx_XGIVEREF(__pyx_r);
9479 __Pyx_RefNannyFinishContext();
9491static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value) {
9492 char *__pyx_v_itemp;
9493 PyObject *__pyx_r = NULL;
9494 __Pyx_RefNannyDeclarations
9496 PyObject *__pyx_t_2 = NULL;
9497 int __pyx_lineno = 0;
9498 const char *__pyx_filename = NULL;
9499 int __pyx_clineno = 0;
9500 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
9509 __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)
9510 __pyx_v_itemp = __pyx_t_1;
9519 __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)
9520 __Pyx_GOTREF(__pyx_t_2);
9521 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9532 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9535 __Pyx_XDECREF(__pyx_t_2);
9536 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9540 __Pyx_XGIVEREF(__pyx_r);
9541 __Pyx_RefNannyFinishContext();
9553static PyObject *__pyx_memoryview_setitem_indexed1(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9554 char *__pyx_v_buffer;
9555 char *__pyx_v_itemp;
9556 PyObject *__pyx_r = NULL;
9557 __Pyx_RefNannyDeclarations
9558 Py_ssize_t __pyx_t_1;
9560 PyObject *__pyx_t_3 = NULL;
9561 int __pyx_lineno = 0;
9562 const char *__pyx_filename = NULL;
9563 int __pyx_clineno = 0;
9564 __Pyx_RefNannySetupContext(
"setitem_indexed1", 0);
9573 __pyx_v_buffer = ((
char *)__pyx_v_self->view.buf);
9582 __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)
9583 __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)
9584 __pyx_v_itemp = __pyx_t_2;
9594 __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)
9595 __Pyx_GOTREF(__pyx_t_3);
9596 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9607 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9610 __Pyx_XDECREF(__pyx_t_3);
9611 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed1", __pyx_clineno, __pyx_lineno, __pyx_filename);
9616 __Pyx_XGIVEREF(__pyx_r);
9617 __Pyx_RefNannyFinishContext();
9629static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
9630 PyObject *__pyx_v_struct = NULL;
9631 PyObject *__pyx_v_bytesitem = 0;
9632 PyObject *__pyx_v_result = NULL;
9633 PyObject *__pyx_r = NULL;
9634 __Pyx_RefNannyDeclarations
9635 PyObject *__pyx_t_1 = NULL;
9636 PyObject *__pyx_t_2 = NULL;
9637 PyObject *__pyx_t_3 = NULL;
9638 PyObject *__pyx_t_4 = NULL;
9639 PyObject *__pyx_t_5 = NULL;
9640 PyObject *__pyx_t_6 = NULL;
9642 Py_ssize_t __pyx_t_8;
9644 PyObject *__pyx_t_10 = NULL;
9646 int __pyx_lineno = 0;
9647 const char *__pyx_filename = NULL;
9648 int __pyx_clineno = 0;
9649 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
9658 __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)
9659 __pyx_t_1 = __pyx_t_2;
9660 __Pyx_GOTREF(__pyx_t_1);
9661 __pyx_v_struct = __pyx_t_1;
9671 __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)
9672 __Pyx_GOTREF(__pyx_t_1);
9673 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9684 __Pyx_PyThreadState_declare
9685 __Pyx_PyThreadState_assign
9686 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9687 __Pyx_XGOTREF(__pyx_t_2);
9688 __Pyx_XGOTREF(__pyx_t_3);
9689 __Pyx_XGOTREF(__pyx_t_4);
9699 __pyx_t_5 = __pyx_v_struct;
9700 __Pyx_INCREF(__pyx_t_5);
9701 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 540, __pyx_L3_error)
9702 __Pyx_GOTREF(__pyx_t_6);
9705 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_bytesitem};
9706 __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));
9707 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9708 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9709 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L3_error)
9710 __Pyx_GOTREF(__pyx_t_1);
9712 __pyx_v_result = __pyx_t_1;
9732 __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)
9733 __pyx_t_9 = (__pyx_t_8 == 1);
9746 __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)
9747 __Pyx_GOTREF(__pyx_t_1);
9749 PyObject *__pyx_temp;
9751 __pyx_temp = __pyx_r;
9752 __pyx_r = __pyx_t_1;
9754 __Pyx_XDECREF(__pyx_temp);
9757 goto __pyx_L6_except_return;
9776 PyObject *__pyx_temp;
9778 __pyx_temp = __pyx_r;
9779 __Pyx_INCREF(__pyx_v_result);
9780 __pyx_r = __pyx_v_result;
9782 __Pyx_XDECREF(__pyx_temp);
9784 goto __pyx_L6_except_return;
9787 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9788 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9789 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9798 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5);
9799 __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)
9800 __Pyx_GOTREF(__pyx_t_10);
9801 __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_10);
9802 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9803 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5);
9804 __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
9806 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9807 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(1, 541, __pyx_L5_except_error)
9808 __Pyx_XGOTREF(__pyx_t_5);
9809 __Pyx_XGOTREF(__pyx_t_6);
9810 __Pyx_XGOTREF(__pyx_t_1);
9819 __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)
9821 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9822 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9823 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9824 goto __pyx_L4_exception_handled;
9826 goto __pyx_L5_except_error;
9835 __pyx_L5_except_error:;
9836 __Pyx_XGIVEREF(__pyx_t_2);
9837 __Pyx_XGIVEREF(__pyx_t_3);
9838 __Pyx_XGIVEREF(__pyx_t_4);
9839 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9840 goto __pyx_L1_error;
9841 __pyx_L6_except_return:;
9842 __Pyx_XGIVEREF(__pyx_t_2);
9843 __Pyx_XGIVEREF(__pyx_t_3);
9844 __Pyx_XGIVEREF(__pyx_t_4);
9845 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9847 __pyx_L4_exception_handled:;
9848 __Pyx_XGIVEREF(__pyx_t_2);
9849 __Pyx_XGIVEREF(__pyx_t_3);
9850 __Pyx_XGIVEREF(__pyx_t_4);
9851 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9863 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9866 __Pyx_XDECREF(__pyx_t_1);
9867 __Pyx_XDECREF(__pyx_t_5);
9868 __Pyx_XDECREF(__pyx_t_6);
9869 __Pyx_XDECREF(__pyx_t_10);
9870 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9873 __Pyx_XDECREF(__pyx_v_struct);
9874 __Pyx_XDECREF(__pyx_v_bytesitem);
9875 __Pyx_XDECREF(__pyx_v_result);
9876 __Pyx_XGIVEREF(__pyx_r);
9877 __Pyx_RefNannyFinishContext();
9889static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
9890 PyObject *__pyx_v_struct = NULL;
9892 PyObject *__pyx_v_bytesvalue = 0;
9893 Py_ssize_t __pyx_v_i;
9894 PyObject *__pyx_r = NULL;
9895 __Pyx_RefNannyDeclarations
9896 PyObject *__pyx_t_1 = NULL;
9897 PyObject *__pyx_t_2 = NULL;
9899 PyObject *__pyx_t_4 = NULL;
9900 PyObject *__pyx_t_5 = NULL;
9901 PyObject *__pyx_t_6 = NULL;
9903 Py_ssize_t __pyx_t_8;
9904 PyObject *__pyx_t_9 = NULL;
9907 Py_ssize_t __pyx_t_12;
9910 int __pyx_lineno = 0;
9911 const char *__pyx_filename = NULL;
9912 int __pyx_clineno = 0;
9913 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
9922 __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)
9923 __pyx_t_1 = __pyx_t_2;
9924 __Pyx_GOTREF(__pyx_t_1);
9925 __pyx_v_struct = __pyx_t_1;
9935 __pyx_t_3 = PyTuple_Check(__pyx_v_value);
9946 __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)
9947 __Pyx_GOTREF(__pyx_t_1);
9948 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
9949 __Pyx_GOTREF(__pyx_t_4);
9950 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
9951 __Pyx_GOTREF(__pyx_t_5);
9952 __Pyx_GIVEREF(__pyx_t_4);
9953 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 557, __pyx_L1_error);
9955 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
9956 __Pyx_GOTREF(__pyx_t_4);
9957 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 557, __pyx_L1_error)
9958 __Pyx_GOTREF(__pyx_t_6);
9959 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9960 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9961 __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)
9962 __Pyx_GOTREF(__pyx_t_4);
9963 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9964 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9965 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)
9966 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
9987 __pyx_t_6 = __pyx_v_struct;
9988 __Pyx_INCREF(__pyx_t_6);
9989 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
9990 __Pyx_GOTREF(__pyx_t_1);
9993 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_value};
9994 __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));
9995 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9997 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 559, __pyx_L1_error)
9998 __Pyx_GOTREF(__pyx_t_4);
10000 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)
10001 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10015 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
10016 PyErr_SetString(PyExc_TypeError,
"\047NoneType\047 is not iterable");
10017 __PYX_ERR(1, 561, __pyx_L1_error)
10019 __Pyx_INCREF(__pyx_v_bytesvalue);
10020 __pyx_t_9 = __pyx_v_bytesvalue;
10021 __pyx_t_11 = __Pyx_PyBytes_AsWritableString(__pyx_t_9);
if (unlikely(__pyx_t_11 == ((
char *)NULL))) __PYX_ERR(1, 561, __pyx_L1_error)
10022 __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)
10023 __pyx_t_13 = (__pyx_t_11 + __pyx_t_12);
10025 for (__pyx_t_14 = __pyx_t_11; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
10026 __pyx_t_10 = __pyx_t_14;
10027 __pyx_v_c = (__pyx_t_10[0]);
10036 __pyx_v_i = __pyx_t_8;
10045 __pyx_t_8 = (__pyx_t_8 + 1);
10054 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10059 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10070 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10073 __Pyx_XDECREF(__pyx_t_1);
10074 __Pyx_XDECREF(__pyx_t_4);
10075 __Pyx_XDECREF(__pyx_t_5);
10076 __Pyx_XDECREF(__pyx_t_6);
10077 __Pyx_XDECREF(__pyx_t_9);
10078 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10081 __Pyx_XDECREF(__pyx_v_struct);
10083 __Pyx_XDECREF(__pyx_v_bytesvalue);
10085 __Pyx_XGIVEREF(__pyx_r);
10086 __Pyx_RefNannyFinishContext();
10099CYTHON_UNUSED
static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
10100CYTHON_UNUSED
static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
10101 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10103 __Pyx_RefNannyDeclarations
10104 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
10105 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10106 __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));
10111 __Pyx_RefNannyFinishContext();
10115static 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) {
10117 __Pyx_RefNannyDeclarations
10121 Py_ssize_t *__pyx_t_4;
10124 Py_ssize_t __pyx_t_7;
10125 int __pyx_lineno = 0;
10126 const char *__pyx_filename = NULL;
10127 int __pyx_clineno = 0;
10128 if (unlikely(__pyx_v_info == NULL)) {
10129 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
10132 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
10133 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10134 __Pyx_GIVEREF(__pyx_v_info->obj);
10143 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10149 __pyx_t_1 = __pyx_t_2;
10151 goto __pyx_L4_bool_binop_done;
10154 __pyx_t_1 = __pyx_v_self->view.readonly;
10155 __pyx_L4_bool_binop_done:;
10156 if (unlikely(__pyx_t_1)) {
10166 __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)
10185 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10197 __pyx_t_4 = __pyx_v_self->view.shape;
10199 __pyx_v_info->shape = __pyx_t_4;
10219 __pyx_v_info->shape = NULL;
10230 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10242 __pyx_t_4 = __pyx_v_self->view.strides;
10244 __pyx_v_info->strides = __pyx_t_4;
10264 __pyx_v_info->strides = NULL;
10275 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10287 __pyx_t_4 = __pyx_v_self->view.suboffsets;
10289 __pyx_v_info->suboffsets = __pyx_t_4;
10309 __pyx_v_info->suboffsets = NULL;
10320 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10332 __pyx_t_5 = __pyx_v_self->view.format;
10334 __pyx_v_info->format = __pyx_t_5;
10354 __pyx_v_info->format = NULL;
10365 __pyx_t_6 = __pyx_v_self->view.buf;
10367 __pyx_v_info->buf = __pyx_t_6;
10376 __pyx_t_3 = __pyx_v_self->view.ndim;
10378 __pyx_v_info->ndim = __pyx_t_3;
10387 __pyx_t_7 = __pyx_v_self->view.itemsize;
10389 __pyx_v_info->itemsize = __pyx_t_7;
10398 __pyx_t_7 = __pyx_v_self->view.len;
10400 __pyx_v_info->len = __pyx_t_7;
10409 __pyx_t_1 = __pyx_v_self->view.readonly;
10411 __pyx_v_info->readonly = __pyx_t_1;
10420 __Pyx_INCREF((PyObject *)__pyx_v_self);
10421 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10422 __Pyx_GOTREF(__pyx_v_info->obj);
10423 __Pyx_DECREF(__pyx_v_info->obj);
10424 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10438 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10440 if (__pyx_v_info->obj != NULL) {
10441 __Pyx_GOTREF(__pyx_v_info->obj);
10442 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10446 if (__pyx_v_info->obj == Py_None) {
10447 __Pyx_GOTREF(__pyx_v_info->obj);
10448 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10452 __Pyx_RefNannyFinishContext();
10465static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
10466static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10467 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10468 PyObject *__pyx_r = 0;
10469 __Pyx_RefNannyDeclarations
10470 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10471 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10472 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10475 __Pyx_RefNannyFinishContext();
10479static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10480 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10481 PyObject *__pyx_r = NULL;
10482 __Pyx_RefNannyDeclarations
10483 PyObject *__pyx_t_1 = NULL;
10485 int __pyx_lineno = 0;
10486 const char *__pyx_filename = NULL;
10487 int __pyx_clineno = 0;
10488 __Pyx_RefNannySetupContext(
"__get__", 0);
10497 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 599, __pyx_L1_error)
10498 __Pyx_GOTREF(__pyx_t_1);
10499 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)
10500 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10510 __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)
10521 PyObject *__pyx_temp;
10523 __pyx_temp = __pyx_r;
10524 __Pyx_INCREF((PyObject *)__pyx_v_result);
10525 __pyx_r = ((PyObject *)__pyx_v_result);
10527 __Pyx_XDECREF(__pyx_temp);
10541 __Pyx_XDECREF(__pyx_t_1);
10542 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10545 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10546 __Pyx_XGIVEREF(__pyx_r);
10547 __Pyx_RefNannyFinishContext();
10560static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
10561static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10562 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10563 PyObject *__pyx_r = 0;
10564 __Pyx_RefNannyDeclarations
10565 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10566 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10567 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10570 __Pyx_RefNannyFinishContext();
10574static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10575 PyObject *__pyx_r = NULL;
10576 __Pyx_RefNannyDeclarations
10577 PyObject *__pyx_t_1 = NULL;
10578 int __pyx_lineno = 0;
10579 const char *__pyx_filename = NULL;
10580 int __pyx_clineno = 0;
10581 __Pyx_RefNannySetupContext(
"__get__", 0);
10590 __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)
10591 __Pyx_GOTREF(__pyx_t_1);
10593 PyObject *__pyx_temp;
10595 __pyx_temp = __pyx_r;
10596 __pyx_r = __pyx_t_1;
10598 __Pyx_XDECREF(__pyx_temp);
10613 __Pyx_XDECREF(__pyx_t_1);
10614 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10617 __Pyx_XGIVEREF(__pyx_r);
10618 __Pyx_RefNannyFinishContext();
10630static PyObject *__pyx_memoryview__get_base(
struct __pyx_memoryview_obj *__pyx_v_self) {
10631 PyObject *__pyx_r = NULL;
10632 __Pyx_RefNannyDeclarations
10633 __Pyx_RefNannySetupContext(
"_get_base", 0);
10643 PyObject *__pyx_temp;
10645 __pyx_temp = __pyx_r;
10646 __Pyx_INCREF(__pyx_v_self->obj);
10647 __pyx_r = __pyx_v_self->obj;
10649 __Pyx_XDECREF(__pyx_temp);
10663 __Pyx_XGIVEREF(__pyx_r);
10664 __Pyx_RefNannyFinishContext();
10677static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
10678static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10679 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10680 PyObject *__pyx_r = 0;
10681 __Pyx_RefNannyDeclarations
10682 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10683 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10684 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10687 __Pyx_RefNannyFinishContext();
10691static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10692 Py_ssize_t __pyx_7genexpr__pyx_v_length;
10693 PyObject *__pyx_r = NULL;
10694 __Pyx_RefNannyDeclarations
10695 PyObject *__pyx_t_1 = NULL;
10696 Py_ssize_t *__pyx_t_2;
10697 Py_ssize_t *__pyx_t_3;
10698 Py_ssize_t *__pyx_t_4;
10699 PyObject *__pyx_t_5 = NULL;
10700 int __pyx_lineno = 0;
10701 const char *__pyx_filename = NULL;
10702 int __pyx_clineno = 0;
10703 __Pyx_RefNannySetupContext(
"__get__", 0);
10713 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
10714 __Pyx_GOTREF(__pyx_t_1);
10715 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10717 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10718 __pyx_t_2 = __pyx_t_4;
10719 __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
10720 __pyx_t_5 = PyLong_FromSsize_t(__pyx_7genexpr__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10721 __Pyx_GOTREF(__pyx_t_5);
10722 __Pyx_GIVEREF(__pyx_t_5);
10723 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, __pyx_t_5))) __PYX_ERR(1, 612, __pyx_L1_error)
10728 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10729 __Pyx_GOTREF(__pyx_t_5);
10730 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10732 PyObject *__pyx_temp;
10734 __pyx_temp = __pyx_r;
10735 __pyx_r = __pyx_t_5;
10737 __Pyx_XDECREF(__pyx_temp);
10752 __Pyx_XDECREF(__pyx_t_1);
10753 __Pyx_XDECREF(__pyx_t_5);
10754 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10758 __Pyx_XGIVEREF(__pyx_r);
10759 __Pyx_RefNannyFinishContext();
10772static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
10773static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10774 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10775 PyObject *__pyx_r = 0;
10776 __Pyx_RefNannyDeclarations
10777 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10778 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10779 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10782 __Pyx_RefNannyFinishContext();
10786static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10787 Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
10788 PyObject *__pyx_r = NULL;
10789 __Pyx_RefNannyDeclarations
10792 PyObject *__pyx_t_3 = NULL;
10793 Py_ssize_t *__pyx_t_4;
10794 Py_ssize_t *__pyx_t_5;
10795 Py_ssize_t *__pyx_t_6;
10796 PyObject *__pyx_t_7 = NULL;
10797 int __pyx_lineno = 0;
10798 const char *__pyx_filename = NULL;
10799 int __pyx_clineno = 0;
10800 __Pyx_RefNannySetupContext(
"__get__", 0);
10809 __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
10811 if (unlikely(__pyx_t_1)) {
10821 __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)
10841 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 620, __pyx_L1_error)
10842 __Pyx_GOTREF(__pyx_t_3);
10843 __pyx_t_5 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
10845 for (__pyx_t_6 = __pyx_v_self->view.strides; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
10846 __pyx_t_4 = __pyx_t_6;
10847 __pyx_8genexpr1__pyx_v_stride = (__pyx_t_4[0]);
10848 __pyx_t_7 = PyLong_FromSsize_t(__pyx_8genexpr1__pyx_v_stride);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10849 __Pyx_GOTREF(__pyx_t_7);
10850 __Pyx_GIVEREF(__pyx_t_7);
10851 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_3, __pyx_t_7))) __PYX_ERR(1, 620, __pyx_L1_error)
10856 __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10857 __Pyx_GOTREF(__pyx_t_7);
10858 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10860 PyObject *__pyx_temp;
10862 __pyx_temp = __pyx_r;
10863 __pyx_r = __pyx_t_7;
10865 __Pyx_XDECREF(__pyx_temp);
10880 __Pyx_XDECREF(__pyx_t_3);
10881 __Pyx_XDECREF(__pyx_t_7);
10882 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10886 __Pyx_XGIVEREF(__pyx_r);
10887 __Pyx_RefNannyFinishContext();
10900static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
10901static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
10902 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10903 PyObject *__pyx_r = 0;
10904 __Pyx_RefNannyDeclarations
10905 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10906 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10907 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10910 __Pyx_RefNannyFinishContext();
10914static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10915 Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
10916 PyObject *__pyx_r = NULL;
10917 __Pyx_RefNannyDeclarations
10919 PyObject *__pyx_t_2 = NULL;
10920 Py_ssize_t *__pyx_t_3;
10921 Py_ssize_t *__pyx_t_4;
10922 Py_ssize_t *__pyx_t_5;
10923 PyObject *__pyx_t_6 = NULL;
10924 int __pyx_lineno = 0;
10925 const char *__pyx_filename = NULL;
10926 int __pyx_clineno = 0;
10927 __Pyx_RefNannySetupContext(
"__get__", 0);
10936 __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
10948 __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)
10949 __Pyx_GOTREF(__pyx_t_2);
10951 PyObject *__pyx_temp;
10953 __pyx_temp = __pyx_r;
10954 __pyx_r = __pyx_t_2;
10956 __Pyx_XDECREF(__pyx_temp);
10978 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error)
10979 __Pyx_GOTREF(__pyx_t_2);
10980 __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
10982 for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10983 __pyx_t_3 = __pyx_t_5;
10984 __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
10985 __pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
10986 __Pyx_GOTREF(__pyx_t_6);
10987 __Pyx_GIVEREF(__pyx_t_6);
10988 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_2, __pyx_t_6))) __PYX_ERR(1, 627, __pyx_L1_error)
10993 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
10994 __Pyx_GOTREF(__pyx_t_6);
10995 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10997 PyObject *__pyx_temp;
10999 __pyx_temp = __pyx_r;
11000 __pyx_r = __pyx_t_6;
11002 __Pyx_XDECREF(__pyx_temp);
11017 __Pyx_XDECREF(__pyx_t_2);
11018 __Pyx_XDECREF(__pyx_t_6);
11019 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11023 __Pyx_XGIVEREF(__pyx_r);
11024 __Pyx_RefNannyFinishContext();
11037static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
11038static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11039 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11040 PyObject *__pyx_r = 0;
11041 __Pyx_RefNannyDeclarations
11042 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11043 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11044 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11047 __Pyx_RefNannyFinishContext();
11051static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11052 PyObject *__pyx_r = NULL;
11053 __Pyx_RefNannyDeclarations
11054 PyObject *__pyx_t_1 = NULL;
11055 int __pyx_lineno = 0;
11056 const char *__pyx_filename = NULL;
11057 int __pyx_clineno = 0;
11058 __Pyx_RefNannySetupContext(
"__get__", 0);
11067 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 631, __pyx_L1_error)
11068 __Pyx_GOTREF(__pyx_t_1);
11070 PyObject *__pyx_temp;
11072 __pyx_temp = __pyx_r;
11073 __pyx_r = __pyx_t_1;
11075 __Pyx_XDECREF(__pyx_temp);
11090 __Pyx_XDECREF(__pyx_t_1);
11091 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11094 __Pyx_XGIVEREF(__pyx_r);
11095 __Pyx_RefNannyFinishContext();
11108static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
11109static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
11110 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11111 PyObject *__pyx_r = 0;
11112 __Pyx_RefNannyDeclarations
11113 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11114 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11115 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11118 __Pyx_RefNannyFinishContext();
11122static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11123 PyObject *__pyx_r = NULL;
11124 __Pyx_RefNannyDeclarations
11125 PyObject *__pyx_t_1 = NULL;
11126 int __pyx_lineno = 0;
11127 const char *__pyx_filename = NULL;
11128 int __pyx_clineno = 0;
11129 __Pyx_RefNannySetupContext(
"__get__", 0);
11138 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 635, __pyx_L1_error)
11139 __Pyx_GOTREF(__pyx_t_1);
11141 PyObject *__pyx_temp;
11143 __pyx_temp = __pyx_r;
11144 __pyx_r = __pyx_t_1;
11146 __Pyx_XDECREF(__pyx_temp);
11161 __Pyx_XDECREF(__pyx_t_1);
11162 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11165 __Pyx_XGIVEREF(__pyx_r);
11166 __Pyx_RefNannyFinishContext();
11179static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
11180static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
11181 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11182 PyObject *__pyx_r = 0;
11183 __Pyx_RefNannyDeclarations
11184 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11185 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11186 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11189 __Pyx_RefNannyFinishContext();
11193static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11194 PyObject *__pyx_r = NULL;
11195 __Pyx_RefNannyDeclarations
11196 PyObject *__pyx_t_1 = NULL;
11197 PyObject *__pyx_t_2 = NULL;
11198 PyObject *__pyx_t_3 = NULL;
11199 int __pyx_lineno = 0;
11200 const char *__pyx_filename = NULL;
11201 int __pyx_clineno = 0;
11202 __Pyx_RefNannySetupContext(
"__get__", 0);
11211 __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)
11212 __Pyx_GOTREF(__pyx_t_1);
11213 __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
11214 __Pyx_GOTREF(__pyx_t_2);
11215 __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)
11216 __Pyx_GOTREF(__pyx_t_3);
11217 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11218 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11220 PyObject *__pyx_temp;
11222 __pyx_temp = __pyx_r;
11223 __pyx_r = __pyx_t_3;
11225 __Pyx_XDECREF(__pyx_temp);
11240 __Pyx_XDECREF(__pyx_t_1);
11241 __Pyx_XDECREF(__pyx_t_2);
11242 __Pyx_XDECREF(__pyx_t_3);
11243 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11246 __Pyx_XGIVEREF(__pyx_r);
11247 __Pyx_RefNannyFinishContext();
11260static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
11261static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11262 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11263 PyObject *__pyx_r = 0;
11264 __Pyx_RefNannyDeclarations
11265 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11266 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11267 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11270 __Pyx_RefNannyFinishContext();
11274static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11275 size_t __pyx_v_result;
11276 Py_ssize_t __pyx_v_length;
11277 PyObject *__pyx_r = NULL;
11278 __Pyx_RefNannyDeclarations
11280 Py_ssize_t *__pyx_t_2;
11281 Py_ssize_t *__pyx_t_3;
11282 Py_ssize_t *__pyx_t_4;
11283 PyObject *__pyx_t_5 = NULL;
11284 int __pyx_lineno = 0;
11285 const char *__pyx_filename = NULL;
11286 int __pyx_clineno = 0;
11287 __Pyx_RefNannySetupContext(
"__get__", 0);
11296 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11307 __pyx_v_result = 1;
11316 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11318 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11319 __pyx_t_2 = __pyx_t_4;
11320 __pyx_v_length = (__pyx_t_2[0]);
11329 __pyx_v_result = (__pyx_v_result * ((size_t)__pyx_v_length));
11340 __pyx_t_5 = __Pyx_PyLong_FromSize_t(__pyx_v_result);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 650, __pyx_L1_error)
11341 __Pyx_GOTREF(__pyx_t_5);
11342 __Pyx_GIVEREF(__pyx_t_5);
11343 __Pyx_GOTREF(__pyx_v_self->_size);
11344 __Pyx_DECREF(__pyx_v_self->_size);
11345 __pyx_v_self->_size = __pyx_t_5;
11365 PyObject *__pyx_temp;
11367 __pyx_temp = __pyx_r;
11368 __Pyx_INCREF(__pyx_v_self->_size);
11369 __pyx_r = __pyx_v_self->_size;
11371 __Pyx_XDECREF(__pyx_temp);
11385 __Pyx_XDECREF(__pyx_t_5);
11386 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11391 __Pyx_XGIVEREF(__pyx_r);
11392 __Pyx_RefNannyFinishContext();
11405static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
11406static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11407 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11408 Py_ssize_t __pyx_r;
11409 __Pyx_RefNannyDeclarations
11410 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
11411 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11412 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11415 __Pyx_RefNannyFinishContext();
11419static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11420 Py_ssize_t __pyx_r;
11430 __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11444 __pyx_r = (__pyx_v_self->view.shape[0]);
11493static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
11494static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11495 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11496 PyObject *__pyx_r = 0;
11497 __Pyx_RefNannyDeclarations
11498 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
11499 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11500 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11503 __Pyx_RefNannyFinishContext();
11507static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11508 PyObject *__pyx_r = NULL;
11509 __Pyx_RefNannyDeclarations
11510 PyObject *__pyx_t_1 = NULL;
11511 PyObject *__pyx_t_2 = NULL;
11512 PyObject *__pyx_t_3 = NULL;
11513 PyObject *__pyx_t_4[5];
11514 Py_ssize_t __pyx_t_5;
11516 int __pyx_lineno = 0;
11517 const char *__pyx_filename = NULL;
11518 int __pyx_clineno = 0;
11519 __Pyx_RefNannySetupContext(
"__repr__", 0);
11528 __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)
11529 __Pyx_GOTREF(__pyx_t_1);
11530 __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)
11531 __Pyx_GOTREF(__pyx_t_2);
11532 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11533 __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)
11534 __Pyx_GOTREF(__pyx_t_1);
11535 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11536 __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)
11537 __Pyx_GOTREF(__pyx_t_2);
11538 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11547 __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)
11548 __Pyx_GOTREF(__pyx_t_1);
11549 __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)
11550 __Pyx_GOTREF(__pyx_t_3);
11551 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11552 __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11553 __pyx_t_4[1] = __pyx_t_2;
11554 __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
11555 __pyx_t_4[3] = __pyx_t_3;
11556 __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__4;
11566 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11567 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[3]);
11570 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11571 __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[3]);
11573 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6);
11574 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11575 __Pyx_GOTREF(__pyx_t_1);
11576 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11577 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11579 PyObject *__pyx_temp;
11581 __pyx_temp = __pyx_r;
11582 __pyx_r = __pyx_t_1;
11584 __Pyx_XDECREF(__pyx_temp);
11599 __Pyx_XDECREF(__pyx_t_1);
11600 __Pyx_XDECREF(__pyx_t_2);
11601 __Pyx_XDECREF(__pyx_t_3);
11602 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11605 __Pyx_XGIVEREF(__pyx_r);
11606 __Pyx_RefNannyFinishContext();
11619static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
11620static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11621 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11622 PyObject *__pyx_r = 0;
11623 __Pyx_RefNannyDeclarations
11624 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
11625 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11626 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11629 __Pyx_RefNannyFinishContext();
11633static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11634 PyObject *__pyx_r = NULL;
11635 __Pyx_RefNannyDeclarations
11636 PyObject *__pyx_t_1 = NULL;
11637 PyObject *__pyx_t_2 = NULL;
11638 PyObject *__pyx_t_3[3];
11639 Py_ssize_t __pyx_t_4;
11641 int __pyx_lineno = 0;
11642 const char *__pyx_filename = NULL;
11643 int __pyx_clineno = 0;
11644 __Pyx_RefNannySetupContext(
"__str__", 0);
11653 __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)
11654 __Pyx_GOTREF(__pyx_t_1);
11655 __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)
11656 __Pyx_GOTREF(__pyx_t_2);
11657 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11658 __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)
11659 __Pyx_GOTREF(__pyx_t_1);
11660 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11661 __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)
11662 __Pyx_GOTREF(__pyx_t_2);
11663 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11664 __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11665 __pyx_t_3[1] = __pyx_t_2;
11666 __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object_2;
11668 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11669 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]);
11672 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11673 __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]);
11675 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5);
11676 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11677 __Pyx_GOTREF(__pyx_t_1);
11678 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11680 PyObject *__pyx_temp;
11682 __pyx_temp = __pyx_r;
11683 __pyx_r = __pyx_t_1;
11685 __Pyx_XDECREF(__pyx_temp);
11700 __Pyx_XDECREF(__pyx_t_1);
11701 __Pyx_XDECREF(__pyx_t_2);
11702 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11705 __Pyx_XGIVEREF(__pyx_r);
11706 __Pyx_RefNannyFinishContext();
11719static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11720#
if CYTHON_VECTORCALL
11721PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11723PyObject *__pyx_args, PyObject *__pyx_kwds
11726static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11727#
if CYTHON_VECTORCALL
11728PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11730PyObject *__pyx_args, PyObject *__pyx_kwds
11733 #if !CYTHON_VECTORCALL
11734 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11736 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11737 PyObject *__pyx_r = 0;
11738 __Pyx_RefNannyDeclarations
11739 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
11740 #if !CYTHON_VECTORCALL
11741 #if CYTHON_ASSUME_SAFE_SIZE
11742 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11744 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
11747 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11748 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"is_c_contig", 1, 0, 0, __pyx_nargs);
return NULL; }
11749 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11750 if (unlikely(__pyx_kwds_len < 0))
return NULL;
11751 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"is_c_contig", __pyx_kwds);
return NULL;}
11752 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11755 __Pyx_RefNannyFinishContext();
11759static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
11760 __Pyx_memviewslice *__pyx_v_mslice;
11761 __Pyx_memviewslice __pyx_v_tmp;
11762 PyObject *__pyx_r = NULL;
11763 __Pyx_RefNannyDeclarations
11764 __Pyx_memviewslice *__pyx_t_1;
11765 PyObject *__pyx_t_2 = NULL;
11766 int __pyx_lineno = 0;
11767 const char *__pyx_filename = NULL;
11768 int __pyx_clineno = 0;
11769 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
11778 __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)
11779 __pyx_v_mslice = __pyx_t_1;
11788 __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)
11789 __Pyx_GOTREF(__pyx_t_2);
11791 PyObject *__pyx_temp;
11793 __pyx_temp = __pyx_r;
11794 __pyx_r = __pyx_t_2;
11796 __Pyx_XDECREF(__pyx_temp);
11811 __Pyx_XDECREF(__pyx_t_2);
11812 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11817 __Pyx_XGIVEREF(__pyx_r);
11818 __Pyx_RefNannyFinishContext();
11831static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11832#
if CYTHON_VECTORCALL
11833PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11835PyObject *__pyx_args, PyObject *__pyx_kwds
11838static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11839#
if CYTHON_VECTORCALL
11840PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11842PyObject *__pyx_args, PyObject *__pyx_kwds
11845 #if !CYTHON_VECTORCALL
11846 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11848 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11849 PyObject *__pyx_r = 0;
11850 __Pyx_RefNannyDeclarations
11851 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
11852 #if !CYTHON_VECTORCALL
11853 #if CYTHON_ASSUME_SAFE_SIZE
11854 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11856 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
11859 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11860 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"is_f_contig", 1, 0, 0, __pyx_nargs);
return NULL; }
11861 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11862 if (unlikely(__pyx_kwds_len < 0))
return NULL;
11863 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"is_f_contig", __pyx_kwds);
return NULL;}
11864 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11867 __Pyx_RefNannyFinishContext();
11871static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
11872 __Pyx_memviewslice *__pyx_v_mslice;
11873 __Pyx_memviewslice __pyx_v_tmp;
11874 PyObject *__pyx_r = NULL;
11875 __Pyx_RefNannyDeclarations
11876 __Pyx_memviewslice *__pyx_t_1;
11877 PyObject *__pyx_t_2 = NULL;
11878 int __pyx_lineno = 0;
11879 const char *__pyx_filename = NULL;
11880 int __pyx_clineno = 0;
11881 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
11890 __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)
11891 __pyx_v_mslice = __pyx_t_1;
11900 __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)
11901 __Pyx_GOTREF(__pyx_t_2);
11903 PyObject *__pyx_temp;
11905 __pyx_temp = __pyx_r;
11906 __pyx_r = __pyx_t_2;
11908 __Pyx_XDECREF(__pyx_temp);
11923 __Pyx_XDECREF(__pyx_t_2);
11924 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11929 __Pyx_XGIVEREF(__pyx_r);
11930 __Pyx_RefNannyFinishContext();
11943static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11944#
if CYTHON_VECTORCALL
11945PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11947PyObject *__pyx_args, PyObject *__pyx_kwds
11950static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11951#
if CYTHON_VECTORCALL
11952PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11954PyObject *__pyx_args, PyObject *__pyx_kwds
11957 #if !CYTHON_VECTORCALL
11958 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11960 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11961 PyObject *__pyx_r = 0;
11962 __Pyx_RefNannyDeclarations
11963 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
11964 #if !CYTHON_VECTORCALL
11965 #if CYTHON_ASSUME_SAFE_SIZE
11966 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11968 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
11971 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11972 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"copy", 1, 0, 0, __pyx_nargs);
return NULL; }
11973 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11974 if (unlikely(__pyx_kwds_len < 0))
return NULL;
11975 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"copy", __pyx_kwds);
return NULL;}
11976 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11979 __Pyx_RefNannyFinishContext();
11983static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
11984 __Pyx_memviewslice __pyx_v_mslice;
11986 PyObject *__pyx_r = NULL;
11987 __Pyx_RefNannyDeclarations
11988 __Pyx_memviewslice __pyx_t_1;
11989 PyObject *__pyx_t_2 = NULL;
11990 int __pyx_lineno = 0;
11991 const char *__pyx_filename = NULL;
11992 int __pyx_clineno = 0;
11993 __Pyx_RefNannySetupContext(
"copy", 0);
12002 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12011 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12020 __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)
12021 __pyx_v_mslice = __pyx_t_1;
12030 __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)
12031 __Pyx_GOTREF(__pyx_t_2);
12033 PyObject *__pyx_temp;
12035 __pyx_temp = __pyx_r;
12036 __pyx_r = __pyx_t_2;
12038 __Pyx_XDECREF(__pyx_temp);
12053 __Pyx_XDECREF(__pyx_t_2);
12054 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12059 __Pyx_XGIVEREF(__pyx_r);
12060 __Pyx_RefNannyFinishContext();
12073static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12074#
if CYTHON_VECTORCALL
12075PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12077PyObject *__pyx_args, PyObject *__pyx_kwds
12080static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12081#
if CYTHON_VECTORCALL
12082PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12084PyObject *__pyx_args, PyObject *__pyx_kwds
12087 #if !CYTHON_VECTORCALL
12088 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12090 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
12091 PyObject *__pyx_r = 0;
12092 __Pyx_RefNannyDeclarations
12093 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
12094 #if !CYTHON_VECTORCALL
12095 #if CYTHON_ASSUME_SAFE_SIZE
12096 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12098 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
12101 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12102 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"copy_fortran", 1, 0, 0, __pyx_nargs);
return NULL; }
12103 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12104 if (unlikely(__pyx_kwds_len < 0))
return NULL;
12105 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"copy_fortran", __pyx_kwds);
return NULL;}
12106 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12109 __Pyx_RefNannyFinishContext();
12113static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
12114 __Pyx_memviewslice __pyx_v_src;
12115 __Pyx_memviewslice __pyx_v_dst;
12117 PyObject *__pyx_r = NULL;
12118 __Pyx_RefNannyDeclarations
12119 __Pyx_memviewslice __pyx_t_1;
12120 PyObject *__pyx_t_2 = NULL;
12121 int __pyx_lineno = 0;
12122 const char *__pyx_filename = NULL;
12123 int __pyx_clineno = 0;
12124 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
12133 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12142 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12151 __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)
12152 __pyx_v_dst = __pyx_t_1;
12161 __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)
12162 __Pyx_GOTREF(__pyx_t_2);
12164 PyObject *__pyx_temp;
12166 __pyx_temp = __pyx_r;
12167 __pyx_r = __pyx_t_2;
12169 __Pyx_XDECREF(__pyx_temp);
12184 __Pyx_XDECREF(__pyx_t_2);
12185 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12191 __Pyx_XGIVEREF(__pyx_r);
12192 __Pyx_RefNannyFinishContext();
12203static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12204#
if CYTHON_VECTORCALL
12205PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12207PyObject *__pyx_args, PyObject *__pyx_kwds
12210static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12211#
if CYTHON_VECTORCALL
12212PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12214PyObject *__pyx_args, PyObject *__pyx_kwds
12217 #if !CYTHON_VECTORCALL
12218 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12220 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
12221 PyObject *__pyx_r = 0;
12222 __Pyx_RefNannyDeclarations
12223 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
12224 #if !CYTHON_VECTORCALL
12225 #if CYTHON_ASSUME_SAFE_SIZE
12226 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12228 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
12231 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12232 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
12233 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12234 if (unlikely(__pyx_kwds_len < 0))
return NULL;
12235 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
12236 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12239 __Pyx_RefNannyFinishContext();
12243static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
12244 PyObject *__pyx_r = NULL;
12245 __Pyx_RefNannyDeclarations
12246 int __pyx_lineno = 0;
12247 const char *__pyx_filename = NULL;
12248 int __pyx_clineno = 0;
12249 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
12257 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12258 __PYX_ERR(1, 2, __pyx_L1_error)
12268 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12270 __Pyx_XGIVEREF(__pyx_r);
12271 __Pyx_RefNannyFinishContext();
12283static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12284#
if CYTHON_VECTORCALL
12285PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12287PyObject *__pyx_args, PyObject *__pyx_kwds
12290static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12291#
if CYTHON_VECTORCALL
12292PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12294PyObject *__pyx_args, PyObject *__pyx_kwds
12297 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
12298 #if !CYTHON_VECTORCALL
12299 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12301 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
12302 PyObject* values[1] = {0};
12303 int __pyx_lineno = 0;
12304 const char *__pyx_filename = NULL;
12305 int __pyx_clineno = 0;
12306 PyObject *__pyx_r = 0;
12307 __Pyx_RefNannyDeclarations
12308 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
12309 #if !CYTHON_VECTORCALL
12310 #if CYTHON_ASSUME_SAFE_SIZE
12311 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12313 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
12316 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12318 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
12319 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12320 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
12321 if (__pyx_kwds_len > 0) {
12322 switch (__pyx_nargs) {
12324 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12325 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12326 CYTHON_FALLTHROUGH;
12328 default:
goto __pyx_L5_argtuple_error;
12330 const Py_ssize_t kwd_pos_args = __pyx_nargs;
12331 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)
12332 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
12333 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
12335 }
else if (unlikely(__pyx_nargs != 1)) {
12336 goto __pyx_L5_argtuple_error;
12338 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12339 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12341 __pyx_v___pyx_state = values[0];
12343 goto __pyx_L6_skip;
12344 __pyx_L5_argtuple_error:;
12345 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
12347 goto __pyx_L4_argument_unpacking_done;
12349 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
12350 Py_XDECREF(values[__pyx_temp]);
12352 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12353 __Pyx_RefNannyFinishContext();
12355 __pyx_L4_argument_unpacking_done:;
12356 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
12359 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
12360 Py_XDECREF(values[__pyx_temp]);
12362 __Pyx_RefNannyFinishContext();
12366static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12367 PyObject *__pyx_r = NULL;
12368 __Pyx_RefNannyDeclarations
12369 int __pyx_lineno = 0;
12370 const char *__pyx_filename = NULL;
12371 int __pyx_clineno = 0;
12372 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
12379 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12380 __PYX_ERR(1, 4, __pyx_L1_error)
12391 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12393 __Pyx_XGIVEREF(__pyx_r);
12394 __Pyx_RefNannyFinishContext();
12406static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo
const *__pyx_v_typeinfo) {
12407 struct __pyx_memoryview_obj *__pyx_v_result = 0;
12408 PyObject *__pyx_r = NULL;
12409 __Pyx_RefNannyDeclarations
12410 PyObject *__pyx_t_1 = NULL;
12411 PyObject *__pyx_t_2 = NULL;
12412 PyObject *__pyx_t_3 = NULL;
12413 PyObject *__pyx_t_4 = NULL;
12415 int __pyx_lineno = 0;
12416 const char *__pyx_filename = NULL;
12417 int __pyx_clineno = 0;
12418 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
12428 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 707, __pyx_L1_error)
12429 __Pyx_GOTREF(__pyx_t_3);
12430 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 707, __pyx_L1_error)
12431 __Pyx_GOTREF(__pyx_t_4);
12434 PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_o, __pyx_t_3, __pyx_t_4};
12435 __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));
12436 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12437 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12438 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12439 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 707, __pyx_L1_error)
12440 __Pyx_GOTREF((PyObject *)__pyx_t_1);
12442 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_1);
12452 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12462 PyObject *__pyx_temp;
12464 __pyx_temp = __pyx_r;
12465 __Pyx_INCREF((PyObject *)__pyx_v_result);
12466 __pyx_r = ((PyObject *)__pyx_v_result);
12468 __Pyx_XDECREF(__pyx_temp);
12482 __Pyx_XDECREF(__pyx_t_1);
12483 __Pyx_XDECREF(__pyx_t_2);
12484 __Pyx_XDECREF(__pyx_t_3);
12485 __Pyx_XDECREF(__pyx_t_4);
12486 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12489 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12490 __Pyx_XGIVEREF(__pyx_r);
12491 __Pyx_RefNannyFinishContext();
12503static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12514 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type);
12516 __pyx_r = __pyx_t_1;
12542static int __pyx_memoryview_err_invalid_index(PyObject *__pyx_v_item) {
12543 PyObject *__pyx_v_type_name = NULL;
12545 __Pyx_RefNannyDeclarations
12546 PyObject *__pyx_t_1 = NULL;
12547 int __pyx_lineno = 0;
12548 const char *__pyx_filename = NULL;
12549 int __pyx_clineno = 0;
12550 __Pyx_RefNannySetupContext(
"_err_invalid_index", 0);
12559 __pyx_t_1 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
12560 __Pyx_GOTREF(__pyx_t_1);
12561 __pyx_v_type_name = ((PyObject*)__pyx_t_1);
12571 (void)(PyErr_Format(PyExc_TypeError, __pyx_k_Cannot_index_with_type_200U, ((PyObject *)__pyx_v_type_name)));
12596 __Pyx_XDECREF(__pyx_t_1);
12597 __Pyx_AddTraceback(
"View.MemoryView._err_invalid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
12600 __Pyx_XDECREF(__pyx_v_type_name);
12602 __Pyx_RefNannyFinishContext();
12614static PyObject *_unellipsify_index_tuple(PyObject *__pyx_v_index_tuple,
int __pyx_v_ndim) {
12615 Py_ssize_t __pyx_v_first_ellipsis_index;
12616 Py_ssize_t __pyx_v_idx;
12617 Py_ssize_t __pyx_v_ellipsis_end;
12618 Py_ssize_t __pyx_v_indices_from_ellipsis;
12619 int __pyx_v_have_slices;
12620 PyObject *__pyx_v_item = NULL;
12621 PyObject *__pyx_v_result = NULL;
12622 PyObject *__pyx_r = NULL;
12623 __Pyx_RefNannyDeclarations
12624 PyObject *__pyx_t_1 = NULL;
12625 Py_ssize_t __pyx_t_2;
12626 PyObject *__pyx_t_3 = NULL;
12629 Py_ssize_t __pyx_t_6;
12630 Py_ssize_t __pyx_t_7;
12631 Py_ssize_t __pyx_t_8;
12632 int __pyx_lineno = 0;
12633 const char *__pyx_filename = NULL;
12634 int __pyx_clineno = 0;
12635 __Pyx_RefNannySetupContext(
"_unellipsify_index_tuple", 0);
12636 __Pyx_INCREF(__pyx_v_index_tuple);
12645 __pyx_v_first_ellipsis_index = -1L;
12654 __pyx_v_have_slices = 0;
12672 __pyx_t_1 = __pyx_v_index_tuple; __Pyx_INCREF(__pyx_t_1);
12676 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
12677 #if !CYTHON_ASSUME_SAFE_SIZE
12678 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 733, __pyx_L1_error)
12680 if (__pyx_t_2 >= __pyx_temp)
break;
12682 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12683 __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
12685 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
12688 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 733, __pyx_L1_error)
12689 __Pyx_GOTREF(__pyx_t_3);
12690 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
12700 __pyx_t_4 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12711 __pyx_v_have_slices = 1;
12720 __pyx_t_4 = (__pyx_v_first_ellipsis_index == -1L);
12732 __pyx_v_first_ellipsis_index = __pyx_v_idx;
12760 __pyx_t_4 = PySlice_Check(__pyx_v_item);
12771 __pyx_v_have_slices = 1;
12790 __pyx_t_4 = (!(PyIndex_Check(__pyx_v_item) != 0));
12792 if (unlikely(__pyx_t_4)) {
12802 __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)
12822 __pyx_v_idx = (__pyx_v_idx + 1);
12832 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12841 __pyx_t_4 = (__pyx_v_first_ellipsis_index >= 0);
12853 __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)
12854 __Pyx_GOTREF(__pyx_t_1);
12855 { Py_ssize_t __pyx_temp;
12856 for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
12857 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
12858 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
12859 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 745, __pyx_L1_error);
12862 __pyx_v_result = ((PyObject*)__pyx_t_1);
12873 __pyx_t_2 = __pyx_v_first_ellipsis_index;
12874 __pyx_t_6 = __pyx_t_2;
12876 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12877 __pyx_v_idx = __pyx_t_7;
12886 __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)
12887 __Pyx_GOTREF(__pyx_t_1);
12888 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)
12889 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12900 __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)
12901 __pyx_v_indices_from_ellipsis = (__pyx_t_2 - __pyx_v_first_ellipsis_index);
12911 __pyx_v_ellipsis_end = (__pyx_v_ndim - __pyx_v_indices_from_ellipsis);
12921 __pyx_t_2 = __pyx_v_indices_from_ellipsis;
12922 __pyx_t_6 = __pyx_t_2;
12924 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12925 __pyx_v_idx = __pyx_t_7;
12934 __pyx_t_8 = (__pyx_v_first_ellipsis_index + __pyx_v_idx);
12936 __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)
12937 __Pyx_GOTREF(__pyx_t_1);
12939 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
12949 __pyx_t_4 = (__pyx_v_item != __pyx_builtin_Ellipsis);
12960 __pyx_t_8 = (__pyx_v_ellipsis_end + __pyx_v_idx);
12962 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)
12983 __pyx_t_1 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 758, __pyx_L1_error)
12984 __Pyx_GOTREF(__pyx_t_1);
12985 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_1));
13005 __pyx_t_4 = (__pyx_v_ndim > __pyx_v_idx);
13017 __pyx_v_have_slices = 1;
13026 __pyx_t_2 = (__pyx_v_ndim - __pyx_v_idx);
13028 __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)
13029 __Pyx_GOTREF(__pyx_t_1);
13031 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_index_tuple, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error)
13032 __Pyx_GOTREF(__pyx_t_3);
13033 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13034 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_3));
13054 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 765, __pyx_L1_error)
13055 __Pyx_GOTREF(__pyx_t_3);
13056 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 765, __pyx_L1_error)
13057 __Pyx_GOTREF(__pyx_t_1);
13058 __Pyx_GIVEREF(__pyx_t_3);
13059 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
13060 __Pyx_INCREF(__pyx_v_index_tuple);
13061 __Pyx_GIVEREF(__pyx_v_index_tuple);
13062 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_index_tuple) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
13065 PyObject *__pyx_temp;
13067 __pyx_temp = __pyx_r;
13068 __pyx_r = ((PyObject*)__pyx_t_1);
13070 __Pyx_XDECREF(__pyx_temp);
13085 __Pyx_XDECREF(__pyx_t_1);
13086 __Pyx_XDECREF(__pyx_t_3);
13087 __Pyx_AddTraceback(
"View.MemoryView._unellipsify_index_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
13095 __Pyx_XDECREF(__pyx_v_item);
13096 __Pyx_XDECREF(__pyx_v_result);
13097 __Pyx_XDECREF(__pyx_v_index_tuple);
13098 __Pyx_XGIVEREF(__pyx_r);
13099 __Pyx_RefNannyFinishContext();
13111static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
13112 PyObject *__pyx_v_result = 0;
13113 int __pyx_v_have_slices;
13114 PyObject *__pyx_r = NULL;
13115 __Pyx_RefNannyDeclarations
13117 PyObject *__pyx_t_2 = NULL;
13120 PyObject *__pyx_t_5 = NULL;
13121 PyObject *__pyx_t_6 = NULL;
13122 int __pyx_lineno = 0;
13123 const char *__pyx_filename = NULL;
13124 int __pyx_clineno = 0;
13125 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
13134 __pyx_v_have_slices = 0;
13143 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
13154 __pyx_v_have_slices = 1;
13163 __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)
13164 __Pyx_GOTREF(__pyx_t_2);
13165 __pyx_v_result = ((PyObject*)__pyx_t_2);
13185 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13196 if (unlikely(__pyx_v_index == Py_None)) {
13197 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
13198 __PYX_ERR(1, 780, __pyx_L1_error)
13200 __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)
13201 __Pyx_GOTREF(__pyx_t_2);
13203 PyObject *__pyx_temp;
13205 __pyx_temp = __pyx_r;
13206 __pyx_r = ((PyObject*)__pyx_t_2);
13208 __Pyx_XDECREF(__pyx_temp);
13230 __pyx_t_1 = PySlice_Check(__pyx_v_index);
13241 __pyx_v_have_slices = 1;
13260 __pyx_t_1 = (!(PyIndex_Check(__pyx_v_index) != 0));
13262 if (unlikely(__pyx_t_1)) {
13272 __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)
13292 switch (__pyx_v_ndim) {
13302 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
13303 __Pyx_GOTREF(__pyx_t_2);
13304 __Pyx_INCREF(__pyx_v_index);
13305 __Pyx_GIVEREF(__pyx_v_index);
13306 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 790, __pyx_L1_error);
13307 __pyx_v_result = ((PyObject*)__pyx_t_2);
13327 __pyx_v_have_slices = 1;
13336 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __pyx_L1_error)
13337 __Pyx_GOTREF(__pyx_t_2);
13338 __Pyx_INCREF(__pyx_v_index);
13339 __Pyx_GIVEREF(__pyx_v_index);
13340 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13341 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
13342 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
13343 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13344 __pyx_v_result = ((PyObject*)__pyx_t_2);
13364 __pyx_v_have_slices = 1;
13373 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 796, __pyx_L1_error)
13374 __Pyx_GOTREF(__pyx_t_2);
13375 __Pyx_INCREF(__pyx_v_index);
13376 __Pyx_GIVEREF(__pyx_v_index);
13377 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 796, __pyx_L1_error);
13378 __pyx_t_4 = (__pyx_v_ndim - 1);
13380 __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)
13381 __Pyx_GOTREF(__pyx_t_5);
13383 __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 796, __pyx_L1_error)
13384 __Pyx_GOTREF(__pyx_t_6);
13385 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13386 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13387 __pyx_v_result = ((PyObject*)__pyx_t_6);
13401 __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 798, __pyx_L1_error)
13402 __Pyx_GOTREF(__pyx_t_6);
13403 __pyx_t_5 = PyTuple_New(2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 798, __pyx_L1_error)
13404 __Pyx_GOTREF(__pyx_t_5);
13405 __Pyx_GIVEREF(__pyx_t_6);
13406 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13407 __Pyx_INCREF(__pyx_v_result);
13408 __Pyx_GIVEREF(__pyx_v_result);
13409 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_result) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13412 PyObject *__pyx_temp;
13414 __pyx_temp = __pyx_r;
13415 __pyx_r = ((PyObject*)__pyx_t_5);
13417 __Pyx_XDECREF(__pyx_temp);
13432 __Pyx_XDECREF(__pyx_t_2);
13433 __Pyx_XDECREF(__pyx_t_5);
13434 __Pyx_XDECREF(__pyx_t_6);
13435 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13438 __Pyx_XDECREF(__pyx_v_result);
13440 __Pyx_XGIVEREF(__pyx_r);
13441 __Pyx_RefNannyFinishContext();
13453static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
13454 Py_ssize_t __pyx_v_suboffset;
13456 Py_ssize_t *__pyx_t_1;
13457 Py_ssize_t *__pyx_t_2;
13458 Py_ssize_t *__pyx_t_3;
13461 int __pyx_lineno = 0;
13462 const char *__pyx_filename = NULL;
13463 int __pyx_clineno = 0;
13472 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13474 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13475 __pyx_t_1 = __pyx_t_3;
13476 __pyx_v_suboffset = (__pyx_t_1[0]);
13485 __pyx_t_4 = (__pyx_v_suboffset >= 0);
13487 if (unlikely(__pyx_t_4)) {
13497 __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)
13534 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13550static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13551 int __pyx_v_new_ndim;
13552 int __pyx_v_suboffset_dim;
13554 __Pyx_memviewslice __pyx_v_src;
13555 __Pyx_memviewslice __pyx_v_dst;
13556 __Pyx_memviewslice *__pyx_v_p_src;
13557 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13558 __Pyx_memviewslice *__pyx_v_p_dst;
13559 int *__pyx_v_p_suboffset_dim;
13560 Py_ssize_t __pyx_v_start;
13561 Py_ssize_t __pyx_v_stop;
13562 Py_ssize_t __pyx_v_step;
13563 Py_ssize_t __pyx_v_cindex;
13564 int __pyx_v_have_start;
13565 int __pyx_v_have_stop;
13566 int __pyx_v_have_step;
13567 PyObject *__pyx_v_index = NULL;
13568 struct __pyx_memoryview_obj *__pyx_r = NULL;
13569 __Pyx_RefNannyDeclarations
13571 PyObject *__pyx_t_2 = NULL;
13572 struct __pyx_memoryview_obj *__pyx_t_3;
13575 Py_ssize_t __pyx_t_6;
13576 PyObject *__pyx_t_7 = NULL;
13577 Py_ssize_t __pyx_t_8;
13579 Py_ssize_t __pyx_t_10;
13580 int __pyx_lineno = 0;
13581 const char *__pyx_filename = NULL;
13582 int __pyx_clineno = 0;
13583 __Pyx_RefNannySetupContext(
"memview_slice", 0);
13592 __pyx_v_new_ndim = 0;
13593 __pyx_v_suboffset_dim = -1;
13602 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
13611 #ifndef CYTHON_WITHOUT_ASSERTIONS
13612 if (unlikely(__pyx_assertions_enabled())) {
13613 __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
13615 if (unlikely(!__pyx_t_1)) {
13616 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
13617 __PYX_ERR(1, 824, __pyx_L1_error)
13622 if ((1));
else __PYX_ERR(1, 824, __pyx_L1_error)
13632 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
13643 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
13644 __Pyx_INCREF(__pyx_t_2);
13645 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)
13646 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
13656 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13676 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13685 __pyx_v_p_src = (&__pyx_v_src);
13696 __pyx_t_3 = __pyx_v_p_src->memview;
13698 __pyx_v_dst.memview = __pyx_t_3;
13707 __pyx_t_4 = __pyx_v_p_src->data;
13709 __pyx_v_dst.data = __pyx_t_4;
13718 __pyx_v_p_dst = (&__pyx_v_dst);
13727 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13738 __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
13742 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
13743 #if !CYTHON_ASSUME_SAFE_SIZE
13744 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 848, __pyx_L1_error)
13746 if (__pyx_t_6 >= __pyx_temp)
break;
13748 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13749 __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
13751 __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
13754 if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 848, __pyx_L1_error)
13755 __Pyx_GOTREF(__pyx_t_7);
13756 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_7);
13758 __pyx_v_dim = __pyx_t_5;
13759 __pyx_t_5 = (__pyx_t_5 + 1);
13768 __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
13780 __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)
13781 __pyx_v_cindex = __pyx_t_8;
13790 __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)
13810 __pyx_t_1 = (__pyx_v_index == Py_None);
13821 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13830 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13839 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13848 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13868 __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)
13869 __Pyx_GOTREF(__pyx_t_7);
13870 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 863, __pyx_L1_error)
13872 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13874 __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)
13875 __pyx_t_8 = __pyx_t_10;
13876 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13877 goto __pyx_L7_bool_binop_done;
13881 __pyx_L7_bool_binop_done:;
13882 __pyx_v_start = __pyx_t_8;
13891 __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)
13892 __Pyx_GOTREF(__pyx_t_7);
13893 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 864, __pyx_L1_error)
13895 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13897 __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)
13898 __pyx_t_8 = __pyx_t_10;
13899 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13900 goto __pyx_L9_bool_binop_done;
13904 __pyx_L9_bool_binop_done:;
13905 __pyx_v_stop = __pyx_t_8;
13914 __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)
13915 __Pyx_GOTREF(__pyx_t_7);
13916 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 865, __pyx_L1_error)
13918 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13920 __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)
13921 __pyx_t_8 = __pyx_t_10;
13922 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13923 goto __pyx_L11_bool_binop_done;
13927 __pyx_L11_bool_binop_done:;
13928 __pyx_v_step = __pyx_t_8;
13937 __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)
13938 __Pyx_GOTREF(__pyx_t_7);
13939 __pyx_t_1 = (__pyx_t_7 != Py_None);
13940 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13941 __pyx_v_have_start = __pyx_t_1;
13950 __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)
13951 __Pyx_GOTREF(__pyx_t_7);
13952 __pyx_t_1 = (__pyx_t_7 != Py_None);
13953 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13954 __pyx_v_have_stop = __pyx_t_1;
13963 __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)
13964 __Pyx_GOTREF(__pyx_t_7);
13965 __pyx_t_1 = (__pyx_t_7 != Py_None);
13966 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13967 __pyx_v_have_step = __pyx_t_1;
13976 __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)
13986 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13998 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14007 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
14018 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 881, __pyx_L1_error) }
14027 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 882, __pyx_L1_error) }
14036 __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)
14037 __Pyx_GOTREF(__pyx_t_2);
14038 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)
14040 struct __pyx_memoryview_obj *__pyx_temp;
14042 __pyx_temp = __pyx_r;
14043 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
14045 __Pyx_XDECREF((PyObject *)__pyx_temp);
14075 __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)
14076 __Pyx_GOTREF(__pyx_t_2);
14085 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)
14087 struct __pyx_memoryview_obj *__pyx_temp;
14089 __pyx_temp = __pyx_r;
14090 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
14092 __Pyx_XDECREF((PyObject *)__pyx_temp);
14108 __Pyx_XDECREF(__pyx_t_2);
14109 __Pyx_XDECREF(__pyx_t_7);
14110 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14119 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14129 __Pyx_XDECREF(__pyx_v_index);
14130 __Pyx_XGIVEREF((PyObject *)__pyx_r);
14131 __Pyx_RefNannyFinishContext();
14143static 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) {
14144 Py_ssize_t __pyx_v_shape;
14145 Py_ssize_t __pyx_v_stride;
14146 Py_ssize_t __pyx_v_suboffset;
14147 Py_ssize_t __pyx_v_itemsize;
14148 char *__pyx_v_resultp;
14150 Py_ssize_t __pyx_t_1;
14153 int __pyx_lineno = 0;
14154 const char *__pyx_filename = NULL;
14155 int __pyx_clineno = 0;
14165 __pyx_v_suboffset = -1L;
14174 __pyx_t_1 = __pyx_v_view->itemsize;
14176 __pyx_v_itemsize = __pyx_t_1;
14185 __pyx_t_2 = (__pyx_v_view->ndim == 0);
14197 if (unlikely(__pyx_v_itemsize == 0)) {
14198 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
14199 __PYX_ERR(1, 900, __pyx_L1_error)
14201 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))) {
14202 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
14203 __PYX_ERR(1, 900, __pyx_L1_error)
14205 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);
14214 __pyx_v_stride = __pyx_v_itemsize;
14234 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14243 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14252 __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14264 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14284 __pyx_t_2 = (__pyx_v_index < 0);
14296 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14305 __pyx_t_2 = (__pyx_v_index < 0);
14307 if (unlikely(__pyx_t_2)) {
14317 __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)
14345 __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14347 if (unlikely(__pyx_t_2)) {
14357 __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)
14376 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14385 __pyx_t_2 = (__pyx_v_suboffset >= 0);
14397 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14417 __pyx_r = __pyx_v_resultp;
14431 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14452static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14454 Py_ssize_t *__pyx_v_shape;
14455 Py_ssize_t *__pyx_v_strides;
14460 Py_ssize_t *__pyx_t_2;
14463 Py_ssize_t __pyx_t_5;
14464 Py_ssize_t __pyx_t_6;
14468 int __pyx_lineno = 0;
14469 const char *__pyx_filename = NULL;
14470 int __pyx_clineno = 0;
14471 PyGILState_STATE __pyx_gilstate_save;
14480 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14482 __pyx_v_ndim = __pyx_t_1;
14491 __pyx_t_2 = __pyx_v_memslice->shape;
14493 __pyx_v_shape = __pyx_t_2;
14502 __pyx_t_2 = __pyx_v_memslice->strides;
14504 __pyx_v_strides = __pyx_t_2;
14514 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2, 1);
14515 __pyx_t_4 = __pyx_t_3;
14517 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14518 __pyx_v_i = __pyx_t_1;
14527 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14536 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14538 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14540 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14542 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14552 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14554 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14556 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14558 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14568 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14574 __pyx_t_7 = __pyx_t_8;
14576 goto __pyx_L6_bool_binop_done;
14578 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14581 __pyx_t_7 = __pyx_t_8;
14583 __pyx_L6_bool_binop_done:;
14584 if (unlikely(__pyx_t_7)) {
14594 __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)
14631 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14632 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14634 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14653static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
14654static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14655 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
14656 __Pyx_RefNannyDeclarations
14657 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
14658 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
14659 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14662 __Pyx_RefNannyFinishContext();
14665static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14674 __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
14696static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
14697 PyObject *__pyx_r = NULL;
14698 __Pyx_RefNannyDeclarations
14700 PyObject *__pyx_t_2 = NULL;
14701 int __pyx_lineno = 0;
14702 const char *__pyx_filename = NULL;
14703 int __pyx_clineno = 0;
14704 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
14713 __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
14725 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 965, __pyx_L1_error)
14726 __Pyx_GOTREF(__pyx_t_2);
14728 PyObject *__pyx_temp;
14730 __pyx_temp = __pyx_r;
14731 __pyx_r = __pyx_t_2;
14733 __Pyx_XDECREF(__pyx_temp);
14755 __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)
14756 __Pyx_GOTREF(__pyx_t_2);
14758 PyObject *__pyx_temp;
14760 __pyx_temp = __pyx_r;
14761 __pyx_r = __pyx_t_2;
14763 __Pyx_XDECREF(__pyx_temp);
14779 __Pyx_XDECREF(__pyx_t_2);
14780 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14783 __Pyx_XGIVEREF(__pyx_r);
14784 __Pyx_RefNannyFinishContext();
14796static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14797 PyObject *__pyx_r = NULL;
14798 __Pyx_RefNannyDeclarations
14801 PyObject *__pyx_t_3 = NULL;
14802 int __pyx_lineno = 0;
14803 const char *__pyx_filename = NULL;
14804 int __pyx_clineno = 0;
14805 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
14814 __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
14826 __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)
14847 __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)
14848 __Pyx_GOTREF(__pyx_t_3);
14849 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14862 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14865 __Pyx_XDECREF(__pyx_t_3);
14866 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14869 __Pyx_XGIVEREF(__pyx_r);
14870 __Pyx_RefNannyFinishContext();
14882static PyObject *__pyx_memoryviewslice__get_base(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14883 PyObject *__pyx_r = NULL;
14884 __Pyx_RefNannyDeclarations
14885 __Pyx_RefNannySetupContext(
"_get_base", 0);
14895 PyObject *__pyx_temp;
14897 __pyx_temp = __pyx_r;
14898 __Pyx_INCREF(__pyx_v_self->from_object);
14899 __pyx_r = __pyx_v_self->from_object;
14901 __Pyx_XDECREF(__pyx_temp);
14915 __Pyx_XGIVEREF(__pyx_r);
14916 __Pyx_RefNannyFinishContext();
14927static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14928#
if CYTHON_VECTORCALL
14929PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14931PyObject *__pyx_args, PyObject *__pyx_kwds
14934static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14935#
if CYTHON_VECTORCALL
14936PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14938PyObject *__pyx_args, PyObject *__pyx_kwds
14941 #if !CYTHON_VECTORCALL
14942 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14944 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
14945 PyObject *__pyx_r = 0;
14946 __Pyx_RefNannyDeclarations
14947 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
14948 #if !CYTHON_VECTORCALL
14949 #if CYTHON_ASSUME_SAFE_SIZE
14950 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14952 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
14955 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14956 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
14957 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
14958 if (unlikely(__pyx_kwds_len < 0))
return NULL;
14959 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
14960 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14963 __Pyx_RefNannyFinishContext();
14967static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14968 PyObject *__pyx_r = NULL;
14969 __Pyx_RefNannyDeclarations
14970 int __pyx_lineno = 0;
14971 const char *__pyx_filename = NULL;
14972 int __pyx_clineno = 0;
14973 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
14981 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
14982 __PYX_ERR(1, 2, __pyx_L1_error)
14992 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14994 __Pyx_XGIVEREF(__pyx_r);
14995 __Pyx_RefNannyFinishContext();
15007static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15008#
if CYTHON_VECTORCALL
15009PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15011PyObject *__pyx_args, PyObject *__pyx_kwds
15014static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15015#
if CYTHON_VECTORCALL
15016PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15018PyObject *__pyx_args, PyObject *__pyx_kwds
15021 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
15022 #if !CYTHON_VECTORCALL
15023 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
15025 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
15026 PyObject* values[1] = {0};
15027 int __pyx_lineno = 0;
15028 const char *__pyx_filename = NULL;
15029 int __pyx_clineno = 0;
15030 PyObject *__pyx_r = 0;
15031 __Pyx_RefNannyDeclarations
15032 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
15033 #if !CYTHON_VECTORCALL
15034 #if CYTHON_ASSUME_SAFE_SIZE
15035 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
15037 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
15040 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
15042 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
15043 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
15044 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
15045 if (__pyx_kwds_len > 0) {
15046 switch (__pyx_nargs) {
15048 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
15049 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
15050 CYTHON_FALLTHROUGH;
15052 default:
goto __pyx_L5_argtuple_error;
15054 const Py_ssize_t kwd_pos_args = __pyx_nargs;
15055 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)
15056 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
15057 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
15059 }
else if (unlikely(__pyx_nargs != 1)) {
15060 goto __pyx_L5_argtuple_error;
15062 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
15063 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
15065 __pyx_v___pyx_state = values[0];
15067 goto __pyx_L6_skip;
15068 __pyx_L5_argtuple_error:;
15069 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
15071 goto __pyx_L4_argument_unpacking_done;
15073 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
15074 Py_XDECREF(values[__pyx_temp]);
15076 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15077 __Pyx_RefNannyFinishContext();
15079 __pyx_L4_argument_unpacking_done:;
15080 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
15083 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
15084 Py_XDECREF(values[__pyx_temp]);
15086 __Pyx_RefNannyFinishContext();
15090static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15091 PyObject *__pyx_r = NULL;
15092 __Pyx_RefNannyDeclarations
15093 int __pyx_lineno = 0;
15094 const char *__pyx_filename = NULL;
15095 int __pyx_clineno = 0;
15096 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
15103 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
15104 __PYX_ERR(1, 4, __pyx_L1_error)
15115 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15117 __Pyx_XGIVEREF(__pyx_r);
15118 __Pyx_RefNannyFinishContext();
15130static 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) {
15131 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15132 Py_ssize_t __pyx_v_suboffset;
15133 Py_ssize_t __pyx_v_length;
15134 PyObject *__pyx_r = NULL;
15135 __Pyx_RefNannyDeclarations
15137 PyObject *__pyx_t_2 = NULL;
15138 PyObject *__pyx_t_3 = NULL;
15139 __Pyx_TypeInfo
const *__pyx_t_4;
15140 Py_buffer __pyx_t_5;
15141 Py_ssize_t *__pyx_t_6;
15142 Py_ssize_t *__pyx_t_7;
15143 Py_ssize_t *__pyx_t_8;
15144 Py_ssize_t __pyx_t_9;
15145 int __pyx_lineno = 0;
15146 const char *__pyx_filename = NULL;
15147 int __pyx_clineno = 0;
15148 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
15157 __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
15170 PyObject *__pyx_temp;
15172 __pyx_temp = __pyx_r;
15173 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15175 __Pyx_XDECREF(__pyx_temp);
15195 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
15196 __Pyx_GOTREF(__pyx_t_2);
15197 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1010, __pyx_L1_error)
15198 __Pyx_GOTREF(__pyx_t_3);
15199 __Pyx_INCREF(Py_None);
15200 __Pyx_GIVEREF(Py_None);
15201 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15202 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
15203 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
15204 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15205 __Pyx_GIVEREF(__pyx_t_2);
15206 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15208 __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)
15209 __Pyx_GOTREF(__pyx_t_2);
15210 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15211 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15221 __pyx_v_result->from_slice = __pyx_v_memviewslice;
15230 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15239 __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)
15240 __Pyx_GOTREF(__pyx_t_2);
15241 __Pyx_GIVEREF(__pyx_t_2);
15242 __Pyx_GOTREF(__pyx_v_result->from_object);
15243 __Pyx_DECREF(__pyx_v_result->from_object);
15244 __pyx_v_result->from_object = __pyx_t_2;
15254 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15256 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15265 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15267 __pyx_v_result->__pyx_base.view = __pyx_t_5;
15276 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
15285 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15294 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15303 Py_INCREF(Py_None);
15312 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15324 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15344 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15355 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15364 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15373 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15382 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15384 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15385 __pyx_t_6 = __pyx_t_8;
15386 __pyx_v_suboffset = (__pyx_t_6[0]);
15395 __pyx_t_1 = (__pyx_v_suboffset >= 0);
15407 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15416 goto __pyx_L6_break;
15437 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15439 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15448 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15450 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15451 __pyx_t_6 = __pyx_t_8;
15452 __pyx_v_length = (__pyx_t_6[0]);
15461 __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * __pyx_v_length);
15472 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15481 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15491 PyObject *__pyx_temp;
15493 __pyx_temp = __pyx_r;
15494 __Pyx_INCREF((PyObject *)__pyx_v_result);
15495 __pyx_r = ((PyObject *)__pyx_v_result);
15497 __Pyx_XDECREF(__pyx_temp);
15511 __Pyx_XDECREF(__pyx_t_2);
15512 __Pyx_XDECREF(__pyx_t_3);
15513 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15516 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15519 __Pyx_XGIVEREF(__pyx_r);
15520 __Pyx_RefNannyFinishContext();
15532static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15533 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15534 __Pyx_memviewslice *__pyx_r;
15535 __Pyx_RefNannyDeclarations
15537 PyObject *__pyx_t_2 = NULL;
15538 int __pyx_lineno = 0;
15539 const char *__pyx_filename = NULL;
15540 int __pyx_clineno = 0;
15541 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
15550 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15561 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
15562 __Pyx_INCREF(__pyx_t_2);
15563 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)
15564 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15576 __pyx_r = (&__pyx_v_obj->from_slice);
15597 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15608 __pyx_r = __pyx_v_mslice;
15623 __Pyx_XDECREF(__pyx_t_2);
15624 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15627 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15629 __Pyx_RefNannyFinishContext();
15641static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15643 Py_ssize_t *__pyx_v_shape;
15644 Py_ssize_t *__pyx_v_strides;
15645 Py_ssize_t *__pyx_v_suboffsets;
15646 Py_ssize_t *__pyx_t_1;
15650 Py_ssize_t __pyx_t_5;
15660 __pyx_t_1 = __pyx_v_memview->view.shape;
15662 __pyx_v_shape = __pyx_t_1;
15671 __pyx_t_1 = __pyx_v_memview->view.strides;
15673 __pyx_v_strides = __pyx_t_1;
15682 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15684 __pyx_v_suboffsets = __pyx_t_1;
15693 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
15702 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
15712 __pyx_t_2 = __pyx_v_memview->view.ndim;
15713 __pyx_t_3 = __pyx_t_2;
15715 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15716 __pyx_v_dim = __pyx_t_4;
15725 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15734 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15743 __pyx_t_6 = (__pyx_v_suboffsets != 0);
15747 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15753 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15782static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
15783 __Pyx_memviewslice __pyx_v_memviewslice;
15784 PyObject *__pyx_r = NULL;
15785 __Pyx_RefNannyDeclarations
15786 PyObject *__pyx_t_1 = NULL;
15787 int __pyx_lineno = 0;
15788 const char *__pyx_filename = NULL;
15789 int __pyx_clineno = 0;
15790 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
15799 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15808 __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)
15809 __Pyx_GOTREF(__pyx_t_1);
15811 PyObject *__pyx_temp;
15813 __pyx_temp = __pyx_r;
15814 __pyx_r = __pyx_t_1;
15816 __Pyx_XDECREF(__pyx_temp);
15831 __Pyx_XDECREF(__pyx_t_1);
15832 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15836 __Pyx_XGIVEREF(__pyx_r);
15837 __Pyx_RefNannyFinishContext();
15849static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15850 PyObject *(*__pyx_v_to_object_func)(
char *);
15851 __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func;
15852 PyObject *__pyx_r = NULL;
15853 __Pyx_RefNannyDeclarations
15855 PyObject *(*__pyx_t_2)(
char *);
15856 __pyx_memoryview_to_dtype_func_type __pyx_t_3;
15857 PyObject *__pyx_t_4 = NULL;
15858 int __pyx_lineno = 0;
15859 const char *__pyx_filename = NULL;
15860 int __pyx_clineno = 0;
15861 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
15870 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15881 __pyx_t_2 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15883 __pyx_v_to_object_func = __pyx_t_2;
15892 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15894 __pyx_v_to_dtype_func = __pyx_t_3;
15914 __pyx_v_to_object_func = NULL;
15923 __pyx_v_to_dtype_func = NULL;
15934 __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)
15935 __Pyx_GOTREF(__pyx_t_4);
15937 PyObject *__pyx_temp;
15939 __pyx_temp = __pyx_r;
15940 __pyx_r = __pyx_t_4;
15942 __Pyx_XDECREF(__pyx_temp);
15957 __Pyx_XDECREF(__pyx_t_4);
15958 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15963 __Pyx_XGIVEREF(__pyx_r);
15964 __Pyx_RefNannyFinishContext();
15976static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
15977 Py_ssize_t __pyx_r;
15978 Py_ssize_t __pyx_t_1;
15988 __pyx_t_2 = (__pyx_v_arg < 0);
15992 __pyx_t_1 = (-__pyx_v_arg);
15995 __pyx_t_1 = __pyx_v_arg;
15999 __pyx_r = __pyx_t_1;
16024static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
16026 Py_ssize_t __pyx_v_c_stride;
16027 Py_ssize_t __pyx_v_f_stride;
16041 __pyx_v_c_stride = 0;
16050 __pyx_v_f_stride = 0;
16059 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
16060 __pyx_v_i = __pyx_t_1;
16069 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16081 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16090 goto __pyx_L4_break;
16111 __pyx_t_1 = __pyx_v_ndim;
16112 __pyx_t_3 = __pyx_t_1;
16114 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16115 __pyx_v_i = __pyx_t_4;
16124 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16136 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16145 goto __pyx_L7_break;
16166 __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
16232static 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) {
16233 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16234 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16235 Py_ssize_t __pyx_v_dst_extent;
16236 Py_ssize_t __pyx_v_src_stride;
16237 Py_ssize_t __pyx_v_dst_stride;
16240 Py_ssize_t __pyx_t_3;
16241 Py_ssize_t __pyx_t_4;
16242 Py_ssize_t __pyx_t_5;
16253 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16262 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16271 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16280 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16289 __pyx_t_1 = (__pyx_v_ndim == 1);
16301 __pyx_t_2 = (__pyx_v_src_stride > 0);
16307 __pyx_t_1 = __pyx_t_2;
16309 goto __pyx_L5_bool_binop_done;
16311 __pyx_t_2 = (__pyx_v_dst_stride > 0);
16317 __pyx_t_1 = __pyx_t_2;
16319 goto __pyx_L5_bool_binop_done;
16329 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16331 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16334 __pyx_t_1 = __pyx_t_2;
16336 __pyx_L5_bool_binop_done:;
16355 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * ((
size_t)__pyx_v_dst_extent))));
16376 __pyx_t_3 = __pyx_v_dst_extent;
16377 __pyx_t_4 = __pyx_t_3;
16379 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16380 __pyx_v_i = __pyx_t_5;
16389 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16398 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16407 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16432 __pyx_t_3 = __pyx_v_dst_extent;
16433 __pyx_t_4 = __pyx_t_3;
16435 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16436 __pyx_v_i = __pyx_t_5;
16445 _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);
16454 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16463 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16495static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
16504 _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);
16525static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
16526 Py_ssize_t __pyx_v_shape;
16527 size_t __pyx_v_size;
16529 Py_ssize_t *__pyx_t_1;
16530 Py_ssize_t *__pyx_t_2;
16531 Py_ssize_t *__pyx_t_3;
16540 __pyx_v_size = ((size_t)__pyx_v_src->memview->view.itemsize);
16549 __pyx_t_2 = (__pyx_v_src->shape + __pyx_v_ndim);
16551 for (__pyx_t_3 = __pyx_v_src->shape; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16552 __pyx_t_1 = __pyx_t_3;
16553 __pyx_v_shape = (__pyx_t_1[0]);
16562 __pyx_v_size = (__pyx_v_size * ((size_t)__pyx_v_shape));
16575 __pyx_r = __pyx_v_size;
16602static 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) {
16604 Py_ssize_t __pyx_r;
16618 __pyx_t_1 = (__pyx_v_order ==
'F');
16631 __pyx_t_2 = __pyx_v_ndim;
16632 __pyx_t_3 = __pyx_t_2;
16634 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16635 __pyx_v_idx = __pyx_t_4;
16644 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16653 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16675 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16676 __pyx_v_idx = __pyx_t_2;
16685 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16694 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16708 __pyx_r = __pyx_v_stride;
16735static 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) {
16737 void *__pyx_v_result;
16738 size_t __pyx_v_itemsize;
16739 size_t __pyx_v_size;
16743 struct __pyx_memoryview_obj *__pyx_t_3;
16746 int __pyx_lineno = 0;
16747 const char *__pyx_filename = NULL;
16748 int __pyx_clineno = 0;
16749 PyGILState_STATE __pyx_gilstate_save;
16758 __pyx_v_itemsize = ((size_t)__pyx_v_src->memview->view.itemsize);
16767 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16776 __pyx_v_result = malloc(__pyx_v_size);
16785 __pyx_t_1 = (!(__pyx_v_result != 0));
16787 if (unlikely(__pyx_t_1)) {
16797 __pyx_t_2 = __pyx_memoryview_err_no_memory();
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
16816 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
16825 __pyx_t_3 = __pyx_v_src->memview;
16827 __pyx_v_tmpslice->memview = __pyx_t_3;
16837 __pyx_t_2 = __pyx_v_ndim;
16838 __pyx_t_4 = __pyx_t_2;
16840 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16841 __pyx_v_i = __pyx_t_5;
16850 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16859 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16870 (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));
16880 __pyx_t_2 = __pyx_v_ndim;
16881 __pyx_t_4 = __pyx_t_2;
16883 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16884 __pyx_v_i = __pyx_t_5;
16893 __pyx_t_1 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
16905 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16925 __pyx_t_1 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
16937 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16957 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
16970 __pyx_r = __pyx_v_result;
16984 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16985 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
16987 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17004static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
17006 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17018 (void)(PyErr_Format(PyExc_ValueError, __pyx_k_got_differing_extents_in_dimensi, __pyx_v_i, __pyx_v_extent1, __pyx_v_extent2));
17047 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17059static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char const *__pyx_v_msg,
int __pyx_v_dim) {
17061 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17073 (void)(PyErr_Format(__pyx_v_error, __pyx_v_msg, __pyx_v_dim));
17102 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17114static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char const *__pyx_v_msg) {
17116 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17127 (void)(PyErr_SetString(__pyx_v_error, __pyx_v_msg));
17155 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17167static int __pyx_memoryview_err_no_memory(
void) {
17169 int __pyx_lineno = 0;
17170 const char *__pyx_filename = NULL;
17171 int __pyx_clineno = 0;
17172 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17181 PyErr_NoMemory(); __PYX_ERR(1, 1267, __pyx_L1_error)
17193 __Pyx_AddTraceback(
"View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
17196 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17208static int __pyx_memoryview_err_ValueError(
char const *__pyx_v_msg) {
17218 (void)(PyErr_SetString(PyExc_ValueError, __pyx_v_msg));
17255static int __pyx_memoryview_err_IndexError(
char const *__pyx_v_msg, Py_ssize_t __pyx_v_index) {
17265 (void)(PyErr_Format(PyExc_IndexError, __pyx_v_msg, __pyx_v_index));
17302static 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) {
17303 void *__pyx_v_tmpdata;
17304 size_t __pyx_v_itemsize;
17306 char __pyx_v_order;
17307 int __pyx_v_broadcasting;
17308 int __pyx_v_direct_copy;
17309 __Pyx_memviewslice __pyx_v_tmp;
17318 int __pyx_lineno = 0;
17319 const char *__pyx_filename = NULL;
17320 int __pyx_clineno = 0;
17321 PyGILState_STATE __pyx_gilstate_save;
17331 __pyx_v_tmpdata = NULL;
17340 __pyx_v_itemsize = ((size_t)__pyx_v_src.memview->view.itemsize);
17349 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17358 __pyx_v_broadcasting = 0;
17367 __pyx_v_direct_copy = 0;
17376 __pyx_t_1 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17388 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17407 __pyx_t_1 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17419 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17439 __pyx_t_2 = __pyx_v_dst_ndim;
17441 __pyx_t_3 = __pyx_v_src_ndim;
17442 __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
17446 __pyx_t_4 = __pyx_t_2;
17449 __pyx_t_4 = __pyx_t_3;
17452 __pyx_v_ndim = __pyx_t_4;
17463 __pyx_t_4 = __pyx_v_ndim;
17464 __pyx_t_2 = __pyx_t_4;
17466 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17467 __pyx_v_i = __pyx_t_3;
17476 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17488 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17490 if (likely(__pyx_t_1)) {
17500 __pyx_v_broadcasting = 1;
17509 (__pyx_v_src.strides[__pyx_v_i]) = 0;
17529 __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)
17550 __pyx_t_1 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17552 if (unlikely(__pyx_t_1)) {
17562 __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)
17583 __pyx_t_1 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17595 __pyx_t_1 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17607 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17625 __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)
17626 __pyx_v_tmpdata = __pyx_t_6;
17635 __pyx_v_src = __pyx_v_tmp;
17653 __pyx_t_1 = (!__pyx_v_broadcasting);
17665 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim);
17677 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
17696 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim);
17708 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
17727 if (__pyx_v_direct_copy) {
17736 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17745 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17754 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17763 free(__pyx_v_tmpdata);
17803 __pyx_t_1 = (__pyx_v_order ==
'F');
17805 __pyx_t_1 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17817 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1344, __pyx_L1_error)
17827 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1345, __pyx_L1_error)
17846 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17855 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17864 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17873 free(__pyx_v_tmpdata);
17898 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17899 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17901 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17923static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
17925 int __pyx_v_offset;
17937 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17946 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17947 __pyx_v_i = __pyx_t_1;
17956 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
17965 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
17974 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
17985 __pyx_t_1 = __pyx_v_offset;
17986 __pyx_t_2 = __pyx_t_1;
17988 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17989 __pyx_v_i = __pyx_t_3;
17998 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
18007 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
18016 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
18041static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
18050 if (__pyx_v_dtype_is_object) {
18059 __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);
18089static 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) {
18090 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18104 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
18121 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18132static 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) {
18133 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18134 Py_ssize_t __pyx_v_stride;
18135 Py_ssize_t __pyx_t_1;
18136 Py_ssize_t __pyx_t_2;
18137 Py_ssize_t __pyx_t_3;
18148 __pyx_v_stride = (__pyx_v_strides[0]);
18158 __pyx_t_1 = (__pyx_v_shape[0]);
18159 __pyx_t_2 = __pyx_t_1;
18161 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18162 __pyx_v_i = __pyx_t_3;
18171 __pyx_t_4 = (__pyx_v_ndim == 1);
18192 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
18212 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
18234 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18245 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18272static 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) {
18281 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18290 __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);
18299 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18320static 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) {
18321 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18322 Py_ssize_t __pyx_v_stride;
18323 Py_ssize_t __pyx_v_extent;
18325 Py_ssize_t __pyx_t_2;
18326 Py_ssize_t __pyx_t_3;
18327 Py_ssize_t __pyx_t_4;
18337 __pyx_v_stride = (__pyx_v_strides[0]);
18346 __pyx_v_extent = (__pyx_v_shape[0]);
18355 __pyx_t_1 = (__pyx_v_ndim == 1);
18368 __pyx_t_2 = __pyx_v_extent;
18369 __pyx_t_3 = __pyx_t_2;
18371 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18372 __pyx_v_i = __pyx_t_4;
18381 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18390 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18413 __pyx_t_2 = __pyx_v_extent;
18414 __pyx_t_3 = __pyx_t_2;
18416 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18417 __pyx_v_i = __pyx_t_4;
18426 __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);
18434 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18464static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18465#
if CYTHON_VECTORCALL
18466PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18468PyObject *__pyx_args, PyObject *__pyx_kwds
18471static 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};
18472static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18473#
if CYTHON_VECTORCALL
18474PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18476PyObject *__pyx_args, PyObject *__pyx_kwds
18479 PyObject *__pyx_v___pyx_type = 0;
18480 long __pyx_v___pyx_checksum;
18481 PyObject *__pyx_v___pyx_state = 0;
18482 #if !CYTHON_VECTORCALL
18483 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18485 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
18486 PyObject* values[3] = {0,0,0};
18487 int __pyx_lineno = 0;
18488 const char *__pyx_filename = NULL;
18489 int __pyx_clineno = 0;
18490 PyObject *__pyx_r = 0;
18491 __Pyx_RefNannyDeclarations
18492 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
18493 #if !CYTHON_VECTORCALL
18494 #if CYTHON_ASSUME_SAFE_SIZE
18495 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18497 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
18500 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18502 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};
18503 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
18504 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 4, __pyx_L3_error)
18505 if (__pyx_kwds_len > 0) {
18506 switch (__pyx_nargs) {
18508 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18509 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18510 CYTHON_FALLTHROUGH;
18512 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18513 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18514 CYTHON_FALLTHROUGH;
18516 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18517 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18518 CYTHON_FALLTHROUGH;
18520 default:
goto __pyx_L5_argtuple_error;
18522 const Py_ssize_t kwd_pos_args = __pyx_nargs;
18523 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)
18524 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
18525 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
18527 }
else if (unlikely(__pyx_nargs != 3)) {
18528 goto __pyx_L5_argtuple_error;
18530 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18531 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18532 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18533 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18534 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18535 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18537 __pyx_v___pyx_type = values[0];
18538 __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)
18539 __pyx_v___pyx_state = ((PyObject*)values[2]);
18541 goto __pyx_L6_skip;
18542 __pyx_L5_argtuple_error:;
18543 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __pyx_L3_error)
18545 goto __pyx_L4_argument_unpacking_done;
18547 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
18548 Py_XDECREF(values[__pyx_temp]);
18550 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18551 __Pyx_RefNannyFinishContext();
18553 __pyx_L4_argument_unpacking_done:;
18554 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1,
"__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
18555 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18561 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
18562 Py_XDECREF(values[__pyx_temp]);
18564 goto __pyx_L7_cleaned_up;
18566 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
18567 Py_XDECREF(values[__pyx_temp]);
18569 __pyx_L7_cleaned_up:;
18571 __Pyx_RefNannyFinishContext();
18575static 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) {
18576 PyObject *__pyx_v___pyx_result = 0;
18577 PyObject *__pyx_r = NULL;
18578 __Pyx_RefNannyDeclarations
18580 PyObject *__pyx_t_2 = NULL;
18581 PyObject *__pyx_t_3 = NULL;
18584 int __pyx_lineno = 0;
18585 const char *__pyx_filename = NULL;
18586 int __pyx_clineno = 0;
18587 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
18596 __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)
18606 __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
18607 __Pyx_INCREF(__pyx_t_3);
18610 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
18611 __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));
18612 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18613 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
18614 __Pyx_GOTREF(__pyx_t_2);
18616 __pyx_v___pyx_result = __pyx_t_2;
18626 __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
18637 if (unlikely(__pyx_v___pyx_state == Py_None)) {
18638 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
18639 __PYX_ERR(1, 9, __pyx_L1_error)
18641 __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)
18642 __Pyx_GOTREF(__pyx_t_2);
18643 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18662 PyObject *__pyx_temp;
18664 __pyx_temp = __pyx_r;
18665 __Pyx_INCREF(__pyx_v___pyx_result);
18666 __pyx_r = __pyx_v___pyx_result;
18668 __Pyx_XDECREF(__pyx_temp);
18682 __Pyx_XDECREF(__pyx_t_2);
18683 __Pyx_XDECREF(__pyx_t_3);
18684 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18687 __Pyx_XDECREF(__pyx_v___pyx_result);
18688 __Pyx_XGIVEREF(__pyx_r);
18689 __Pyx_RefNannyFinishContext();
18701static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18702 PyObject *__pyx_r = NULL;
18703 __Pyx_RefNannyDeclarations
18704 PyObject *__pyx_t_1 = NULL;
18706 int __pyx_lineno = 0;
18707 const char *__pyx_filename = NULL;
18708 int __pyx_clineno = 0;
18709 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
18717 __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)
18718 __Pyx_GOTREF(__pyx_t_1);
18719 __Pyx_GIVEREF(__pyx_t_1);
18720 __Pyx_GOTREF(__pyx_v___pyx_result->name);
18721 __Pyx_DECREF(__pyx_v___pyx_result->name);
18722 __pyx_v___pyx_result->name = __pyx_t_1;
18730 __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)
18742 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18745 __Pyx_XDECREF(__pyx_t_1);
18746 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18749 __Pyx_XGIVEREF(__pyx_r);
18750 __Pyx_RefNannyFinishContext();
18762static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
18763 PyTypeObject *__pyx_r;
18774 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
18799static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
18811 __pyx_r = PyDataType_KIND(__pyx_v_self);
18836static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
18848 __pyx_r = PyDataType_TYPE(__pyx_v_self);
18873static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
18885 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
18910static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
18922 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
18947static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
18959 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
18984static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
18996 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
19021static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
19022 PyObject *__pyx_r = NULL;
19023 __Pyx_RefNannyDeclarations
19024 PyObject *__pyx_t_1;
19025 __Pyx_RefNannySetupContext(
"__get__", 0);
19034 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
19037 PyObject *__pyx_temp;
19039 __pyx_temp = __pyx_r;
19040 __Pyx_INCREF(((PyObject *)__pyx_t_1));
19041 __pyx_r = ((PyObject *)__pyx_t_1);
19043 __Pyx_XDECREF(__pyx_temp);
19058 __Pyx_XGIVEREF(__pyx_r);
19059 __Pyx_RefNannyFinishContext();
19071static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
19072 PyObject *__pyx_r = NULL;
19073 __Pyx_RefNannyDeclarations
19074 PyObject *__pyx_t_1;
19075 __Pyx_RefNannySetupContext(
"__get__", 0);
19084 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
19087 PyObject *__pyx_temp;
19089 __pyx_temp = __pyx_r;
19090 __Pyx_INCREF(((PyObject*)__pyx_t_1));
19091 __pyx_r = ((PyObject*)__pyx_t_1);
19093 __Pyx_XDECREF(__pyx_temp);
19108 __Pyx_XGIVEREF(__pyx_r);
19109 __Pyx_RefNannyFinishContext();
19121static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
19122 PyArray_ArrayDescr *__pyx_r;
19133 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
19158static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
19159 npy_uint64 __pyx_r;
19170 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
19195static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
19207 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
19232static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
19244 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
19269static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
19281 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
19306static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
19318 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
19343static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
19355 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
19380static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
19392 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
19417static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
19429 __pyx_r = PyArray_BASE(__pyx_v_self);
19454static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
19455 PyArray_Descr *__pyx_r = NULL;
19456 __Pyx_RefNannyDeclarations
19457 PyArray_Descr *__pyx_t_1;
19458 __Pyx_RefNannySetupContext(
"__get__", 0);
19467 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
19470 PyArray_Descr *__pyx_temp;
19472 __pyx_temp = __pyx_r;
19473 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
19474 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19476 __Pyx_XDECREF((PyObject *)__pyx_temp);
19491 __Pyx_XGIVEREF((PyObject *)__pyx_r);
19492 __Pyx_RefNannyFinishContext();
19504static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
19516 __pyx_r = PyArray_NDIM(__pyx_v_self);
19541static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
19553 __pyx_r = PyArray_DIMS(__pyx_v_self);
19578static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
19590 __pyx_r = PyArray_STRIDES(__pyx_v_self);
19615static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
19627 __pyx_r = PyArray_SIZE(__pyx_v_self);
19652static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
19664 __pyx_r = PyArray_BYTES(__pyx_v_self);
19689static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19690 PyObject *__pyx_r = NULL;
19691 __Pyx_RefNannyDeclarations
19692 PyObject *__pyx_t_1 = NULL;
19693 int __pyx_lineno = 0;
19694 const char *__pyx_filename = NULL;
19695 int __pyx_clineno = 0;
19696 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
19705 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 795, __pyx_L1_error)
19706 __Pyx_GOTREF(__pyx_t_1);
19708 PyObject *__pyx_temp;
19710 __pyx_temp = __pyx_r;
19711 __pyx_r = __pyx_t_1;
19713 __Pyx_XDECREF(__pyx_temp);
19728 __Pyx_XDECREF(__pyx_t_1);
19729 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19732 __Pyx_XGIVEREF(__pyx_r);
19733 __Pyx_RefNannyFinishContext();
19745static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19746 PyObject *__pyx_r = NULL;
19747 __Pyx_RefNannyDeclarations
19748 PyObject *__pyx_t_1 = NULL;
19749 int __pyx_lineno = 0;
19750 const char *__pyx_filename = NULL;
19751 int __pyx_clineno = 0;
19752 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
19761 __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)
19762 __Pyx_GOTREF(__pyx_t_1);
19764 PyObject *__pyx_temp;
19766 __pyx_temp = __pyx_r;
19767 __pyx_r = __pyx_t_1;
19769 __Pyx_XDECREF(__pyx_temp);
19784 __Pyx_XDECREF(__pyx_t_1);
19785 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19788 __Pyx_XGIVEREF(__pyx_r);
19789 __Pyx_RefNannyFinishContext();
19801static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19802 PyObject *__pyx_r = NULL;
19803 __Pyx_RefNannyDeclarations
19804 PyObject *__pyx_t_1 = NULL;
19805 int __pyx_lineno = 0;
19806 const char *__pyx_filename = NULL;
19807 int __pyx_clineno = 0;
19808 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
19817 __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)
19818 __Pyx_GOTREF(__pyx_t_1);
19820 PyObject *__pyx_temp;
19822 __pyx_temp = __pyx_r;
19823 __pyx_r = __pyx_t_1;
19825 __Pyx_XDECREF(__pyx_temp);
19840 __Pyx_XDECREF(__pyx_t_1);
19841 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19844 __Pyx_XGIVEREF(__pyx_r);
19845 __Pyx_RefNannyFinishContext();
19857static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
19858 PyObject *__pyx_r = NULL;
19859 __Pyx_RefNannyDeclarations
19860 PyObject *__pyx_t_1 = NULL;
19861 int __pyx_lineno = 0;
19862 const char *__pyx_filename = NULL;
19863 int __pyx_clineno = 0;
19864 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
19873 __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)
19874 __Pyx_GOTREF(__pyx_t_1);
19876 PyObject *__pyx_temp;
19878 __pyx_temp = __pyx_r;
19879 __pyx_r = __pyx_t_1;
19881 __Pyx_XDECREF(__pyx_temp);
19896 __Pyx_XDECREF(__pyx_t_1);
19897 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19900 __Pyx_XGIVEREF(__pyx_r);
19901 __Pyx_RefNannyFinishContext();
19913static 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) {
19914 PyObject *__pyx_r = NULL;
19915 __Pyx_RefNannyDeclarations
19916 PyObject *__pyx_t_1 = NULL;
19917 int __pyx_lineno = 0;
19918 const char *__pyx_filename = NULL;
19919 int __pyx_clineno = 0;
19920 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
19929 __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)
19930 __Pyx_GOTREF(__pyx_t_1);
19932 PyObject *__pyx_temp;
19934 __pyx_temp = __pyx_r;
19935 __pyx_r = __pyx_t_1;
19937 __Pyx_XDECREF(__pyx_temp);
19952 __Pyx_XDECREF(__pyx_t_1);
19953 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
19956 __Pyx_XGIVEREF(__pyx_r);
19957 __Pyx_RefNannyFinishContext();
19969static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
19970 PyObject *__pyx_r = NULL;
19971 __Pyx_RefNannyDeclarations
19973 PyObject *__pyx_t_2;
19974 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
19983 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
19995 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
19998 PyObject *__pyx_temp;
20000 __pyx_temp = __pyx_r;
20001 __Pyx_INCREF(((PyObject*)__pyx_t_2));
20002 __pyx_r = ((PyObject*)__pyx_t_2);
20004 __Pyx_XDECREF(__pyx_temp);
20027 PyObject *__pyx_temp;
20029 __pyx_temp = __pyx_r;
20030 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
20031 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
20033 __Pyx_XDECREF(__pyx_temp);
20048 __Pyx_XGIVEREF(__pyx_r);
20049 __Pyx_RefNannyFinishContext();
20061static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
20073 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
20098static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
20110 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
20135static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
20147 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
20172static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
20173 PyUFuncGenericFunction *__pyx_r;
20184 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
20209static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
20221 __pyx_r = ((
void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
20246static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
20258 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
20283static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
20284 char const *__pyx_r;
20295 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
20320static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
20321 char const *__pyx_r;
20332 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
20357static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
20369 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
20394static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
20406 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
20431static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
20443 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
20468static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
20470 int __pyx_lineno = 0;
20471 const char *__pyx_filename = NULL;
20472 int __pyx_clineno = 0;
20481 Py_INCREF(__pyx_v_base);
20490 __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)
20504 __Pyx_AddTraceback(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
20517static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
20518 PyObject *__pyx_v_base;
20519 PyObject *__pyx_r = NULL;
20520 __Pyx_RefNannyDeclarations
20522 __Pyx_RefNannySetupContext(
"get_array_base", 0);
20531 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20540 __pyx_t_1 = (__pyx_v_base == NULL);
20553 PyObject *__pyx_temp;
20555 __pyx_temp = __pyx_r;
20556 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20558 __Pyx_XDECREF(__pyx_temp);
20579 PyObject *__pyx_temp;
20581 __pyx_temp = __pyx_r;
20582 __Pyx_INCREF(((PyObject *)__pyx_v_base));
20583 __pyx_r = ((PyObject *)__pyx_v_base);
20585 __Pyx_XDECREF(__pyx_temp);
20600 __Pyx_XGIVEREF(__pyx_r);
20601 __Pyx_RefNannyFinishContext();
20613static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
20615 __Pyx_RefNannyDeclarations
20616 PyObject *__pyx_t_1 = NULL;
20617 PyObject *__pyx_t_2 = NULL;
20618 PyObject *__pyx_t_3 = NULL;
20620 PyObject *__pyx_t_5 = NULL;
20621 PyObject *__pyx_t_6 = NULL;
20622 PyObject *__pyx_t_7 = NULL;
20623 PyObject *__pyx_t_8 = NULL;
20624 PyObject *__pyx_t_9 = NULL;
20626 int __pyx_lineno = 0;
20627 const char *__pyx_filename = NULL;
20628 int __pyx_clineno = 0;
20629 __Pyx_RefNannySetupContext(
"import_array", 0);
20639 __Pyx_PyThreadState_declare
20640 __Pyx_PyThreadState_assign
20641 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20642 __Pyx_XGOTREF(__pyx_t_1);
20643 __Pyx_XGOTREF(__pyx_t_2);
20644 __Pyx_XGOTREF(__pyx_t_3);
20654 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1079, __pyx_L3_error)
20665 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20666 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20667 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20668 goto __pyx_L8_try_end;
20678 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20680 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20681 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1080, __pyx_L5_except_error)
20682 __Pyx_XGOTREF(__pyx_t_5);
20683 __Pyx_XGOTREF(__pyx_t_6);
20684 __Pyx_XGOTREF(__pyx_t_7);
20696 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
20697 __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));
20698 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20699 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1081, __pyx_L5_except_error)
20700 __Pyx_GOTREF(__pyx_t_8);
20702 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20703 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20704 __PYX_ERR(2, 1081, __pyx_L5_except_error)
20706 goto __pyx_L5_except_error;
20715 __pyx_L5_except_error:;
20716 __Pyx_XGIVEREF(__pyx_t_1);
20717 __Pyx_XGIVEREF(__pyx_t_2);
20718 __Pyx_XGIVEREF(__pyx_t_3);
20719 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20720 goto __pyx_L1_error;
20736 __Pyx_XDECREF(__pyx_t_5);
20737 __Pyx_XDECREF(__pyx_t_6);
20738 __Pyx_XDECREF(__pyx_t_7);
20739 __Pyx_XDECREF(__pyx_t_8);
20740 __Pyx_XDECREF(__pyx_t_9);
20741 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20745 __Pyx_RefNannyFinishContext();
20757static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
20759 __Pyx_RefNannyDeclarations
20760 PyObject *__pyx_t_1 = NULL;
20761 PyObject *__pyx_t_2 = NULL;
20762 PyObject *__pyx_t_3 = NULL;
20764 PyObject *__pyx_t_5 = NULL;
20765 PyObject *__pyx_t_6 = NULL;
20766 PyObject *__pyx_t_7 = NULL;
20767 PyObject *__pyx_t_8 = NULL;
20768 PyObject *__pyx_t_9 = NULL;
20770 int __pyx_lineno = 0;
20771 const char *__pyx_filename = NULL;
20772 int __pyx_clineno = 0;
20773 __Pyx_RefNannySetupContext(
"import_umath", 0);
20783 __Pyx_PyThreadState_declare
20784 __Pyx_PyThreadState_assign
20785 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20786 __Pyx_XGOTREF(__pyx_t_1);
20787 __Pyx_XGOTREF(__pyx_t_2);
20788 __Pyx_XGOTREF(__pyx_t_3);
20798 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1085, __pyx_L3_error)
20809 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20810 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20811 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20812 goto __pyx_L8_try_end;
20822 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20824 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20825 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1086, __pyx_L5_except_error)
20826 __Pyx_XGOTREF(__pyx_t_5);
20827 __Pyx_XGOTREF(__pyx_t_6);
20828 __Pyx_XGOTREF(__pyx_t_7);
20840 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
20841 __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));
20842 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20843 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1087, __pyx_L5_except_error)
20844 __Pyx_GOTREF(__pyx_t_8);
20846 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20847 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20848 __PYX_ERR(2, 1087, __pyx_L5_except_error)
20850 goto __pyx_L5_except_error;
20859 __pyx_L5_except_error:;
20860 __Pyx_XGIVEREF(__pyx_t_1);
20861 __Pyx_XGIVEREF(__pyx_t_2);
20862 __Pyx_XGIVEREF(__pyx_t_3);
20863 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20864 goto __pyx_L1_error;
20880 __Pyx_XDECREF(__pyx_t_5);
20881 __Pyx_XDECREF(__pyx_t_6);
20882 __Pyx_XDECREF(__pyx_t_7);
20883 __Pyx_XDECREF(__pyx_t_8);
20884 __Pyx_XDECREF(__pyx_t_9);
20885 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20889 __Pyx_RefNannyFinishContext();
20901static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
20903 __Pyx_RefNannyDeclarations
20904 PyObject *__pyx_t_1 = NULL;
20905 PyObject *__pyx_t_2 = NULL;
20906 PyObject *__pyx_t_3 = NULL;
20908 PyObject *__pyx_t_5 = NULL;
20909 PyObject *__pyx_t_6 = NULL;
20910 PyObject *__pyx_t_7 = NULL;
20911 PyObject *__pyx_t_8 = NULL;
20912 PyObject *__pyx_t_9 = NULL;
20914 int __pyx_lineno = 0;
20915 const char *__pyx_filename = NULL;
20916 int __pyx_clineno = 0;
20917 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
20927 __Pyx_PyThreadState_declare
20928 __Pyx_PyThreadState_assign
20929 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20930 __Pyx_XGOTREF(__pyx_t_1);
20931 __Pyx_XGOTREF(__pyx_t_2);
20932 __Pyx_XGOTREF(__pyx_t_3);
20942 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1091, __pyx_L3_error)
20953 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20954 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20955 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20956 goto __pyx_L8_try_end;
20966 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20968 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20969 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1092, __pyx_L5_except_error)
20970 __Pyx_XGOTREF(__pyx_t_5);
20971 __Pyx_XGOTREF(__pyx_t_6);
20972 __Pyx_XGOTREF(__pyx_t_7);
20984 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
20985 __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));
20986 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20987 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1093, __pyx_L5_except_error)
20988 __Pyx_GOTREF(__pyx_t_8);
20990 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20991 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20992 __PYX_ERR(2, 1093, __pyx_L5_except_error)
20994 goto __pyx_L5_except_error;
21003 __pyx_L5_except_error:;
21004 __Pyx_XGIVEREF(__pyx_t_1);
21005 __Pyx_XGIVEREF(__pyx_t_2);
21006 __Pyx_XGIVEREF(__pyx_t_3);
21007 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21008 goto __pyx_L1_error;
21024 __Pyx_XDECREF(__pyx_t_5);
21025 __Pyx_XDECREF(__pyx_t_6);
21026 __Pyx_XDECREF(__pyx_t_7);
21027 __Pyx_XDECREF(__pyx_t_8);
21028 __Pyx_XDECREF(__pyx_t_9);
21029 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21033 __Pyx_RefNannyFinishContext();
21045static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
21057 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
21083static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
21095 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
21121static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
21122 npy_datetime __pyx_r;
21133 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
21158static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
21159 npy_timedelta __pyx_r;
21170 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
21195static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
21196 NPY_DATETIMEUNIT __pyx_r;
21207 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
21233static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self,
21234#
if CYTHON_VECTORCALL
21235PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21237PyObject *__pyx_args, PyObject *__pyx_kwds
21240static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {
"__init__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_9ASMFactor_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21241static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self,
21242#
if CYTHON_VECTORCALL
21243PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21245PyObject *__pyx_args, PyObject *__pyx_kwds
21248 PyObject *__pyx_v_self = 0;
21249 PyObject *__pyx_v_L = 0;
21250 #if !CYTHON_VECTORCALL
21251 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21253 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21254 PyObject* values[2] = {0,0};
21255 int __pyx_lineno = 0;
21256 const char *__pyx_filename = NULL;
21257 int __pyx_clineno = 0;
21258 PyObject *__pyx_r = 0;
21259 __Pyx_RefNannyDeclarations
21260 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
21261 #if !CYTHON_VECTORCALL
21262 #if CYTHON_ASSUME_SAFE_SIZE
21263 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21265 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
21268 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21270 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_L,0};
21271 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21272 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 8, __pyx_L3_error)
21273 if (__pyx_kwds_len > 0) {
21274 switch (__pyx_nargs) {
21276 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21277 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 8, __pyx_L3_error)
21278 CYTHON_FALLTHROUGH;
21280 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21281 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 8, __pyx_L3_error)
21282 CYTHON_FALLTHROUGH;
21284 default:
goto __pyx_L5_argtuple_error;
21286 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21287 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__init__", 0) < (0)) __PYX_ERR(0, 8, __pyx_L3_error)
21288 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
21289 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, i); __PYX_ERR(0, 8, __pyx_L3_error) }
21291 }
else if (unlikely(__pyx_nargs != 2)) {
21292 goto __pyx_L5_argtuple_error;
21294 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21295 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 8, __pyx_L3_error)
21296 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21297 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 8, __pyx_L3_error)
21299 __pyx_v_self = values[0];
21300 __pyx_v_L = values[1];
21302 goto __pyx_L6_skip;
21303 __pyx_L5_argtuple_error:;
21304 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 8, __pyx_L3_error)
21306 goto __pyx_L4_argument_unpacking_done;
21308 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21309 Py_XDECREF(values[__pyx_temp]);
21311 __Pyx_AddTraceback(
"csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21312 __Pyx_RefNannyFinishContext();
21314 __pyx_L4_argument_unpacking_done:;
21315 __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
21318 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21319 Py_XDECREF(values[__pyx_temp]);
21321 __Pyx_RefNannyFinishContext();
21325static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
21326 PyObject *__pyx_r = NULL;
21327 __Pyx_RefNannyDeclarations
21328 PyObject *__pyx_t_1 = NULL;
21329 PyObject *__pyx_t_2 = NULL;
21330 PyObject *__pyx_t_3 = NULL;
21331 PyObject *__pyx_t_4 = NULL;
21333 int __pyx_lineno = 0;
21334 const char *__pyx_filename = NULL;
21335 int __pyx_clineno = 0;
21336 __Pyx_RefNannySetupContext(
"__init__", 0);
21345 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_L, __pyx_v_L) < (0)) __PYX_ERR(0, 9, __pyx_L1_error)
21355 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_L);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error)
21356 __Pyx_GOTREF(__pyx_t_3);
21357 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error)
21358 __Pyx_GOTREF(__pyx_t_4);
21359 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21362 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
21363 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_10csmoothers_cASMFactor, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21364 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21365 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21366 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
21367 __Pyx_GOTREF((PyObject *)__pyx_t_1);
21369 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_cASMFactor, ((PyObject *)__pyx_t_1)) < (0)) __PYX_ERR(0, 10, __pyx_L1_error)
21370 __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
21381 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21384 __Pyx_XDECREF(__pyx_t_1);
21385 __Pyx_XDECREF(__pyx_t_2);
21386 __Pyx_XDECREF(__pyx_t_3);
21387 __Pyx_XDECREF(__pyx_t_4);
21388 __Pyx_AddTraceback(
"csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21391 __Pyx_XGIVEREF(__pyx_r);
21392 __Pyx_RefNannyFinishContext();
21405static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self,
21406#
if CYTHON_VECTORCALL_TPNEW
21407PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21409PyObject *__pyx_args, PyObject *__pyx_kwds
21412static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self,
21413#
if CYTHON_VECTORCALL_TPNEW
21414PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21416PyObject *__pyx_args, PyObject *__pyx_kwds
21419 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
21420 #if !CYTHON_VECTORCALL_TPNEW
21421 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21423 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21424 PyObject* values[1] = {0};
21425 int __pyx_lineno = 0;
21426 const char *__pyx_filename = NULL;
21427 int __pyx_clineno = 0;
21429 __Pyx_RefNannyDeclarations
21430 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
21431 #if !CYTHON_VECTORCALL_TPNEW
21432 #if CYTHON_ASSUME_SAFE_SIZE
21433 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21435 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
21438 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
21440 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_L,0};
21441 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
21442 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 14, __pyx_L3_error)
21443 if (__pyx_kwds_len > 0) {
21444 switch (__pyx_nargs) {
21446 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
21447 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 14, __pyx_L3_error)
21448 CYTHON_FALLTHROUGH;
21450 default:
goto __pyx_L5_argtuple_error;
21452 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21453 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__cinit__", 0) < (0)) __PYX_ERR(0, 14, __pyx_L3_error)
21454 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
21455 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 1, 1, i); __PYX_ERR(0, 14, __pyx_L3_error) }
21457 }
else if (unlikely(__pyx_nargs != 1)) {
21458 goto __pyx_L5_argtuple_error;
21460 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
21461 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 14, __pyx_L3_error)
21463 __pyx_v_L = ((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
21465 goto __pyx_L6_skip;
21466 __pyx_L5_argtuple_error:;
21467 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 14, __pyx_L3_error)
21469 goto __pyx_L4_argument_unpacking_done;
21471 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21472 Py_XDECREF(values[__pyx_temp]);
21474 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21475 __Pyx_RefNannyFinishContext();
21477 __pyx_L4_argument_unpacking_done:;
21478 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1,
"L", 0))) __PYX_ERR(0, 15, __pyx_L1_error)
21479 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
21485 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21486 Py_XDECREF(values[__pyx_temp]);
21488 goto __pyx_L7_cleaned_up;
21490 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21491 Py_XDECREF(values[__pyx_temp]);
21493 __pyx_L7_cleaned_up:;
21494 __Pyx_RefNannyFinishContext();
21498static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
21500 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
21502 __Pyx_RefNannyDeclarations
21503 PyObject *__pyx_t_1 = NULL;
21506 int __pyx_lineno = 0;
21507 const char *__pyx_filename = NULL;
21508 int __pyx_clineno = 0;
21509 __Pyx_RefNannySetupContext(
"__cinit__", 0);
21527 __pyx_v_AS.Stype = SLU_NR;
21536 __pyx_v_AS.Dtype = SLU_D;
21545 __pyx_v_AS.Mtype = SLU_GE;
21554 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
21555 __Pyx_GOTREF(__pyx_t_1);
21556 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
21557 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21558 __pyx_v_AS.nrow = __pyx_t_2;
21567 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
21568 __Pyx_GOTREF(__pyx_t_1);
21569 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L1_error)
21570 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21571 __pyx_v_AS.ncol = __pyx_t_2;
21580 __pyx_v_AS.Store = (&__pyx_v_L->A);
21589 __pyx_v_rval =
asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
21598 #ifndef CYTHON_WITHOUT_ASSERTIONS
21599 if (unlikely(__pyx_assertions_enabled())) {
21600 __pyx_t_3 = (__pyx_v_rval == 0);
21602 if (unlikely(!__pyx_t_3)) {
21603 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
21604 __PYX_ERR(0, 31, __pyx_L1_error)
21609 if ((1));
else __PYX_ERR(0, 31, __pyx_L1_error)
21624 __Pyx_XDECREF(__pyx_t_1);
21625 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21631 __Pyx_RefNannyFinishContext();
21644static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self);
21645static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
21646 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21647 __Pyx_RefNannyDeclarations
21648 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
21649 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
21650 __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
21653 __Pyx_RefNannyFinishContext();
21656static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
21665 asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
21686static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self,
21687#
if CYTHON_VECTORCALL
21688PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21690PyObject *__pyx_args, PyObject *__pyx_kwds
21693static PyMethodDef __pyx_mdef_10csmoothers_10cASMFactor_5__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21694static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self,
21695#
if CYTHON_VECTORCALL
21696PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21698PyObject *__pyx_args, PyObject *__pyx_kwds
21701 #if !CYTHON_VECTORCALL
21702 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21704 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21705 PyObject *__pyx_r = 0;
21706 __Pyx_RefNannyDeclarations
21707 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
21708 #if !CYTHON_VECTORCALL
21709 #if CYTHON_ASSUME_SAFE_SIZE
21710 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21712 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
21715 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21716 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
21717 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21718 if (unlikely(__pyx_kwds_len < 0))
return NULL;
21719 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
21720 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
21723 __Pyx_RefNannyFinishContext();
21727static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
21728 PyObject *__pyx_r = NULL;
21729 __Pyx_RefNannyDeclarations
21730 int __pyx_lineno = 0;
21731 const char *__pyx_filename = NULL;
21732 int __pyx_clineno = 0;
21733 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
21741 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
21742 __PYX_ERR(1, 2, __pyx_L1_error)
21752 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21754 __Pyx_XGIVEREF(__pyx_r);
21755 __Pyx_RefNannyFinishContext();
21767static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self,
21768#
if CYTHON_VECTORCALL
21769PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21771PyObject *__pyx_args, PyObject *__pyx_kwds
21774static PyMethodDef __pyx_mdef_10csmoothers_10cASMFactor_7__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21775static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self,
21776#
if CYTHON_VECTORCALL
21777PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21779PyObject *__pyx_args, PyObject *__pyx_kwds
21782 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
21783 #if !CYTHON_VECTORCALL
21784 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21786 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21787 PyObject* values[1] = {0};
21788 int __pyx_lineno = 0;
21789 const char *__pyx_filename = NULL;
21790 int __pyx_clineno = 0;
21791 PyObject *__pyx_r = 0;
21792 __Pyx_RefNannyDeclarations
21793 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
21794 #if !CYTHON_VECTORCALL
21795 #if CYTHON_ASSUME_SAFE_SIZE
21796 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21798 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
21801 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21803 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
21804 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21805 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
21806 if (__pyx_kwds_len > 0) {
21807 switch (__pyx_nargs) {
21809 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21810 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __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,
"__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
21817 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
21818 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
21820 }
else if (unlikely(__pyx_nargs != 1)) {
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(1, 3, __pyx_L3_error)
21826 __pyx_v___pyx_state = values[0];
21828 goto __pyx_L6_skip;
21829 __pyx_L5_argtuple_error:;
21830 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
21832 goto __pyx_L4_argument_unpacking_done;
21834 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21835 Py_XDECREF(values[__pyx_temp]);
21837 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21838 __Pyx_RefNannyFinishContext();
21840 __pyx_L4_argument_unpacking_done:;
21841 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v___pyx_state);
21844 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21845 Py_XDECREF(values[__pyx_temp]);
21847 __Pyx_RefNannyFinishContext();
21851static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
21852 PyObject *__pyx_r = NULL;
21853 __Pyx_RefNannyDeclarations
21854 int __pyx_lineno = 0;
21855 const char *__pyx_filename = NULL;
21856 int __pyx_clineno = 0;
21857 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
21864 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
21865 __PYX_ERR(1, 4, __pyx_L1_error)
21876 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21878 __Pyx_XGIVEREF(__pyx_r);
21879 __Pyx_RefNannyFinishContext();
21892static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self,
21893#
if CYTHON_VECTORCALL
21894PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21896PyObject *__pyx_args, PyObject *__pyx_kwds
21899static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {
"__init__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_10BASMFactor_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21900static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self,
21901#
if CYTHON_VECTORCALL
21902PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21904PyObject *__pyx_args, PyObject *__pyx_kwds
21907 PyObject *__pyx_v_self = 0;
21908 PyObject *__pyx_v_L = 0;
21909 PyObject *__pyx_v_bs = 0;
21910 #if !CYTHON_VECTORCALL
21911 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21913 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21914 PyObject* values[3] = {0,0,0};
21915 int __pyx_lineno = 0;
21916 const char *__pyx_filename = NULL;
21917 int __pyx_clineno = 0;
21918 PyObject *__pyx_r = 0;
21919 __Pyx_RefNannyDeclarations
21920 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
21921 #if !CYTHON_VECTORCALL
21922 #if CYTHON_ASSUME_SAFE_SIZE
21923 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21925 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
21928 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21930 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_L,&__pyx_mstate_global->__pyx_n_u_bs,0};
21931 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21932 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 45, __pyx_L3_error)
21933 if (__pyx_kwds_len > 0) {
21934 switch (__pyx_nargs) {
21936 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21937 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 45, __pyx_L3_error)
21938 CYTHON_FALLTHROUGH;
21940 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21941 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 45, __pyx_L3_error)
21942 CYTHON_FALLTHROUGH;
21944 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21945 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 45, __pyx_L3_error)
21946 CYTHON_FALLTHROUGH;
21948 default:
goto __pyx_L5_argtuple_error;
21950 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21951 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__init__", 0) < (0)) __PYX_ERR(0, 45, __pyx_L3_error)
21952 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
21953 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, i); __PYX_ERR(0, 45, __pyx_L3_error) }
21955 }
else if (unlikely(__pyx_nargs != 3)) {
21956 goto __pyx_L5_argtuple_error;
21958 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21959 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 45, __pyx_L3_error)
21960 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21961 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 45, __pyx_L3_error)
21962 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21963 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 45, __pyx_L3_error)
21965 __pyx_v_self = values[0];
21966 __pyx_v_L = values[1];
21967 __pyx_v_bs = values[2];
21969 goto __pyx_L6_skip;
21970 __pyx_L5_argtuple_error:;
21971 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 45, __pyx_L3_error)
21973 goto __pyx_L4_argument_unpacking_done;
21975 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21976 Py_XDECREF(values[__pyx_temp]);
21978 __Pyx_AddTraceback(
"csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21979 __Pyx_RefNannyFinishContext();
21981 __pyx_L4_argument_unpacking_done:;
21982 __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
21985 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21986 Py_XDECREF(values[__pyx_temp]);
21988 __Pyx_RefNannyFinishContext();
21992static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
21993 PyObject *__pyx_r = NULL;
21994 __Pyx_RefNannyDeclarations
21995 PyObject *__pyx_t_1 = NULL;
21996 PyObject *__pyx_t_2 = NULL;
21997 PyObject *__pyx_t_3 = NULL;
21998 PyObject *__pyx_t_4 = NULL;
22000 int __pyx_lineno = 0;
22001 const char *__pyx_filename = NULL;
22002 int __pyx_clineno = 0;
22003 __Pyx_RefNannySetupContext(
"__init__", 0);
22012 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_L, __pyx_v_L) < (0)) __PYX_ERR(0, 46, __pyx_L1_error)
22021 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_bs, __pyx_v_bs) < (0)) __PYX_ERR(0, 47, __pyx_L1_error)
22031 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_L);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error)
22032 __Pyx_GOTREF(__pyx_t_3);
22033 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error)
22034 __Pyx_GOTREF(__pyx_t_4);
22035 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22044 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_bs);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
22045 __Pyx_GOTREF(__pyx_t_3);
22048 PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_3};
22049 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_10csmoothers_cBASMFactor, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22050 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22051 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22052 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22053 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
22054 __Pyx_GOTREF((PyObject *)__pyx_t_1);
22064 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_cBASMFactor, ((PyObject *)__pyx_t_1)) < (0)) __PYX_ERR(0, 48, __pyx_L1_error)
22065 __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
22076 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22079 __Pyx_XDECREF(__pyx_t_1);
22080 __Pyx_XDECREF(__pyx_t_2);
22081 __Pyx_XDECREF(__pyx_t_3);
22082 __Pyx_XDECREF(__pyx_t_4);
22083 __Pyx_AddTraceback(
"csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22086 __Pyx_XGIVEREF(__pyx_r);
22087 __Pyx_RefNannyFinishContext();
22100static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self,
22101#
if CYTHON_VECTORCALL_TPNEW
22102PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22104PyObject *__pyx_args, PyObject *__pyx_kwds
22107static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self,
22108#
if CYTHON_VECTORCALL_TPNEW
22109PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22111PyObject *__pyx_args, PyObject *__pyx_kwds
22114 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
22116 #if !CYTHON_VECTORCALL_TPNEW
22117 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22119 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
22120 PyObject* values[2] = {0,0};
22121 int __pyx_lineno = 0;
22122 const char *__pyx_filename = NULL;
22123 int __pyx_clineno = 0;
22125 __Pyx_RefNannyDeclarations
22126 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
22127 #if !CYTHON_VECTORCALL_TPNEW
22128 #if CYTHON_ASSUME_SAFE_SIZE
22129 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22131 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
22134 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
22136 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_L,&__pyx_mstate_global->__pyx_n_u_bs,0};
22137 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
22138 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 53, __pyx_L3_error)
22139 if (__pyx_kwds_len > 0) {
22140 switch (__pyx_nargs) {
22142 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
22143 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 53, __pyx_L3_error)
22144 CYTHON_FALLTHROUGH;
22146 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
22147 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 53, __pyx_L3_error)
22148 CYTHON_FALLTHROUGH;
22150 default:
goto __pyx_L5_argtuple_error;
22152 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22153 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__cinit__", 0) < (0)) __PYX_ERR(0, 53, __pyx_L3_error)
22154 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
22155 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, i); __PYX_ERR(0, 53, __pyx_L3_error) }
22157 }
else if (unlikely(__pyx_nargs != 2)) {
22158 goto __pyx_L5_argtuple_error;
22160 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
22161 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 53, __pyx_L3_error)
22162 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
22163 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 53, __pyx_L3_error)
22165 __pyx_v_L = ((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
22166 __pyx_v_bs = __Pyx_PyLong_As_int(values[1]);
if (unlikely((__pyx_v_bs == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error)
22168 goto __pyx_L6_skip;
22169 __pyx_L5_argtuple_error:;
22170 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 53, __pyx_L3_error)
22172 goto __pyx_L4_argument_unpacking_done;
22174 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22175 Py_XDECREF(values[__pyx_temp]);
22177 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22178 __Pyx_RefNannyFinishContext();
22180 __pyx_L4_argument_unpacking_done:;
22181 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1,
"L", 0))) __PYX_ERR(0, 54, __pyx_L1_error)
22182 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
22188 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22189 Py_XDECREF(values[__pyx_temp]);
22191 goto __pyx_L7_cleaned_up;
22193 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22194 Py_XDECREF(values[__pyx_temp]);
22196 __pyx_L7_cleaned_up:;
22198 __Pyx_RefNannyFinishContext();
22202static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L,
int __pyx_v_bs) {
22204 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
22206 __Pyx_RefNannyDeclarations
22207 PyObject *__pyx_t_1 = NULL;
22210 int __pyx_lineno = 0;
22211 const char *__pyx_filename = NULL;
22212 int __pyx_clineno = 0;
22213 __Pyx_RefNannySetupContext(
"__cinit__", 0);
22231 __pyx_v_AS.Stype = SLU_NR;
22240 __pyx_v_AS.Dtype = SLU_D;
22249 __pyx_v_AS.Mtype = SLU_GE;
22258 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
22259 __Pyx_GOTREF(__pyx_t_1);
22260 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
22261 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22262 __pyx_v_AS.nrow = __pyx_t_2;
22271 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
22272 __Pyx_GOTREF(__pyx_t_1);
22273 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error)
22274 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22275 __pyx_v_AS.ncol = __pyx_t_2;
22284 __pyx_v_AS.Store = (&__pyx_v_L->A);
22293 __pyx_v_rval =
basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
22302 #ifndef CYTHON_WITHOUT_ASSERTIONS
22303 if (unlikely(__pyx_assertions_enabled())) {
22304 __pyx_t_3 = (__pyx_v_rval == 0);
22306 if (unlikely(!__pyx_t_3)) {
22307 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
22308 __PYX_ERR(0, 73, __pyx_L1_error)
22313 if ((1));
else __PYX_ERR(0, 73, __pyx_L1_error)
22328 __Pyx_XDECREF(__pyx_t_1);
22329 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22335 __Pyx_RefNannyFinishContext();
22348static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self);
22349static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
22350 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
22351 __Pyx_RefNannyDeclarations
22352 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
22353 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
22354 __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
22357 __Pyx_RefNannyFinishContext();
22360static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
22369 basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
22390static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self,
22391#
if CYTHON_VECTORCALL
22392PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22394PyObject *__pyx_args, PyObject *__pyx_kwds
22397static PyMethodDef __pyx_mdef_10csmoothers_11cBASMFactor_5__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22398static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self,
22399#
if CYTHON_VECTORCALL
22400PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22402PyObject *__pyx_args, PyObject *__pyx_kwds
22405 #if !CYTHON_VECTORCALL
22406 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22408 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
22409 PyObject *__pyx_r = 0;
22410 __Pyx_RefNannyDeclarations
22411 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
22412 #if !CYTHON_VECTORCALL
22413 #if CYTHON_ASSUME_SAFE_SIZE
22414 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22416 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
22419 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22420 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
22421 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22422 if (unlikely(__pyx_kwds_len < 0))
return NULL;
22423 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
22424 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
22427 __Pyx_RefNannyFinishContext();
22431static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
22432 PyObject *__pyx_r = NULL;
22433 __Pyx_RefNannyDeclarations
22434 int __pyx_lineno = 0;
22435 const char *__pyx_filename = NULL;
22436 int __pyx_clineno = 0;
22437 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
22445 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
22446 __PYX_ERR(1, 2, __pyx_L1_error)
22456 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22458 __Pyx_XGIVEREF(__pyx_r);
22459 __Pyx_RefNannyFinishContext();
22471static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self,
22472#
if CYTHON_VECTORCALL
22473PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22475PyObject *__pyx_args, PyObject *__pyx_kwds
22478static PyMethodDef __pyx_mdef_10csmoothers_11cBASMFactor_7__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22479static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self,
22480#
if CYTHON_VECTORCALL
22481PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22483PyObject *__pyx_args, PyObject *__pyx_kwds
22486 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
22487 #if !CYTHON_VECTORCALL
22488 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22490 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
22491 PyObject* values[1] = {0};
22492 int __pyx_lineno = 0;
22493 const char *__pyx_filename = NULL;
22494 int __pyx_clineno = 0;
22495 PyObject *__pyx_r = 0;
22496 __Pyx_RefNannyDeclarations
22497 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
22498 #if !CYTHON_VECTORCALL
22499 #if CYTHON_ASSUME_SAFE_SIZE
22500 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22502 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
22505 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22507 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
22508 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22509 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
22510 if (__pyx_kwds_len > 0) {
22511 switch (__pyx_nargs) {
22513 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22514 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
22515 CYTHON_FALLTHROUGH;
22517 default:
goto __pyx_L5_argtuple_error;
22519 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22520 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)
22521 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
22522 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
22524 }
else if (unlikely(__pyx_nargs != 1)) {
22525 goto __pyx_L5_argtuple_error;
22527 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22528 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
22530 __pyx_v___pyx_state = values[0];
22532 goto __pyx_L6_skip;
22533 __pyx_L5_argtuple_error:;
22534 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
22536 goto __pyx_L4_argument_unpacking_done;
22538 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22539 Py_XDECREF(values[__pyx_temp]);
22541 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22542 __Pyx_RefNannyFinishContext();
22544 __pyx_L4_argument_unpacking_done:;
22545 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v___pyx_state);
22548 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22549 Py_XDECREF(values[__pyx_temp]);
22551 __Pyx_RefNannyFinishContext();
22555static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
22556 PyObject *__pyx_r = NULL;
22557 __Pyx_RefNannyDeclarations
22558 int __pyx_lineno = 0;
22559 const char *__pyx_filename = NULL;
22560 int __pyx_clineno = 0;
22561 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
22568 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
22569 __PYX_ERR(1, 4, __pyx_L1_error)
22580 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22582 __Pyx_XGIVEREF(__pyx_r);
22583 __Pyx_RefNannyFinishContext();
22596static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self,
22597#
if CYTHON_VECTORCALL
22598PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22600PyObject *__pyx_args, PyObject *__pyx_kwds
22603PyDoc_STRVAR(__pyx_doc_10csmoothers_jacobi_NR_prepare,
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ");
22604static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {
"jacobi_NR_prepare", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_1jacobi_NR_prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
22605static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self,
22606#
if CYTHON_VECTORCALL
22607PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22609PyObject *__pyx_args, PyObject *__pyx_kwds
22612 PyObject *__pyx_v_A = 0;
22613 PyObject *__pyx_v_w = 0;
22614 PyObject *__pyx_v_tol = 0;
22615 PyObject *__pyx_v_M = 0;
22616 #if !CYTHON_VECTORCALL
22617 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22619 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
22620 PyObject* values[4] = {0,0,0,0};
22621 int __pyx_lineno = 0;
22622 const char *__pyx_filename = NULL;
22623 int __pyx_clineno = 0;
22624 PyObject *__pyx_r = 0;
22625 __Pyx_RefNannyDeclarations
22626 __Pyx_RefNannySetupContext(
"jacobi_NR_prepare (wrapper)", 0);
22627 #if !CYTHON_VECTORCALL
22628 #if CYTHON_ASSUME_SAFE_SIZE
22629 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22631 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
22634 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22636 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_M,0};
22637 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22638 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
22639 if (__pyx_kwds_len > 0) {
22640 switch (__pyx_nargs) {
22642 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22643 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 85, __pyx_L3_error)
22644 CYTHON_FALLTHROUGH;
22646 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22647 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 85, __pyx_L3_error)
22648 CYTHON_FALLTHROUGH;
22650 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22651 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 85, __pyx_L3_error)
22652 CYTHON_FALLTHROUGH;
22654 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22655 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 85, __pyx_L3_error)
22656 CYTHON_FALLTHROUGH;
22658 default:
goto __pyx_L5_argtuple_error;
22660 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22661 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"jacobi_NR_prepare", 0) < (0)) __PYX_ERR(0, 85, __pyx_L3_error)
22662 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
22663 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, i); __PYX_ERR(0, 85, __pyx_L3_error) }
22665 }
else if (unlikely(__pyx_nargs != 4)) {
22666 goto __pyx_L5_argtuple_error;
22668 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22669 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 85, __pyx_L3_error)
22670 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22671 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 85, __pyx_L3_error)
22672 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22673 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 85, __pyx_L3_error)
22674 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22675 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 85, __pyx_L3_error)
22677 __pyx_v_A = values[0];
22678 __pyx_v_w = values[1];
22679 __pyx_v_tol = values[2];
22680 __pyx_v_M = values[3];
22682 goto __pyx_L6_skip;
22683 __pyx_L5_argtuple_error:;
22684 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 85, __pyx_L3_error)
22686 goto __pyx_L4_argument_unpacking_done;
22688 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22689 Py_XDECREF(values[__pyx_temp]);
22691 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
22692 __Pyx_RefNannyFinishContext();
22694 __pyx_L4_argument_unpacking_done:;
22695 __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
22698 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22699 Py_XDECREF(values[__pyx_temp]);
22701 __Pyx_RefNannyFinishContext();
22705static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
22706 PyObject *__pyx_r = NULL;
22707 __Pyx_RefNannyDeclarations
22708 PyObject *__pyx_t_1 = NULL;
22711 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
22712 int __pyx_lineno = 0;
22713 const char *__pyx_filename = NULL;
22714 int __pyx_clineno = 0;
22715 __Pyx_RefNannySetupContext(
"jacobi_NR_prepare", 0);
22724 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
22725 __Pyx_GOTREF(__pyx_t_1);
22726 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 95, __pyx_L1_error)
22727 __pyx_t_2 = __Pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error)
22728 __pyx_t_3 = __Pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error)
22729 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 95, __pyx_L1_error)
22730 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error)
22731 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22734 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;
22745 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22748 __Pyx_XDECREF(__pyx_t_1);
22749 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
22750 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
22753 __Pyx_XGIVEREF(__pyx_r);
22754 __Pyx_RefNannyFinishContext();
22766static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
22767 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
22768 __Pyx_RefNannyDeclarations
22769 PyObject *__pyx_t_1 = NULL;
22771 Py_ssize_t __pyx_t_3;
22772 int __pyx_lineno = 0;
22773 const char *__pyx_filename = NULL;
22774 int __pyx_clineno = 0;
22775 __Pyx_RefNannySetupContext(
"smootherWrappersjacobi_NR_prepare", 0);
22784 __pyx_v_AS.Stype = SLU_NR;
22793 __pyx_v_AS.Dtype = SLU_D;
22802 __pyx_v_AS.Mtype = SLU_GE;
22811 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
22812 __Pyx_GOTREF(__pyx_t_1);
22813 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
22814 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22815 __pyx_v_AS.nrow = __pyx_t_2;
22824 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
22825 __Pyx_GOTREF(__pyx_t_1);
22826 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L1_error)
22827 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22828 __pyx_v_AS.ncol = __pyx_t_2;
22837 __pyx_v_AS.Store = (&__pyx_v_sm->A);
22848 if (__pyx_t_3 < 0) {
22849 __pyx_t_3 += __pyx_v_M.shape[0];
22850 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
22851 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
22852 if (unlikely(__pyx_t_2 != -1)) {
22853 __Pyx_RaiseBufferIndexError(__pyx_t_2);
22854 __PYX_ERR(0, 108, __pyx_L1_error)
22856 jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
22869 __Pyx_XDECREF(__pyx_t_1);
22870 __Pyx_AddTraceback(
"csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
22874 __Pyx_RefNannyFinishContext();
22886static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self,
22887#
if CYTHON_VECTORCALL
22888PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22890PyObject *__pyx_args, PyObject *__pyx_kwds
22893PyDoc_STRVAR(__pyx_doc_10csmoothers_2jacobi_NR_solve,
"\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ");
22894static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {
"jacobi_NR_solve", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_3jacobi_NR_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
22895static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self,
22896#
if CYTHON_VECTORCALL
22897PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22899PyObject *__pyx_args, PyObject *__pyx_kwds
22902 PyObject *__pyx_v_A = 0;
22903 PyObject *__pyx_v_M = 0;
22904 PyObject *__pyx_v_R = 0;
22905 PyObject *__pyx_v_node_order = 0;
22906 PyObject *__pyx_v_dX = 0;
22907 #if !CYTHON_VECTORCALL
22908 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22910 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
22911 PyObject* values[5] = {0,0,0,0,0};
22912 int __pyx_lineno = 0;
22913 const char *__pyx_filename = NULL;
22914 int __pyx_clineno = 0;
22915 PyObject *__pyx_r = 0;
22916 __Pyx_RefNannyDeclarations
22917 __Pyx_RefNannySetupContext(
"jacobi_NR_solve (wrapper)", 0);
22918 #if !CYTHON_VECTORCALL
22919 #if CYTHON_ASSUME_SAFE_SIZE
22920 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22922 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
22925 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22927 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_M,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_node_order,&__pyx_mstate_global->__pyx_n_u_dX,0};
22928 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22929 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 110, __pyx_L3_error)
22930 if (__pyx_kwds_len > 0) {
22931 switch (__pyx_nargs) {
22933 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
22934 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 110, __pyx_L3_error)
22935 CYTHON_FALLTHROUGH;
22937 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22938 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 110, __pyx_L3_error)
22939 CYTHON_FALLTHROUGH;
22941 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22942 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 110, __pyx_L3_error)
22943 CYTHON_FALLTHROUGH;
22945 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22946 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 110, __pyx_L3_error)
22947 CYTHON_FALLTHROUGH;
22949 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22950 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 110, __pyx_L3_error)
22951 CYTHON_FALLTHROUGH;
22953 default:
goto __pyx_L5_argtuple_error;
22955 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22956 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"jacobi_NR_solve", 0) < (0)) __PYX_ERR(0, 110, __pyx_L3_error)
22957 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
22958 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, i); __PYX_ERR(0, 110, __pyx_L3_error) }
22960 }
else if (unlikely(__pyx_nargs != 5)) {
22961 goto __pyx_L5_argtuple_error;
22963 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22964 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 110, __pyx_L3_error)
22965 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22966 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 110, __pyx_L3_error)
22967 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22968 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 110, __pyx_L3_error)
22969 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22970 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 110, __pyx_L3_error)
22971 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
22972 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 110, __pyx_L3_error)
22974 __pyx_v_A = values[0];
22975 __pyx_v_M = values[1];
22976 __pyx_v_R = values[2];
22977 __pyx_v_node_order = values[3];
22978 __pyx_v_dX = values[4];
22980 goto __pyx_L6_skip;
22981 __pyx_L5_argtuple_error:;
22982 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 110, __pyx_L3_error)
22984 goto __pyx_L4_argument_unpacking_done;
22986 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22987 Py_XDECREF(values[__pyx_temp]);
22989 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
22990 __Pyx_RefNannyFinishContext();
22992 __pyx_L4_argument_unpacking_done:;
22993 __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
22996 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22997 Py_XDECREF(values[__pyx_temp]);
22999 __Pyx_RefNannyFinishContext();
23003static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
23004 PyObject *__pyx_r = NULL;
23005 __Pyx_RefNannyDeclarations
23006 PyObject *__pyx_t_1 = NULL;
23007 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
23008 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
23009 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
23010 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
23011 int __pyx_lineno = 0;
23012 const char *__pyx_filename = NULL;
23013 int __pyx_clineno = 0;
23014 __Pyx_RefNannySetupContext(
"jacobi_NR_solve", 0);
23023 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
23024 __Pyx_GOTREF(__pyx_t_1);
23025 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 121, __pyx_L1_error)
23026 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 121, __pyx_L1_error)
23027 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 121, __pyx_L1_error)
23028 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 121, __pyx_L1_error)
23029 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 121, __pyx_L1_error)
23030 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error)
23031 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23032 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);; __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
23033 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL;
23034 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;
23035 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
23046 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23049 __Pyx_XDECREF(__pyx_t_1);
23050 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
23051 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
23052 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
23053 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
23054 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
23057 __Pyx_XGIVEREF(__pyx_r);
23058 __Pyx_RefNannyFinishContext();
23070static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
23071 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
23072 __Pyx_RefNannyDeclarations
23073 PyObject *__pyx_t_1 = NULL;
23075 Py_ssize_t __pyx_t_3;
23076 Py_ssize_t __pyx_t_4;
23077 Py_ssize_t __pyx_t_5;
23078 Py_ssize_t __pyx_t_6;
23079 int __pyx_lineno = 0;
23080 const char *__pyx_filename = NULL;
23081 int __pyx_clineno = 0;
23082 __Pyx_RefNannySetupContext(
"smootherWrappersjacobi_NR_solve", 0);
23091 __pyx_v_AS.Stype = SLU_NR;
23100 __pyx_v_AS.Dtype = SLU_D;
23109 __pyx_v_AS.Mtype = SLU_GE;
23118 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
23119 __Pyx_GOTREF(__pyx_t_1);
23120 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
23121 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23122 __pyx_v_AS.nrow = __pyx_t_2;
23131 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
23132 __Pyx_GOTREF(__pyx_t_1);
23133 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L1_error)
23134 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23135 __pyx_v_AS.ncol = __pyx_t_2;
23144 __pyx_v_AS.Store = (&__pyx_v_sm->A);
23155 if (__pyx_t_3 < 0) {
23156 __pyx_t_3 += __pyx_v_M.shape[0];
23157 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
23158 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
23159 if (unlikely(__pyx_t_2 != -1)) {
23160 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23161 __PYX_ERR(0, 135, __pyx_L1_error)
23165 if (__pyx_t_4 < 0) {
23166 __pyx_t_4 += __pyx_v_R.shape[0];
23167 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
23168 }
else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
23169 if (unlikely(__pyx_t_2 != -1)) {
23170 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23171 __PYX_ERR(0, 135, __pyx_L1_error)
23175 if (__pyx_t_5 < 0) {
23176 __pyx_t_5 += __pyx_v_node_order.shape[0];
23177 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
23178 }
else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
23179 if (unlikely(__pyx_t_2 != -1)) {
23180 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23181 __PYX_ERR(0, 135, __pyx_L1_error)
23185 if (__pyx_t_6 < 0) {
23186 __pyx_t_6 += __pyx_v_dX.shape[0];
23187 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
23188 }
else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
23189 if (unlikely(__pyx_t_2 != -1)) {
23190 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23191 __PYX_ERR(0, 135, __pyx_L1_error)
23193 jacobi_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
23206 __Pyx_XDECREF(__pyx_t_1);
23207 __Pyx_AddTraceback(
"csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
23211 __Pyx_RefNannyFinishContext();
23223static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self,
23224#
if CYTHON_VECTORCALL
23225PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23227PyObject *__pyx_args, PyObject *__pyx_kwds
23230PyDoc_STRVAR(__pyx_doc_10csmoothers_4nl_jacobi_NR_solve,
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ");
23231static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {
"nl_jacobi_NR_solve", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
23232static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self,
23233#
if CYTHON_VECTORCALL
23234PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23236PyObject *__pyx_args, PyObject *__pyx_kwds
23239 PyObject *__pyx_v_A = 0;
23240 PyObject *__pyx_v_R = 0;
23241 PyObject *__pyx_v_node_order = 0;
23242 PyObject *__pyx_v_w = 0;
23243 PyObject *__pyx_v_tol = 0;
23244 PyObject *__pyx_v_dX = 0;
23245 #if !CYTHON_VECTORCALL
23246 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23248 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
23249 PyObject* values[6] = {0,0,0,0,0,0};
23250 int __pyx_lineno = 0;
23251 const char *__pyx_filename = NULL;
23252 int __pyx_clineno = 0;
23253 PyObject *__pyx_r = 0;
23254 __Pyx_RefNannyDeclarations
23255 __Pyx_RefNannySetupContext(
"nl_jacobi_NR_solve (wrapper)", 0);
23256 #if !CYTHON_VECTORCALL
23257 #if CYTHON_ASSUME_SAFE_SIZE
23258 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23260 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
23263 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23265 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_node_order,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_dX,0};
23266 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
23267 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 137, __pyx_L3_error)
23268 if (__pyx_kwds_len > 0) {
23269 switch (__pyx_nargs) {
23271 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
23272 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 137, __pyx_L3_error)
23273 CYTHON_FALLTHROUGH;
23275 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
23276 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 137, __pyx_L3_error)
23277 CYTHON_FALLTHROUGH;
23279 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23280 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 137, __pyx_L3_error)
23281 CYTHON_FALLTHROUGH;
23283 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23284 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 137, __pyx_L3_error)
23285 CYTHON_FALLTHROUGH;
23287 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23288 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 137, __pyx_L3_error)
23289 CYTHON_FALLTHROUGH;
23291 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23292 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 137, __pyx_L3_error)
23293 CYTHON_FALLTHROUGH;
23295 default:
goto __pyx_L5_argtuple_error;
23297 const Py_ssize_t kwd_pos_args = __pyx_nargs;
23298 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"nl_jacobi_NR_solve", 0) < (0)) __PYX_ERR(0, 137, __pyx_L3_error)
23299 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
23300 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, i); __PYX_ERR(0, 137, __pyx_L3_error) }
23302 }
else if (unlikely(__pyx_nargs != 6)) {
23303 goto __pyx_L5_argtuple_error;
23305 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23306 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 137, __pyx_L3_error)
23307 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23308 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 137, __pyx_L3_error)
23309 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23310 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 137, __pyx_L3_error)
23311 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23312 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 137, __pyx_L3_error)
23313 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
23314 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 137, __pyx_L3_error)
23315 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
23316 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 137, __pyx_L3_error)
23318 __pyx_v_A = values[0];
23319 __pyx_v_R = values[1];
23320 __pyx_v_node_order = values[2];
23321 __pyx_v_w = values[3];
23322 __pyx_v_tol = values[4];
23323 __pyx_v_dX = values[5];
23325 goto __pyx_L6_skip;
23326 __pyx_L5_argtuple_error:;
23327 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 137, __pyx_L3_error)
23329 goto __pyx_L4_argument_unpacking_done;
23331 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
23332 Py_XDECREF(values[__pyx_temp]);
23334 __Pyx_AddTraceback(
"csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
23335 __Pyx_RefNannyFinishContext();
23337 __pyx_L4_argument_unpacking_done:;
23338 __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
23341 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
23342 Py_XDECREF(values[__pyx_temp]);
23344 __Pyx_RefNannyFinishContext();
23348static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
23349 PyObject *__pyx_r = NULL;
23350 __Pyx_RefNannyDeclarations
23351 PyObject *__pyx_t_1 = NULL;
23352 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
23353 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
23356 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
23357 int __pyx_lineno = 0;
23358 const char *__pyx_filename = NULL;
23359 int __pyx_clineno = 0;
23360 __Pyx_RefNannySetupContext(
"nl_jacobi_NR_solve", 0);
23369 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
23370 __Pyx_GOTREF(__pyx_t_1);
23371 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 149, __pyx_L1_error)
23372 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 149, __pyx_L1_error)
23373 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 149, __pyx_L1_error)
23374 __pyx_t_4 = __Pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error)
23375 __pyx_t_5 = __Pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error)
23376 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 149, __pyx_L1_error)
23377 __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error)
23378 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23379 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);; __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
23380 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL;
23383 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL;
23394 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23397 __Pyx_XDECREF(__pyx_t_1);
23398 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
23399 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
23400 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
23401 __Pyx_AddTraceback(
"csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
23404 __Pyx_XGIVEREF(__pyx_r);
23405 __Pyx_RefNannyFinishContext();
23417static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
23418 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
23419 __Pyx_RefNannyDeclarations
23420 PyObject *__pyx_t_1 = NULL;
23422 Py_ssize_t __pyx_t_3;
23423 Py_ssize_t __pyx_t_4;
23424 Py_ssize_t __pyx_t_5;
23425 int __pyx_lineno = 0;
23426 const char *__pyx_filename = NULL;
23427 int __pyx_clineno = 0;
23428 __Pyx_RefNannySetupContext(
"smootherWrappersnl_jacobi_NR_solve", 0);
23437 __pyx_v_AS.Stype = SLU_NR;
23446 __pyx_v_AS.Dtype = SLU_D;
23455 __pyx_v_AS.Mtype = SLU_GE;
23464 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
23465 __Pyx_GOTREF(__pyx_t_1);
23466 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
23467 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23468 __pyx_v_AS.nrow = __pyx_t_2;
23477 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
23478 __Pyx_GOTREF(__pyx_t_1);
23479 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
23480 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23481 __pyx_v_AS.ncol = __pyx_t_2;
23490 __pyx_v_AS.Store = (&__pyx_v_sm->A);
23501 if (__pyx_t_3 < 0) {
23502 __pyx_t_3 += __pyx_v_R.shape[0];
23503 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
23504 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
23505 if (unlikely(__pyx_t_2 != -1)) {
23506 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23507 __PYX_ERR(0, 164, __pyx_L1_error)
23511 if (__pyx_t_4 < 0) {
23512 __pyx_t_4 += __pyx_v_node_order.shape[0];
23513 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
23514 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
23515 if (unlikely(__pyx_t_2 != -1)) {
23516 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23517 __PYX_ERR(0, 164, __pyx_L1_error)
23521 if (__pyx_t_5 < 0) {
23522 __pyx_t_5 += __pyx_v_dX.shape[0];
23523 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
23524 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
23525 if (unlikely(__pyx_t_2 != -1)) {
23526 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23527 __PYX_ERR(0, 164, __pyx_L1_error)
23529 nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
23542 __Pyx_XDECREF(__pyx_t_1);
23543 __Pyx_AddTraceback(
"csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
23547 __Pyx_RefNannyFinishContext();
23559static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self,
23560#
if CYTHON_VECTORCALL
23561PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23563PyObject *__pyx_args, PyObject *__pyx_kwds
23566PyDoc_STRVAR(__pyx_doc_10csmoothers_6gauss_seidel_NR_preare,
"\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ");
23567static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {
"gauss_seidel_NR_preare", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
23568static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self,
23569#
if CYTHON_VECTORCALL
23570PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23572PyObject *__pyx_args, PyObject *__pyx_kwds
23575 PyObject *__pyx_v_A = 0;
23576 PyObject *__pyx_v_w = 0;
23577 PyObject *__pyx_v_tol = 0;
23578 PyObject *__pyx_v_M = 0;
23579 #if !CYTHON_VECTORCALL
23580 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23582 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
23583 PyObject* values[4] = {0,0,0,0};
23584 int __pyx_lineno = 0;
23585 const char *__pyx_filename = NULL;
23586 int __pyx_clineno = 0;
23587 PyObject *__pyx_r = 0;
23588 __Pyx_RefNannyDeclarations
23589 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_preare (wrapper)", 0);
23590 #if !CYTHON_VECTORCALL
23591 #if CYTHON_ASSUME_SAFE_SIZE
23592 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23594 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
23597 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23599 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_M,0};
23600 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
23601 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 166, __pyx_L3_error)
23602 if (__pyx_kwds_len > 0) {
23603 switch (__pyx_nargs) {
23605 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23606 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 166, __pyx_L3_error)
23607 CYTHON_FALLTHROUGH;
23609 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23610 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 166, __pyx_L3_error)
23611 CYTHON_FALLTHROUGH;
23613 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23614 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 166, __pyx_L3_error)
23615 CYTHON_FALLTHROUGH;
23617 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23618 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 166, __pyx_L3_error)
23619 CYTHON_FALLTHROUGH;
23621 default:
goto __pyx_L5_argtuple_error;
23623 const Py_ssize_t kwd_pos_args = __pyx_nargs;
23624 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"gauss_seidel_NR_preare", 0) < (0)) __PYX_ERR(0, 166, __pyx_L3_error)
23625 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
23626 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, i); __PYX_ERR(0, 166, __pyx_L3_error) }
23628 }
else if (unlikely(__pyx_nargs != 4)) {
23629 goto __pyx_L5_argtuple_error;
23631 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23632 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 166, __pyx_L3_error)
23633 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23634 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 166, __pyx_L3_error)
23635 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23636 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 166, __pyx_L3_error)
23637 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23638 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 166, __pyx_L3_error)
23640 __pyx_v_A = values[0];
23641 __pyx_v_w = values[1];
23642 __pyx_v_tol = values[2];
23643 __pyx_v_M = values[3];
23645 goto __pyx_L6_skip;
23646 __pyx_L5_argtuple_error:;
23647 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 166, __pyx_L3_error)
23649 goto __pyx_L4_argument_unpacking_done;
23651 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
23652 Py_XDECREF(values[__pyx_temp]);
23654 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
23655 __Pyx_RefNannyFinishContext();
23657 __pyx_L4_argument_unpacking_done:;
23658 __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
23661 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
23662 Py_XDECREF(values[__pyx_temp]);
23664 __Pyx_RefNannyFinishContext();
23668static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
23669 PyObject *__pyx_r = NULL;
23670 __Pyx_RefNannyDeclarations
23671 PyObject *__pyx_t_1 = NULL;
23674 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
23675 int __pyx_lineno = 0;
23676 const char *__pyx_filename = NULL;
23677 int __pyx_clineno = 0;
23678 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_preare", 0);
23687 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
23688 __Pyx_GOTREF(__pyx_t_1);
23689 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 176, __pyx_L1_error)
23690 __pyx_t_2 = __Pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L1_error)
23691 __pyx_t_3 = __Pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L1_error)
23692 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 176, __pyx_L1_error)
23693 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L1_error)
23694 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23697 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;
23708 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23711 __Pyx_XDECREF(__pyx_t_1);
23712 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
23713 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
23716 __Pyx_XGIVEREF(__pyx_r);
23717 __Pyx_RefNannyFinishContext();
23729static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
23730 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
23731 __Pyx_RefNannyDeclarations
23732 PyObject *__pyx_t_1 = NULL;
23734 Py_ssize_t __pyx_t_3;
23735 int __pyx_lineno = 0;
23736 const char *__pyx_filename = NULL;
23737 int __pyx_clineno = 0;
23738 __Pyx_RefNannySetupContext(
"smootherWrappersgauss_seidel_NR_prepare", 0);
23747 __pyx_v_AS.Stype = SLU_NR;
23756 __pyx_v_AS.Dtype = SLU_D;
23765 __pyx_v_AS.Mtype = SLU_GE;
23774 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
23775 __Pyx_GOTREF(__pyx_t_1);
23776 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
23777 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23778 __pyx_v_AS.nrow = __pyx_t_2;
23787 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
23788 __Pyx_GOTREF(__pyx_t_1);
23789 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L1_error)
23790 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23791 __pyx_v_AS.ncol = __pyx_t_2;
23800 __pyx_v_AS.Store = (&__pyx_v_sm->A);
23811 if (__pyx_t_3 < 0) {
23812 __pyx_t_3 += __pyx_v_M.shape[0];
23813 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
23814 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
23815 if (unlikely(__pyx_t_2 != -1)) {
23816 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23817 __PYX_ERR(0, 189, __pyx_L1_error)
23819 gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
23832 __Pyx_XDECREF(__pyx_t_1);
23833 __Pyx_AddTraceback(
"csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
23837 __Pyx_RefNannyFinishContext();
23849static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self,
23850#
if CYTHON_VECTORCALL
23851PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23853PyObject *__pyx_args, PyObject *__pyx_kwds
23856PyDoc_STRVAR(__pyx_doc_10csmoothers_8gauss_seidel_NR_solve,
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ");
23857static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {
"gauss_seidel_NR_solve", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
23858static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self,
23859#
if CYTHON_VECTORCALL
23860PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23862PyObject *__pyx_args, PyObject *__pyx_kwds
23865 PyObject *__pyx_v_A = 0;
23866 PyObject *__pyx_v_M = 0;
23867 PyObject *__pyx_v_R = 0;
23868 PyObject *__pyx_v_node_order = 0;
23869 PyObject *__pyx_v_dX = 0;
23870 #if !CYTHON_VECTORCALL
23871 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23873 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
23874 PyObject* values[5] = {0,0,0,0,0};
23875 int __pyx_lineno = 0;
23876 const char *__pyx_filename = NULL;
23877 int __pyx_clineno = 0;
23878 PyObject *__pyx_r = 0;
23879 __Pyx_RefNannyDeclarations
23880 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_solve (wrapper)", 0);
23881 #if !CYTHON_VECTORCALL
23882 #if CYTHON_ASSUME_SAFE_SIZE
23883 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23885 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
23888 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23890 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_M,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_node_order,&__pyx_mstate_global->__pyx_n_u_dX,0};
23891 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
23892 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 191, __pyx_L3_error)
23893 if (__pyx_kwds_len > 0) {
23894 switch (__pyx_nargs) {
23896 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
23897 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 191, __pyx_L3_error)
23898 CYTHON_FALLTHROUGH;
23900 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23901 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 191, __pyx_L3_error)
23902 CYTHON_FALLTHROUGH;
23904 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23905 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 191, __pyx_L3_error)
23906 CYTHON_FALLTHROUGH;
23908 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23909 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 191, __pyx_L3_error)
23910 CYTHON_FALLTHROUGH;
23912 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23913 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 191, __pyx_L3_error)
23914 CYTHON_FALLTHROUGH;
23916 default:
goto __pyx_L5_argtuple_error;
23918 const Py_ssize_t kwd_pos_args = __pyx_nargs;
23919 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"gauss_seidel_NR_solve", 0) < (0)) __PYX_ERR(0, 191, __pyx_L3_error)
23920 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
23921 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, i); __PYX_ERR(0, 191, __pyx_L3_error) }
23923 }
else if (unlikely(__pyx_nargs != 5)) {
23924 goto __pyx_L5_argtuple_error;
23926 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23927 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 191, __pyx_L3_error)
23928 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23929 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 191, __pyx_L3_error)
23930 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23931 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 191, __pyx_L3_error)
23932 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23933 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 191, __pyx_L3_error)
23934 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
23935 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 191, __pyx_L3_error)
23937 __pyx_v_A = values[0];
23938 __pyx_v_M = values[1];
23939 __pyx_v_R = values[2];
23940 __pyx_v_node_order = values[3];
23941 __pyx_v_dX = values[4];
23943 goto __pyx_L6_skip;
23944 __pyx_L5_argtuple_error:;
23945 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 191, __pyx_L3_error)
23947 goto __pyx_L4_argument_unpacking_done;
23949 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
23950 Py_XDECREF(values[__pyx_temp]);
23952 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
23953 __Pyx_RefNannyFinishContext();
23955 __pyx_L4_argument_unpacking_done:;
23956 __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
23959 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
23960 Py_XDECREF(values[__pyx_temp]);
23962 __Pyx_RefNannyFinishContext();
23966static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
23967 PyObject *__pyx_r = NULL;
23968 __Pyx_RefNannyDeclarations
23969 PyObject *__pyx_t_1 = NULL;
23970 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
23971 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
23972 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
23973 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
23974 int __pyx_lineno = 0;
23975 const char *__pyx_filename = NULL;
23976 int __pyx_clineno = 0;
23977 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_solve", 0);
23986 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
23987 __Pyx_GOTREF(__pyx_t_1);
23988 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 202, __pyx_L1_error)
23989 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 202, __pyx_L1_error)
23990 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 202, __pyx_L1_error)
23991 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 202, __pyx_L1_error)
23992 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 202, __pyx_L1_error)
23993 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error)
23994 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23995 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);; __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
23996 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL;
23997 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;
23998 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
24009 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24012 __Pyx_XDECREF(__pyx_t_1);
24013 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
24014 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
24015 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
24016 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
24017 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24020 __Pyx_XGIVEREF(__pyx_r);
24021 __Pyx_RefNannyFinishContext();
24033static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
24034 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
24035 __Pyx_RefNannyDeclarations
24036 PyObject *__pyx_t_1 = NULL;
24038 Py_ssize_t __pyx_t_3;
24039 Py_ssize_t __pyx_t_4;
24040 Py_ssize_t __pyx_t_5;
24041 Py_ssize_t __pyx_t_6;
24042 int __pyx_lineno = 0;
24043 const char *__pyx_filename = NULL;
24044 int __pyx_clineno = 0;
24045 __Pyx_RefNannySetupContext(
"smootherWrappersgauss_seidel_NR_solve", 0);
24054 __pyx_v_AS.Stype = SLU_NR;
24063 __pyx_v_AS.Dtype = SLU_D;
24072 __pyx_v_AS.Mtype = SLU_GE;
24081 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
24082 __Pyx_GOTREF(__pyx_t_1);
24083 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
24084 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24085 __pyx_v_AS.nrow = __pyx_t_2;
24094 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
24095 __Pyx_GOTREF(__pyx_t_1);
24096 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L1_error)
24097 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24098 __pyx_v_AS.ncol = __pyx_t_2;
24107 __pyx_v_AS.Store = (&__pyx_v_sm->A);
24118 if (__pyx_t_3 < 0) {
24119 __pyx_t_3 += __pyx_v_M.shape[0];
24120 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
24121 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
24122 if (unlikely(__pyx_t_2 != -1)) {
24123 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24124 __PYX_ERR(0, 216, __pyx_L1_error)
24128 if (__pyx_t_4 < 0) {
24129 __pyx_t_4 += __pyx_v_R.shape[0];
24130 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
24131 }
else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
24132 if (unlikely(__pyx_t_2 != -1)) {
24133 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24134 __PYX_ERR(0, 216, __pyx_L1_error)
24138 if (__pyx_t_5 < 0) {
24139 __pyx_t_5 += __pyx_v_node_order.shape[0];
24140 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
24141 }
else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
24142 if (unlikely(__pyx_t_2 != -1)) {
24143 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24144 __PYX_ERR(0, 216, __pyx_L1_error)
24148 if (__pyx_t_6 < 0) {
24149 __pyx_t_6 += __pyx_v_dX.shape[0];
24150 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
24151 }
else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
24152 if (unlikely(__pyx_t_2 != -1)) {
24153 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24154 __PYX_ERR(0, 216, __pyx_L1_error)
24156 gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
24169 __Pyx_XDECREF(__pyx_t_1);
24170 __Pyx_AddTraceback(
"csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24174 __Pyx_RefNannyFinishContext();
24186static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self,
24187#
if CYTHON_VECTORCALL
24188PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24190PyObject *__pyx_args, PyObject *__pyx_kwds
24193PyDoc_STRVAR(__pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve,
"\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ");
24194static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {
"nl_gauss_seidel_NR_solve", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
24195static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self,
24196#
if CYTHON_VECTORCALL
24197PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24199PyObject *__pyx_args, PyObject *__pyx_kwds
24202 PyObject *__pyx_v_A = 0;
24203 PyObject *__pyx_v_R = 0;
24204 PyObject *__pyx_v_node_order = 0;
24205 PyObject *__pyx_v_w = 0;
24206 PyObject *__pyx_v_tol = 0;
24207 PyObject *__pyx_v_dX = 0;
24208 #if !CYTHON_VECTORCALL
24209 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24211 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
24212 PyObject* values[6] = {0,0,0,0,0,0};
24213 int __pyx_lineno = 0;
24214 const char *__pyx_filename = NULL;
24215 int __pyx_clineno = 0;
24216 PyObject *__pyx_r = 0;
24217 __Pyx_RefNannyDeclarations
24218 __Pyx_RefNannySetupContext(
"nl_gauss_seidel_NR_solve (wrapper)", 0);
24219 #if !CYTHON_VECTORCALL
24220 #if CYTHON_ASSUME_SAFE_SIZE
24221 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24223 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
24226 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24228 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_node_order,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_dX,0};
24229 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24230 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 218, __pyx_L3_error)
24231 if (__pyx_kwds_len > 0) {
24232 switch (__pyx_nargs) {
24234 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24235 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 218, __pyx_L3_error)
24236 CYTHON_FALLTHROUGH;
24238 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24239 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 218, __pyx_L3_error)
24240 CYTHON_FALLTHROUGH;
24242 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24243 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 218, __pyx_L3_error)
24244 CYTHON_FALLTHROUGH;
24246 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24247 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 218, __pyx_L3_error)
24248 CYTHON_FALLTHROUGH;
24250 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24251 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 218, __pyx_L3_error)
24252 CYTHON_FALLTHROUGH;
24254 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24255 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 218, __pyx_L3_error)
24256 CYTHON_FALLTHROUGH;
24258 default:
goto __pyx_L5_argtuple_error;
24260 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24261 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"nl_gauss_seidel_NR_solve", 0) < (0)) __PYX_ERR(0, 218, __pyx_L3_error)
24262 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
24263 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, i); __PYX_ERR(0, 218, __pyx_L3_error) }
24265 }
else if (unlikely(__pyx_nargs != 6)) {
24266 goto __pyx_L5_argtuple_error;
24268 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24269 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 218, __pyx_L3_error)
24270 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24271 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 218, __pyx_L3_error)
24272 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24273 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 218, __pyx_L3_error)
24274 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24275 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 218, __pyx_L3_error)
24276 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24277 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 218, __pyx_L3_error)
24278 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24279 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 218, __pyx_L3_error)
24281 __pyx_v_A = values[0];
24282 __pyx_v_R = values[1];
24283 __pyx_v_node_order = values[2];
24284 __pyx_v_w = values[3];
24285 __pyx_v_tol = values[4];
24286 __pyx_v_dX = values[5];
24288 goto __pyx_L6_skip;
24289 __pyx_L5_argtuple_error:;
24290 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 218, __pyx_L3_error)
24292 goto __pyx_L4_argument_unpacking_done;
24294 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
24295 Py_XDECREF(values[__pyx_temp]);
24297 __Pyx_AddTraceback(
"csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24298 __Pyx_RefNannyFinishContext();
24300 __pyx_L4_argument_unpacking_done:;
24301 __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
24304 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
24305 Py_XDECREF(values[__pyx_temp]);
24307 __Pyx_RefNannyFinishContext();
24311static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
24312 PyObject *__pyx_r = NULL;
24313 __Pyx_RefNannyDeclarations
24314 PyObject *__pyx_t_1 = NULL;
24315 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
24316 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
24319 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
24320 PyObject *__pyx_t_7 = NULL;
24321 int __pyx_lineno = 0;
24322 const char *__pyx_filename = NULL;
24323 int __pyx_clineno = 0;
24324 __Pyx_RefNannySetupContext(
"nl_gauss_seidel_NR_solve", 0);
24333 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
24334 __Pyx_GOTREF(__pyx_t_1);
24335 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 230, __pyx_L1_error)
24344 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
24353 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 232, __pyx_L1_error)
24362 __pyx_t_4 = __Pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
24371 __pyx_t_5 = __Pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L1_error)
24380 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 235, __pyx_L1_error)
24389 __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 230, __pyx_L1_error)
24390 __Pyx_GOTREF(__pyx_t_7);
24391 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24392 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);; __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
24393 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL;
24396 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL;
24397 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24408 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24411 __Pyx_XDECREF(__pyx_t_1);
24412 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
24413 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
24414 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
24415 __Pyx_XDECREF(__pyx_t_7);
24416 __Pyx_AddTraceback(
"csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24419 __Pyx_XGIVEREF(__pyx_r);
24420 __Pyx_RefNannyFinishContext();
24432static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
24433 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
24434 PyObject *__pyx_r = NULL;
24435 __Pyx_RefNannyDeclarations
24436 PyObject *__pyx_t_1 = NULL;
24438 Py_ssize_t __pyx_t_3;
24439 Py_ssize_t __pyx_t_4;
24440 Py_ssize_t __pyx_t_5;
24441 int __pyx_lineno = 0;
24442 const char *__pyx_filename = NULL;
24443 int __pyx_clineno = 0;
24444 __Pyx_RefNannySetupContext(
"smootherWrappers_nl_gauss_seidel_NR_solve", 0);
24453 __pyx_v_AS.Stype = SLU_NR;
24462 __pyx_v_AS.Dtype = SLU_D;
24471 __pyx_v_AS.Mtype = SLU_GE;
24480 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
24481 __Pyx_GOTREF(__pyx_t_1);
24482 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
24483 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24484 __pyx_v_AS.nrow = __pyx_t_2;
24493 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
24494 __Pyx_GOTREF(__pyx_t_1);
24495 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L1_error)
24496 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24497 __pyx_v_AS.ncol = __pyx_t_2;
24506 __pyx_v_AS.Store = (&__pyx_v_sm->A);
24517 if (__pyx_t_3 < 0) {
24518 __pyx_t_3 += __pyx_v_R.shape[0];
24519 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
24520 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
24521 if (unlikely(__pyx_t_2 != -1)) {
24522 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24523 __PYX_ERR(0, 250, __pyx_L1_error)
24527 if (__pyx_t_4 < 0) {
24528 __pyx_t_4 += __pyx_v_node_order.shape[0];
24529 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
24530 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
24531 if (unlikely(__pyx_t_2 != -1)) {
24532 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24533 __PYX_ERR(0, 250, __pyx_L1_error)
24537 if (__pyx_t_5 < 0) {
24538 __pyx_t_5 += __pyx_v_dX.shape[0];
24539 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
24540 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
24541 if (unlikely(__pyx_t_2 != -1)) {
24542 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24543 __PYX_ERR(0, 250, __pyx_L1_error)
24545 nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
24556 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24559 __Pyx_XDECREF(__pyx_t_1);
24560 __Pyx_AddTraceback(
"csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24564 __Pyx_XGIVEREF(__pyx_r);
24565 __Pyx_RefNannyFinishContext();
24578static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self,
24579#
if CYTHON_VECTORCALL
24580PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24582PyObject *__pyx_args, PyObject *__pyx_kwds
24585PyDoc_STRVAR(__pyx_doc_10csmoothers_12asm_NR_prepare,
"\n\n Arguments\n ---------\n A :\n asmFactor :\n ");
24586static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {
"asm_NR_prepare", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_13asm_NR_prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
24587static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self,
24588#
if CYTHON_VECTORCALL
24589PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24591PyObject *__pyx_args, PyObject *__pyx_kwds
24594 PyObject *__pyx_v_A = 0;
24595 PyObject *__pyx_v_asmFactor = 0;
24596 #if !CYTHON_VECTORCALL
24597 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24599 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
24600 PyObject* values[2] = {0,0};
24601 int __pyx_lineno = 0;
24602 const char *__pyx_filename = NULL;
24603 int __pyx_clineno = 0;
24604 PyObject *__pyx_r = 0;
24605 __Pyx_RefNannyDeclarations
24606 __Pyx_RefNannySetupContext(
"asm_NR_prepare (wrapper)", 0);
24607 #if !CYTHON_VECTORCALL
24608 #if CYTHON_ASSUME_SAFE_SIZE
24609 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24611 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
24614 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24616 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_asmFactor,0};
24617 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24618 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 252, __pyx_L3_error)
24619 if (__pyx_kwds_len > 0) {
24620 switch (__pyx_nargs) {
24622 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24623 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 252, __pyx_L3_error)
24624 CYTHON_FALLTHROUGH;
24626 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24627 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 252, __pyx_L3_error)
24628 CYTHON_FALLTHROUGH;
24630 default:
goto __pyx_L5_argtuple_error;
24632 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24633 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"asm_NR_prepare", 0) < (0)) __PYX_ERR(0, 252, __pyx_L3_error)
24634 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
24635 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"asm_NR_prepare", 1, 2, 2, i); __PYX_ERR(0, 252, __pyx_L3_error) }
24637 }
else if (unlikely(__pyx_nargs != 2)) {
24638 goto __pyx_L5_argtuple_error;
24640 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24641 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 252, __pyx_L3_error)
24642 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24643 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 252, __pyx_L3_error)
24645 __pyx_v_A = values[0];
24646 __pyx_v_asmFactor = values[1];
24648 goto __pyx_L6_skip;
24649 __pyx_L5_argtuple_error:;
24650 __Pyx_RaiseArgtupleInvalid(
"asm_NR_prepare", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 252, __pyx_L3_error)
24652 goto __pyx_L4_argument_unpacking_done;
24654 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
24655 Py_XDECREF(values[__pyx_temp]);
24657 __Pyx_AddTraceback(
"csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
24658 __Pyx_RefNannyFinishContext();
24660 __pyx_L4_argument_unpacking_done:;
24661 __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
24664 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
24665 Py_XDECREF(values[__pyx_temp]);
24667 __Pyx_RefNannyFinishContext();
24671static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
24672 PyObject *__pyx_r = NULL;
24673 __Pyx_RefNannyDeclarations
24674 PyObject *__pyx_t_1 = NULL;
24675 PyObject *__pyx_t_2 = NULL;
24676 int __pyx_lineno = 0;
24677 const char *__pyx_filename = NULL;
24678 int __pyx_clineno = 0;
24679 __Pyx_RefNannySetupContext(
"asm_NR_prepare", 0);
24688 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
24689 __Pyx_GOTREF(__pyx_t_1);
24690 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 260, __pyx_L1_error)
24699 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_mstate_global->__pyx_n_u_cASMFactor);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
24700 __Pyx_GOTREF(__pyx_t_2);
24701 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 261, __pyx_L1_error)
24710 __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2));
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 260, __pyx_L1_error)
24711 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24712 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24723 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24726 __Pyx_XDECREF(__pyx_t_1);
24727 __Pyx_XDECREF(__pyx_t_2);
24728 __Pyx_AddTraceback(
"csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
24731 __Pyx_XGIVEREF(__pyx_r);
24732 __Pyx_RefNannyFinishContext();
24744static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
24745 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
24746 __Pyx_RefNannyDeclarations
24747 PyObject *__pyx_t_1 = NULL;
24749 int __pyx_lineno = 0;
24750 const char *__pyx_filename = NULL;
24751 int __pyx_clineno = 0;
24752 __Pyx_RefNannySetupContext(
"smootherWrappers_asm_NR_prepare", 0);
24761 __pyx_v_AS.Stype = SLU_NR;
24770 __pyx_v_AS.Dtype = SLU_D;
24779 __pyx_v_AS.Mtype = SLU_GE;
24788 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
24789 __Pyx_GOTREF(__pyx_t_1);
24790 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
24791 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24792 __pyx_v_AS.nrow = __pyx_t_2;
24801 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
24802 __Pyx_GOTREF(__pyx_t_1);
24803 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
24804 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24805 __pyx_v_AS.ncol = __pyx_t_2;
24814 __pyx_v_AS.Store = (&__pyx_v_sm->A);
24823 asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
24836 __Pyx_XDECREF(__pyx_t_1);
24837 __Pyx_AddTraceback(
"csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
24841 __Pyx_RefNannyFinishContext();
24853static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self,
24854#
if CYTHON_VECTORCALL
24855PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24857PyObject *__pyx_args, PyObject *__pyx_kwds
24860PyDoc_STRVAR(__pyx_doc_10csmoothers_14asm_NR_solve,
"\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ");
24861static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {
"asm_NR_solve", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_15asm_NR_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
24862static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self,
24863#
if CYTHON_VECTORCALL
24864PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24866PyObject *__pyx_args, PyObject *__pyx_kwds
24869 PyObject *__pyx_v_A = 0;
24870 PyObject *__pyx_v_w = 0;
24871 PyObject *__pyx_v_asmFactor = 0;
24872 PyObject *__pyx_v_node_order = 0;
24873 PyObject *__pyx_v_R = 0;
24874 PyObject *__pyx_v_dX = 0;
24875 #if !CYTHON_VECTORCALL
24876 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24878 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
24879 PyObject* values[6] = {0,0,0,0,0,0};
24880 int __pyx_lineno = 0;
24881 const char *__pyx_filename = NULL;
24882 int __pyx_clineno = 0;
24883 PyObject *__pyx_r = 0;
24884 __Pyx_RefNannyDeclarations
24885 __Pyx_RefNannySetupContext(
"asm_NR_solve (wrapper)", 0);
24886 #if !CYTHON_VECTORCALL
24887 #if CYTHON_ASSUME_SAFE_SIZE
24888 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24890 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
24893 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24895 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_asmFactor,&__pyx_mstate_global->__pyx_n_u_node_order,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_dX,0};
24896 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24897 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 278, __pyx_L3_error)
24898 if (__pyx_kwds_len > 0) {
24899 switch (__pyx_nargs) {
24901 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24902 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 278, __pyx_L3_error)
24903 CYTHON_FALLTHROUGH;
24905 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24906 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 278, __pyx_L3_error)
24907 CYTHON_FALLTHROUGH;
24909 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24910 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 278, __pyx_L3_error)
24911 CYTHON_FALLTHROUGH;
24913 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24914 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 278, __pyx_L3_error)
24915 CYTHON_FALLTHROUGH;
24917 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24918 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 278, __pyx_L3_error)
24919 CYTHON_FALLTHROUGH;
24921 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24922 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 278, __pyx_L3_error)
24923 CYTHON_FALLTHROUGH;
24925 default:
goto __pyx_L5_argtuple_error;
24927 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24928 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"asm_NR_solve", 0) < (0)) __PYX_ERR(0, 278, __pyx_L3_error)
24929 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
24930 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, i); __PYX_ERR(0, 278, __pyx_L3_error) }
24932 }
else if (unlikely(__pyx_nargs != 6)) {
24933 goto __pyx_L5_argtuple_error;
24935 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24936 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 278, __pyx_L3_error)
24937 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24938 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 278, __pyx_L3_error)
24939 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24940 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 278, __pyx_L3_error)
24941 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24942 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 278, __pyx_L3_error)
24943 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24944 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 278, __pyx_L3_error)
24945 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24946 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 278, __pyx_L3_error)
24948 __pyx_v_A = values[0];
24949 __pyx_v_w = values[1];
24950 __pyx_v_asmFactor = values[2];
24951 __pyx_v_node_order = values[3];
24952 __pyx_v_R = values[4];
24953 __pyx_v_dX = values[5];
24955 goto __pyx_L6_skip;
24956 __pyx_L5_argtuple_error:;
24957 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 278, __pyx_L3_error)
24959 goto __pyx_L4_argument_unpacking_done;
24961 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
24962 Py_XDECREF(values[__pyx_temp]);
24964 __Pyx_AddTraceback(
"csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24965 __Pyx_RefNannyFinishContext();
24967 __pyx_L4_argument_unpacking_done:;
24968 __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
24971 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
24972 Py_XDECREF(values[__pyx_temp]);
24974 __Pyx_RefNannyFinishContext();
24978static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
24979 PyObject *__pyx_r = NULL;
24980 __Pyx_RefNannyDeclarations
24981 PyObject *__pyx_t_1 = NULL;
24983 PyObject *__pyx_t_3 = NULL;
24984 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
24985 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
24986 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
24987 int __pyx_lineno = 0;
24988 const char *__pyx_filename = NULL;
24989 int __pyx_clineno = 0;
24990 __Pyx_RefNannySetupContext(
"asm_NR_solve", 0);
24999 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
25000 __Pyx_GOTREF(__pyx_t_1);
25001 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 290, __pyx_L1_error)
25010 __pyx_t_2 = __Pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 291, __pyx_L1_error)
25019 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_mstate_global->__pyx_n_u_cASMFactor);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
25020 __Pyx_GOTREF(__pyx_t_3);
25021 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 292, __pyx_L1_error)
25030 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
25039 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
25048 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 295, __pyx_L1_error)
25057 __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
25058 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25060 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25061 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;
25062 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
25063 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL;
25074 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25077 __Pyx_XDECREF(__pyx_t_1);
25078 __Pyx_XDECREF(__pyx_t_3);
25079 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
25080 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
25081 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
25082 __Pyx_AddTraceback(
"csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
25085 __Pyx_XGIVEREF(__pyx_r);
25086 __Pyx_RefNannyFinishContext();
25098static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
25099 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
25100 __Pyx_RefNannyDeclarations
25101 PyObject *__pyx_t_1 = NULL;
25103 Py_ssize_t __pyx_t_3;
25104 Py_ssize_t __pyx_t_4;
25105 Py_ssize_t __pyx_t_5;
25106 int __pyx_lineno = 0;
25107 const char *__pyx_filename = NULL;
25108 int __pyx_clineno = 0;
25109 __Pyx_RefNannySetupContext(
"smootherWrappers_asm_NR_solve", 0);
25118 __pyx_v_AS.Stype = SLU_NR;
25127 __pyx_v_AS.Dtype = SLU_D;
25136 __pyx_v_AS.Mtype = SLU_GE;
25145 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
25146 __Pyx_GOTREF(__pyx_t_1);
25147 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
25148 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25149 __pyx_v_AS.nrow = __pyx_t_2;
25158 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
25159 __Pyx_GOTREF(__pyx_t_1);
25160 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L1_error)
25161 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25162 __pyx_v_AS.ncol = __pyx_t_2;
25171 __pyx_v_AS.Store = (&__pyx_v_sm->A);
25182 if (__pyx_t_3 < 0) {
25183 __pyx_t_3 += __pyx_v_R.shape[0];
25184 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
25185 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
25186 if (unlikely(__pyx_t_2 != -1)) {
25187 __Pyx_RaiseBufferIndexError(__pyx_t_2);
25188 __PYX_ERR(0, 315, __pyx_L1_error)
25200 if (__pyx_t_4 < 0) {
25201 __pyx_t_4 += __pyx_v_node_order.shape[0];
25202 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
25203 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
25204 if (unlikely(__pyx_t_2 != -1)) {
25205 __Pyx_RaiseBufferIndexError(__pyx_t_2);
25206 __PYX_ERR(0, 317, __pyx_L1_error)
25218 if (__pyx_t_5 < 0) {
25219 __pyx_t_5 += __pyx_v_dX.shape[0];
25220 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
25221 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
25222 if (unlikely(__pyx_t_2 != -1)) {
25223 __Pyx_RaiseBufferIndexError(__pyx_t_2);
25224 __PYX_ERR(0, 319, __pyx_L1_error)
25234 asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
25247 __Pyx_XDECREF(__pyx_t_1);
25248 __Pyx_AddTraceback(
"csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
25252 __Pyx_RefNannyFinishContext();
25264static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self,
25265#
if CYTHON_VECTORCALL
25266PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25268PyObject *__pyx_args, PyObject *__pyx_kwds
25271PyDoc_STRVAR(__pyx_doc_10csmoothers_16basm_NR_prepare,
"\n\n Arguments\n ---------\n A :\n basmFactor :\n ");
25272static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {
"basm_NR_prepare", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_17basm_NR_prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
25273static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self,
25274#
if CYTHON_VECTORCALL
25275PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25277PyObject *__pyx_args, PyObject *__pyx_kwds
25280 PyObject *__pyx_v_A = 0;
25281 PyObject *__pyx_v_basmFactor = 0;
25282 #if !CYTHON_VECTORCALL
25283 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
25285 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
25286 PyObject* values[2] = {0,0};
25287 int __pyx_lineno = 0;
25288 const char *__pyx_filename = NULL;
25289 int __pyx_clineno = 0;
25290 PyObject *__pyx_r = 0;
25291 __Pyx_RefNannyDeclarations
25292 __Pyx_RefNannySetupContext(
"basm_NR_prepare (wrapper)", 0);
25293 #if !CYTHON_VECTORCALL
25294 #if CYTHON_ASSUME_SAFE_SIZE
25295 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
25297 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
25300 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
25302 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_basmFactor,0};
25303 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
25304 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 322, __pyx_L3_error)
25305 if (__pyx_kwds_len > 0) {
25306 switch (__pyx_nargs) {
25308 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25309 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 322, __pyx_L3_error)
25310 CYTHON_FALLTHROUGH;
25312 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25313 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 322, __pyx_L3_error)
25314 CYTHON_FALLTHROUGH;
25316 default:
goto __pyx_L5_argtuple_error;
25318 const Py_ssize_t kwd_pos_args = __pyx_nargs;
25319 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"basm_NR_prepare", 0) < (0)) __PYX_ERR(0, 322, __pyx_L3_error)
25320 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
25321 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"basm_NR_prepare", 1, 2, 2, i); __PYX_ERR(0, 322, __pyx_L3_error) }
25323 }
else if (unlikely(__pyx_nargs != 2)) {
25324 goto __pyx_L5_argtuple_error;
25326 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25327 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 322, __pyx_L3_error)
25328 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25329 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 322, __pyx_L3_error)
25331 __pyx_v_A = values[0];
25332 __pyx_v_basmFactor = values[1];
25334 goto __pyx_L6_skip;
25335 __pyx_L5_argtuple_error:;
25336 __Pyx_RaiseArgtupleInvalid(
"basm_NR_prepare", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 322, __pyx_L3_error)
25338 goto __pyx_L4_argument_unpacking_done;
25340 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
25341 Py_XDECREF(values[__pyx_temp]);
25343 __Pyx_AddTraceback(
"csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
25344 __Pyx_RefNannyFinishContext();
25346 __pyx_L4_argument_unpacking_done:;
25347 __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
25350 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
25351 Py_XDECREF(values[__pyx_temp]);
25353 __Pyx_RefNannyFinishContext();
25357static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
25358 PyObject *__pyx_r = NULL;
25359 __Pyx_RefNannyDeclarations
25360 PyObject *__pyx_t_1 = NULL;
25361 PyObject *__pyx_t_2 = NULL;
25362 int __pyx_lineno = 0;
25363 const char *__pyx_filename = NULL;
25364 int __pyx_clineno = 0;
25365 __Pyx_RefNannySetupContext(
"basm_NR_prepare", 0);
25374 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
25375 __Pyx_GOTREF(__pyx_t_1);
25376 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 330, __pyx_L1_error)
25385 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_mstate_global->__pyx_n_u_cBASMFactor);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
25386 __Pyx_GOTREF(__pyx_t_2);
25387 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 331, __pyx_L1_error)
25396 __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_2));
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L1_error)
25397 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25398 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25409 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25412 __Pyx_XDECREF(__pyx_t_1);
25413 __Pyx_XDECREF(__pyx_t_2);
25414 __Pyx_AddTraceback(
"csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
25417 __Pyx_XGIVEREF(__pyx_r);
25418 __Pyx_RefNannyFinishContext();
25430static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor) {
25431 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
25432 __Pyx_RefNannyDeclarations
25433 PyObject *__pyx_t_1 = NULL;
25435 int __pyx_lineno = 0;
25436 const char *__pyx_filename = NULL;
25437 int __pyx_clineno = 0;
25438 __Pyx_RefNannySetupContext(
"smootherWrappers_basm_NR_prepare", 0);
25447 __pyx_v_AS.Dtype = SLU_D;
25456 __pyx_v_AS.Mtype = SLU_GE;
25465 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
25466 __Pyx_GOTREF(__pyx_t_1);
25467 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
25468 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25469 __pyx_v_AS.nrow = __pyx_t_2;
25478 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
25479 __Pyx_GOTREF(__pyx_t_1);
25480 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L1_error)
25481 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25482 __pyx_v_AS.ncol = __pyx_t_2;
25491 __pyx_v_AS.Store = (&__pyx_v_sm->A);
25500 basm_NR_prepare(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
25513 __Pyx_XDECREF(__pyx_t_1);
25514 __Pyx_AddTraceback(
"csmoothers.smootherWrappers_basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
25518 __Pyx_RefNannyFinishContext();
25530static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self,
25531#
if CYTHON_VECTORCALL
25532PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25534PyObject *__pyx_args, PyObject *__pyx_kwds
25537PyDoc_STRVAR(__pyx_doc_10csmoothers_18basm_NR_solve,
"\n \n Arguments\n ---------\n A :\n w :\n basmFactor :\n node_order :\n R :\n dX :\n ");
25538static PyMethodDef __pyx_mdef_10csmoothers_19basm_NR_solve = {
"basm_NR_solve", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_19basm_NR_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_18basm_NR_solve};
25539static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self,
25540#
if CYTHON_VECTORCALL
25541PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25543PyObject *__pyx_args, PyObject *__pyx_kwds
25546 PyObject *__pyx_v_A = 0;
25547 PyObject *__pyx_v_w = 0;
25548 PyObject *__pyx_v_basmFactor = 0;
25549 PyObject *__pyx_v_node_order = 0;
25550 PyObject *__pyx_v_R = 0;
25551 PyObject *__pyx_v_dX = 0;
25552 #if !CYTHON_VECTORCALL
25553 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
25555 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
25556 PyObject* values[6] = {0,0,0,0,0,0};
25557 int __pyx_lineno = 0;
25558 const char *__pyx_filename = NULL;
25559 int __pyx_clineno = 0;
25560 PyObject *__pyx_r = 0;
25561 __Pyx_RefNannyDeclarations
25562 __Pyx_RefNannySetupContext(
"basm_NR_solve (wrapper)", 0);
25563 #if !CYTHON_VECTORCALL
25564 #if CYTHON_ASSUME_SAFE_SIZE
25565 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
25567 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
25570 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
25572 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_basmFactor,&__pyx_mstate_global->__pyx_n_u_node_order,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_dX,0};
25573 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
25574 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 351, __pyx_L3_error)
25575 if (__pyx_kwds_len > 0) {
25576 switch (__pyx_nargs) {
25578 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
25579 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 351, __pyx_L3_error)
25580 CYTHON_FALLTHROUGH;
25582 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
25583 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 351, __pyx_L3_error)
25584 CYTHON_FALLTHROUGH;
25586 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
25587 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 351, __pyx_L3_error)
25588 CYTHON_FALLTHROUGH;
25590 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25591 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 351, __pyx_L3_error)
25592 CYTHON_FALLTHROUGH;
25594 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25595 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 351, __pyx_L3_error)
25596 CYTHON_FALLTHROUGH;
25598 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25599 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 351, __pyx_L3_error)
25600 CYTHON_FALLTHROUGH;
25602 default:
goto __pyx_L5_argtuple_error;
25604 const Py_ssize_t kwd_pos_args = __pyx_nargs;
25605 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"basm_NR_solve", 0) < (0)) __PYX_ERR(0, 351, __pyx_L3_error)
25606 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
25607 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, i); __PYX_ERR(0, 351, __pyx_L3_error) }
25609 }
else if (unlikely(__pyx_nargs != 6)) {
25610 goto __pyx_L5_argtuple_error;
25612 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25613 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 351, __pyx_L3_error)
25614 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25615 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 351, __pyx_L3_error)
25616 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25617 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 351, __pyx_L3_error)
25618 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
25619 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 351, __pyx_L3_error)
25620 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
25621 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 351, __pyx_L3_error)
25622 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
25623 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 351, __pyx_L3_error)
25625 __pyx_v_A = values[0];
25626 __pyx_v_w = values[1];
25627 __pyx_v_basmFactor = values[2];
25628 __pyx_v_node_order = values[3];
25629 __pyx_v_R = values[4];
25630 __pyx_v_dX = values[5];
25632 goto __pyx_L6_skip;
25633 __pyx_L5_argtuple_error:;
25634 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 351, __pyx_L3_error)
25636 goto __pyx_L4_argument_unpacking_done;
25638 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
25639 Py_XDECREF(values[__pyx_temp]);
25641 __Pyx_AddTraceback(
"csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
25642 __Pyx_RefNannyFinishContext();
25644 __pyx_L4_argument_unpacking_done:;
25645 __pyx_r = __pyx_pf_10csmoothers_18basm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_basmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
25648 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
25649 Py_XDECREF(values[__pyx_temp]);
25651 __Pyx_RefNannyFinishContext();
25655static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
25656 PyObject *__pyx_r = NULL;
25657 __Pyx_RefNannyDeclarations
25658 PyObject *__pyx_t_1 = NULL;
25660 PyObject *__pyx_t_3 = NULL;
25661 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
25662 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
25663 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
25664 int __pyx_lineno = 0;
25665 const char *__pyx_filename = NULL;
25666 int __pyx_clineno = 0;
25667 __Pyx_RefNannySetupContext(
"basm_NR_solve", 0);
25676 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
25677 __Pyx_GOTREF(__pyx_t_1);
25678 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 363, __pyx_L1_error)
25687 __pyx_t_2 = __Pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error)
25696 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_mstate_global->__pyx_n_u_cBASMFactor);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
25697 __Pyx_GOTREF(__pyx_t_3);
25698 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 365, __pyx_L1_error)
25707 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 366, __pyx_L1_error)
25716 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 367, __pyx_L1_error)
25725 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 368, __pyx_L1_error)
25734 __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
25735 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25737 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25738 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;
25739 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
25740 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL;
25751 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25754 __Pyx_XDECREF(__pyx_t_1);
25755 __Pyx_XDECREF(__pyx_t_3);
25756 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
25757 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
25758 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
25759 __Pyx_AddTraceback(
"csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
25762 __Pyx_XGIVEREF(__pyx_r);
25763 __Pyx_RefNannyFinishContext();
25775static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
25776 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
25777 __Pyx_RefNannyDeclarations
25778 PyObject *__pyx_t_1 = NULL;
25780 Py_ssize_t __pyx_t_3;
25781 Py_ssize_t __pyx_t_4;
25782 Py_ssize_t __pyx_t_5;
25783 int __pyx_lineno = 0;
25784 const char *__pyx_filename = NULL;
25785 int __pyx_clineno = 0;
25786 __Pyx_RefNannySetupContext(
"smootherWrappers_basm_NR_solve", 0);
25795 __pyx_v_AS.Stype = SLU_NR;
25804 __pyx_v_AS.Dtype = SLU_D;
25813 __pyx_v_AS.Mtype = SLU_GE;
25822 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
25823 __Pyx_GOTREF(__pyx_t_1);
25824 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
25825 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25826 __pyx_v_AS.nrow = __pyx_t_2;
25835 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
25836 __Pyx_GOTREF(__pyx_t_1);
25837 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L1_error)
25838 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25839 __pyx_v_AS.ncol = __pyx_t_2;
25848 __pyx_v_AS.Store = (&__pyx_v_sm->A);
25859 if (__pyx_t_3 < 0) {
25860 __pyx_t_3 += __pyx_v_R.shape[0];
25861 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
25862 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
25863 if (unlikely(__pyx_t_2 != -1)) {
25864 __Pyx_RaiseBufferIndexError(__pyx_t_2);
25865 __PYX_ERR(0, 390, __pyx_L1_error)
25877 if (__pyx_t_4 < 0) {
25878 __pyx_t_4 += __pyx_v_node_order.shape[0];
25879 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
25880 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
25881 if (unlikely(__pyx_t_2 != -1)) {
25882 __Pyx_RaiseBufferIndexError(__pyx_t_2);
25883 __PYX_ERR(0, 392, __pyx_L1_error)
25895 if (__pyx_t_5 < 0) {
25896 __pyx_t_5 += __pyx_v_dX.shape[0];
25897 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
25898 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
25899 if (unlikely(__pyx_t_2 != -1)) {
25900 __Pyx_RaiseBufferIndexError(__pyx_t_2);
25901 __PYX_ERR(0, 394, __pyx_L1_error)
25911 basm_NR_solve(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_w, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_basmFactor->subdomain_R, (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_basmFactor->subdomain_dX, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
25924 __Pyx_XDECREF(__pyx_t_1);
25925 __Pyx_AddTraceback(
"csmoothers.smootherWrappers_basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
25929 __Pyx_RefNannyFinishContext();
25933static PyObject *__pyx_tp_new__initialisation_10csmoothers_cASMFactor(PyObject *o,
25934#
if CYTHON_VECTORCALL_TPNEW
25935 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
25937 PyObject *a, PyObject *k
25941 int cinit_result = __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(o,
25942#
if CYTHON_VECTORCALL_TPNEW
25943 args, nargs, kwnames
25948 if (unlikely(cinit_result))
goto bad;
25952 Py_DECREF(o); o = 0;
25956static PyObject *__pyx_tp_new_vectorcall_10csmoothers_cASMFactor(PyTypeObject *t,
25957#
if CYTHON_VECTORCALL_TPNEW
25958 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
25960 PyObject *a, PyObject *k
25964 o = __Pyx_AllocateExtensionType(t, 0);
25965 if (unlikely(!o))
return 0;
25966 return __pyx_tp_new__initialisation_10csmoothers_cASMFactor(o,
25967#
if CYTHON_VECTORCALL_TPNEW
25968 args, nargs, kwnames
25975#if CYTHON_VECTORCALL_TPNEW
25976static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
25977 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_10csmoothers_cASMFactor, t, a, k);
25981#if CYTHON_VECTORCALL_TPNEW
25982static PyObject *__pyx_tp_vectorcall_10csmoothers_cASMFactor(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
25983 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_10csmoothers_cASMFactor || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25984 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25986 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25987 PyObject *o = __pyx_tp_new_vectorcall_10csmoothers_cASMFactor((PyTypeObject*)t, args, nargs, kwnames);
25992static void __pyx_tp_dealloc_10csmoothers_cASMFactor(PyObject *o) {
25993 #if CYTHON_USE_TP_FINALIZE
25994 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25995 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10csmoothers_cASMFactor) {
25996 if (PyObject_CallFinalizerFromDealloc(o))
return;
26001 PyObject *etype, *eval, *etb;
26002 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26003 __Pyx_DeallocKeepAliveBegin(o);
26004 __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(o);
26005 __Pyx_DeallocKeepAliveEnd(o);
26006 __Pyx_PyErr_RestoreException(etype, eval, etb);
26008 PyTypeObject *tp = Py_TYPE(o);
26009 #if CYTHON_USE_TYPE_SLOTS
26013 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26014 if (tp_free) tp_free(o);
26017 #if CYTHON_USE_TYPE_SPECS
26022static PyMethodDef __pyx_methods_10csmoothers_cASMFactor[] = {
26023 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26024 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26027#if CYTHON_USE_TYPE_SPECS
26028static PyType_Slot __pyx_type_10csmoothers_cASMFactor_slots[] = {
26029 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_10csmoothers_cASMFactor},
26030 {Py_tp_methods, (
void *)__pyx_methods_10csmoothers_cASMFactor},
26031 {Py_tp_new, (
void *)__pyx_tp_new_10csmoothers_cASMFactor},
26032 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26033 #if CYTHON_VECTORCALL_TPNEW
26034 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_10csmoothers_cASMFactor},
26039static PyType_Spec __pyx_type_10csmoothers_cASMFactor_spec = {
26040 "csmoothers.cASMFactor",
26041 sizeof(
struct __pyx_obj_10csmoothers_cASMFactor),
26043 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
26044 __pyx_type_10csmoothers_cASMFactor_slots,
26048static PyTypeObject __pyx_type_10csmoothers_cASMFactor = {
26049 PyVarObject_HEAD_INIT(0, 0)
26050 "csmoothers.""cASMFactor",
26051 sizeof(
struct __pyx_obj_10csmoothers_cASMFactor),
26053 __pyx_tp_dealloc_10csmoothers_cASMFactor,
26068 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
26076 __pyx_methods_10csmoothers_cASMFactor,
26083 #
if !CYTHON_USE_TYPE_SPECS
26088 __pyx_tp_new_10csmoothers_cASMFactor,
26098 #
if CYTHON_USE_TP_FINALIZE
26103 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26104 #
if CYTHON_VECTORCALL_TPNEW
26105 __pyx_tp_vectorcall_10csmoothers_cASMFactor,
26110 #
if __PYX_NEED_TP_PRINT_SLOT == 1
26113 #
if PY_VERSION_HEX >= 0x030C0000
26116 #
if PY_VERSION_HEX >= 0x030d00A4
26119 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26125static PyObject *__pyx_tp_new__initialisation_10csmoothers_cBASMFactor(PyObject *o,
26126#
if CYTHON_VECTORCALL_TPNEW
26127 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
26129 PyObject *a, PyObject *k
26133 int cinit_result = __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(o,
26134#
if CYTHON_VECTORCALL_TPNEW
26135 args, nargs, kwnames
26140 if (unlikely(cinit_result))
goto bad;
26144 Py_DECREF(o); o = 0;
26148static PyObject *__pyx_tp_new_vectorcall_10csmoothers_cBASMFactor(PyTypeObject *t,
26149#
if CYTHON_VECTORCALL_TPNEW
26150 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
26152 PyObject *a, PyObject *k
26156 o = __Pyx_AllocateExtensionType(t, 0);
26157 if (unlikely(!o))
return 0;
26158 return __pyx_tp_new__initialisation_10csmoothers_cBASMFactor(o,
26159#
if CYTHON_VECTORCALL_TPNEW
26160 args, nargs, kwnames
26167#if CYTHON_VECTORCALL_TPNEW
26168static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
26169 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_10csmoothers_cBASMFactor, t, a, k);
26173#if CYTHON_VECTORCALL_TPNEW
26174static PyObject *__pyx_tp_vectorcall_10csmoothers_cBASMFactor(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
26175 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_10csmoothers_cBASMFactor || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26176 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26178 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26179 PyObject *o = __pyx_tp_new_vectorcall_10csmoothers_cBASMFactor((PyTypeObject*)t, args, nargs, kwnames);
26184static void __pyx_tp_dealloc_10csmoothers_cBASMFactor(PyObject *o) {
26185 #if CYTHON_USE_TP_FINALIZE
26186 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
26187 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10csmoothers_cBASMFactor) {
26188 if (PyObject_CallFinalizerFromDealloc(o))
return;
26193 PyObject *etype, *eval, *etb;
26194 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26195 __Pyx_DeallocKeepAliveBegin(o);
26196 __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(o);
26197 __Pyx_DeallocKeepAliveEnd(o);
26198 __Pyx_PyErr_RestoreException(etype, eval, etb);
26200 PyTypeObject *tp = Py_TYPE(o);
26201 #if CYTHON_USE_TYPE_SLOTS
26205 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26206 if (tp_free) tp_free(o);
26209 #if CYTHON_USE_TYPE_SPECS
26214static PyMethodDef __pyx_methods_10csmoothers_cBASMFactor[] = {
26215 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26216 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26219#if CYTHON_USE_TYPE_SPECS
26220static PyType_Slot __pyx_type_10csmoothers_cBASMFactor_slots[] = {
26221 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_10csmoothers_cBASMFactor},
26222 {Py_tp_methods, (
void *)__pyx_methods_10csmoothers_cBASMFactor},
26223 {Py_tp_new, (
void *)__pyx_tp_new_10csmoothers_cBASMFactor},
26224 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26225 #if CYTHON_VECTORCALL_TPNEW
26226 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_10csmoothers_cBASMFactor},
26231static PyType_Spec __pyx_type_10csmoothers_cBASMFactor_spec = {
26232 "csmoothers.cBASMFactor",
26233 sizeof(
struct __pyx_obj_10csmoothers_cBASMFactor),
26235 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
26236 __pyx_type_10csmoothers_cBASMFactor_slots,
26240static PyTypeObject __pyx_type_10csmoothers_cBASMFactor = {
26241 PyVarObject_HEAD_INIT(0, 0)
26242 "csmoothers.""cBASMFactor",
26243 sizeof(
struct __pyx_obj_10csmoothers_cBASMFactor),
26245 __pyx_tp_dealloc_10csmoothers_cBASMFactor,
26260 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
26268 __pyx_methods_10csmoothers_cBASMFactor,
26275 #
if !CYTHON_USE_TYPE_SPECS
26280 __pyx_tp_new_10csmoothers_cBASMFactor,
26290 #
if CYTHON_USE_TP_FINALIZE
26295 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26296 #
if CYTHON_VECTORCALL_TPNEW
26297 __pyx_tp_vectorcall_10csmoothers_cBASMFactor,
26302 #
if __PYX_NEED_TP_PRINT_SLOT == 1
26305 #
if PY_VERSION_HEX >= 0x030C0000
26308 #
if PY_VERSION_HEX >= 0x030d00A4
26311 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26316static struct __pyx_vtabstruct_array __pyx_vtable_array;
26318static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
26319#
if CYTHON_VECTORCALL_TPNEW
26320 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
26322 PyObject *a, PyObject *k
26325 struct __pyx_array_obj *p = ((
struct __pyx_array_obj *)o);
26326 p->__pyx_vtab = __pyx_vtabptr_array;
26327 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
26328 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
26330 int cinit_result = __pyx_array___cinit__(o,
26331#
if CYTHON_VECTORCALL_TPNEW
26332 args, nargs, kwnames
26337 if (unlikely(cinit_result))
goto bad;
26341 Py_DECREF(o); o = 0;
26345static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
26346#
if CYTHON_VECTORCALL_TPNEW
26347 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
26349 PyObject *a, PyObject *k
26353 o = __Pyx_AllocateExtensionType(t, 0);
26354 if (unlikely(!o))
return 0;
26355 return __pyx_tp_new__initialisation_array(o,
26356#
if CYTHON_VECTORCALL_TPNEW
26357 args, nargs, kwnames
26364#if CYTHON_VECTORCALL_TPNEW
26365static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
26366 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_array, t, a, k);
26370#if CYTHON_VECTORCALL_TPNEW
26371static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
26372 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_array_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26373 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26375 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26376 PyObject *o = __pyx_tp_new_vectorcall_array((PyTypeObject*)t, args, nargs, kwnames);
26381static void __pyx_tp_dealloc_array(PyObject *o) {
26382 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
26383 #if CYTHON_USE_TP_FINALIZE
26384 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
26385 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
26386 if (PyObject_CallFinalizerFromDealloc(o))
return;
26391 PyObject *etype, *eval, *etb;
26392 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26393 __Pyx_DeallocKeepAliveBegin(o);
26394 __pyx_array___dealloc__(o);
26395 __Pyx_DeallocKeepAliveEnd(o);
26396 __Pyx_PyErr_RestoreException(etype, eval, etb);
26399 Py_CLEAR(p->_format);
26400 PyTypeObject *tp = Py_TYPE(o);
26401 #if CYTHON_USE_TYPE_SLOTS
26405 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26406 if (tp_free) tp_free(o);
26409 #if CYTHON_USE_TYPE_SPECS
26414static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
26416 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return NULL;
26417 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
26418 binaryfunc
f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
26420 binaryfunc
f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
26427static PyObject *__pyx_mp_subscript_array(PyObject *o, PyObject *i) {
26428 return __pyx_array___getitem__(o, i);
26431static int __pyx_sq_ass_item_array(PyObject *o, Py_ssize_t i, PyObject *
v) {
26433 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return -1;
26434 int r = __pyx_array___setitem__(o, x,
v);
26438 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
26443static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
26445 return __pyx_array___setitem__(o, i,
v);
26447 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
26452static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
26453 PyObject *
v = PyObject_GenericGetAttr(o,
n);
26454 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
26456 v = __pyx_array___getattr__(o,
n);
26461static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
26462 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
26465static PyMethodDef __pyx_methods_array[] = {
26466 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
26467 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26468 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26472static struct PyGetSetDef __pyx_getsets_array[] = {
26473 {
"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
26476#if CYTHON_USE_TYPE_SPECS
26477#if !CYTHON_COMPILING_IN_LIMITED_API
26479static PyBufferProcs __pyx_tp_as_buffer_array = {
26480 __pyx_array_getbuffer,
26484static PyType_Slot __pyx_type___pyx_array_slots[] = {
26485 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_array},
26486 {Py_sq_length, (
void *)__pyx_array___len__},
26487 {Py_sq_item, (
void *)__pyx_sq_item_array},
26488 {Py_sq_ass_item, (
void *)__pyx_sq_ass_item_array},
26489 {Py_mp_length, (
void *)__pyx_array___len__},
26490 {Py_mp_subscript, (
void *)__pyx_mp_subscript_array},
26491 {Py_mp_ass_subscript, (
void *)__pyx_mp_ass_subscript_array},
26492 {Py_tp_getattro, (
void *)__pyx_tp_getattro_array},
26493 #if defined(Py_bf_getbuffer)
26494 {Py_bf_getbuffer, (
void *)__pyx_array_getbuffer},
26496 {Py_tp_methods, (
void *)__pyx_methods_array},
26497 {Py_tp_getset, (
void *)__pyx_getsets_array},
26498 {Py_tp_new, (
void *)__pyx_tp_new_array},
26499 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26500 #if CYTHON_VECTORCALL_TPNEW
26501 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_array},
26506static PyType_Spec __pyx_type___pyx_array_spec = {
26507 "csmoothers.array",
26508 sizeof(
struct __pyx_array_obj),
26510 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
26511 __pyx_type___pyx_array_slots,
26515static PySequenceMethods __pyx_tp_as_sequence_array = {
26516 __pyx_array___len__,
26519 __pyx_sq_item_array,
26521 __pyx_sq_ass_item_array,
26528static PyMappingMethods __pyx_tp_as_mapping_array = {
26529 __pyx_array___len__,
26530 __pyx_mp_subscript_array,
26531 __pyx_mp_ass_subscript_array,
26534static PyBufferProcs __pyx_tp_as_buffer_array = {
26535 __pyx_array_getbuffer,
26539static PyTypeObject __pyx_type___pyx_array = {
26540 PyVarObject_HEAD_INIT(0, 0)
26541 "csmoothers.""array",
26542 sizeof(
struct __pyx_array_obj),
26544 __pyx_tp_dealloc_array,
26551 &__pyx_tp_as_sequence_array,
26552 &__pyx_tp_as_mapping_array,
26556 __pyx_tp_getattro_array,
26558 &__pyx_tp_as_buffer_array,
26559 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
26567 __pyx_methods_array,
26569 __pyx_getsets_array,
26574 #
if !CYTHON_USE_TYPE_SPECS
26579 __pyx_tp_new_array,
26589 #
if CYTHON_USE_TP_FINALIZE
26594 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26595 #
if CYTHON_VECTORCALL_TPNEW
26596 __pyx_tp_vectorcall_array,
26601 #
if __PYX_NEED_TP_PRINT_SLOT == 1
26604 #
if PY_VERSION_HEX >= 0x030C0000
26607 #
if PY_VERSION_HEX >= 0x030d00A4
26610 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26616static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
26617#
if CYTHON_VECTORCALL_TPNEW
26618 CYTHON_UNUSED PyObject *
const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
26620 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
26623 struct __pyx_MemviewEnum_obj *p = ((
struct __pyx_MemviewEnum_obj *)o);
26624 p->name = Py_None; Py_INCREF(Py_None);
26628static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
26629#
if CYTHON_VECTORCALL_TPNEW
26630 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
26632 PyObject *a, PyObject *k
26636 o = __Pyx_AllocateExtensionType(t, 0);
26637 if (unlikely(!o))
return 0;
26638 return __pyx_tp_new__initialisation_Enum(o,
26639#
if CYTHON_VECTORCALL_TPNEW
26640 args, nargs, kwnames
26647#if CYTHON_VECTORCALL_TPNEW
26648static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k) {
26649 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_Enum, t, a, k);
26653#if CYTHON_VECTORCALL_TPNEW
26654static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
26655 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_MemviewEnum_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26656 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26658 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26659 PyObject *o = __pyx_tp_new_vectorcall_Enum((PyTypeObject*)t, args, nargs, kwnames);
26661 assert(Py_TYPE(o) == (PyTypeObject*)t);
26662 if (unlikely(__pyx_MemviewEnum___init__(o, args, nargs, kwnames) < 0)) {
26670#if CYTHON_VECTORCALL_TPNEW
26671static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds) {
26672 return __Pyx_CallTpinitAsVectorcall(__pyx_MemviewEnum___init__, o, args, kwds);
26676static void __pyx_tp_dealloc_Enum(PyObject *o) {
26677 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
26678 #if CYTHON_USE_TP_FINALIZE
26679 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26680 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
26681 if (PyObject_CallFinalizerFromDealloc(o))
return;
26685 PyObject_GC_UnTrack(o);
26687 PyTypeObject *tp = Py_TYPE(o);
26688 #if CYTHON_USE_TYPE_SLOTS
26692 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26693 if (tp_free) tp_free(o);
26696 #if CYTHON_USE_TYPE_SPECS
26701static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
26703 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
26705 e = __Pyx_call_type_traverse(o, 1,
v, a);
26709 e = (*v)(p->name, a);
if (e)
return e;
26714static int __pyx_tp_clear_Enum(PyObject *o) {
26716 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
26717 tmp = ((PyObject*)p->name);
26718 p->name = Py_None; Py_INCREF(Py_None);
26723static PyMethodDef __pyx_methods_Enum[] = {
26724 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26725 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26728#if CYTHON_USE_TYPE_SPECS
26729static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
26730 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_Enum},
26731 {Py_tp_repr, (
void *)__pyx_MemviewEnum___repr__},
26732 {Py_tp_traverse, (
void *)__pyx_tp_traverse_Enum},
26733 {Py_tp_clear, (
void *)__pyx_tp_clear_Enum},
26734 {Py_tp_methods, (
void *)__pyx_methods_Enum},
26735 {Py_tp_init, (
void *)__pyx_tp_init_Enum},
26736 {Py_tp_new, (
void *)__pyx_tp_new_Enum},
26737 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26738 #if CYTHON_VECTORCALL_TPNEW
26739 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_Enum},
26744static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
26746 sizeof(
struct __pyx_MemviewEnum_obj),
26748 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26749 __pyx_type___pyx_MemviewEnum_slots,
26753static PyTypeObject __pyx_type___pyx_MemviewEnum = {
26754 PyVarObject_HEAD_INIT(0, 0)
26755 "csmoothers.""Enum",
26756 sizeof(
struct __pyx_MemviewEnum_obj),
26758 __pyx_tp_dealloc_Enum,
26763 __pyx_MemviewEnum___repr__,
26773 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26775 __pyx_tp_traverse_Enum,
26776 __pyx_tp_clear_Enum,
26781 __pyx_methods_Enum,
26788 #
if !CYTHON_USE_TYPE_SPECS
26791 __pyx_tp_init_Enum,
26803 #
if CYTHON_USE_TP_FINALIZE
26808 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26809 #
if CYTHON_VECTORCALL_TPNEW
26810 __pyx_tp_vectorcall_Enum,
26815 #
if __PYX_NEED_TP_PRINT_SLOT == 1
26818 #
if PY_VERSION_HEX >= 0x030C0000
26821 #
if PY_VERSION_HEX >= 0x030d00A4
26824 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26829static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
26831static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
26832#
if CYTHON_VECTORCALL_TPNEW
26833 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
26835 PyObject *a, PyObject *k
26838 struct __pyx_memoryview_obj *p = ((
struct __pyx_memoryview_obj *)o);
26839 p->__pyx_vtab = __pyx_vtabptr_memoryview;
26840 p->obj = Py_None; Py_INCREF(Py_None);
26841 p->_size = Py_None; Py_INCREF(Py_None);
26842 p->view.obj = NULL;
26844 int cinit_result = __pyx_memoryview___cinit__(o,
26845#
if CYTHON_VECTORCALL_TPNEW
26846 args, nargs, kwnames
26851 if (unlikely(cinit_result))
goto bad;
26855 Py_DECREF(o); o = 0;
26859static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
26860#
if CYTHON_VECTORCALL_TPNEW
26861 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
26863 PyObject *a, PyObject *k
26867 o = __Pyx_AllocateExtensionType(t, 0);
26868 if (unlikely(!o))
return 0;
26869 return __pyx_tp_new__initialisation_memoryview(o,
26870#
if CYTHON_VECTORCALL_TPNEW
26871 args, nargs, kwnames
26878#if CYTHON_VECTORCALL_TPNEW
26879static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
26880 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_memoryview, t, a, k);
26884#if CYTHON_VECTORCALL_TPNEW
26885static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
26886 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryview_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26887 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26889 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26890 PyObject *o = __pyx_tp_new_vectorcall_memoryview((PyTypeObject*)t, args, nargs, kwnames);
26895static void __pyx_tp_dealloc_memoryview(PyObject *o) {
26896 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
26897 #if CYTHON_USE_TP_FINALIZE
26898 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26899 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
26900 if (PyObject_CallFinalizerFromDealloc(o))
return;
26904 PyObject_GC_UnTrack(o);
26906 PyObject *etype, *eval, *etb;
26907 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26908 __Pyx_DeallocKeepAliveBegin(o);
26909 __pyx_memoryview___dealloc__(o);
26910 __Pyx_DeallocKeepAliveEnd(o);
26911 __Pyx_PyErr_RestoreException(etype, eval, etb);
26914 Py_CLEAR(p->_size);
26915 PyTypeObject *tp = Py_TYPE(o);
26916 #if CYTHON_USE_TYPE_SLOTS
26920 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26921 if (tp_free) tp_free(o);
26924 #if CYTHON_USE_TYPE_SPECS
26929static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
26931 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
26933 e = __Pyx_call_type_traverse(o, 1,
v, a);
26937 e = (*v)(p->obj, a);
if (e)
return e;
26940 e = (*v)(p->_size, a);
if (e)
return e;
26943 e = (*v)(p->view.obj, a);
if (e)
return e;
26948static int __pyx_tp_clear_memoryview(PyObject *o) {
26950 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
26951 tmp = ((PyObject*)p->obj);
26952 p->obj = Py_None; Py_INCREF(Py_None);
26954 tmp = ((PyObject*)p->_size);
26955 p->_size = Py_None; Py_INCREF(Py_None);
26957 Py_CLEAR(p->view.obj);
26961static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
26963 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return NULL;
26964 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
26965 binaryfunc
f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
26967 binaryfunc
f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
26974static PyObject *__pyx_mp_subscript_memoryview(PyObject *o, PyObject *i) {
26975 return __pyx_memoryview___getitem__(o, i);
26978static int __pyx_sq_ass_item_memoryview(PyObject *o, Py_ssize_t i, PyObject *
v) {
26980 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return -1;
26981 int r = __pyx_memoryview___setitem__(o, x,
v);
26985 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
26990static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
26992 return __pyx_memoryview___setitem__(o, i,
v);
26994 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
26999static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
27000 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
27003static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
27004 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
27007static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
27008 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
27011static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
27012 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
27015static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
27016 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
27019static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
27020 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
27023static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
27024 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
27027static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
27028 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
27031static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
27032 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
27035static PyMethodDef __pyx_methods_memoryview[] = {
27036 {
"is_c_contig", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27037 {
"is_f_contig", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27038 {
"copy", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27039 {
"copy_fortran", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27040 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27041 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27045static struct PyGetSetDef __pyx_getsets_memoryview[] = {
27046 {
"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
27047 {
"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
27048 {
"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
27049 {
"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
27050 {
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
27051 {
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
27052 {
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
27053 {
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
27054 {
"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
27057#if CYTHON_USE_TYPE_SPECS
27058#if !CYTHON_COMPILING_IN_LIMITED_API
27060static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
27061 __pyx_memoryview_getbuffer,
27065static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
27066 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_memoryview},
27067 {Py_tp_repr, (
void *)__pyx_memoryview___repr__},
27068 {Py_sq_length, (
void *)__pyx_memoryview___len__},
27069 {Py_sq_item, (
void *)__pyx_sq_item_memoryview},
27070 {Py_sq_ass_item, (
void *)__pyx_sq_ass_item_memoryview},
27071 {Py_mp_length, (
void *)__pyx_memoryview___len__},
27072 {Py_mp_subscript, (
void *)__pyx_mp_subscript_memoryview},
27073 {Py_mp_ass_subscript, (
void *)__pyx_mp_ass_subscript_memoryview},
27074 {Py_tp_str, (
void *)__pyx_memoryview___str__},
27075 #if defined(Py_bf_getbuffer)
27076 {Py_bf_getbuffer, (
void *)__pyx_memoryview_getbuffer},
27078 {Py_tp_traverse, (
void *)__pyx_tp_traverse_memoryview},
27079 {Py_tp_clear, (
void *)__pyx_tp_clear_memoryview},
27080 {Py_tp_methods, (
void *)__pyx_methods_memoryview},
27081 {Py_tp_getset, (
void *)__pyx_getsets_memoryview},
27082 {Py_tp_new, (
void *)__pyx_tp_new_memoryview},
27083 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27084 #if CYTHON_VECTORCALL_TPNEW
27085 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_memoryview},
27090static PyType_Spec __pyx_type___pyx_memoryview_spec = {
27091 "csmoothers.memoryview",
27092 sizeof(
struct __pyx_memoryview_obj),
27094 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
27095 __pyx_type___pyx_memoryview_slots,
27099static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
27100 __pyx_memoryview___len__,
27103 __pyx_sq_item_memoryview,
27105 __pyx_sq_ass_item_memoryview,
27112static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
27113 __pyx_memoryview___len__,
27114 __pyx_mp_subscript_memoryview,
27115 __pyx_mp_ass_subscript_memoryview,
27118static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
27119 __pyx_memoryview_getbuffer,
27123static PyTypeObject __pyx_type___pyx_memoryview = {
27124 PyVarObject_HEAD_INIT(0, 0)
27125 "csmoothers.""memoryview",
27126 sizeof(
struct __pyx_memoryview_obj),
27128 __pyx_tp_dealloc_memoryview,
27133 __pyx_memoryview___repr__,
27135 &__pyx_tp_as_sequence_memoryview,
27136 &__pyx_tp_as_mapping_memoryview,
27139 __pyx_memoryview___str__,
27142 &__pyx_tp_as_buffer_memoryview,
27143 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
27145 __pyx_tp_traverse_memoryview,
27146 __pyx_tp_clear_memoryview,
27151 __pyx_methods_memoryview,
27153 __pyx_getsets_memoryview,
27158 #
if !CYTHON_USE_TYPE_SPECS
27163 __pyx_tp_new_memoryview,
27173 #
if CYTHON_USE_TP_FINALIZE
27178 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27179 #
if CYTHON_VECTORCALL_TPNEW
27180 __pyx_tp_vectorcall_memoryview,
27185 #
if __PYX_NEED_TP_PRINT_SLOT == 1
27188 #
if PY_VERSION_HEX >= 0x030C0000
27191 #
if PY_VERSION_HEX >= 0x030d00A4
27194 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
27199static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
27201static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
27202#
if CYTHON_VECTORCALL_TPNEW
27203 CYTHON_UNUSED PyObject *
const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
27205 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
27208 struct __pyx_memoryviewslice_obj *p = ((
struct __pyx_memoryviewslice_obj *)o);
27209 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
27210 p->from_object = Py_None; Py_INCREF(Py_None);
27211 p->from_slice.memview = NULL;
27215static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
27216#
if CYTHON_VECTORCALL_TPNEW
27217 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
27219 PyObject *a, PyObject *k
27223 o = __pyx_tp_new_vectorcall_memoryview(t,
27224#
if CYTHON_VECTORCALL_TPNEW
27225 args, nargs, kwnames
27230 if (unlikely(!o))
return 0;
27231 return __pyx_tp_new__initialisation__memoryviewslice(o,
27232#
if CYTHON_VECTORCALL_TPNEW
27233 args, nargs, kwnames
27240#if CYTHON_VECTORCALL_TPNEW
27241static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
27242 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall__memoryviewslice, t, a, k);
27246#if CYTHON_VECTORCALL_TPNEW
27247static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
27248 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryviewslice_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
27249 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
27251 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
27252 PyObject *o = __pyx_tp_new_vectorcall__memoryviewslice((PyTypeObject*)t, args, nargs, kwnames);
27257static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
27258 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
27259 #if CYTHON_USE_TP_FINALIZE
27260 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
27261 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
27262 if (PyObject_CallFinalizerFromDealloc(o))
return;
27266 PyObject_GC_UnTrack(o);
27268 PyObject *etype, *eval, *etb;
27269 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
27270 __Pyx_DeallocKeepAliveBegin(o);
27271 __pyx_memoryviewslice___dealloc__(o);
27272 __Pyx_DeallocKeepAliveEnd(o);
27273 __Pyx_PyErr_RestoreException(etype, eval, etb);
27275 Py_CLEAR(p->from_object);
27276 PyObject_GC_Track(o);
27277 __pyx_tp_dealloc_memoryview(o);
27280static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
27282 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
27283 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
27284 if (p->from_object) {
27285 e = (*v)(p->from_object, a);
if (e)
return e;
27290static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
27292 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
27293 __pyx_tp_clear_memoryview(o);
27294 tmp = ((PyObject*)p->from_object);
27295 p->from_object = Py_None; Py_INCREF(Py_None);
27297 __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
27301static PyMethodDef __pyx_methods__memoryviewslice[] = {
27302 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27303 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27306#if CYTHON_USE_TYPE_SPECS
27307static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
27308 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc__memoryviewslice},
27309 {Py_tp_doc, (
void *)PyDoc_STR(
"Internal class for passing memoryview slices to Python")},
27310 {Py_tp_traverse, (
void *)__pyx_tp_traverse__memoryviewslice},
27311 {Py_tp_clear, (
void *)__pyx_tp_clear__memoryviewslice},
27312 {Py_tp_methods, (
void *)__pyx_methods__memoryviewslice},
27313 {Py_tp_new, (
void *)__pyx_tp_new__memoryviewslice},
27314 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27315 #if CYTHON_VECTORCALL_TPNEW
27316 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall__memoryviewslice},
27321static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
27322 "csmoothers._memoryviewslice",
27323 sizeof(
struct __pyx_memoryviewslice_obj),
27325 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
27326 __pyx_type___pyx_memoryviewslice_slots,
27330static PyTypeObject __pyx_type___pyx_memoryviewslice = {
27331 PyVarObject_HEAD_INIT(0, 0)
27332 "csmoothers.""_memoryviewslice",
27333 sizeof(
struct __pyx_memoryviewslice_obj),
27335 __pyx_tp_dealloc__memoryviewslice,
27340 #
if CYTHON_COMPILING_IN_PYPY || 0
27341 __pyx_memoryview___repr__,
27350 #
if CYTHON_COMPILING_IN_PYPY || 0
27351 __pyx_memoryview___str__,
27358 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
27359 PyDoc_STR(
"Internal class for passing memoryview slices to Python"),
27360 __pyx_tp_traverse__memoryviewslice,
27361 __pyx_tp_clear__memoryviewslice,
27366 __pyx_methods__memoryviewslice,
27373 #if !CYTHON_USE_TYPE_SPECS
27378 __pyx_tp_new__memoryviewslice,
27388 #if CYTHON_USE_TP_FINALIZE
27393 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27394 #if CYTHON_VECTORCALL_TPNEW
27395 __pyx_tp_vectorcall__memoryviewslice,
27400 #if __PYX_NEED_TP_PRINT_SLOT == 1
27403 #if PY_VERSION_HEX >= 0x030C0000
27406 #if PY_VERSION_HEX >= 0x030d00A4
27409 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
27415static PyMethodDef __pyx_methods[] = {
27419static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate);
27420static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate);
27421static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void);
27422static CYTHON_SMALL_CODE
int __Pyx_InitAfterSharedUtility(
void);
27423static CYTHON_SMALL_CODE
int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate);
27424static CYTHON_SMALL_CODE
int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate);
27425static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate);
27426static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate);
27427static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_obj_10csmoothers_cASMFactor(__pyx_mstatetype *__pyx_mstate);
27428static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_obj_10csmoothers_cBASMFactor(__pyx_mstatetype *__pyx_mstate);
27429static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate);
27430static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate);
27431static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate);
27432static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate);
27433static CYTHON_SMALL_CODE
int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate);
27434static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate);
27435static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate);
27436static CYTHON_SMALL_CODE
int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate);
27439static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
27440 __Pyx_RefNannyDeclarations
27441 CYTHON_UNUSED_VAR(__pyx_mstate);
27442 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Global_init_code", 0);
27444 __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
27445 generic = Py_None; Py_INCREF(Py_None);
27446 strided = Py_None; Py_INCREF(Py_None);
27447 indirect = Py_None; Py_INCREF(Py_None);
27448 contiguous = Py_None; Py_INCREF(Py_None);
27449 indirect_contiguous = Py_None; Py_INCREF(Py_None);
27450 __Pyx_RefNannyFinishContext();
27454static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
27455 __Pyx_RefNannyDeclarations
27456 CYTHON_UNUSED_VAR(__pyx_mstate);
27457 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_export_code", 0);
27459 __Pyx_RefNannyFinishContext();
27463static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
27464 __Pyx_RefNannyDeclarations
27465 CYTHON_UNUSED_VAR(__pyx_mstate);
27466 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_export_code", 0);
27468 __Pyx_RefNannyFinishContext();
27472static int __Pyx_modinit_Exttype___pyx_obj_10csmoothers_cASMFactor(__pyx_mstatetype *__pyx_mstate) {
27473 __Pyx_RefNannyDeclarations
27474 int __pyx_lineno = 0;
27475 const char *__pyx_filename = NULL;
27476 int __pyx_clineno = 0;
27477 CYTHON_UNUSED_VAR(__pyx_mstate);
27478 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_obj_10csmoothers_cASMFactor", 0);
27480 #if CYTHON_USE_TYPE_SPECS
27481 __pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10csmoothers_cASMFactor_spec, NULL);
if (unlikely(!__pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor)) __PYX_ERR(0, 12, __pyx_L1_error)
27483 __pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor = &__pyx_type_10csmoothers_cASMFactor;
27485 #if !CYTHON_COMPILING_IN_LIMITED_API
27487 #if !CYTHON_USE_TYPE_SPECS
27488 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor) < (0)) __PYX_ERR(0, 12, __pyx_L1_error)
27490 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27491 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor);
27493 #if !CYTHON_COMPILING_IN_LIMITED_API
27494 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor->tp_dictoffset && __pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor->tp_getattro == PyObject_GenericGetAttr)) {
27495 __pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor->tp_getattro = PyObject_GenericGetAttr;
27498 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_cASMFactor_2, (PyObject *) __pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor) < (0)) __PYX_ERR(0, 12, __pyx_L1_error)
27499 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor) < (0)) __PYX_ERR(0, 12, __pyx_L1_error)
27500 __Pyx_RefNannyFinishContext();
27503 __Pyx_RefNannyFinishContext();
27507static int __Pyx_modinit_Exttype___pyx_obj_10csmoothers_cBASMFactor(__pyx_mstatetype *__pyx_mstate) {
27508 __Pyx_RefNannyDeclarations
27509 int __pyx_lineno = 0;
27510 const char *__pyx_filename = NULL;
27511 int __pyx_clineno = 0;
27512 CYTHON_UNUSED_VAR(__pyx_mstate);
27513 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_obj_10csmoothers_cBASMFactor", 0);
27515 #if CYTHON_USE_TYPE_SPECS
27516 __pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10csmoothers_cBASMFactor_spec, NULL);
if (unlikely(!__pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor)) __PYX_ERR(0, 51, __pyx_L1_error)
27518 __pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor = &__pyx_type_10csmoothers_cBASMFactor;
27520 #if !CYTHON_COMPILING_IN_LIMITED_API
27522 #if !CYTHON_USE_TYPE_SPECS
27523 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor) < (0)) __PYX_ERR(0, 51, __pyx_L1_error)
27525 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27526 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor);
27528 #if !CYTHON_COMPILING_IN_LIMITED_API
27529 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor->tp_dictoffset && __pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor->tp_getattro == PyObject_GenericGetAttr)) {
27530 __pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor->tp_getattro = PyObject_GenericGetAttr;
27533 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_cBASMFactor_2, (PyObject *) __pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor) < (0)) __PYX_ERR(0, 51, __pyx_L1_error)
27534 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor) < (0)) __PYX_ERR(0, 51, __pyx_L1_error)
27535 __Pyx_RefNannyFinishContext();
27538 __Pyx_RefNannyFinishContext();
27542static int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate) {
27543 __Pyx_RefNannyDeclarations
27544 int __pyx_lineno = 0;
27545 const char *__pyx_filename = NULL;
27546 int __pyx_clineno = 0;
27547 CYTHON_UNUSED_VAR(__pyx_mstate);
27548 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_array_obj", 0);
27550 __pyx_vtabptr_array = &__pyx_vtable_array;
27551 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
27552 #if CYTHON_USE_TYPE_SPECS
27553 __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)
27554 #if !CYTHON_COMPILING_IN_LIMITED_API
27555 __pyx_mstate->__pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
27556 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) {
27557 __pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
27559 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
27561 #elif defined(_MSC_VER)
27562 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
27564 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
27567 __pyx_mstate->__pyx_array_type = &__pyx_type___pyx_array;
27569 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_array_type, 1) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
27570 #if !CYTHON_COMPILING_IN_LIMITED_API
27572 #if !CYTHON_USE_TYPE_SPECS
27573 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
27575 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27576 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_array_type);
27578 if (__Pyx_SetVtable(__pyx_mstate->__pyx_array_type, __pyx_vtabptr_array) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
27579 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
27580 __Pyx_RefNannyFinishContext();
27583 __Pyx_RefNannyFinishContext();
27587static int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate) {
27588 __Pyx_RefNannyDeclarations
27589 int __pyx_lineno = 0;
27590 const char *__pyx_filename = NULL;
27591 int __pyx_clineno = 0;
27592 CYTHON_UNUSED_VAR(__pyx_mstate);
27593 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_MemviewEnum_obj", 0);
27595 #if CYTHON_USE_TYPE_SPECS
27596 __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)
27598 __pyx_mstate->__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
27600 #if !CYTHON_COMPILING_IN_LIMITED_API
27602 #if !CYTHON_USE_TYPE_SPECS
27603 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
27605 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27606 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_MemviewEnum_type);
27608 #if !CYTHON_COMPILING_IN_LIMITED_API
27609 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)) {
27610 __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro = PyObject_GenericGetAttr;
27613 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
27614 __Pyx_RefNannyFinishContext();
27617 __Pyx_RefNannyFinishContext();
27621static int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate) {
27622 __Pyx_RefNannyDeclarations
27623 int __pyx_lineno = 0;
27624 const char *__pyx_filename = NULL;
27625 int __pyx_clineno = 0;
27626 CYTHON_UNUSED_VAR(__pyx_mstate);
27627 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_memoryview_obj", 0);
27629 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
27630 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
27631 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
27632 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
27633 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
27634 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
27635 __pyx_vtable_memoryview.setitem_indexed1 = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed1;
27636 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
27637 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
27638 __pyx_vtable_memoryview._get_base = (PyObject *(*)(
struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
27639 #if CYTHON_USE_TYPE_SPECS
27640 __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)
27641 #if !CYTHON_COMPILING_IN_LIMITED_API
27642 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
27643 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) {
27644 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
27646 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
27648 #elif defined(_MSC_VER)
27649 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
27651 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
27654 __pyx_mstate->__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
27656 #if !CYTHON_COMPILING_IN_LIMITED_API
27658 #if !CYTHON_USE_TYPE_SPECS
27659 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
27661 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27662 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryview_type);
27664 #if !CYTHON_COMPILING_IN_LIMITED_API
27665 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)) {
27666 __pyx_mstate->__pyx_memoryview_type->tp_getattro = PyObject_GenericGetAttr;
27669 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryview_type, __pyx_vtabptr_memoryview) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
27670 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
27671 __Pyx_RefNannyFinishContext();
27674 __Pyx_RefNannyFinishContext();
27678static int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate) {
27679 __Pyx_RefNannyDeclarations
27680 PyObject *__pyx_t_1 = NULL;
27681 int __pyx_lineno = 0;
27682 const char *__pyx_filename = NULL;
27683 int __pyx_clineno = 0;
27684 CYTHON_UNUSED_VAR(__pyx_mstate);
27685 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_memoryviewslice_obj", 0);
27687 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
27688 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
27689 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
27690 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
27691 __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(
struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
27692 #if CYTHON_USE_TYPE_SPECS
27693 __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)
27694 __Pyx_GOTREF(__pyx_t_1);
27695 __pyx_mstate->__pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
27696 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27697 if (unlikely(!__pyx_mstate->__pyx_memoryviewslice_type)) __PYX_ERR(1, 947, __pyx_L1_error)
27699 __pyx_mstate->__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
27701 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_memoryviewslice_type, 1) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
27702 #if !CYTHON_COMPILING_IN_LIMITED_API
27703 __pyx_mstate_global->__pyx_memoryviewslice_type->tp_base = __pyx_mstate_global->__pyx_memoryview_type;
27705 #if !CYTHON_USE_TYPE_SPECS
27706 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
27708 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27709 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryviewslice_type);
27711 #if !CYTHON_COMPILING_IN_LIMITED_API
27712 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)) {
27713 __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro = PyObject_GenericGetAttr;
27716 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
27717 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
27718 __Pyx_RefNannyFinishContext();
27721 __Pyx_XDECREF(__pyx_t_1);
27722 __Pyx_RefNannyFinishContext();
27726static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
27727 __Pyx_RefNannyDeclarations
27728 PyObject *__pyx_t_1 = NULL;
27729 int __pyx_lineno = 0;
27730 const char *__pyx_filename = NULL;
27731 int __pyx_clineno = 0;
27732 CYTHON_UNUSED_VAR(__pyx_mstate);
27733 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Type_import_code", 0);
27735 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
27736 __Pyx_GOTREF(__pyx_t_1);
27737 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
27738 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27739 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
27740 #elif CYTHON_COMPILING_IN_LIMITED_API
27743 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
27745 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
27746 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27747 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error)
27748 __Pyx_GOTREF(__pyx_t_1);
27749 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"dtype",
27750 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27751 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
27752 #elif CYTHON_COMPILING_IN_LIMITED_API
27753 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
27755 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
27757 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 229, __pyx_L1_error)
27758 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flatiter",
27759 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27760 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
27761 #elif CYTHON_COMPILING_IN_LIMITED_API
27762 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
27764 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
27766 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 286, __pyx_L1_error)
27767 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"broadcast",
27768 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27769 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
27770 #elif CYTHON_COMPILING_IN_LIMITED_API
27771 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
27773 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
27775 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 290, __pyx_L1_error)
27776 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ndarray",
27777 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27778 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
27779 #elif CYTHON_COMPILING_IN_LIMITED_API
27780 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
27782 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
27784 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 329, __pyx_L1_error)
27785 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"generic",
27786 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27787 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27788 #elif CYTHON_COMPILING_IN_LIMITED_API
27789 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27791 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27793 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
27794 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"number",
27795 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27796 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27797 #elif CYTHON_COMPILING_IN_LIMITED_API
27798 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27800 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27802 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
27803 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"integer",
27804 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27805 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27806 #elif CYTHON_COMPILING_IN_LIMITED_API
27807 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27809 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27811 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
27812 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"signedinteger",
27813 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27814 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27815 #elif CYTHON_COMPILING_IN_LIMITED_API
27816 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27818 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27820 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
27821 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"unsignedinteger",
27822 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27823 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27824 #elif CYTHON_COMPILING_IN_LIMITED_API
27825 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27827 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27829 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
27830 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"inexact",
27831 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27832 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27833 #elif CYTHON_COMPILING_IN_LIMITED_API
27834 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27836 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27838 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
27839 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"floating",
27840 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27841 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27842 #elif CYTHON_COMPILING_IN_LIMITED_API
27843 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27845 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27847 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
27848 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"complexfloating",
27849 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27850 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27851 #elif CYTHON_COMPILING_IN_LIMITED_API
27852 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27854 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27856 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
27857 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flexible",
27858 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27859 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27860 #elif CYTHON_COMPILING_IN_LIMITED_API
27861 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27863 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27865 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
27866 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"character",
27867 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27868 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27869 #elif CYTHON_COMPILING_IN_LIMITED_API
27870 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27872 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27874 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
27875 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ufunc",
27876 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27877 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
27878 #elif CYTHON_COMPILING_IN_LIMITED_API
27879 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
27881 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
27883 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 946, __pyx_L1_error)
27884 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27885 __pyx_t_1 = PyImport_ImportModule(
"proteus.superluWrappers");
if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 68, __pyx_L1_error)
27886 __Pyx_GOTREF(__pyx_t_1);
27887 __pyx_mstate->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = __Pyx_ImportType_3_3_0(__pyx_t_1,
"proteus.superluWrappers",
"cSparseMatrix",
27888 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27889 sizeof(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix),
27890 #elif CYTHON_COMPILING_IN_LIMITED_API
27891 sizeof(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix),
27893 sizeof(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix),
27895 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix) __PYX_ERR(4, 68, __pyx_L1_error)
27896 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27897 __Pyx_RefNannyFinishContext();
27900 __Pyx_XDECREF(__pyx_t_1);
27901 __Pyx_RefNannyFinishContext();
27905static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
27906 __Pyx_RefNannyDeclarations
27907 CYTHON_UNUSED_VAR(__pyx_mstate);
27908 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_import_code", 0);
27910 __Pyx_RefNannyFinishContext();
27914static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
27915 __Pyx_RefNannyDeclarations
27916 CYTHON_UNUSED_VAR(__pyx_mstate);
27917 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_import_code", 0);
27919 __Pyx_RefNannyFinishContext();
27923#if CYTHON_PEP489_MULTI_PHASE_INIT
27924static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
27925static int __pyx_pymod_exec_csmoothers(PyObject* module);
27926static PyModuleDef_Slot __pyx_moduledef_slots[] = {
27927 {Py_mod_create, (
void*)__pyx_pymod_create},
27928 {Py_mod_exec, (
void*)__pyx_pymod_exec_csmoothers},
27929 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
27930 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
27932 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
27933 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
27941 struct PyModuleDef __pyx_moduledef =
27943 static struct PyModuleDef __pyx_moduledef =
27946 PyModuleDef_HEAD_INIT,
27949 #if CYTHON_USE_MODULE_STATE
27950 sizeof(__pyx_mstatetype),
27952 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1,
27955 #if CYTHON_PEP489_MULTI_PHASE_INIT
27956 __pyx_moduledef_slots,
27960 #if CYTHON_USE_MODULE_STATE
27975#ifndef CYTHON_NO_PYINIT_EXPORT
27976 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27979 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
27981 #define __Pyx_PyMODINIT_FUNC PyObject *
27985__Pyx_PyMODINIT_FUNC PyInit_csmoothers(
void) CYTHON_SMALL_CODE;
27986__Pyx_PyMODINIT_FUNC PyInit_csmoothers(
void)
27987#if CYTHON_PEP489_MULTI_PHASE_INIT
27989 return PyModuleDef_Init(&__pyx_moduledef);
27992#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
27993 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
27994static PY_INT64_T __Pyx_GetCurrentInterpreterId(
void) {
27996 PyObject *module = PyImport_ImportModule(
"_interpreters");
27998 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
28002 module = PyImport_ImportModule("_xxsubinterpreters");
28003 if (!module)
goto bad;
28005 PyObject *current = PyObject_CallMethod(module,
"get_current", NULL);
28007 if (!current)
goto bad;
28008 if (PyTuple_Check(current)) {
28009 PyObject *new_current = PySequence_GetItem(current, 0);
28010 Py_DECREF(current);
28011 current = new_current;
28012 if (!new_current)
goto bad;
28014 long long as_c_int = PyLong_AsLongLong(current);
28015 Py_DECREF(current);
28019 PySys_WriteStderr(
"__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
28023#if !CYTHON_USE_MODULE_STATE
28024static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
28025 static PY_INT64_T main_interpreter_id = -1;
28026#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
28027 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
28028#elif CYTHON_COMPILING_IN_GRAAL
28029 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
28030#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
28031 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
28032 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
28033#elif CYTHON_COMPILING_IN_LIMITED_API
28034 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
28036 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
28038 if (unlikely(current_id == -1)) {
28041 if (main_interpreter_id == -1) {
28042 main_interpreter_id = current_id;
28044 }
else if (unlikely(main_interpreter_id != current_id)) {
28047 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
28053static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none)
28055 PyObject *value = PyObject_GetAttrString(spec, from_name);
28057 if (likely(value)) {
28058 if (allow_none || value != Py_None) {
28059 result = PyDict_SetItemString(moddict, to_name, value);
28062 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
28069static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
28070 PyObject *module = NULL, *moddict, *modname;
28071 CYTHON_UNUSED_VAR(def);
28072 #if !CYTHON_USE_MODULE_STATE
28073 if (__Pyx_check_single_interpreter())
28077 return __Pyx_NewRef(__pyx_m);
28078 modname = PyObject_GetAttrString(spec,
"name");
28079 if (unlikely(!modname))
goto bad;
28080 module = PyModule_NewObject(modname);
28081 Py_DECREF(modname);
28082 if (unlikely(!module))
goto bad;
28083 moddict = PyModule_GetDict(module);
28084 if (unlikely(!moddict))
goto bad;
28085 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
28086 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
28087 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
28088 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
28091 Py_XDECREF(module);
28096static CYTHON_SMALL_CODE
int __pyx_pymod_exec_csmoothers(PyObject *__pyx_pyinit_module)
28099 int stringtab_initialized = 0;
28100 #if CYTHON_USE_MODULE_STATE
28101 int pystate_addmodule_run = 0;
28103 __pyx_mstatetype *__pyx_mstate = NULL;
28104 PyObject *__pyx_t_1 = NULL;
28105 PyObject *__pyx_t_2 = NULL;
28106 PyObject *__pyx_t_3 = NULL;
28107 PyObject *__pyx_t_4 = NULL;
28108 PyObject *__pyx_t_5 = NULL;
28110 static PyThread_type_lock __pyx_t_7[8];
28112 PyObject *__pyx_t_9 = NULL;
28113 PyObject *__pyx_t_10 = NULL;
28114 int __pyx_lineno = 0;
28115 const char *__pyx_filename = NULL;
28116 int __pyx_clineno = 0;
28117 __Pyx_RefNannyDeclarations
28118 #if CYTHON_PEP489_MULTI_PHASE_INIT
28120 if (__pyx_m == __pyx_pyinit_module)
return 0;
28121 PyErr_SetString(PyExc_RuntimeError,
"Module 'csmoothers' has already been imported. Re-initialisation is not supported.");
28125 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
28128 #if CYTHON_PEP489_MULTI_PHASE_INIT
28129 __pyx_t_1 = __pyx_pyinit_module;
28130 Py_INCREF(__pyx_t_1);
28132 __pyx_t_1 = PyModule_Create(&__pyx_moduledef);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
28134 #if CYTHON_USE_MODULE_STATE
28136 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
28138 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28139 pystate_addmodule_run = 1;
28142 __pyx_m = __pyx_t_1;
28144 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28145 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
28147 __pyx_mstate = __pyx_mstate_global;
28148 CYTHON_UNUSED_VAR(__pyx_t_1);
28149 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
28150 Py_INCREF(__pyx_mstate->__pyx_d);
28151 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
28152 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef(
"cython_runtime");
if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
28153 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28155 #if CYTHON_REFNANNY
28156 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
28157 if (!__Pyx_RefNanny) {
28158 if (PyErr_ExceptionMatches(PyExc_Exception)) {
28160 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
28162 if (!__Pyx_RefNanny)
28163 Py_FatalError(
"failed to import 'refnanny' module");
28167__Pyx_RefNannySetupContext(
"PyInit_csmoothers", 0);
28168 __Pyx_init_runtime_version();
28169 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)
28170 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
28171 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
28172 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
28175 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28176 stringtab_initialized = 1;
28177 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28178 if (__pyx_module_is_main_csmoothers) {
28179 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)
28182 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
28183 if (!PyDict_GetItemString(modules,
"csmoothers")) {
28184 if (unlikely((PyDict_SetItemString(modules,
"csmoothers", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28188 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28190 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28191 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28193 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
28194 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
28195 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
28197 if (unlikely((__Pyx_modinit_Exttype___pyx_obj_10csmoothers_cASMFactor(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28198 if (unlikely((__Pyx_modinit_Exttype___pyx_obj_10csmoothers_cBASMFactor(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28199 if (unlikely((__Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28200 if (unlikely((__Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28201 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28202 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28203 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28204 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
28205 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
28206 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28217 __Pyx_PyThreadState_declare
28218 __Pyx_PyThreadState_assign
28219 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
28220 __Pyx_XGOTREF(__pyx_t_1);
28221 __Pyx_XGOTREF(__pyx_t_2);
28222 __Pyx_XGOTREF(__pyx_t_3);
28235 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_collections_abc};
28236 __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));
28237 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28238 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
28239 __Pyx_GOTREF(__pyx_t_4);
28241 __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)
28242 __Pyx_GOTREF(__pyx_t_5);
28243 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28244 __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)
28245 __Pyx_GOTREF(__pyx_t_4);
28246 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28247 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
28248 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
28249 __Pyx_GIVEREF(__pyx_t_4);
28260 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28261 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28262 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28263 goto __pyx_L7_try_end;
28265 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28266 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28276 __Pyx_ErrRestore(0,0,0);
28285 __Pyx_INCREF(Py_None);
28286 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
28287 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
28288 __Pyx_GIVEREF(Py_None);
28289 goto __pyx_L3_exception_handled;
28291 __pyx_L3_exception_handled:;
28292 __Pyx_XGIVEREF(__pyx_t_1);
28293 __Pyx_XGIVEREF(__pyx_t_2);
28294 __Pyx_XGIVEREF(__pyx_t_3);
28295 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
28307 __Pyx_PyThreadState_declare
28308 __Pyx_PyThreadState_assign
28309 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
28310 __Pyx_XGOTREF(__pyx_t_3);
28311 __Pyx_XGOTREF(__pyx_t_2);
28312 __Pyx_XGOTREF(__pyx_t_1);
28322 __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)
28323 __Pyx_GOTREF(__pyx_t_4);
28324 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)
28325 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28334 __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)
28335 __Pyx_GOTREF(__pyx_t_4);
28336 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)
28337 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28347 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28348 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28349 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28350 goto __pyx_L15_try_end;
28352 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28353 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28363 __Pyx_ErrRestore(0,0,0);
28364 goto __pyx_L11_exception_handled;
28366 __pyx_L11_exception_handled:;
28367 __Pyx_XGIVEREF(__pyx_t_3);
28368 __Pyx_XGIVEREF(__pyx_t_2);
28369 __Pyx_XGIVEREF(__pyx_t_1);
28370 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
28371 __pyx_L15_try_end:;
28384 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct_or_indirect};
28385 __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));
28386 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28387 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 326, __pyx_L1_error)
28388 __Pyx_GOTREF((PyObject *)__pyx_t_4);
28390 __Pyx_XGOTREF(generic);
28391 __Pyx_DECREF_SET(generic, ((PyObject *)__pyx_t_4));
28392 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
28405 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct};
28406 __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));
28407 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28408 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 327, __pyx_L1_error)
28409 __Pyx_GOTREF((PyObject *)__pyx_t_4);
28411 __Pyx_XGOTREF(strided);
28412 __Pyx_DECREF_SET(strided, ((PyObject *)__pyx_t_4));
28413 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
28426 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_indirect};
28427 __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));
28428 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28429 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 328, __pyx_L1_error)
28430 __Pyx_GOTREF((PyObject *)__pyx_t_4);
28432 __Pyx_XGOTREF(indirect);
28433 __Pyx_DECREF_SET(indirect, ((PyObject *)__pyx_t_4));
28434 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
28447 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_direct};
28448 __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));
28449 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28450 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 331, __pyx_L1_error)
28451 __Pyx_GOTREF((PyObject *)__pyx_t_4);
28453 __Pyx_XGOTREF(contiguous);
28454 __Pyx_DECREF_SET(contiguous, ((PyObject *)__pyx_t_4));
28455 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
28468 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_indirect};
28469 __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));
28470 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28471 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 332, __pyx_L1_error)
28472 __Pyx_GOTREF((PyObject *)__pyx_t_4);
28474 __Pyx_XGOTREF(indirect_contiguous);
28475 __Pyx_DECREF_SET(indirect_contiguous, ((PyObject *)__pyx_t_4));
28476 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
28486 __pyx_memoryview_thread_locks_used = 0;
28495 __pyx_t_7[0] = PyThread_allocate_lock();
28496 __pyx_t_7[1] = PyThread_allocate_lock();
28497 __pyx_t_7[2] = PyThread_allocate_lock();
28498 __pyx_t_7[3] = PyThread_allocate_lock();
28499 __pyx_t_7[4] = PyThread_allocate_lock();
28500 __pyx_t_7[5] = PyThread_allocate_lock();
28501 __pyx_t_7[6] = PyThread_allocate_lock();
28502 __pyx_t_7[7] = PyThread_allocate_lock();
28503 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_7,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
28513 __Pyx_PyThreadState_declare
28514 __Pyx_PyThreadState_assign
28515 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
28516 __Pyx_XGOTREF(__pyx_t_1);
28517 __Pyx_XGOTREF(__pyx_t_2);
28518 __Pyx_XGOTREF(__pyx_t_3);
28528 __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)
28529 __Pyx_GOTREF(__pyx_t_4);
28530 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)
28531 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28540 __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)
28541 __Pyx_GOTREF(__pyx_t_4);
28542 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)
28543 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28553 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28554 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28555 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28556 goto __pyx_L23_try_end;
28558 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28559 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28569 __Pyx_ErrRestore(0,0,0);
28570 goto __pyx_L19_exception_handled;
28572 __pyx_L19_exception_handled:;
28573 __Pyx_XGIVEREF(__pyx_t_1);
28574 __Pyx_XGIVEREF(__pyx_t_2);
28575 __Pyx_XGIVEREF(__pyx_t_3);
28576 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
28577 __pyx_L23_try_end:;
28588 __Pyx_PyThreadState_declare
28589 __Pyx_PyThreadState_assign
28590 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
28591 __Pyx_XGOTREF(__pyx_t_3);
28592 __Pyx_XGOTREF(__pyx_t_2);
28593 __Pyx_XGOTREF(__pyx_t_1);
28603 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence);
if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 986, __pyx_L26_error)
28614 __pyx_t_5 = __pyx_collections_abc_Sequence;
28615 __Pyx_INCREF(__pyx_t_5);
28618 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_memoryviewslice_type)};
28619 __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));
28620 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28621 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 990, __pyx_L26_error)
28622 __Pyx_GOTREF(__pyx_t_4);
28624 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28633 __pyx_t_5 = __pyx_collections_abc_Sequence;
28634 __Pyx_INCREF(__pyx_t_5);
28637 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_array_type)};
28638 __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));
28639 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28640 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 991, __pyx_L26_error)
28641 __Pyx_GOTREF(__pyx_t_4);
28643 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28662 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28663 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28664 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28665 goto __pyx_L31_try_end;
28667 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28668 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28678 __Pyx_ErrRestore(0,0,0);
28679 goto __pyx_L27_exception_handled;
28681 __pyx_L27_exception_handled:;
28682 __Pyx_XGIVEREF(__pyx_t_3);
28683 __Pyx_XGIVEREF(__pyx_t_2);
28684 __Pyx_XGIVEREF(__pyx_t_1);
28685 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
28686 __pyx_L31_try_end:;
28696 __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)
28697 __Pyx_GOTREF(__pyx_t_4);
28698 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)
28699 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28707 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
28708 __pyx_t_4 = __pyx_t_1;
28709 __Pyx_GOTREF(__pyx_t_4);
28710 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_4) < (0)) __PYX_ERR(0, 2, __pyx_L1_error)
28711 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28720 __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[3]);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
28721 __Pyx_GOTREF(__pyx_t_4);
28722 __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6, __pyx_L1_error)
28723 __Pyx_GOTREF(__pyx_t_5);
28724 __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_ASMFactor, __pyx_mstate_global->__pyx_n_u_ASMFactor, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, (PyObject *) NULL);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6, __pyx_L1_error)
28725 __Pyx_GOTREF(__pyx_t_9);
28726 if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[3]) {
28727 if (unlikely((PyDict_SetItemString(__pyx_t_9,
"__orig_bases__", __pyx_mstate_global->__pyx_tuple[3]) < 0))) __PYX_ERR(0, 6, __pyx_L1_error)
28737 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_9ASMFactor_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ASMFactor___init, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 8, __pyx_L1_error)
28738 __Pyx_GOTREF(__pyx_t_10);
28739 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28740 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
28742 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_10) < (0)) __PYX_ERR(0, 8, __pyx_L1_error)
28743 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
28752 __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASMFactor, __pyx_t_4, __pyx_t_9, NULL, 0, 0);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6, __pyx_L1_error)
28753 __Pyx_GOTREF(__pyx_t_10);
28754 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28755 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
28757 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ASMFactor, __pyx_t_10) < (0)) __PYX_ERR(0, 6, __pyx_L1_error)
28758 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
28759 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28760 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28761 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28768 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_10cASMFactor_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cASMFactor___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
28769 __Pyx_GOTREF(__pyx_t_4);
28770 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28771 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28773 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)
28774 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28782 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_10cASMFactor_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cASMFactor___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
28783 __Pyx_GOTREF(__pyx_t_4);
28784 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28785 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28787 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)
28788 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28797 __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[5]);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error)
28798 __Pyx_GOTREF(__pyx_t_4);
28799 __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error)
28800 __Pyx_GOTREF(__pyx_t_5);
28801 __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_BASMFactor, __pyx_mstate_global->__pyx_n_u_BASMFactor, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, (PyObject *) NULL);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error)
28802 __Pyx_GOTREF(__pyx_t_9);
28803 if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[5]) {
28804 if (unlikely((PyDict_SetItemString(__pyx_t_9,
"__orig_bases__", __pyx_mstate_global->__pyx_tuple[5]) < 0))) __PYX_ERR(0, 43, __pyx_L1_error)
28814 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_10BASMFactor_1__init__, 0, __pyx_mstate_global->__pyx_n_u_BASMFactor___init, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
28815 __Pyx_GOTREF(__pyx_t_10);
28816 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28817 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
28819 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_10) < (0)) __PYX_ERR(0, 45, __pyx_L1_error)
28820 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
28829 __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BASMFactor, __pyx_t_4, __pyx_t_9, NULL, 0, 0);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 43, __pyx_L1_error)
28830 __Pyx_GOTREF(__pyx_t_10);
28831 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28832 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
28834 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_BASMFactor, __pyx_t_10) < (0)) __PYX_ERR(0, 43, __pyx_L1_error)
28835 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
28836 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28837 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28838 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28845 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_11cBASMFactor_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cBASMFactor___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
28846 __Pyx_GOTREF(__pyx_t_4);
28847 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28848 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28850 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)
28851 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28859 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_11cBASMFactor_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cBASMFactor___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
28860 __Pyx_GOTREF(__pyx_t_4);
28861 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28862 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28864 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)
28865 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28874 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_1jacobi_NR_prepare, 0, __pyx_mstate_global->__pyx_n_u_jacobi_NR_prepare, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
28875 __Pyx_GOTREF(__pyx_t_4);
28876 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28877 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28879 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_jacobi_NR_prepare, __pyx_t_4) < (0)) __PYX_ERR(0, 85, __pyx_L1_error)
28880 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28889 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_3jacobi_NR_solve, 0, __pyx_mstate_global->__pyx_n_u_jacobi_NR_solve, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error)
28890 __Pyx_GOTREF(__pyx_t_4);
28891 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28892 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28894 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_jacobi_NR_solve, __pyx_t_4) < (0)) __PYX_ERR(0, 110, __pyx_L1_error)
28895 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28904 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_5nl_jacobi_NR_solve, 0, __pyx_mstate_global->__pyx_n_u_nl_jacobi_NR_solve, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error)
28905 __Pyx_GOTREF(__pyx_t_4);
28906 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28907 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28909 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_nl_jacobi_NR_solve, __pyx_t_4) < (0)) __PYX_ERR(0, 137, __pyx_L1_error)
28910 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28919 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_7gauss_seidel_NR_preare, 0, __pyx_mstate_global->__pyx_n_u_gauss_seidel_NR_preare, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
28920 __Pyx_GOTREF(__pyx_t_4);
28921 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28922 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28924 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_gauss_seidel_NR_preare, __pyx_t_4) < (0)) __PYX_ERR(0, 166, __pyx_L1_error)
28925 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28934 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_9gauss_seidel_NR_solve, 0, __pyx_mstate_global->__pyx_n_u_gauss_seidel_NR_solve, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
28935 __Pyx_GOTREF(__pyx_t_4);
28936 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28937 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28939 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_gauss_seidel_NR_solve, __pyx_t_4) < (0)) __PYX_ERR(0, 191, __pyx_L1_error)
28940 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28949 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve, 0, __pyx_mstate_global->__pyx_n_u_nl_gauss_seidel_NR_solve, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error)
28950 __Pyx_GOTREF(__pyx_t_4);
28951 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28952 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28954 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_nl_gauss_seidel_NR_solve, __pyx_t_4) < (0)) __PYX_ERR(0, 218, __pyx_L1_error)
28955 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28964 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_13asm_NR_prepare, 0, __pyx_mstate_global->__pyx_n_u_asm_NR_prepare, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
28965 __Pyx_GOTREF(__pyx_t_4);
28966 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28967 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28969 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_asm_NR_prepare, __pyx_t_4) < (0)) __PYX_ERR(0, 252, __pyx_L1_error)
28970 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28979 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_15asm_NR_solve, 0, __pyx_mstate_global->__pyx_n_u_asm_NR_solve, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
28980 __Pyx_GOTREF(__pyx_t_4);
28981 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28982 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28984 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_asm_NR_solve, __pyx_t_4) < (0)) __PYX_ERR(0, 278, __pyx_L1_error)
28985 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28994 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_17basm_NR_prepare, 0, __pyx_mstate_global->__pyx_n_u_basm_NR_prepare, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
28995 __Pyx_GOTREF(__pyx_t_4);
28996 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28997 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28999 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_basm_NR_prepare, __pyx_t_4) < (0)) __PYX_ERR(0, 322, __pyx_L1_error)
29000 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29009 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_19basm_NR_solve, 0, __pyx_mstate_global->__pyx_n_u_basm_NR_solve, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
29010 __Pyx_GOTREF(__pyx_t_4);
29011 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
29012 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
29014 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_basm_NR_solve, __pyx_t_4) < (0)) __PYX_ERR(0, 351, __pyx_L1_error)
29015 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29022 __pyx_t_4 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
29023 __Pyx_GOTREF(__pyx_t_4);
29024 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)
29025 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29031 __Pyx_XDECREF(__pyx_t_4);
29032 __Pyx_XDECREF(__pyx_t_5);
29033 __Pyx_XDECREF(__pyx_t_9);
29034 __Pyx_XDECREF(__pyx_t_10);
29036 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
29037 __Pyx_AddTraceback(
"init csmoothers", __pyx_clineno, __pyx_lineno, __pyx_filename);
29039 #if !CYTHON_USE_MODULE_STATE
29042 Py_DECREF(__pyx_m);
29043 if (pystate_addmodule_run) {
29044 PyObject *tp, *value, *tb;
29045 __Pyx_PyErr_FetchException(&tp, &value, &tb);
29046 __Pyx_State_RemoveModule(&__pyx_moduledef);
29047 __Pyx_PyErr_RestoreException(tp, value, tb);
29050 }
else if (!PyErr_Occurred()) {
29051 PyErr_SetString(PyExc_ImportError,
"init csmoothers");
29054 __Pyx_RefNannyFinishContext();
29055 #if CYTHON_PEP489_MULTI_PHASE_INIT
29056 return (__pyx_m != NULL) ? 0 : -1;
29064static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
29065 int __pyx_lineno = 0;
29066 const char *__pyx_filename = NULL;
29067 int __pyx_clineno = 0;
29068 CYTHON_UNUSED_VAR(__pyx_mstate);
29069 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_object);
if (!__pyx_builtin_object) __PYX_ERR(0, 6, __pyx_L1_error)
29070 __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_import);
if (!__pyx_builtin___import__) __PYX_ERR(1, 119, __pyx_L1_error)
29071 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 175, __pyx_L1_error)
29072 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 436, __pyx_L1_error)
29073 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 662, __pyx_L1_error)
29076 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
29077 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
29078 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
29079 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
29080 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
29081 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
29088static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
29089 __Pyx_RefNannyDeclarations
29090 int __pyx_lineno = 0;
29091 const char *__pyx_filename = NULL;
29092 int __pyx_clineno = 0;
29093 CYTHON_UNUSED_VAR(__pyx_mstate);
29094 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
29103 __pyx_mstate_global->__pyx_tuple[0] = PyTuple_New(1);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(1, 625, __pyx_L1_error)
29104 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
29105 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
29106 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_1);
29107 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);
29108 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
29117 __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)
29118 __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
29119 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
29128 __pyx_mstate_global->__pyx_tuple[1] = PyTuple_New(1);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 763, __pyx_L1_error)
29129 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
29130 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
29131 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
29132 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);
29133 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
29143 PyObject* __pyx_temp[1] = {__pyx_builtin_object};
29144 __pyx_mstate_global->__pyx_tuple[2] = __Pyx_PyTuple_FromArray(__pyx_temp, 1);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 6, __pyx_L1_error)
29145 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
29147 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
29149 PyObject* __pyx_temp[1] = {__pyx_builtin_object};
29150 __pyx_mstate_global->__pyx_tuple[3] = __Pyx_PyTuple_FromArray(__pyx_temp, 1);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 6, __pyx_L1_error)
29151 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
29153 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
29163 PyObject* __pyx_temp[1] = {__pyx_builtin_object};
29164 __pyx_mstate_global->__pyx_tuple[4] = __Pyx_PyTuple_FromArray(__pyx_temp, 1);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 43, __pyx_L1_error)
29165 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
29167 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
29169 PyObject* __pyx_temp[1] = {__pyx_builtin_object};
29170 __pyx_mstate_global->__pyx_tuple[5] = __Pyx_PyTuple_FromArray(__pyx_temp, 1);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 43, __pyx_L1_error)
29171 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
29173 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
29174 #if CYTHON_IMMORTAL_CONSTANTS
29176 PyObject **table = __pyx_mstate->__pyx_tuple;
29177 for (Py_ssize_t i=0; i<6; ++i) {
29178 #if PY_VERSION_HEX >= 0x030F0000
29179 PyUnstable_SetImmortal(table[i]);
29180 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29181 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
29182 #if PY_VERSION_HEX < 0x030E0000
29183 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
29185 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29188 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29191 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
29192 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29197 #if CYTHON_IMMORTAL_CONSTANTS
29199 PyObject **table = __pyx_mstate->__pyx_slice;
29200 for (Py_ssize_t i=0; i<1; ++i) {
29201 #if PY_VERSION_HEX >= 0x030F0000
29202 PyUnstable_SetImmortal(table[i]);
29203 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29204 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
29205 #if PY_VERSION_HEX < 0x030E0000
29206 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
29208 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29211 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29214 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
29215 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29220 __Pyx_RefNannyFinishContext();
29223 __Pyx_RefNannyFinishContext();
29228static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
29229 int __pyx_lineno = 0;
29230 const char *__pyx_filename = NULL;
29231 int __pyx_clineno = 0;
29232 CYTHON_UNUSED_VAR(__pyx_mstate);
29234 const struct {
const unsigned int length: 8; } str_length_index[] = {{6},{8},{15},{1},{2},{15},{23},{25},{32},{20},{22},{1},{1},{37},{45},{22},{179},{8},{15},{7},{6},{2},{9},{50},{39},{34},{22},{30},{37},{1},{5},{9},{18},{10},{19},{8},{1},{1},{1},{8},{15},{20},{12},{9},{17},{8},{7},{8},{12},{10},{8},{8},{13},{10},{15},{8},{7},{11},{14},{11},{10},{19},{14},{12},{10},{17},{13},{12},{12},{19},{8},{11},{12},{14},{13},{3},{15},{9},{14},{12},{18},{4},{10},{15},{13},{2},{1},{10},{28},{30},{11},{29},{31},{18},{5},{10},{2},{15},{6},{9},{5},{5},{6},{7},{22},{21},{2},{5},{5},{8},{17},{15},{7},{4},{4},{2},{4},{24},{18},{10},{2},{2},{5},{3},{6},{4},{3},{8},{4},{10},{5},{4},{5},{4},{4},{6},{3},{6},{6},{6},{1},{1}};
29235 const struct {
const unsigned int length: 6; } bytes_length_index[] = {{1},{9},{18},{18},{20},{20},{22},{22},{30},{30},{25},{28},{37},{24}};
29236 #ifndef CYTHON_COMPRESS_STRINGS
29237 #define CYTHON_COMPRESS_STRINGS 90
29239 #if (CYTHON_COMPRESS_STRINGS) == 1
29240static const char cstring[] =
"x\332}U;O$G\020\006\335!Y\326\005F~\310\201\203\346\345\305\006\006#\335Y\347\023\302Z0H\310\007\307C\262\234\265zzjv\373\350\351\236\355\307\336\256#\302\013\t/\334pB\207\033\022\022n\270?\303?\301\3253\373\002NH3\3335U\365UW}]]K\230#\277t\210\216\337\003w{\353\316\000\220\324\260F\006\312\375\024\275!\273\047\220i\323\375K\300\007\242S\262\313\265r\242\341\265\267\204\251\204$\302\004\334C\265Pc\203uF$\220\3148\023m\236\264\337\327M<\367~?`JiG\230\265\242\241\210\323\304\000K\266\264\222]\222\225I\2661\311c\325fR$$\323\tl\022\350\344\210\305P5^\013\373\326Rm\234a\252\266I\032\030j\354l\233,\007\334\212\260\216\260\344T; \256\211\304\034t]S+\202\272\004\244\210\3010\007\270[\310\017\243\232\340\244\310\331\341\331\326\313\327/\313l\r\004\032-\261>\346\022\023\005\033H\213\275\220\016\243\273n\0166\"\307)\351jO\024`^XE\216~\263\000\327\004E,\270 \220ZY3sB+\212p\241\032\265\021M\242\r\001}\304\244\205\210%\tE?\340Z\312`\323\312F,\346\211\260,\226\000*\3746\270\260\225\224(\215\005\245\314KG(5\220x\016\224\222\304\227\021\225V[X`[0\211V.\224p\224*\237\345\335\210rm \312\020\047\2301\254KR&dU\205\310r\244v\326\315g\3145\037y\344\006\323\364v\233\333Lk\254\320\330(\357v|\231W\360bRj\2164\223j\203\2049\026}\306Z\235X\240\274j\026\033\325\353\227\007\307\307\365\313\223#\306\2356\023!\242\264*a\177\242\332\177l<\224R\344V\330\267\047\027\227\320\362\2408\204\226\217\246\335O\351Y\267\203\357\037x\364\364\024:\356\002RJG\307\203\364!U\341\000\247B\003\234p\220\005E\0220a\325<,\251W\345\212\036v\014\256\330)\2452!J3&T\271\202c\223\320\330\326^\226\200\314h\212w\324\010(\r\212e\245Z\205L)\315\r\344\314\224\032\244\227\362&\360+\353\263\352k\264i\020CKV\222W\271\340W\030\373P\215\375\332.\360\036b\264<\223\343\035\306\3752\221xyKf\024\320\t\037\330\302\223\254\354L\245\023y\212s`C\311|r.\224\357\317\310\227X\212\205\023\206\305v\250\260\241\275\264\307\013\005\330\342\343\216\240\261OS\274\2406\253P(\320\323\2131\017\243/\253e\033\345\256\342BG\223(6f\026\342\t2\276\017\215g""\261\261\345\323$\371l\033=\340\342\236\355Q\3053\325\361\375\247\242\354?\035Fb\366\330/\024G\032\307D\371\025\327^\271\351\325J\376N\312\003F\316\252\001\217}\215s\021\360\204\313Y\006\306h\223J\326\2608\027\361\272\216\246c\203y\3546\013x\257\344\210\t$\342\241\266$D$8\240\241\023\032\335V?\377\300{\306u,f(\234*J\014\016\3530\251\303\204\016\375\2418\216\370LI\372\331\rP\377\000\256\020G\265I\300\250\\\231r\342`qU}9r\220k\334\266!,\016h\0132E\326F\263\256\234\031!Ad\321 \225\220[\247\3615\236;\247%^\000D\373\034G\016\340\337\202\007\373\241\363\356z~\370\374\313\217\0337\347\327\363\377}5\267\260\332\333\351\325{\347\303\325\255b\244Y\013\337=6\\\333.Z\250\371fn\341\307\360=\250\275\356?\353\277\272\235\257t\233\305NQ\037l\355\365\371\355\267\267\014u\337\215b\r\326~\375\227\367\277\356\277\275\233\257\264?\027\213\305\322`c\267\177\320\267\267\233w\301\367\373\271\205\345\336bo\251\2673\\^\031.o\024\325\032\236\312\272\022l\275\372peu\270\202\211\225kx*k\255\307z\255\301\372o\345.\317\356^\r\316\316+CT\234\027\254h\r\243\355\331\347\272>\374\342\305\307\303\233\305\260\034\335,\3412x\361\303\247?{\255\342y\261_\260\341\372fQ\277\347\364\356\323\033,9)\226\213\372\377\335\3625\t";
29241 PyObject *data = __Pyx_DecompressString(cstring, 1110, 1);
29242 #define __Pyx_DecompressString_LZSS_UNUSED
29243 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
29244 const char*
const bytes = __Pyx_PyBytes_AsString(data);
29245 #if !CYTHON_ASSUME_SAFE_MACROS
29246 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
29248 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90
29249static const char cstring[] =
"\377 at 0x o\377bject>(t\377ree frag\377ment).: \377<MemoryV\377iew of <\377contiguo\377us and d\263ir4\001\007\rin\021\005s\277trided\"\010 7or \004\031><(\tA\006\377>?Cannot\377 assign \377to read-\277only m\240\002v\376\242\000Invalid\377 mode, esxp\324\000|\000\047c\047t\001\377\047fortran\317\047, gH\000%\005sh\367ape\222\000 axi\377s Note t\375h\226 Cython\375 \021\000delibe\317ratek\000\320\001ct\373er!\001n PEPo-484\212\"re\303!\177s subcl\246\000\373es\261!built\375i\260\000ypes. \377If you n\311e\224 \303\000p\316\000%\tth\277en set\200\000e\373 \047\357\002ation\377_typing\047\366\355$iv\242\000o Fa\377lse.add_>\231 ecoll\305@+\000\377s.abcdis\277ableen\002\001g\367cis\004\003dno \377default \377__reduce\337__ duM\002no{n-\262@vial\033\000\377cinit__n\377umpy._co\357re.m5\000iar\377ray fail\316\300\003imp\330 \033\tum\267ath\021\016pr\333 u\177s/csmoo\350\000\177rs.pyxu\235\002\276\320Aalloc\344 >[\003data.\013\020\254C\374\376a\333cs.AASC\377IIASMFacwtor\000\006.__\275\003\365B\023\006B\013\017Elli\377psisLMRS\177equence\357\204\001}.\364\204\007__Pyx\001\000\377Dict_Nex?tRef__\230D\274 \333__\355B__\001\005ge_titem\r\001d0\001\356\027\000doc\034\001fun\014\003\002\037\000st\320`0\001\272#\005\002~\354\"__mainJ\001\357metaR\006mod\373uli\002mro_e\277ntriesp\001n\273am\200\002new\177\001p\237repar\222\002\334 _\177checksu\212\000\300\n\001n\004\025\001\321`\370@\037\001unopickY\000En \005\363vt\272a\316\001qual\210Z\005\250e\261fc\241\205\002\365\001\304de\275x\202!set_\216\005s\343et\341\006\003\006.\007tes\266\341`_c\265F_c\244G_\373cS\310\000seMat\277rix_is\202\204\001o\377utineabc\376\250e_buffer\347asm\372C\006\000_NR\371_\201$\007\004solve\377asyncio.\367cor@\003sbas\253eb1\006b-\013b0\tb\013sc\233\007c\330i\277\205\004\204%\017\n\214\341\016\323\010cB*\031\235\204\n5\017lz\201 _\243`trac\277\000\177ckcount\321\205\007\307dXd\334B\261 \333\212\003en\377codeenum\376\307\210\002errorfl\377agsforma\375t\227\211\004gauss_?seidel\276$\311`\374\006\r""\310\"idinde\365x\345\204\001s\000\002izej\037acobi\363(\007\007\374\"\307mem\246\212\001\236\212\001\262\204\001nc\177ndimnl_L\022\374\025\0000\014node_o\377rdernpnr\356\224\210\002obj\273\214\003pac\377kpopregi\377sterself\247set\345\210\004\341\212\002s\236\000s\357tart\035\000pst\375o\001\000ructto\367lun:\001upda\377tevalues\377wxO\200\001\330\004\n\377\210+\220Q\200\001\360\020\377\000\005$\2401\240A\240_Q\330$-\250\013\004%\014\001\177\240a\330%/\250q!\000\377\024\000\005&\240Q\240a\377\320\0478\270\003\2705\300\375\001\016\003,\2501\250A\320\377->\270c\300\025\300a\372I\000\026E\004\320%6\260c\277\270\023\270L\310\001\020\003*\377\250\021\250!\320+<\270\277C\270s\300,\310(\001\030\377\000\005\"\240\021\240!\240\3771\330\"#\330\"+\250\244\002\003\010\000#\223\000\033\000#\030\001\240?A\330#$\330#\226\000\003\002\372\010\000$\030\003\047\240a\240q\367\320(9a\002\003\3105\320\373PQ1\003.\250Q\250a\037\250q\330./\000\000\000\003\t\000\377\200A\330\010\014\210E\220\335\021\003\001F\220!\013\000\320\014\377\034\230K\240q\250\004\250\377B\250a\330(,\250A\356\030\nO\230:\360\000d\250\"\003\250A";
29250 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 1489, 2126);
29251 #define __Pyx_DecompressString_UNUSED
29252 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
29253 const char*
const bytes = __Pyx_PyBytes_AsString(data);
29254 #if !CYTHON_ASSUME_SAFE_MACROS
29255 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
29258static const char bytes[] =
" at 0x object>(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/csmoothers.pyxunable to allocate array data.unable to allocate shape and strides.AASCIIASMFactorASMFactor.__init__BASMFactorBASMFactor.__init__EllipsisLMRSequenceView.MemoryView__Pyx_PyDict_NextRef__annotate____class____class_getitem____dict____doc____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___cASMFactor_cBASMFactor_cSparseMatrix_is_coroutineabcallocate_bufferasmFactorasm_NR_prepareasm_NR_solveasyncio.coroutinesbasebasmFactorbasm_NR_preparebasm_NR_solvebsccASMFactorcASMFactor.__reduce_cython__cASMFactor.__setstate_cython__cBASMFactorcBASMFactor.__reduce_cython__cBASMFactor.__setstate_cython__cline_in_tracebackcountcsmoothersdXdtype_is_objectencodeenumerateerrorflagsformatfortrangauss_seidel_NR_prearegauss_seidel_NR_solveidindexitemsitemsizejacobi_NR_preparejacobi_NR_solvememviewmodenamencndimnl_gauss_seidel_NR_solvenl_jacobi_NR_solvenode_ordernpnrnumpyobjobjectpackpopregisterselfsetdefaultshapesizestartstepstopstructtolunpackupdatevalueswxO\200\001\330\004\n\210+\220Q\200\001\360\020\000\005$\2401\240A\240Q\330$-\250Q\200\001\360\020\000\005%\240A\240Q\240a\330%/\250q\200\001\360\024\000\005&""\240Q\240a\320\0478\270\003\2705\300\001\200\001\360\024\000\005,\2501\250A\320->\270c\300\025\300a\200\001\360\026\000\005$\2401\240A\320%6\260c\270\023\270L\310\001\200\001\360\026\000\005*\250\021\250!\320+<\270C\270s\300,\310a\200\001\360\030\000\005\"\240\021\240!\2401\330\"#\330\"+\2501\330\"#\330\"#\330\"#\200\001\360\030\000\005#\240!\2401\240A\330#$\330#-\250Q\330#$\330#$\330#$\200\001\360\030\000\005\047\240a\240q\320(9\270\023\270L\310\003\3105\320PQ\200\001\360\030\000\005.\250Q\250a\250q\330./\330./\330./\330./\330./\200A\330\010\014\210E\220\021\330\010\014\210F\220!\330\010\014\320\014\034\230K\240q\250\004\250B\250a\330(,\250A\200A\330\010\014\210E\220\021\330\010\014\210O\230:\240Q\240d\250\"\250A";
29259 PyObject *data = NULL;
29260 #define __Pyx_DecompressString_UNUSED
29261 #define __Pyx_DecompressString_LZSS_UNUSED
29263 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
29264 Py_ssize_t pos = 0;
29265 for (
int i = 0; i < 142; i++) {
29266 Py_ssize_t bytes_length = str_length_index[i].length;
29267 PyObject *
string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
29268 if (likely(
string) && i >= 29) PyUnicode_InternInPlace(&
string);
29269 if (unlikely(!
string)) {
29271 __PYX_ERR(0, 1, __pyx_L1_error)
29273 stringtab[i] = string;
29274 pos += bytes_length;
29276 for (
int i = 142; i < 156; i++) {
29277 Py_ssize_t bytes_length = bytes_length_index[i-142].length;
29278 PyObject *
string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
29279 stringtab[i] = string;
29280 pos += bytes_length;
29281 if (unlikely(!
string)) {
29283 __PYX_ERR(0, 1, __pyx_L1_error)
29287 for (Py_ssize_t i = 0; i < 156; i++) {
29288 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
29289 __PYX_ERR(0, 1, __pyx_L1_error)
29292 #if CYTHON_IMMORTAL_CONSTANTS
29294 PyObject **table = stringtab + 142;
29295 for (Py_ssize_t i=0; i<14; ++i) {
29296 #if PY_VERSION_HEX >= 0x030F0000
29297 PyUnstable_SetImmortal(table[i]);
29298 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29299 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
29300 #if PY_VERSION_HEX < 0x030E0000
29301 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
29303 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29306 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29309 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
29310 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29317 PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
29318 int8_t
const cint_constants_1[] = {0,-1};
29319 int32_t
const cint_constants_4[] = {136983863L};
29320 for (
int i = 0; i < 3; i++) {
29321 numbertab[i] = PyLong_FromLong((i < 2 ? cint_constants_1[i - 0] : cint_constants_4[i - 2]));
29322 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
29325 #if CYTHON_IMMORTAL_CONSTANTS
29327 PyObject **table = __pyx_mstate->__pyx_number_tab;
29328 for (Py_ssize_t i=0; i<3; ++i) {
29329 #if PY_VERSION_HEX >= 0x030F0000
29330 PyUnstable_SetImmortal(table[i]);
29331 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29332 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
29333 #if PY_VERSION_HEX < 0x030E0000
29334 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
29336 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29339 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29342 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
29343 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29357 unsigned int argcount : 3;
29358 unsigned int num_posonly_args : 1;
29359 unsigned int num_kwonly_args : 1;
29360 unsigned int nlocals : 3;
29361 unsigned int flags : 10;
29362 unsigned int first_line : 9;
29363} __Pyx_PyCode_New_function_description;
29368static PyObject* __Pyx_PyCode_New(
29369 const __Pyx_PyCode_New_function_description descr,
29370 PyObject *
const *varnames,
29371 PyObject *filename,
29372 PyObject *funcname,
29373 PyObject *line_table,
29374 PyObject *tuple_dedup_map
29378static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
29379 PyObject* tuple_dedup_map = PyDict_New();
29380 if (unlikely(!tuple_dedup_map))
return -1;
29382 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 8};
29383 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_L};
29384 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_E_O_Qd_A, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0]))
goto bad;
29387 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
29388 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self};
29389 __pyx_mstate_global->__pyx_codeobj_tab[1] = __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[1]))
goto bad;
29392 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
29393 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
29394 __pyx_mstate_global->__pyx_codeobj_tab[2] = __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[2]))
goto bad;
29397 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 45};
29398 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_L, __pyx_mstate->__pyx_n_u_bs};
29399 __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_E_F_Kq_Ba_A, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3]))
goto bad;
29402 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
29403 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self};
29404 __pyx_mstate_global->__pyx_codeobj_tab[4] = __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[4]))
goto bad;
29407 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
29408 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
29409 __pyx_mstate_global->__pyx_codeobj_tab[5] = __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[5]))
goto bad;
29412 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 85};
29413 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_M};
29414 __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_jacobi_NR_prepare, __pyx_mstate->__pyx_kp_b_iso88591_Qa_8_5, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6]))
goto bad;
29417 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 110};
29418 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_node_order, __pyx_mstate->__pyx_n_u_dX};
29419 __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_jacobi_NR_solve, __pyx_mstate->__pyx_kp_b_iso88591_1A_6c_L, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7]))
goto bad;
29422 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 137};
29423 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_node_order, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_dX};
29424 __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_nl_jacobi_NR_solve, __pyx_mstate->__pyx_kp_b_iso88591_aq_9_L_5PQ, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8]))
goto bad;
29427 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 166};
29428 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_M};
29429 __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_gauss_seidel_NR_preare, __pyx_mstate->__pyx_kp_b_iso88591_1A_c_a, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9]))
goto bad;
29432 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 191};
29433 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_node_order, __pyx_mstate->__pyx_n_u_dX};
29434 __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_gauss_seidel_NR_solve, __pyx_mstate->__pyx_kp_b_iso88591_Cs_a, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10]))
goto bad;
29437 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 218};
29438 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_node_order, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_dX};
29439 __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_nl_gauss_seidel_NR_solve, __pyx_mstate->__pyx_kp_b_iso88591_Qaq, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11]))
goto bad;
29442 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 252};
29443 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_asmFactor};
29444 __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_asm_NR_prepare, __pyx_mstate->__pyx_kp_b_iso88591_1AQ_Q, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12]))
goto bad;
29447 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 278};
29448 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_asmFactor, __pyx_mstate->__pyx_n_u_node_order, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_dX};
29449 __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_asm_NR_solve, __pyx_mstate->__pyx_kp_b_iso88591_1_1, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13]))
goto bad;
29452 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 322};
29453 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_basmFactor};
29454 __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_basm_NR_prepare, __pyx_mstate->__pyx_kp_b_iso88591_AQa_q, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14]))
goto bad;
29457 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 351};
29458 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_basmFactor, __pyx_mstate->__pyx_n_u_node_order, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_dX};
29459 __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_basm_NR_solve, __pyx_mstate->__pyx_kp_b_iso88591_1A_Q, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15]))
goto bad;
29461 Py_DECREF(tuple_dedup_map);
29464 Py_DECREF(tuple_dedup_map);
29469static int __Pyx_InitGlobals(
void) {
29470 int __pyx_lineno = 0;
29471 const char *__pyx_filename = NULL;
29472 int __pyx_clineno = 0;
29474 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0));
else
29476 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29479 #if CYTHON_COMPILING_IN_LIMITED_API
29481 PyObject *builtins = PyEval_GetBuiltins();
29482 if (likely(builtins)) {
29483 PyObject *type_name = PyUnicode_FromStringAndSize(
"frozendict",
sizeof(
"frozendict")-1);
29484 if (likely(type_name)) {
29485 PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
29486 Py_DECREF(type_name);
29487 if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
29489 frozendict_type = (PyObject*) &PyDict_Type;
29490 Py_INCREF(frozendict_type);
29492 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
29498 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29501 if (likely(__Pyx_init_assertions_enabled() == 0));
else
29503 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29512 #ifdef NPY_FEATURE_VERSION
29513 #ifndef NO_IMPORT_ARRAY
29514 if (unlikely(_import_array() == -1)) {
29515 PyErr_SetString(PyExc_ImportError,
"numpy.core.multiarray failed to import "
29516 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
29517 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
29522 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29525 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0));
else
29527 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29530 #if CYTHON_COMPILING_IN_LIMITED_API
29532 PyObject *typesModule=NULL;
29533 typesModule = PyImport_ImportModule(
"types");
29535 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule,
"MethodType");
29536 Py_DECREF(typesModule);
29541 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29549static int __Pyx_InitAfterSharedUtility(
void) {
29550 int __pyx_lineno = 0;
29551 const char *__pyx_filename = NULL;
29552 int __pyx_clineno = 0;
29554 if (likely(__pyx_CyFunction_init(__pyx_m) == 0));
else
29556 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29567#pragma warning( push )
29572#pragma warning( disable : 4127 )
29582static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
29583 PyObject *m = NULL, *p = NULL;
29585 m = PyImport_ImportModule(modname);
29587 p = PyObject_GetAttrString(m,
"RefNannyAPI");
29589 r = PyLong_AsVoidPtr(p);
29593 return (__Pyx_RefNannyAPIStruct *)
r;
29598#if CYTHON_COMPILING_IN_CPYTHON
29599static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
29601 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
29605 return b == &PyBaseObject_Type;
29607static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
29609 if (a == b)
return 1;
29613 n = PyTuple_GET_SIZE(mro);
29614 for (i = 0; i <
n; i++) {
29615 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
29620 return __Pyx_InBases(a, b);
29622static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
29624 if (cls == a || cls == b)
return 1;
29628 n = PyTuple_GET_SIZE(mro);
29629 for (i = 0; i <
n; i++) {
29630 PyObject *base = PyTuple_GET_ITEM(mro, i);
29631 if (base == (PyObject *)a || base == (PyObject *)b)
29636 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
29641#if CYTHON_FAST_THREAD_STATE
29642static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
29643#if PY_VERSION_HEX >= 0x030C00A6
29644 PyObject *tmp_value;
29645 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
29647 #if CYTHON_COMPILING_IN_CPYTHON
29648 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
29650 PyException_SetTraceback(value, tb);
29652 tmp_value = tstate->current_exception;
29653 tstate->current_exception = value;
29654 Py_XDECREF(tmp_value);
29658 PyObject *tmp_type, *tmp_value, *tmp_tb;
29659 tmp_type = tstate->curexc_type;
29660 tmp_value = tstate->curexc_value;
29661 tmp_tb = tstate->curexc_traceback;
29662 tstate->curexc_type = type;
29663 tstate->curexc_value = value;
29664 tstate->curexc_traceback = tb;
29665 Py_XDECREF(tmp_type);
29666 Py_XDECREF(tmp_value);
29667 Py_XDECREF(tmp_tb);
29670static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29671#if PY_VERSION_HEX >= 0x030C00A6
29672 PyObject* exc_value;
29673 exc_value = tstate->current_exception;
29674 tstate->current_exception = 0;
29675 *value = exc_value;
29679 *type = (PyObject*) Py_TYPE(exc_value);
29681 #if CYTHON_COMPILING_IN_CPYTHON
29682 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
29685 *tb = PyException_GetTraceback(exc_value);
29689 *type = tstate->curexc_type;
29690 *value = tstate->curexc_value;
29691 *tb = tstate->curexc_traceback;
29692 tstate->curexc_type = 0;
29693 tstate->curexc_value = 0;
29694 tstate->curexc_traceback = 0;
29700#if CYTHON_COMPILING_IN_CPYTHON
29701static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
29703 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
29705 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
29708static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29710 assert(PyExceptionClass_Check(exc_type));
29711 n = PyTuple_GET_SIZE(tuple);
29712 for (i=0; i<
n; i++) {
29713 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
29715 for (i=0; i<
n; i++) {
29716 PyObject *t = PyTuple_GET_ITEM(tuple, i);
29717 if (likely(PyExceptionClass_Check(t))) {
29718 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
29724static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
29725 if (likely(err == exc_type))
return 1;
29726 if (likely(PyExceptionClass_Check(err))) {
29727 if (likely(PyExceptionClass_Check(exc_type))) {
29728 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
29729 }
else if (likely(PyTuple_Check(exc_type))) {
29730 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
29734 return PyErr_GivenExceptionMatches(err, exc_type);
29736static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
29737 assert(PyExceptionClass_Check(exc_type1));
29738 assert(PyExceptionClass_Check(exc_type2));
29739 if (likely(err == exc_type1 || err == exc_type2))
return 1;
29740 if (likely(PyExceptionClass_Check(err))) {
29741 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
29743 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
29748#if CYTHON_FAST_THREAD_STATE
29749static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29751 n = PyTuple_GET_SIZE(tuple);
29752 for (i=0; i<
n; i++) {
29753 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
29755 for (i=0; i<
n; i++) {
29756 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
29760static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
29762 PyObject *exc_type;
29763#if PY_VERSION_HEX >= 0x030C00A6
29764 PyObject *current_exception = tstate->current_exception;
29765 if (unlikely(!current_exception))
return 0;
29766 exc_type = (PyObject*) Py_TYPE(current_exception);
29767 if (exc_type == err)
return 1;
29769 exc_type = tstate->curexc_type;
29770 if (exc_type == err)
return 1;
29771 if (unlikely(!exc_type))
return 0;
29773 #if CYTHON_AVOID_BORROWED_REFS
29774 Py_INCREF(exc_type);
29776 if (unlikely(PyTuple_Check(err))) {
29777 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
29779 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
29781 #if CYTHON_AVOID_BORROWED_REFS
29782 Py_DECREF(exc_type);
29789#if CYTHON_USE_TYPE_SLOTS
29790static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
29791 PyTypeObject* tp = Py_TYPE(obj);
29792 if (likely(tp->tp_getattro))
29793 return tp->tp_getattro(obj, attr_name);
29794 return PyObject_GetAttr(obj, attr_name);
29799#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
29800static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
29801 __Pyx_PyThreadState_declare
29802 __Pyx_PyThreadState_assign
29803 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
29804 __Pyx_PyErr_Clear();
29807static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
29809#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
29810 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
29813#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
29814 PyTypeObject* tp = Py_TYPE(obj);
29815 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
29816 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
29819 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
29820 if (unlikely(!result)) {
29821 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
29828static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
29829 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
29830 if (unlikely(!result) && !PyErr_Occurred()) {
29831 PyErr_Format(PyExc_NameError,
29832 "name '%U' is not defined", name);
29838#if CYTHON_COMPILING_IN_CPYTHON
29839static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
29842 for (i = 0; i < length; i++) {
29843 v = dest[i] = src[i];
29850#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
29851CYTHON_UNUSED
static PyObject *
29852__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n) {
29854 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
29856 PyObject *res = PyTuple_New(
n);
29857 if (unlikely(res == NULL))
return NULL;
29858 #if CYTHON_COMPILING_IN_CPYTHON
29859 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item,
n);
29862 for (i = 0; i <
n; i++) {
29864 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
29875#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
29876#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
29877static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
29878 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
29879 int result = PyUnicode_Equal(s1, s2);
29880 #if !CYTHON_COMPILING_IN_CPYTHON
29881 if (unlikely(result == -1))
return -1;
29883 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
29885 int result = PyUnicode_Compare(s1, s2);
29886 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
29887 if (result == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
29895static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop) {
29896 CYTHON_UNUSED_VAR(pyop);
29897 if (unlikely(op1 == Py_None)) {
29898 if (op2 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
29900 if (unlikely(op2 == Py_None)) {
29901 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
29904 if (likely(op1 != Py_None)) {
29905 if (op1 == op2)
goto __pyx_return_true;
29906 if (likely(op2 != Py_None)) {
29907 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
29909 goto __pyx_richcmp;
29912 if ((0))
goto __pyx_richcmp;
29913 if ((0))
goto __pyx_return_true;
29914 if ((0))
goto __pyx_return_false;
29916 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
29924#if CYTHON_VECTORCALL
29925static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s)
29927 Py_ssize_t i,
n = __Pyx_PyTuple_GET_SIZE(kwnames);
29928 #if !CYTHON_ASSUME_SAFE_SIZE
29929 if (unlikely(
n == -1))
return NULL;
29931 for (i = 0; i <
n; i++)
29933 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
29934 #if !CYTHON_ASSUME_SAFE_MACROS
29935 if (unlikely(!namei))
return NULL;
29937 if (
s == namei)
return kwvalues[i];
29939 for (i = 0; i <
n; i++)
29941 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
29942 #if !CYTHON_ASSUME_SAFE_MACROS
29943 if (unlikely(!namei))
return NULL;
29945 int eq = __Pyx_PyUnicode_Equals(
s, namei);
29946 if (unlikely(eq != 0)) {
29947 if (unlikely(eq < 0))
return NULL;
29948 return kwvalues[i];
29953#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
29954CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues) {
29955 Py_ssize_t i, nkwargs;
29957#if !CYTHON_ASSUME_SAFE_SIZE
29958 nkwargs = PyTuple_Size(kwnames);
29959 if (unlikely(nkwargs < 0))
return NULL;
29961 nkwargs = PyTuple_GET_SIZE(kwnames);
29963 dict = PyDict_New();
29964 if (unlikely(!dict))
29966 for (i=0; i<nkwargs; i++) {
29967#if !CYTHON_ASSUME_SAFE_MACROS
29968 PyObject *key = PyTuple_GetItem(kwnames, i);
29969 if (!key)
goto bad;
29971 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
29973 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
29985#if CYTHON_COMPILING_IN_CPYTHON
29986static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
29988 ternaryfunc call = Py_TYPE(func)->tp_call;
29989 if (unlikely(!call))
29990 return PyObject_Call(func, arg, kw);
29991 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
29993 result = (*call)(func, arg, kw);
29994 Py_LeaveRecursiveCall();
29995 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29998 "NULL result without error in PyObject_Call");
30005#if CYTHON_COMPILING_IN_CPYTHON
30006static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
30007 PyObject *self, *result;
30009 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
30010 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
30011 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
30013 result = cfunc(self, arg);
30014 Py_LeaveRecursiveCall();
30015 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
30018 "NULL result without error in PyObject_Call");
30025#if CYTHON_COMPILING_IN_LIMITED_API
30026static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject *
const*args,
size_t nargs, PyObject *kwargs) {
30027 PyObject *argstuple;
30028 PyObject *result = 0;
30030 argstuple = PyTuple_New((Py_ssize_t)nargs);
30031 if (unlikely(!argstuple))
return NULL;
30032 for (i = 0; i < nargs; i++) {
30033 Py_INCREF(args[i]);
30034 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0))
goto bad;
30036 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
30038 Py_DECREF(argstuple);
30042#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
30043 #if CYTHON_COMPILING_IN_CPYTHON
30044static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
30045 PyTypeObject *tp = Py_TYPE(callable);
30046 #if defined(__Pyx_CyFunction_USED)
30047 if (__Pyx_CyFunction_CheckExact(callable)) {
30048 return __Pyx_CyFunction_func_vectorcall(callable);
30051 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
30054 assert(PyCallable_Check(callable));
30055 Py_ssize_t offset = tp->tp_vectorcall_offset;
30056 assert(offset > 0);
30057 vectorcallfunc ptr;
30058 memcpy(&ptr, (
char *) callable + offset,
sizeof(ptr));
30062 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
30065static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwargs) {
30066 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
30067#if CYTHON_COMPILING_IN_CPYTHON
30068 if (nargs == 0 && kwargs == NULL) {
30069 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
30070 return __Pyx_PyObject_CallMethO(func, NULL);
30072 else if (nargs == 1 && kwargs == NULL) {
30073 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
30074 return __Pyx_PyObject_CallMethO(func, args[0]);
30077 if (kwargs == NULL) {
30078 #if CYTHON_VECTORCALL
30079 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30080 return PyObject_Vectorcall(func, args, nargsf, NULL);
30082 vectorcallfunc
f = __Pyx_PyVectorcall_Function(func);
30084 return f(func, args, nargsf, NULL);
30090 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
30092 #if CYTHON_COMPILING_IN_LIMITED_API
30093 return __Pyx_PyObject_FastCall_fallback(func, args, (
size_t)nargs, kwargs);
30094 #elif CYTHON_COMPILING_IN_PYPY
30095 return PyObject_VectorcallDict(func, args, (
size_t) nargs, kwargs);
30097 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
30102static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
30103 PyObject *args[2] = {NULL, arg};
30104 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
30108static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
30109 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
30117#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
30118static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
30120 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
30121 if (unlikely(!selfless_args))
return NULL;
30122 result = PyObject_Call(method, selfless_args, kwargs);
30123 Py_DECREF(selfless_args);
30127static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames) {
30128 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (
size_t) nargs-1 : 0, kwnames);
30131static PyMethodDef __Pyx_UnboundCMethod_Def = {
30132 "CythonUnboundCMethod",
30133 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
30134#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
30135 METH_VARARGS | METH_KEYWORDS,
30137 METH_FASTCALL | METH_KEYWORDS,
30141static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
30142 PyObject *method, *result=NULL;
30143 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
30144 if (unlikely(!method))
30147#if CYTHON_COMPILING_IN_CPYTHON
30148 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
30150 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
30151 target->func = descr->d_method->ml_meth;
30152 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
30155#if CYTHON_COMPILING_IN_PYPY
30157 if (PyCFunction_Check(method))
30162#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30163 self = PyObject_GetAttrString(method,
"__self__");
30164 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
30168 self = PyCFunction_GET_SELF(method);
30170 self_found = (self && self != Py_None);
30171#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30175 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
30176 if (unlikely(!unbound_method))
return -1;
30178 result = unbound_method;
30181#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
30182 if (unlikely(target->method)) {
30186 target->method = result;
30191#if CYTHON_COMPILING_IN_CPYTHON
30192static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
30193 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
30194 if (likely(was_initialized == 2 && cfunc->func)) {
30195 if (likely(cfunc->flag == METH_NOARGS))
30196 return __Pyx_CallCFunction(cfunc, self, NULL);
30197 if (likely(cfunc->flag == METH_FASTCALL))
30198 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
30199 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
30200 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
30201 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
30202 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
30203 if (cfunc->flag == METH_VARARGS)
30204 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
30205 return __Pyx__CallUnboundCMethod0(cfunc, self);
30207#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
30208 else if (unlikely(was_initialized == 1)) {
30209 __Pyx_CachedCFunction tmp_cfunc = {
30214 tmp_cfunc.type = cfunc->type;
30215 tmp_cfunc.method_name = cfunc->method_name;
30216 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
30219 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
30220 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
30224static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
30226 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
30227 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
30232static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
30233 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
30237static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
30238 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
30242#if CYTHON_AVOID_BORROWED_REFS
30243static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
30244 PyObject *next = NULL;
30247 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
30248 if (unlikely(!dictview))
goto bad;
30249 *ppos = PyObject_GetIter(dictview);
30250 Py_DECREF(dictview);
30252 *ppos = PyObject_GetIter(p);
30254 if (unlikely(!*ppos))
goto bad;
30256 next = PyIter_Next(*ppos);
30258 if (PyErr_Occurred())
goto bad;
30261 if (pkey && pvalue) {
30262 *pkey = __Pyx_PySequence_ITEM(next, 0);
30263 if (unlikely(*pkey))
goto bad;
30264 *pvalue = __Pyx_PySequence_ITEM(next, 1);
30265 if (unlikely(*pvalue))
goto bad;
30276#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
30277 PyErr_FormatUnraisable(
"Exception ignored in __Pyx_PyDict_NextRef");
30279 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
30281 if (pkey) *pkey = NULL;
30282 if (pvalue) *pvalue = NULL;
30286static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
30287 int result = PyDict_Next(p, ppos, pkey, pvalue);
30288 if (likely(result == 1)) {
30289 if (pkey) Py_INCREF(*pkey);
30290 if (pvalue) Py_INCREF(*pvalue);
30297static void __Pyx_RaiseDoubleKeywordsError(
30298 const char* func_name,
30301 PyErr_Format(PyExc_TypeError,
30302 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
30306#if CYTHON_COMPILING_IN_CPYTHON
30307static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
30308 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
30309 if (likely(was_initialized == 2 && cfunc->func)) {
30310 PyObject *args[2] = {arg1, arg2};
30311 if (cfunc->flag == METH_FASTCALL) {
30312 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
30314 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
30315 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
30317#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
30318 else if (unlikely(was_initialized == 1)) {
30319 __Pyx_CachedCFunction tmp_cfunc = {
30324 tmp_cfunc.type = cfunc->type;
30325 tmp_cfunc.method_name = cfunc->method_name;
30326 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
30329 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
30330 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
30334static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
30335 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
30336#if CYTHON_COMPILING_IN_CPYTHON
30337 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
30338 PyObject *result = NULL;
30339 PyObject *args = PyTuple_New(2);
30340 if (unlikely(!args))
return NULL;
30342 PyTuple_SET_ITEM(args, 0, arg1);
30344 PyTuple_SET_ITEM(args, 1, arg2);
30345 if (cfunc->flag & METH_KEYWORDS)
30346 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
30348 result = __Pyx_CallCFunction(cfunc, self, args);
30354 PyObject *args[4] = {NULL, self, arg1, arg2};
30355 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
30360static int __Pyx_ValidateDuplicatePosArgs(
30362 PyObject **
const argnames[],
30363 PyObject **
const *first_kw_arg,
30364 const char* function_name)
30366 PyObject **
const *name = argnames;
30367 while (name != first_kw_arg) {
30368 PyObject *key = **name;
30369 int found = PyDict_Contains(kwds, key);
30370 if (unlikely(found)) {
30371 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
30380#if CYTHON_USE_UNICODE_INTERNALS
30381static CYTHON_INLINE
int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
30383 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
30384 if (len != PyUnicode_GET_LENGTH(s2))
return 0;
30385 kind = PyUnicode_KIND(s1);
30386 if (kind != PyUnicode_KIND(s2))
return 0;
30387 const void *data1 = PyUnicode_DATA(s1);
30388 const void *data2 = PyUnicode_DATA(s2);
30389 return (memcmp(data1, data2, (
size_t) len * (
size_t) kind) == 0);
30392static int __Pyx_MatchKeywordArg_str(
30394 PyObject **
const argnames[],
30395 PyObject **
const *first_kw_arg,
30396 size_t *index_found,
30397 const char *function_name)
30399 PyObject **
const *name;
30400 #if CYTHON_USE_UNICODE_INTERNALS
30401 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
30402 if (unlikely(key_hash == -1)) {
30403 key_hash = PyObject_Hash(key);
30404 if (unlikely(key_hash == -1))
30408 name = first_kw_arg;
30410 PyObject *name_str = **name;
30411 #if CYTHON_USE_UNICODE_INTERNALS
30412 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
30413 *index_found = (size_t) (name - argnames);
30417 #if CYTHON_ASSUME_SAFE_SIZE
30418 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
30421 int cmp = PyUnicode_Compare(name_str, key);
30422 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
30424 *index_found = (size_t) (name - argnames);
30432 while (name != first_kw_arg) {
30433 PyObject *name_str = **name;
30434 #if CYTHON_USE_UNICODE_INTERNALS
30435 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
30436 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
30437 goto arg_passed_twice;
30440 #if CYTHON_ASSUME_SAFE_SIZE
30441 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
30444 if (unlikely(name_str == key))
goto arg_passed_twice;
30445 int cmp = PyUnicode_Compare(name_str, key);
30446 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
30447 if (cmp == 0)
goto arg_passed_twice;
30454 __Pyx_RaiseDoubleKeywordsError(function_name, key);
30459static int __Pyx_MatchKeywordArg_nostr(
30461 PyObject **
const argnames[],
30462 PyObject **
const *first_kw_arg,
30463 size_t *index_found,
30464 const char *function_name)
30466 PyObject **
const *name;
30467 if (unlikely(!PyUnicode_Check(key)))
goto invalid_keyword_type;
30468 name = first_kw_arg;
30470 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
30472 *index_found = (size_t) (name - argnames);
30475 if (unlikely(cmp == -1))
goto bad;
30479 while (name != first_kw_arg) {
30480 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
30481 if (unlikely(cmp != 0)) {
30482 if (cmp == 1)
goto arg_passed_twice;
30489 __Pyx_RaiseDoubleKeywordsError(function_name, key);
30491invalid_keyword_type:
30492 PyErr_Format(PyExc_TypeError,
30493 "%.200s() keywords must be strings", function_name);
30498static CYTHON_INLINE
int __Pyx_MatchKeywordArg(
30500 PyObject **
const argnames[],
30501 PyObject **
const *first_kw_arg,
30502 size_t *index_found,
30503 const char *function_name)
30505 return likely(PyUnicode_CheckExact(key)) ?
30506 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
30507 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
30509static void __Pyx_RejectUnknownKeyword(
30511 PyObject **
const argnames[],
30512 PyObject **
const *first_kw_arg,
30513 const char *function_name)
30515 #if CYTHON_AVOID_BORROWED_REFS
30516 PyObject *pos = NULL;
30518 Py_ssize_t pos = 0;
30520 PyObject *key = NULL;
30521 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
30522 #if CYTHON_AVOID_BORROWED_REFS
30523 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
30525 (void) __Pyx_PyDict_NextRef;
30526 while (PyDict_Next(kwds, &pos, &key, NULL))
30529 PyObject**
const *name = first_kw_arg;
30530 while (*name && (**name != key)) name++;
30532 size_t index_found = 0;
30533 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
30536 PyErr_Format(PyExc_TypeError,
30537 "%s() got an unexpected keyword argument '%U'",
30538 function_name, key);
30540 #if CYTHON_AVOID_BORROWED_REFS
30546 #if CYTHON_AVOID_BORROWED_REFS
30550 __Pyx_END_CRITICAL_SECTION();
30551 #if CYTHON_AVOID_BORROWED_REFS
30554 assert(PyErr_Occurred());
30556static int __Pyx_ParseKeywordDict(
30558 PyObject **
const argnames[],
30559 PyObject *values[],
30560 Py_ssize_t num_pos_args,
30561 Py_ssize_t num_kwargs,
30562 const char* function_name,
30563 int ignore_unknown_kwargs)
30565 PyObject**
const *name;
30566 PyObject**
const *first_kw_arg = argnames + num_pos_args;
30567 Py_ssize_t extracted = 0;
30568#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
30569 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
30571 name = first_kw_arg;
30572 while (*name && num_kwargs > extracted) {
30573 PyObject * key = **name;
30576 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
30577 found = PyDict_GetItemRef(kwds, key, &value);
30579 value = PyDict_GetItemWithError(kwds, key);
30584 if (unlikely(PyErr_Occurred()))
goto bad;
30588 if (unlikely(found < 0))
goto bad;
30589 values[name-argnames] = value;
30594 if (num_kwargs > extracted) {
30595 if (ignore_unknown_kwargs) {
30596 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
30599 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
30607static int __Pyx_ParseKeywordDictToDict(
30609 PyObject **
const argnames[],
30611 PyObject *values[],
30612 Py_ssize_t num_pos_args,
30613 const char* function_name)
30615 PyObject**
const *name;
30616 PyObject**
const *first_kw_arg = argnames + num_pos_args;
30618#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
30619 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
30621 if (PyDict_Update(kwds2, kwds) < 0)
goto bad;
30622 name = first_kw_arg;
30624 PyObject *key = **name;
30626#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
30627 int found = PyDict_Pop(kwds2, key, &value);
30629 if (unlikely(found < 0))
goto bad;
30630 values[name-argnames] = value;
30632#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
30633 int found = PyDict_GetItemRef(kwds2, key, &value);
30635 if (unlikely(found < 0))
goto bad;
30636 values[name-argnames] = value;
30637 if (unlikely(PyDict_DelItem(kwds2, key) < 0))
goto bad;
30640 #if CYTHON_COMPILING_IN_CPYTHON
30641 value = _PyDict_Pop(kwds2, key, kwds2);
30643 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
30645 if (value == kwds2) {
30648 if (unlikely(!value))
goto bad;
30649 values[name-argnames] = value;
30654 len = PyDict_Size(kwds2);
30656 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
30657 }
else if (unlikely(len == -1)) {
30664static int __Pyx_ParseKeywordsTuple(
30666 PyObject *
const *kwvalues,
30667 PyObject **
const argnames[],
30669 PyObject *values[],
30670 Py_ssize_t num_pos_args,
30671 Py_ssize_t num_kwargs,
30672 const char* function_name,
30673 int ignore_unknown_kwargs)
30675 PyObject *key = NULL;
30676 PyObject**
const * name;
30677 PyObject**
const *first_kw_arg = argnames + num_pos_args;
30678 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
30679#if CYTHON_AVOID_BORROWED_REFS
30680 key = __Pyx_PySequence_ITEM(kwds, pos);
30682 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
30684#if !CYTHON_ASSUME_SAFE_MACROS
30685 if (unlikely(!key))
goto bad;
30687 name = first_kw_arg;
30688 while (*name && (**name != key)) name++;
30690 PyObject *value = kwvalues[pos];
30691 values[name-argnames] = __Pyx_NewRef(value);
30693 size_t index_found = 0;
30694 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
30696 PyObject *value = kwvalues[pos];
30697 values[index_found] = __Pyx_NewRef(value);
30699 if (unlikely(cmp == -1))
goto bad;
30701 PyObject *value = kwvalues[pos];
30702 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
30703 }
else if (!ignore_unknown_kwargs) {
30704 goto invalid_keyword;
30708 #if CYTHON_AVOID_BORROWED_REFS
30715 PyErr_Format(PyExc_TypeError,
30716 "%s() got an unexpected keyword argument '%U'",
30717 function_name, key);
30720 #if CYTHON_AVOID_BORROWED_REFS
30727static int __Pyx_ParseKeywords(
30729 PyObject *
const *kwvalues,
30730 PyObject **
const argnames[],
30732 PyObject *values[],
30733 Py_ssize_t num_pos_args,
30734 Py_ssize_t num_kwargs,
30735 const char* function_name,
30736 int ignore_unknown_kwargs)
30738 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
30739 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
30741 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
30743 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
30747static void __Pyx_RaiseArgtupleInvalid(
30748 const char* func_name,
30750 Py_ssize_t num_min,
30751 Py_ssize_t num_max,
30752 Py_ssize_t num_found)
30754 Py_ssize_t num_expected;
30755 const char *more_or_less;
30756 if (num_found < num_min) {
30757 num_expected = num_min;
30758 more_or_less =
"at least";
30760 num_expected = num_max;
30761 more_or_less =
"at most";
30764 more_or_less =
"exactly";
30766 PyErr_Format(PyExc_TypeError,
30767 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
30768 func_name, more_or_less, num_expected,
30769 (num_expected == 1) ?
"" :
"s", num_found);
30773static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
30775 __Pyx_TypeName type_name;
30776 __Pyx_TypeName obj_type_name;
30777 PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
30778 int from_annotation_subclass = 0;
30779 if (unlikely(!type)) {
30780 PyErr_SetString(PyExc_SystemError,
"Missing type object");
30782 }
else if (exact == 2) {
30783 if (__Pyx_TypeCheck(obj, type)) {
30784 from_annotation_subclass = 1;
30785 extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
30788 type_name = __Pyx_PyType_GetFullyQualifiedName(type);
30789 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30790 if (unlikely(!type_name))
return;
30792 obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
30793 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30794 if (unlikely(!obj_type_name))
goto obj_type_name_failed;
30796 PyErr_Format(PyExc_TypeError,
30797 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
", got " __Pyx_FMT_TYPENAME
")"
30798#
if __PYX_LIMITED_VERSION_HEX < 0x030C0000
30801 , name, type_name, obj_type_name
30802#
if __PYX_LIMITED_VERSION_HEX < 0x030C0000
30803 , (from_annotation_subclass ?
". " :
""), extra_info
30806#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
30807 if (exact == 2 && from_annotation_subclass) {
30809 PyObject *vargs[2];
30810 vargs[0] = PyErr_GetRaisedException();
30811 vargs[1] = extra_info;
30812 res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
30814 PyErr_SetRaisedException(vargs[0]);
30817 __Pyx_DECREF_TypeName(obj_type_name);
30818#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30819obj_type_name_failed:
30821 __Pyx_DECREF_TypeName(type_name);
30826static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
const char *name,
int exact) {
30827 if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
30829 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
30831 __Pyx_ArgTypeError(obj, type, name, exact);
30836#if !CYTHON_VECTORCALL
30837static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *
const *args,
size_t nargsf) {
30839 switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
30841 return PyObject_CallMethodObjArgs(args[0], name, NULL);
30843 return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
30845 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
30847 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
30849 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
30851 PyObject *attr = PyObject_GetAttr(args[0], name);
30852 if (unlikely(!attr))
30854 result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
30861#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30862static __Pyx_TypeName
30863__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
30865 PyObject *module = NULL, *name = NULL, *result = NULL;
30866 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
30867 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
30868 __pyx_mstate_global->__pyx_n_u_qualname);
30870 name = PyType_GetQualName(tp);
30872 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name)))
goto bad;
30873 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
30874 __pyx_mstate_global->__pyx_n_u_module);
30875 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module)))
goto bad;
30876 if (PyUnicode_CompareWithASCIIString(module,
"builtins") == 0) {
30881 result = PyUnicode_FromFormat(
"%U.%U", module, name);
30882 if (unlikely(result == NULL))
goto bad;
30885 Py_XDECREF(module);
30893 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
30900static void __Pyx_RaiseErrorWithType1(PyObject* exc_type,
const char* message,
const char *arg, PyTypeObject *type_obj) {
30901 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
30902 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30903 if (unlikely(!type_name))
return;
30905 PyErr_Format(exc_type, message, arg, type_name);
30906 __Pyx_DECREF_TypeName(type_name);
30910static int __Pyx_RaiseUnexpectedTypeError(
const char *expected, PyObject *obj) {
30911 __Pyx_RaiseTypeErrorWithObjectType1(
30912 "Expected %.42s, got " __Pyx_FMT_TYPENAME,
30918static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
30919 PyObject* owned_instance = NULL;
30920 if (tb == Py_None) {
30922 }
else if (tb && !PyTraceBack_Check(tb)) {
30923 PyErr_SetString(PyExc_TypeError,
30924 "raise: arg 3 must be a traceback or None");
30927 if (value == Py_None)
30929 if (PyExceptionInstance_Check(type)) {
30931 PyErr_SetString(PyExc_TypeError,
30932 "instance exception may not have a separate value");
30936 type = (PyObject*) Py_TYPE(value);
30937 }
else if (PyExceptionClass_Check(type)) {
30938 PyObject *instance_class = NULL;
30939 if (value && PyExceptionInstance_Check(value)) {
30940 instance_class = (PyObject*) Py_TYPE(value);
30941 if (instance_class != type) {
30942 int is_subclass = PyObject_IsSubclass(instance_class, type);
30943 if (!is_subclass) {
30944 instance_class = NULL;
30945 }
else if (unlikely(is_subclass == -1)) {
30948 type = instance_class;
30952 if (!instance_class) {
30955 args = PyTuple_New(0);
30956 else if (PyTuple_Check(value)) {
30960 args = PyTuple_Pack(1, value);
30963 owned_instance = PyObject_Call(type, args, NULL);
30965 if (!owned_instance)
30967 value = owned_instance;
30968 if (!PyExceptionInstance_Check(value)) {
30969 PyErr_Format(PyExc_TypeError,
30970 "calling %R should have returned an instance of "
30971 "BaseException, not %R",
30972 type, Py_TYPE(value));
30977 PyErr_SetString(PyExc_TypeError,
30978 "raise: exception class must be a subclass of BaseException");
30982 PyObject *fixed_cause;
30983 if (cause == Py_None) {
30984 fixed_cause = NULL;
30985 }
else if (PyExceptionClass_Check(cause)) {
30986 fixed_cause = PyObject_CallObject(cause, NULL);
30987 if (fixed_cause == NULL)
30989 }
else if (PyExceptionInstance_Check(cause)) {
30990 fixed_cause = cause;
30991 Py_INCREF(fixed_cause);
30993 PyErr_SetString(PyExc_TypeError,
30994 "exception causes must derive from "
30998 PyException_SetCause(value, fixed_cause);
31000 PyErr_SetObject(type, value);
31002#if PY_VERSION_HEX >= 0x030C00A6
31003 PyException_SetTraceback(value, tb);
31004#elif CYTHON_FAST_THREAD_STATE
31005 PyThreadState *tstate = __Pyx_PyThreadState_Current;
31006 PyObject* tmp_tb = tstate->curexc_traceback;
31007 if (tb != tmp_tb) {
31009 tstate->curexc_traceback = tb;
31010 Py_XDECREF(tmp_tb);
31013 PyObject *tmp_type, *tmp_value, *tmp_tb;
31014 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
31016 PyErr_Restore(tmp_type, tmp_value, tb);
31017 Py_XDECREF(tmp_tb);
31021 Py_XDECREF(owned_instance);
31026static const char DIGIT_PAIRS_10[2*10*10+1] = {
31027 "00010203040506070809"
31028 "10111213141516171819"
31029 "20212223242526272829"
31030 "30313233343536373839"
31031 "40414243444546474849"
31032 "50515253545556575859"
31033 "60616263646566676869"
31034 "70717273747576777879"
31035 "80818283848586878889"
31036 "90919293949596979899"
31038static const char DIGIT_PAIRS_8[2*8*8+1] = {
31048static const char DIGITS_HEX[2*16+1] = {
31054static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength,
const char* chars,
int clength,
31055 int prepend_sign,
char padding_char) {
31057 Py_ssize_t uoffset = ulength - clength;
31058#if CYTHON_USE_UNICODE_INTERNALS
31061 uval = PyUnicode_New(ulength, 127);
31062 if (unlikely(!uval))
return NULL;
31063 udata = PyUnicode_DATA(uval);
31066 if (prepend_sign) {
31067 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0,
'-');
31070 for (; i < uoffset; i++) {
31071 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
31074 for (i=0; i < clength; i++) {
31075 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
31079 PyObject *
sign = NULL, *padding = NULL;
31082 prepend_sign = !!prepend_sign;
31083 if (uoffset > prepend_sign) {
31084 padding = PyUnicode_FromOrdinal(padding_char);
31085 if (likely(padding) && uoffset > prepend_sign + 1) {
31086 PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
31087 Py_DECREF(padding);
31090 if (unlikely(!padding))
goto done_or_error;
31092 if (prepend_sign) {
31093 sign = PyUnicode_FromOrdinal(
'-');
31094 if (unlikely(!
sign))
goto done_or_error;
31097 uval = PyUnicode_DecodeASCII(chars, clength, NULL);
31098 if (likely(uval) && padding) {
31099 PyObject *tmp = PyUnicode_Concat(padding, uval);
31103 if (likely(uval) &&
sign) {
31104 PyObject *tmp = PyUnicode_Concat(
sign, uval);
31109 Py_XDECREF(padding);
31117static CYTHON_INLINE
int __Pyx_CheckUnicodeValue(
int value) {
31118 return value <= 1114111;
31120static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(
int value, Py_ssize_t ulength,
char padding_char) {
31121 Py_ssize_t padding_length = ulength - 1;
31122 if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
31124 if (value <= 255) {
31125 memset(chars, padding_char, (
size_t) padding_length);
31126 chars[ulength-1] = (char) value;
31127 return PyUnicode_DecodeLatin1(chars, ulength, NULL);
31129 char *cpos = chars +
sizeof(chars);
31130 if (value < 0x800) {
31131 *--cpos = (char) (0x80 | (value & 0x3f));
31133 *--cpos = (char) (0xc0 | (value & 0x1f));
31134 }
else if (value < 0x10000) {
31135 *--cpos = (char) (0x80 | (value & 0x3f));
31137 *--cpos = (char) (0x80 | (value & 0x3f));
31139 *--cpos = (char) (0xe0 | (value & 0x0f));
31141 *--cpos = (char) (0x80 | (value & 0x3f));
31143 *--cpos = (char) (0x80 | (value & 0x3f));
31145 *--cpos = (char) (0x80 | (value & 0x3f));
31147 *--cpos = (char) (0xf0 | (value & 0x07));
31149 cpos -= padding_length;
31150 memset(cpos, padding_char, (
size_t) padding_length);
31151 return PyUnicode_DecodeUTF8(cpos, chars +
sizeof(chars) - cpos, NULL);
31153 if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
31154 const char chars[1] = {(char) value};
31155 return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
31158 PyObject *uchar, *padding_uchar, *padding, *result;
31159 padding_uchar = PyUnicode_FromOrdinal(padding_char);
31160 if (unlikely(!padding_uchar))
return NULL;
31161 padding = PySequence_Repeat(padding_uchar, padding_length);
31162 Py_DECREF(padding_uchar);
31163 if (unlikely(!padding))
return NULL;
31164 uchar = PyUnicode_FromOrdinal(value);
31165 if (unlikely(!uchar)) {
31166 Py_DECREF(padding);
31169 result = PyUnicode_Concat(padding, uchar);
31170 Py_DECREF(padding);
31177static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(
int value, Py_ssize_t width,
char padding_char) {
31178#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31179#pragma GCC diagnostic push
31180#pragma GCC diagnostic ignored "-Wconversion"
31182 const int neg_one = (int) -1, const_zero = (
int) 0;
31183#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31184#pragma GCC diagnostic pop
31186 const int is_unsigned = neg_one > const_zero;
31187 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
31188 !(
sizeof(value) <= 2 || value & ~ (
int) 0x01fffff || __Pyx_CheckUnicodeValue((
int) value)))) {
31189 PyErr_SetString(PyExc_OverflowError,
"%c arg not in range(0x110000)");
31193 return PyUnicode_FromOrdinal((
int) value);
31195 return __Pyx_PyUnicode_FromOrdinal_Padded((
int) value, width, padding_char);
31197static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(
int value, Py_ssize_t width,
char padding_char,
char format_char) {
31198 char digits[
sizeof(int)*3+2];
31199 char *dpos, *end = digits +
sizeof(int)*3+2;
31200 const char *hex_digits = DIGITS_HEX;
31201 Py_ssize_t length, ulength;
31202 int prepend_sign, last_one_off;
31204#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31205#pragma GCC diagnostic push
31206#pragma GCC diagnostic ignored "-Wconversion"
31208 const int neg_one = (int) -1, const_zero = (
int) 0;
31209#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31210#pragma GCC diagnostic pop
31212 const int is_unsigned = neg_one > const_zero;
31213 if (format_char ==
'X') {
31222 switch (format_char) {
31224 digit_pos = abs((
int)(remaining % (8*8)));
31225 remaining = (int) (remaining / (8*8));
31227 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
31228 last_one_off = (digit_pos < 8);
31231 digit_pos = abs((
int)(remaining % (10*10)));
31232 remaining = (int) (remaining / (10*10));
31234 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
31235 last_one_off = (digit_pos < 10);
31238 *(--dpos) = hex_digits[abs((
int)(remaining % 16))];
31239 remaining = (int) (remaining / 16);
31245 }
while (unlikely(remaining != 0));
31246 assert(!last_one_off || *dpos ==
'0');
31247 dpos += last_one_off;
31248 length = end - dpos;
31251 if (!is_unsigned && value <= neg_one) {
31252 if (padding_char ==
' ' || width <= length + 1) {
31260 if (width > ulength) {
31263 if (ulength == 1) {
31264 return PyUnicode_FromOrdinal(*dpos);
31266 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (
int) length, prepend_sign, padding_char);
31270static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width,
char padding_char) {
31271#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31272#pragma GCC diagnostic push
31273#pragma GCC diagnostic ignored "-Wconversion"
31275 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
31276#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31277#pragma GCC diagnostic pop
31279 const int is_unsigned = neg_one > const_zero;
31280 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
31281 !(
sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((
int) value)))) {
31282 PyErr_SetString(PyExc_OverflowError,
"%c arg not in range(0x110000)");
31286 return PyUnicode_FromOrdinal((
int) value);
31288 return __Pyx_PyUnicode_FromOrdinal_Padded((
int) value, width, padding_char);
31290static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width,
char padding_char,
char format_char) {
31291 char digits[
sizeof(Py_ssize_t)*3+2];
31292 char *dpos, *end = digits +
sizeof(Py_ssize_t)*3+2;
31293 const char *hex_digits = DIGITS_HEX;
31294 Py_ssize_t length, ulength;
31295 int prepend_sign, last_one_off;
31296 Py_ssize_t remaining;
31297#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31298#pragma GCC diagnostic push
31299#pragma GCC diagnostic ignored "-Wconversion"
31301 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
31302#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31303#pragma GCC diagnostic pop
31305 const int is_unsigned = neg_one > const_zero;
31306 if (format_char ==
'X') {
31315 switch (format_char) {
31317 digit_pos = abs((
int)(remaining % (8*8)));
31318 remaining = (Py_ssize_t) (remaining / (8*8));
31320 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
31321 last_one_off = (digit_pos < 8);
31324 digit_pos = abs((
int)(remaining % (10*10)));
31325 remaining = (Py_ssize_t) (remaining / (10*10));
31327 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
31328 last_one_off = (digit_pos < 10);
31331 *(--dpos) = hex_digits[abs((
int)(remaining % 16))];
31332 remaining = (Py_ssize_t) (remaining / 16);
31338 }
while (unlikely(remaining != 0));
31339 assert(!last_one_off || *dpos ==
'0');
31340 dpos += last_one_off;
31341 length = end - dpos;
31344 if (!is_unsigned && value <= neg_one) {
31345 if (padding_char ==
' ' || width <= length + 1) {
31353 if (width > ulength) {
31356 if (ulength == 1) {
31357 return PyUnicode_FromOrdinal(*dpos);
31359 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (
int) length, prepend_sign, padding_char);
31363static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
int kind) {
31364#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH && CYTHON_USE_UNICODE_INTERNALS
31365 PyObject *result_uval;
31366 int result_ukind, kind_shift;
31367 Py_ssize_t i, char_pos;
31368 void *result_udata;
31369 static const Py_UCS4 max_char[5] = {0x7fU, 0xffU, 0xffffU, 0xffffU, 0x10ffffU};
31370 assert (kind >= 0);
31371 if (kind > PyUnicode_4BYTE_KIND) kind = PyUnicode_4BYTE_KIND;
31372 result_uval = PyUnicode_New(result_ulength, max_char[kind]);
31373 if (unlikely(!result_uval))
return NULL;
31374 kind_shift = kind >> 1;
31375 result_ukind = 1 << kind_shift;
31376 result_udata = PyUnicode_DATA(result_uval);
31377 assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
31378 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
31381 for (i=0; i < value_count; i++) {
31383 Py_ssize_t ulength;
31385 PyObject *uval = values[i];
31386 if (__Pyx_PyUnicode_READY(uval) == (-1))
31388 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
31389 #if !CYTHON_ASSUME_SAFE_SIZE
31390 if (unlikely(ulength < 0))
goto bad;
31392 if (unlikely(!ulength))
31394 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
31396 ukind = __Pyx_PyUnicode_KIND(uval);
31397 udata = __Pyx_PyUnicode_DATA(uval);
31398 if (ukind == result_ukind) {
31399 memcpy((
char *)result_udata + (char_pos << kind_shift), udata, (
size_t) (ulength << kind_shift));
31401 #if PY_VERSION_HEX >= 0x030d0000
31402 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0))
goto bad;
31403 #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
31404 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
31407 for (j=0; j < ulength; j++) {
31408 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
31409 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
31413 char_pos += ulength;
31415 return result_uval;
31417 PyErr_SetString(PyExc_OverflowError,
"join() result is too long for a Python string");
31419 Py_DECREF(result_uval);
31423 PyObject *result = NULL;
31424 PyObject *value_tuple = PyTuple_New(value_count);
31425 if (unlikely(!value_tuple))
return NULL;
31426 CYTHON_UNUSED_VAR(kind);
31427 CYTHON_UNUSED_VAR(result_ulength);
31428 for (i=0; i<value_count; i++) {
31429 Py_INCREF(values[i]);
31430 if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0))
goto bad;
31432 result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
31434 Py_DECREF(value_tuple);
31440#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL)
31441static CYTHON_INLINE
int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2,
int equals) {
31445 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0))
goto bad;
31446 length = __Pyx_PyUnicode_GET_LENGTH(s1);
31447 #if !CYTHON_ASSUME_SAFE_SIZE
31448 if (unlikely(length < 0))
goto bad;
31450 if (length != 1)
goto return_ne;
31451 kind = PyUnicode_KIND(s1);
31453 if (likely(kind == PyUnicode_1BYTE_KIND)) {
31454 ch1 = PyUnicode_1BYTE_DATA(s1)[0];
31455 }
else if (kind == PyUnicode_2BYTE_KIND) {
31456 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
31458 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
31460 }
else if (ch2 < 65536) {
31461 if (kind == PyUnicode_2BYTE_KIND) {
31462 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
31463 }
else if (kind == PyUnicode_4BYTE_KIND) {
31464 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
31469 if (kind == PyUnicode_4BYTE_KIND){
31470 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
31481 return (equals == Py_EQ);
31483 return (equals == Py_NE);
31490#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
31491#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
31492static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
31493 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
31494 int result = PyUnicode_Equal(s1, s2);
31495 #if !CYTHON_COMPILING_IN_CPYTHON
31496 if (unlikely(result == -1))
return -1;
31498 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
31500 int result = PyUnicode_Compare(s1, s2);
31501 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
31502 if (result == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
31510static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2,
int pyop) {
31511 CYTHON_UNUSED_VAR(pyop);
31512 if (unlikely(op2 == Py_None)) {
31513 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_richcmp;
31515 if (PyFloat_CheckExact(op1)) {
31516 goto __pyx_richcmp;
31518 if (PyLong_CheckExact(op1)) {
31519 if (op1 == op2)
goto __pyx_return_true;
31520 goto __pyx_richcmp;
31523 if (likely(PyUnicode_CheckExact(op1))) {
31524 if (op1 == op2)
goto __pyx_return_true;
31525 if (likely(op2 != Py_None)) {
31526 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
31528 goto __pyx_richcmp;
31531 if ((0))
goto __pyx_richcmp;
31532 if ((0))
goto __pyx_return_true;
31533 if ((0))
goto __pyx_return_false;
31535 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
31543#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
31544#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
31545#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
31546static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyBytesPyBytesEq(PyObject* s1, PyObject* s2) {
31547 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
31548 const char *ps1, *ps2;
31549 Py_ssize_t length = PyBytes_GET_SIZE(s1);
31550 if (length != PyBytes_GET_SIZE(s2))
goto __pyx_return_false;
31551 ps1 = PyBytes_AS_STRING(s1);
31552 ps2 = PyBytes_AS_STRING(s2);
31555 Py_ssize_t length, length2;
31556 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length) == -1))
return NULL;
31557 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1))
return NULL;
31558 if (length != length2)
goto __pyx_return_false;
31560 if (ps1[0] != ps2[0])
goto __pyx_return_false;
31561 if (length == 1)
goto __pyx_return_true;
31564#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
31565 Py_hash_t hash1 = ((PyBytesObject*)s1)->ob_shash;
31566 Py_hash_t hash2 = ((PyBytesObject*)s2)->ob_shash;
31567 if (hash1 != hash2 && hash1 != -1 && hash2 != -1)
goto __pyx_return_false;
31569 cmp = memcmp(ps1, ps2, (
size_t)length);
31570 if (cmp == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
31579#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
31580#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
31581#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
31582static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyByteArrayPyBytesEq(PyObject* s1, PyObject* s2) {
31583 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
31584 const char *ps1, *ps2;
31585 Py_ssize_t length = PyByteArray_GET_SIZE(s1);
31586 if (length != PyBytes_GET_SIZE(s2))
goto __pyx_return_false;
31587 ps1 = PyByteArray_AS_STRING(s1);
31588 ps2 = PyBytes_AS_STRING(s2);
31591 Py_ssize_t length, length2;
31592 ps1 = __Pyx_PyByteArray_AsString(s1);
if (unlikely(!ps1))
return NULL;
31593 length = __Pyx_PyByteArray_GET_SIZE(s1);
if (unlikely(length == -1))
return NULL;
31594 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1))
return NULL;
31595 if (length != length2)
goto __pyx_return_false;
31597 if (length == 0)
goto __pyx_return_true;
31598 if (ps1[0] != ps2[0])
goto __pyx_return_false;
31599 if (length == 1)
goto __pyx_return_true;
31602 cmp = memcmp(ps1, ps2, (
size_t)length);
31603 if (cmp == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
31612static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2,
int pyop) {
31613 CYTHON_UNUSED_VAR(pyop);
31614 if (unlikely(op2 == Py_None)) {
31615 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_richcmp;
31617 if (PyFloat_CheckExact(op1)) {
31618 goto __pyx_richcmp;
31620 if (PyLong_CheckExact(op1)) {
31621 if (op1 == op2)
goto __pyx_return_true;
31622 goto __pyx_richcmp;
31624 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
31625 if (likely(PyBytes_CheckExact(op1))) {
31626 if (op1 == op2)
goto __pyx_return_true;
31627 if (likely(op2 != Py_None)) {
31628 return __Pyx_PyObject_ComparePyBytesPyBytesEq(op1, op2);
31630 goto __pyx_richcmp;
31633 if ((0))
goto __pyx_richcmp;
31634 if ((0))
goto __pyx_return_true;
31635 if ((0))
goto __pyx_return_false;
31637 return PyObject_RichCompare(op1, op2, Py_EQ);
31645static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
31646#if CYTHON_USE_TYPE_SLOTS
31647 if (likely(PyUnicode_Check(
n)))
31648 return __Pyx_PyObject_GetAttrStr(o,
n);
31650 return PyObject_GetAttr(o,
n);
31654#if CYTHON_COMPILING_IN_LIMITED_API
31655static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
31656 return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
31661#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31662static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
31664 if (likely(sm->sq_length)) {
31665 Py_ssize_t l = sm->sq_length(o);
31666 if (likely(l >= 0)) {
31669 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
31679static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
31681 if (unlikely(!j))
return NULL;
31682 r = PyObject_GetItem(o, j);
31686static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
31687 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
31689static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
31690 int wraparound,
int boundscheck,
int unsafe_shared) {
31691 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
31692#if CYTHON_AVOID_BORROWED_REFS
31693 CYTHON_UNUSED_VAR(boundscheck);
31694 Py_ssize_t wrapped_i = i;
31695 if (wraparound & unlikely(i < 0)) {
31696 Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
31697 #if !CYTHON_ASSUME_SAFE_SIZE
31698 if (unlikely(size < 0))
return NULL;
31702 return __Pyx_PyList_GetItemRef(o, wrapped_i);
31703#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
31704 Py_ssize_t wrapped_i = i;
31705 Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
31706 if (wraparound & unlikely(i < 0)) {
31709 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
31710 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
31712 return __Pyx_GetItemInt_Generic_size(o, i);
31716 return PySequence_GetItem(o, i);
31719static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
31720 int wraparound,
int boundscheck,
int unsafe_shared) {
31721 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
31722#if CYTHON_AVOID_BORROWED_REFS
31723 CYTHON_UNUSED_VAR(boundscheck);
31724 Py_ssize_t wrapped_i = i;
31725 if (wraparound & unlikely(i < 0)) {
31726 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
31727 #if !CYTHON_ASSUME_SAFE_SIZE
31728 if (unlikely(size < 0))
return NULL;
31732 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
31733 return PySequence_ITEM(o, wrapped_i);
31735 if (unlikely(wrapped_i < 0)) {
31736 PyErr_SetString(PyExc_IndexError,
"tuple index out of range");
31739 return PySequence_GetItem(o, wrapped_i);
31741#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
31742 Py_ssize_t wrapped_i = i;
31743 Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
31744 if (wraparound & unlikely(i < 0)) {
31747 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
31748 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
31750 return __Pyx_GetItemInt_Generic_size(o, i);
31754 return PySequence_GetItem(o, i);
31757#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31758static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
31759 PyObject *
r, *key = PyLong_FromSsize_t(i);
31760 if (unlikely(!key))
return NULL;
31761 r = getitem(o, key);
31766static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
31767 int wraparound,
int boundscheck,
int unsafe_shared) {
31768 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
31769#if CYTHON_ASSUME_SAFE_SIZE
31770 if (PyList_CheckExact(o)) {
31771 return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
31773 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31774 if (PyTuple_CheckExact(o)) {
31775 return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
31779 if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
31780 return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
31783#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31784 if (PyDict_CheckExact(o)) {
31785 return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
31786 #if defined(PyFrozenDict_CheckExact)
31787 }
else if (PyFrozenDict_CheckExact(o)) {
31788 return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
31792 PyTypeObject *obj_type = Py_TYPE(o);
31793 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
31794 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
31795 PyMappingMethods *mm = obj_type->tp_as_mapping;
31796 if (mm && mm->mp_subscript)
31797 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
31799 PySequenceMethods *sm = obj_type->tp_as_sequence;
31800 if (likely(sm && sm->sq_item)) {
31801 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
31803 return sm->sq_item(o, i);
31805 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
31806 PyMappingMethods *mm = obj_type->tp_as_mapping;
31807 if (likely(mm && mm->mp_subscript))
31808 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
31812 if (!PyMapping_Check(o)) {
31813 return PySequence_GetItem(o, i);
31818 return __Pyx_GetItemInt_Generic_size(o, i);
31822static void __Pyx_RaiseErrorWithType(PyObject* exc_type,
const char* message, PyTypeObject *type_obj) {
31823 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
31824 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31825 if (unlikely(!type_name))
return;
31827 PyErr_Format(exc_type, message, type_name);
31828 __Pyx_DECREF_TypeName(type_name);
31832#if CYTHON_USE_TYPE_SLOTS
31833static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
31834 PyObject *runerr = NULL;
31835 Py_ssize_t key_value;
31836 key_value = __Pyx_PyIndex_AsSsize_t(index);
31837 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
31838 return __Pyx_GetItemInt_Fast(obj, key_value, 1, 1, 1);
31840 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
31842 __Pyx_RaiseErrorWithObjectType(
31844 "cannot fit '" __Pyx_FMT_TYPENAME
"' into an index-sized integer",
31849static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
31850 if (likely(PyType_Check(obj))) {
31851 if ((PyTypeObject*)obj == &PyType_Type) {
31852 return Py_GenericAlias(obj, key);
31854 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
31856 if (PyErr_Occurred()) {
31860 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
31865 __Pyx_RaiseTypeErrorWithObjectType(
31866 "'" __Pyx_FMT_TYPENAME
"' object is not subscriptable", obj);
31869static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
31870 PyTypeObject *tp = Py_TYPE(obj);
31871 PyMappingMethods *mm = tp->tp_as_mapping;
31872 PySequenceMethods *sm = tp->tp_as_sequence;
31873 if (likely(mm && mm->mp_subscript)) {
31874 return mm->mp_subscript(obj, key);
31876 if (likely(sm && sm->sq_item)) {
31877 return __Pyx_PyObject_GetIndex(obj, key);
31879 return __Pyx_PyObject_GetItem_Slow(obj, key);
31884static void __Pyx_RejectKeywords(
const char* function_name, PyObject *kwds) {
31885 PyObject *key = NULL;
31886 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds))) {
31887 key = __Pyx_PySequence_ITEM(kwds, 0);
31889#if CYTHON_AVOID_BORROWED_REFS
31890 PyObject *pos = NULL;
31892 Py_ssize_t pos = 0;
31894#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
31895 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return;
31897 __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
31898#if CYTHON_AVOID_BORROWED_REFS
31903 PyErr_Format(PyExc_TypeError,
31904 "%s() got an unexpected keyword argument '%U'",
31905 function_name, key);
31911static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b,
int b_is_constant) {
31912 Py_ssize_t
q = a / b;
31913 Py_ssize_t
r = a -
q*b;
31914 Py_ssize_t adapt_python = (b_is_constant ?
31915 ((
r != 0) & ((
r < 0) ^ (b < 0))) :
31916 ((
r != 0) & ((
r ^ b) < 0))
31918 return q - adapt_python;
31922#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
31923static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
31924 __Pyx_PyThreadState_declare
31925 __Pyx_PyThreadState_assign
31926 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
31928 __Pyx_PyErr_Clear();
31933static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
31935#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
31936 int res = PyObject_GetOptionalAttr(o,
n, &
r);
31937 return (res != 0) ?
r : __Pyx_NewRef(d);
31939 #if CYTHON_USE_TYPE_SLOTS
31940 if (likely(PyUnicode_Check(
n))) {
31941 r = __Pyx_PyObject_GetAttrStrNoError(o,
n);
31942 if (unlikely(!
r) && likely(!PyErr_Occurred())) {
31943 r = __Pyx_NewRef(d);
31948 r = PyObject_GetAttr(o,
n);
31949 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
31954#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
31955static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
31956 PyObject *dict = Py_TYPE(obj)->tp_dict;
31957 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
31959static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
31960 PyObject **dictptr = NULL;
31961 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
31963#if CYTHON_COMPILING_IN_CPYTHON
31964 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
31966 dictptr = _PyObject_GetDictPtr(obj);
31969 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
31971static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
31972 PyObject *dict = Py_TYPE(obj)->tp_dict;
31973 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
31975 return obj_dict_version == __Pyx_get_object_dict_version(obj);
31980#if CYTHON_USE_DICT_VERSIONS
31981static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
31983static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
31987#if CYTHON_COMPILING_IN_LIMITED_API
31988 if (unlikely(!__pyx_m)) {
31989 if (!PyErr_Occurred())
31990 PyErr_SetNone(PyExc_NameError);
31993 result = PyObject_GetAttr(__pyx_m, name);
31994 if (likely(result)) {
31997 if (!__Pyx_IgnoreException(PyExc_Exception)) {
32000#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
32001 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
32002 if (!__Pyx_IgnoreException(PyExc_Exception)) {
32006 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
32007 if (likely(result)) {
32011 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
32012 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
32013 if (likely(result)) {
32014 return __Pyx_NewRef(result);
32016 PyObject *exc = PyErr_Occurred();
32017 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
32021 return __Pyx_GetBuiltinName(name);
32025static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
32026 PyErr_Format(PyExc_ValueError,
32027 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
32031static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
32032 PyErr_Format(PyExc_ValueError,
32033 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
32034 index, (index == 1) ?
"" :
"s");
32038static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
32039 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
32043#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
32044static _PyErr_StackItem *
32045__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
32047 _PyErr_StackItem *exc_info = tstate->exc_info;
32048 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
32049 exc_info->previous_item != NULL)
32051 exc_info = exc_info->previous_item;
32058#if CYTHON_FAST_THREAD_STATE
32059static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
32060 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
32061 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
32062 PyObject *exc_value = exc_info->exc_value;
32063 if (exc_value == NULL || exc_value == Py_None) {
32068 *value = exc_value;
32070 *type = (PyObject*) Py_TYPE(exc_value);
32072 *tb = PyException_GetTraceback(exc_value);
32074 #elif CYTHON_USE_EXC_INFO_STACK
32075 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
32076 *type = exc_info->exc_type;
32077 *value = exc_info->exc_value;
32078 *tb = exc_info->exc_traceback;
32080 Py_XINCREF(*value);
32083 *type = tstate->exc_type;
32084 *value = tstate->exc_value;
32085 *tb = tstate->exc_traceback;
32087 Py_XINCREF(*value);
32091static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
32092 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
32093 _PyErr_StackItem *exc_info = tstate->exc_info;
32094 PyObject *tmp_value = exc_info->exc_value;
32095 exc_info->exc_value = value;
32096 Py_XDECREF(tmp_value);
32100 PyObject *tmp_type, *tmp_value, *tmp_tb;
32101 #if CYTHON_USE_EXC_INFO_STACK
32102 _PyErr_StackItem *exc_info = tstate->exc_info;
32103 tmp_type = exc_info->exc_type;
32104 tmp_value = exc_info->exc_value;
32105 tmp_tb = exc_info->exc_traceback;
32106 exc_info->exc_type = type;
32107 exc_info->exc_value = value;
32108 exc_info->exc_traceback = tb;
32110 tmp_type = tstate->exc_type;
32111 tmp_value = tstate->exc_value;
32112 tmp_tb = tstate->exc_traceback;
32113 tstate->exc_type = type;
32114 tstate->exc_value = value;
32115 tstate->exc_traceback = tb;
32117 Py_XDECREF(tmp_type);
32118 Py_XDECREF(tmp_value);
32119 Py_XDECREF(tmp_tb);
32125static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type,
const char *message,
const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
32126 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
32127 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
32128 if (unlikely(!type_name1))
return;
32130 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
32131 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
32132 if (unlikely(!type_name2))
goto type2_failed;
32134 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
32135 __Pyx_DECREF_TypeName(type_name2);
32136#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
32139 __Pyx_DECREF_TypeName(type_name1);
32143static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
32144 if (unlikely(!type)) {
32145 PyErr_SetString(PyExc_SystemError,
"Missing type object");
32148 if (likely(__Pyx_TypeCheck(obj, type)))
32150 __Pyx_RaiseTypeErrorWithTypes(
32151 "Cannot convert " __Pyx_FMT_TYPENAME
" to " __Pyx_FMT_TYPENAME,
32152 Py_TYPE(obj), type);
32157#if CYTHON_FAST_THREAD_STATE
32158static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
32160static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
32163 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
32164#if CYTHON_FAST_THREAD_STATE
32165 PyObject *tmp_type, *tmp_value, *tmp_tb;
32166 #if PY_VERSION_HEX >= 0x030C0000
32167 local_value = tstate->current_exception;
32168 tstate->current_exception = 0;
32170 local_type = tstate->curexc_type;
32171 local_value = tstate->curexc_value;
32172 local_tb = tstate->curexc_traceback;
32173 tstate->curexc_type = 0;
32174 tstate->curexc_value = 0;
32175 tstate->curexc_traceback = 0;
32177#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
32178 local_value = PyErr_GetRaisedException();
32180 PyErr_Fetch(&local_type, &local_value, &local_tb);
32182#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
32183 if (likely(local_value)) {
32184 local_type = (PyObject*) Py_TYPE(local_value);
32185 Py_INCREF(local_type);
32186 local_tb = PyException_GetTraceback(local_value);
32189 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
32190#if CYTHON_FAST_THREAD_STATE
32191 if (unlikely(tstate->curexc_type))
32193 if (unlikely(PyErr_Occurred()))
32197 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
32201 Py_XINCREF(local_tb);
32202 Py_XINCREF(local_type);
32203 Py_XINCREF(local_value);
32204 *type = local_type;
32205 *value = local_value;
32207#if CYTHON_FAST_THREAD_STATE
32208 #if CYTHON_USE_EXC_INFO_STACK
32210 _PyErr_StackItem *exc_info = tstate->exc_info;
32211 #if PY_VERSION_HEX >= 0x030B00a4
32212 tmp_value = exc_info->exc_value;
32213 exc_info->exc_value = local_value;
32216 Py_XDECREF(local_type);
32217 Py_XDECREF(local_tb);
32219 tmp_type = exc_info->exc_type;
32220 tmp_value = exc_info->exc_value;
32221 tmp_tb = exc_info->exc_traceback;
32222 exc_info->exc_type = local_type;
32223 exc_info->exc_value = local_value;
32224 exc_info->exc_traceback = local_tb;
32228 tmp_type = tstate->exc_type;
32229 tmp_value = tstate->exc_value;
32230 tmp_tb = tstate->exc_traceback;
32231 tstate->exc_type = local_type;
32232 tstate->exc_value = local_value;
32233 tstate->exc_traceback = local_tb;
32235 Py_XDECREF(tmp_type);
32236 Py_XDECREF(tmp_value);
32237 Py_XDECREF(tmp_tb);
32238#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
32239 PyErr_SetHandledException(local_value);
32240 Py_XDECREF(local_value);
32241 Py_XDECREF(local_type);
32242 Py_XDECREF(local_tb);
32244 PyErr_SetExcInfo(local_type, local_value, local_tb);
32247#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
32252 Py_XDECREF(local_type);
32253 Py_XDECREF(local_value);
32254 Py_XDECREF(local_tb);
32260#if CYTHON_FAST_THREAD_STATE
32261static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
32262 PyObject *tmp_type, *tmp_value, *tmp_tb;
32263 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
32264 _PyErr_StackItem *exc_info = tstate->exc_info;
32265 tmp_value = exc_info->exc_value;
32266 exc_info->exc_value = *value;
32267 if (tmp_value == NULL || tmp_value == Py_None) {
32268 Py_XDECREF(tmp_value);
32273 tmp_type = (PyObject*) Py_TYPE(tmp_value);
32274 Py_INCREF(tmp_type);
32275 #if CYTHON_COMPILING_IN_CPYTHON
32276 tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
32277 Py_XINCREF(tmp_tb);
32279 tmp_tb = PyException_GetTraceback(tmp_value);
32282 #elif CYTHON_USE_EXC_INFO_STACK
32283 _PyErr_StackItem *exc_info = tstate->exc_info;
32284 tmp_type = exc_info->exc_type;
32285 tmp_value = exc_info->exc_value;
32286 tmp_tb = exc_info->exc_traceback;
32287 exc_info->exc_type = *type;
32288 exc_info->exc_value = *value;
32289 exc_info->exc_traceback = *tb;
32291 tmp_type = tstate->exc_type;
32292 tmp_value = tstate->exc_value;
32293 tmp_tb = tstate->exc_traceback;
32294 tstate->exc_type = *type;
32295 tstate->exc_value = *value;
32296 tstate->exc_traceback = *tb;
32299 *value = tmp_value;
32303static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
32304 PyObject *tmp_type, *tmp_value, *tmp_tb;
32305 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
32306 PyErr_SetExcInfo(*type, *value, *tb);
32308 *value = tmp_value;
32314#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
32315static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
32317 if (unlikely(!PyUnicode_Check(
n))) {
32318 PyErr_SetString(PyExc_TypeError,
32319 "hasattr(): attribute name must be string");
32322 r = __Pyx_PyObject_GetAttrStrNoError(o,
n);
32324 return (unlikely(PyErr_Occurred())) ? -1 : 0;
32333CYTHON_UNUSED
static PyObject *
32334__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n) {
32335 PyObject *res = PyList_New(
n);
32336 if (unlikely(res == NULL))
return NULL;
32337 #if CYTHON_COMPILING_IN_CPYTHON
32338 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item,
n);
32341 for (i = 0; i <
n; i++) {
32343 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
32353static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
32354 PyObject *imported_module = PyImport_GetModule(qualname);
32355 if (unlikely(!imported_module)) {
32357 if (PyErr_Occurred()) {
32362 *
module = imported_module;
32365static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
32366 PyObject *imported_module;
32367 PyObject *top_level_package_name;
32369 int status, module_found;
32370 Py_ssize_t dot_index;
32371 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
32372 if (unlikely(!module_found || module_found == -1)) {
32374 return module_found;
32376 if (imported_names) {
32377 for (i = 0; i < len_imported_names; i++) {
32378 PyObject *imported_name = imported_names[i];
32379#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
32380 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
32382 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
32383 if (unlikely(has_imported_attribute == -1))
goto error;
32385 if (!has_imported_attribute) {
32389 *
module = imported_module;
32392 dot_index = PyUnicode_FindChar(qualname,
'.', 0, PY_SSIZE_T_MAX, 1);
32393 if (dot_index == -1) {
32394 *
module = imported_module;
32397 if (unlikely(dot_index == -2))
goto error;
32398 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
32399 if (unlikely(!top_level_package_name))
goto error;
32400 Py_DECREF(imported_module);
32401 status = __Pyx__Import_GetModule(top_level_package_name, module);
32402 Py_DECREF(top_level_package_name);
32405 Py_DECREF(imported_module);
32409 Py_DECREF(imported_module);
32413static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level) {
32414 PyObject *module = 0;
32415 PyObject *empty_dict = 0;
32416 PyObject *from_list = 0;
32421 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
32422 if (likely(module_found == 1)) {
32424 }
else if (unlikely(module_found == -1)) {
32427 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
32428 empty_dict = PyFrozenDict_New(NULL);
32430 empty_dict = PyDict_New();
32432 if (unlikely(!empty_dict))
32434 if (imported_names) {
32435 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
32436 if (unlikely(!from_list))
32440 const char* package_sep = strchr(__Pyx_MODULE_NAME,
'.');
32441 if (package_sep != (0)) {
32442 module = PyImport_ImportModuleLevelObject(
32443 name, moddict, empty_dict, from_list, 1);
32444 if (unlikely(!module)) {
32445 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
32453 module = PyImport_ImportModuleLevelObject(
32454 name, moddict, empty_dict, from_list, level);
32457 Py_XDECREF(from_list);
32458 Py_XDECREF(empty_dict);
32463static PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level) {
32464 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
32468#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
32469static CYTHON_INLINE
void __Pyx__ListComp_AppendAndDecref(PyObject* list, Py_ssize_t len, PyObject* x) {
32470 PyList_SET_ITEM(list, len, x);
32471 Py_SET_SIZE(list, len + 1);
32476#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
32477static CYTHON_INLINE
int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
32478 PyListObject*
L = (PyListObject*) list;
32479 Py_ssize_t len = Py_SIZE(list);
32480 if (likely(
L->allocated > len)) {
32481 __Pyx__ListComp_AppendAndDecref(list, len, x);
32484 int result = PyList_Append(list, x);
32489static CYTHON_INLINE
int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
32490 int result = PyList_Append(list, x);
32497#if CYTHON_USE_TYPE_SLOTS
32498static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
32499 PyObject *result, *pymul = PyLong_FromSsize_t(mul);
32500 if (unlikely(!pymul))
32502 result = PyNumber_Multiply(seq, pymul);
32506static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
32507 PyTypeObject *type = Py_TYPE(seq);
32508 if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
32509 return type->tp_as_sequence->sq_repeat(seq, mul);
32511 return __Pyx_PySequence_Multiply_Generic(seq, mul);
32517#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
32518#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32519#ifndef __Pyx_DEFINED_BinopTypeError
32520#define __Pyx_DEFINED_BinopTypeError
32521static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2,
const char* op,
int inplace) {
32522 char opname[4] = {op[0], op[1], 0, 0};
32524 opname[op[1] ? 2 : 1] =
'=';
32526 __Pyx_RaiseErrorWithObjectTypes1(
32528 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME
"' and '" __Pyx_FMT_TYPENAME
"'",
32533#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
32534#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
32535static PyObject* __Pyx_PyNumber_Multiply_xfloat_int(PyObject *op1, PyObject *op2,
int inplace) {
32536 if (likely(op2 != Py_None)) {
32538 #if CYTHON_USE_PYLONG_INTERNALS
32539 if (__Pyx_PyLong_IsCompact(op2)) {
32540 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
32541 int_op2 = (double) compact_op2;
32545 int_op2 = PyLong_AsDouble(op2);
32546 if (unlikely((int_op2 == -1.) && PyErr_Occurred()))
return NULL;
32548 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32549 #if !CYTHON_ASSUME_SAFE_MACROS
32550 if (unlikely((float_op1 == -1.) && PyErr_Occurred()))
return NULL;
32552 if (float_op1 == 0.)
return __Pyx_NewRef(op1);
32553 return PyFloat_FromDouble(float_op1 * int_op2);
32555 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32557 PyTypeObject *type_op2 = Py_TYPE(op2);
32558 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
32559 if (likely(slot_func)) {
32560 PyObject *result = slot_func(op1, op2);
32561 if (likely(result != Py_NotImplemented)) {
32566 __Pyx_BinopTypeError(op1, op2,
"*", inplace);
32570 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
32574#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_int
32575#define __Pyx_DEFINED_PyNumber_Multiply_xint_int
32576static PyObject* __Pyx_PyNumber_Multiply_xint_int(PyObject *op1, PyObject *op2,
int inplace) {
32577 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32579 PyTypeObject *type_op2 = Py_TYPE(op2);
32580 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
32581 if (likely(slot_func)) {
32582 PyObject *result = slot_func(op1, op2);
32583 if (likely(result != Py_NotImplemented)) {
32588 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
32589 if (likely(repeat_func)) {
32591 #if CYTHON_USE_PYLONG_INTERNALS
32592 if (__Pyx_PyLong_IsCompact(op1)) {
32593 count = __Pyx_PyLong_CompactValue(op1);
32597 count = PyLong_AsSsize_t(op1);
32598 if (unlikely((count == -1) && PyErr_Occurred()))
return NULL;
32600 return repeat_func(op2, count);
32602 __Pyx_BinopTypeError(op1, op2,
"*", inplace);
32606 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
32610static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2,
int inplace) {
32611 if (PyFloat_CheckExact(op1)) {
32612 return __Pyx_PyNumber_Multiply_xfloat_int(op1, op2, inplace);
32614 if (likely(PyLong_CheckExact(op1))) {
32615 if (likely(op2 != Py_None)) {
32616 #if CYTHON_USE_PYLONG_INTERNALS
32617 if (__Pyx_PyLong_IsCompact(op1)) {
32618 long long int_op1 = (
long long) __Pyx_PyLong_CompactValue(op1);
32619 if (int_op1 == 0)
return __Pyx_NewRef(op1);
32620 if (__Pyx_PyLong_IsCompact(op2)) {
32621 long long int_op2 = (
long long) __Pyx_PyLong_CompactValue(op2);
32622 if (int_op2 == 0)
return __Pyx_NewRef(op2);
32623 return PyLong_FromLongLong(int_op1 * int_op2);
32626 else if (__Pyx_PyLong_IsZero(op2))
return __Pyx_NewRef(op2);
32628 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_multiply, binaryfunc);
32629 if (likely(slot_func)) {
32630 return slot_func(op1, op2);
32633 return __Pyx_PyNumber_Multiply_xint_int(op1, op2, inplace);
32635 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
32640static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject*
s, PyObject*
f) {
32641 if (unlikely(!
s))
return NULL;
32642 if (likely(PyUnicode_CheckExact(
s)))
return s;
32643 return __Pyx_PyObject_FormatAndDecref(
s,
f);
32645static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject*
s, PyObject*
f) {
32647 if (unlikely(!
s))
return NULL;
32648 result = PyObject_Format(
s,
f);
32654#if CYTHON_USE_UNICODE_WRITER
32655static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
32657 _PyUnicodeWriter writer;
32658 if (likely(PyFloat_CheckExact(obj))) {
32659 _PyUnicodeWriter_Init(&writer);
32660 ret = _PyFloat_FormatAdvancedWriter(
32663 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
32664 }
else if (likely(PyLong_CheckExact(obj))) {
32665 _PyUnicodeWriter_Init(&writer);
32666 ret = _PyLong_FormatAdvancedWriter(
32669 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
32671 return PyObject_Format(obj, format_spec);
32673 if (unlikely(ret == -1)) {
32674 _PyUnicodeWriter_Dealloc(&writer);
32677 return _PyUnicodeWriter_Finish(&writer);
32682static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v) {
32684 if (unlikely(!j))
return -1;
32685 r = PyObject_SetItem(o, j,
v);
32689#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
32690static CYTHON_INLINE
int __Pyx_SetItemInt_Fast_mapping(PyObject *o, objobjargproc setitem, Py_ssize_t i, PyObject *value) {
32691 PyObject *key = PyLong_FromSsize_t(i);
32692 if (unlikely(!key))
return -1;
32693 int r = setitem(o, key, value);
32698static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *
v,
32699 int wraparound,
int boundscheck,
int unsafe_shared) {
32700 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
32701#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
32702 if (PyList_CheckExact(o)) {
32703 Py_ssize_t
n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
32704 if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
32706 return PyList_SetItem(o,
n,
v);
32707 }
else if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o)))) {
32710 old = PyList_GET_ITEM(o,
n);
32711 PyList_SET_ITEM(o,
n,
v);
32717#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
32718 if (PyDict_CheckExact(o)) {
32719 return __Pyx_SetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_ass_subscript, i,
v);
32722 PyTypeObject *obj_type = Py_TYPE(o);
32723 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
32724 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
32725 PyMappingMethods *mm = obj_type->tp_as_mapping;
32726 if (mm && mm->mp_ass_subscript)
32727 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i,
v);
32729 PySequenceMethods *sm = obj_type->tp_as_sequence;
32730 if (likely(sm && sm->sq_ass_item)) {
32731 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
32733 return sm->sq_ass_item(o, i,
v);
32735 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
32736 PyMappingMethods *mm = obj_type->tp_as_mapping;
32737 if (likely(mm && mm->mp_ass_subscript))
32738 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i,
v);
32742 if (!PyMapping_Check(o)) {
32743 return PySequence_SetItem(o, i,
v);
32748 return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i),
v);
32752static void __Pyx_RaiseUnboundLocalError(
const char *varname) {
32753 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
32757static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b,
int b_is_constant) {
32760 long adapt_python = (b_is_constant ?
32761 ((
r != 0) & ((
r < 0) ^ (b < 0))) :
32762 ((
r != 0) & ((
r ^ b) < 0))
32764 return q - adapt_python;
32768#if CYTHON_USE_TYPE_SLOTS
32769static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
32770 PyTypeObject* tp = Py_TYPE(obj);
32771 if (likely(tp->tp_setattro))
32772 return tp->tp_setattro(obj, attr_name, value);
32773 return PyObject_SetAttr(obj, attr_name, value);
32778static void __Pyx_RaiseBufferIndexError(
int axis) {
32779 PyErr_Format(PyExc_IndexError,
32780 "Out of bounds on buffer access (axis %d)", axis);
32784static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t,
int is_final) {
32785 if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
32786 allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
32787 return alloc_func(t, 0);
32789 newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
32790 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
32792 PyObject *new_str = PyUnicode_FromString(
"__new__");
32793 if (likely(new_str)) {
32794 PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
32795 Py_DECREF(new_str);
32801 return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
32806static CYTHON_INLINE
int __Pyx_CallSlotAsVectorcallUnpackDict(Py_ssize_t args_size, PyObject *keys_dict, PyObject **args, PyObject *kwnames) {
32807 Py_ssize_t pos = 0, i = 0;
32808 PyObject *key, *value;
32809 while (PyDict_Next(keys_dict, &pos, &key, &value)) {
32811 args[args_size+i] = value;
32813 if (unlikely(__Pyx_PyTuple_SET_ITEM(kwnames, i, key) == -1)) {
32822#if CYTHON_VECTORCALL_TPNEW
32823static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc
f, PyTypeObject* o, PyObject *a, PyObject *k) {
32824 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
32825#if !CYTHON_ASSUME_SAFE_SIZE
32826 if (unlikely(k_size < 0))
return NULL;
32828 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
32829#if !CYTHON_ASSUME_SAFE_SIZE
32830 if (unlikely(a_size < 0))
return NULL;
32832#if CYTHON_ASSUME_SAFE_MACROS
32834 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
32837 if (k_size == 0 && a_size == 0) {
32838 return f(o, NULL, 0, NULL);
32841 PyObject *stack_args[5];
32842 PyObject **args = stack_args;
32843 Py_ssize_t maxnargs = PY_SSIZE_T_MAX /
sizeof(PyObject*) - 1;
32844 if (a_size > maxnargs - k_size) {
32848 Py_ssize_t total_size = a_size + k_size;
32849 if (total_size > 5) {
32850 args = (PyObject**)PyMem_Malloc(((
size_t)total_size)*
sizeof(PyObject*));
32851 if (unlikely(!args)) {
32856 PyObject * result = NULL;
32857 PyObject *kwnames = NULL;
32858 int unpack_dict_result;
32860 for (; i < a_size; ++i) {
32861 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
32862#if !CYTHON_ASSUME_SAFE_MACROS
32863 if (unlikely(!args[i]))
goto cleanup;
32866#if !CYTHON_ASSUME_SAFE_MACROS
32870 kwnames = PyTuple_New(k_size);
32871 if (unlikely(!kwnames))
goto cleanup;
32872 __Pyx_BEGIN_CRITICAL_SECTION(k);
32873 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
32874 __Pyx_END_CRITICAL_SECTION();
32875 if (unlikely(unpack_dict_result == -1))
goto cleanup;
32877 result =
f(o, args, a_size, kwnames);
32879 Py_XDECREF(kwnames);
32880 for (i=a_size; i<total_size; ++i) {
32881 Py_XDECREF(args[i]);
32883 if (args != stack_args) {
32891#if CYTHON_VECTORCALL_TPNEW
32892static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
32893 newfunc tp_new = __Pyx_PyType_GetSlot(t, tp_new, newfunc);
32894 if (unlikely(!tp_new)) {
32895 __Pyx_RaiseErrorWithType(PyExc_TypeError,
"cannot create " __Pyx_FMT_TYPENAME
" instances", t);
32898 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
32899 PyObject *result = NULL, *args_tuple = NULL, *kwds_dict = NULL;
32900 Py_ssize_t kw_size = kwnames ? __Pyx_PyTuple_GET_SIZE(kwnames) : 0;
32901#if !CYTHON_ASSUME_SAFE_SIZE
32902 if (unlikely(kw_size == -1)) {
32907 kwds_dict = __Pyx_PyDict_NewPresized(kw_size);
32908 if (unlikely(!kwds_dict)) {
32911 for (Py_ssize_t i=0; i<kw_size; ++i) {
32912 PyObject *
v = args[nargs + i];
32913 PyObject *k = __Pyx_PyTuple_GET_ITEM(kwnames, i);
32914#if !CYTHON_ASSUME_SAFE_MACROS
32915 if (unlikely(!k)) {
32919 if (unlikely(PyDict_SetItem(kwds_dict, k,
v) < 0)) {
32925 args_tuple = __Pyx_PyTuple_FromArray(args, nargs);
32926 if (unlikely(!args_tuple)) {
32930 args_tuple = __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
32932 result = tp_new(t, args_tuple, kwds_dict);
32933 if (unlikely(!result)) {
32936 if (PyObject_TypeCheck(result, t)) {
32937 initproc tp_init = __Pyx_PyObject_GetSlot(result, tp_init, initproc);
32938 if (tp_init && unlikely(tp_init(result, args_tuple, kwds_dict) < 0)) {
32943 Py_XDECREF(args_tuple);
32944 Py_XDECREF(kwds_dict);
32950#if CYTHON_VECTORCALL_TPNEW
32951static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc
f, PyObject* o, PyObject *a, PyObject *k) {
32952 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
32953#if !CYTHON_ASSUME_SAFE_SIZE
32954 if (unlikely(k_size < 0))
return -1;
32956 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
32957#if !CYTHON_ASSUME_SAFE_SIZE
32958 if (unlikely(a_size < 0))
return -1;
32960#if CYTHON_ASSUME_SAFE_MACROS
32962 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
32965 if (k_size == 0 && a_size == 0) {
32966 return f(o, NULL, 0, NULL);
32969 PyObject *stack_args[5];
32970 PyObject **args = stack_args;
32971 Py_ssize_t maxnargs = PY_SSIZE_T_MAX /
sizeof(PyObject*) - 1;
32972 if (a_size > maxnargs - k_size) {
32976 Py_ssize_t total_size = a_size + k_size;
32977 if (total_size > 5) {
32978 args = (PyObject**)PyMem_Malloc(((
size_t)total_size)*
sizeof(PyObject*));
32979 if (unlikely(!args)) {
32985 PyObject *kwnames = NULL;
32986 int unpack_dict_result;
32988 for (; i < a_size; ++i) {
32989 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
32990#if !CYTHON_ASSUME_SAFE_MACROS
32991 if (unlikely(!args[i]))
goto cleanup;
32994#if !CYTHON_ASSUME_SAFE_MACROS
32998 kwnames = PyTuple_New(k_size);
32999 if (unlikely(!kwnames))
goto cleanup;
33000 __Pyx_BEGIN_CRITICAL_SECTION(k);
33001 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
33002 __Pyx_END_CRITICAL_SECTION();
33003 if (unlikely(unpack_dict_result == -1))
goto cleanup;
33005 result =
f(o, args, a_size, kwnames);
33007 Py_XDECREF(kwnames);
33008 for (i=a_size; i<total_size; ++i) {
33009 Py_XDECREF(args[i]);
33011 if (args != stack_args) {
33019#if !CYTHON_USE_TYPE_SPECS
33021static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg) {
33022 if (!always_call) {
33023 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
33024 unsigned long flags = PyType_GetFlags(base);
33025 if (flags & Py_TPFLAGS_HEAPTYPE) {
33029 Py_VISIT((PyObject*)Py_TYPE(o));
33035static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
33036#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
33037 return PyObject_VectorcallMethod(method_name, &obj, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
33038#elif CYTHON_COMPILING_IN_LIMITED_API
33039 return PyObject_CallMethodObjArgs(obj, method_name, NULL);
33041 return PyObject_CallMethodNoArgs(obj, method_name);
33046#if !CYTHON_USE_TYPE_SLOTS
33047CYTHON_UNUSED
static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp,
int require_cython_valid_result) {
33048 PyObject *tp_dictoffset_o;
33049 Py_ssize_t tp_dictoffset;
33050 tp_dictoffset_o = PyObject_GetAttrString(tp,
"__dictoffset__");
33051 if (unlikely(!tp_dictoffset_o))
return -1;
33052 tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
33053 Py_DECREF(tp_dictoffset_o);
33054 if (unlikely(require_cython_valid_result && tp_dictoffset == 0)) {
33057 "'type' doesn't have a dictoffset");
33059 }
else if (unlikely(require_cython_valid_result && tp_dictoffset < 0)) {
33062 "'type' has an unexpected negative dictoffset. "
33063 "Please report this as Cython bug");
33066 return tp_dictoffset;
33071#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
33072static int __Pyx_validate_bases_tuple(
const char *type_name,
int has_dictoffset, PyObject *bases) {
33074#if CYTHON_ASSUME_SAFE_SIZE
33075 n = PyTuple_GET_SIZE(bases);
33077 n = PyTuple_Size(bases);
33078 if (unlikely(
n < 0))
return -1;
33080 if (!has_dictoffset) {
33082#if CYTHON_AVOID_BORROWED_REFS
33083 b = PySequence_GetItem(bases, 0);
33085#elif CYTHON_ASSUME_SAFE_MACROS
33086 b = PyTuple_GET_ITEM(bases, 0);
33088 b = PyTuple_GetItem(bases, 0);
33091#if CYTHON_USE_TYPE_SLOTS
33092 has_dictoffset = ((PyTypeObject*)b)->tp_dictoffset != 0;
33094 Py_ssize_t dictoffset = __Pyx_GetTypeDictOffset(b, 0);
33095 has_dictoffset = dictoffset != 0;
33097#if CYTHON_AVOID_BORROWED_REFS
33100#if !CYTHON_USE_TYPE_SLOTS
33101 if (dictoffset == -1 && PyErr_Occurred())
return -1;
33104 for (i = 1; i <
n; i++)
33107#if CYTHON_AVOID_BORROWED_REFS
33108 PyObject *b0 = PySequence_GetItem(bases, i);
33109 if (!b0)
return -1;
33110#elif CYTHON_ASSUME_SAFE_MACROS
33111 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
33113 PyObject *b0 = PyTuple_GetItem(bases, i);
33114 if (!b0)
return -1;
33116 b = (PyTypeObject*) b0;
33117 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
33119 __Pyx_RaiseErrorWithType(
33120 PyExc_TypeError,
"base class '" __Pyx_FMT_TYPENAME
"' is not a heap type", b);
33121#if CYTHON_AVOID_BORROWED_REFS
33126 if (!has_dictoffset)
33128 Py_ssize_t b_dictoffset = 0;
33129#if CYTHON_USE_TYPE_SLOTS
33130 b_dictoffset = b->tp_dictoffset;
33132 b_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)b, 0);
33133 if (b_dictoffset == -1 && PyErr_Occurred())
goto dictoffset_return;
33135 if (b_dictoffset) {
33136 __Pyx_RaiseErrorWithType1(
33138 "extension type '%.200s' has no __dict__ slot, "
33139 "but base type '" __Pyx_FMT_TYPENAME
"' has: "
33140 "either add 'cdef dict __dict__' to the extension type "
33141 "or add '__slots__ = [...]' to the base type",
33143#if !CYTHON_USE_TYPE_SLOTS
33146#if CYTHON_AVOID_BORROWED_REFS
33152#if CYTHON_AVOID_BORROWED_REFS
33161CYTHON_UNUSED
static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
33163 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
33167 t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
33171static int __Pyx_PyType_Ready(PyTypeObject *t) {
33172#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON
33173 (void)__Pyx_PyObject_CallMethod0;
33174#if CYTHON_USE_TYPE_SPECS
33175 (void)__Pyx_validate_bases_tuple;
33177 return PyType_Ready(t);
33180 if (!__Pyx_PyType_HasMultipleInheritance(t)) {
33181 return PyType_Ready(t);
33183 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
33184 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset != 0, bases) == -1))
33187 int gc_was_enabled;
33188 #if PY_VERSION_HEX >= 0x030A00b1
33189 gc_was_enabled = PyGC_Disable();
33190 (void)__Pyx_PyObject_CallMethod0;
33192 PyObject *ret, *py_status;
33193 PyObject *gc = NULL;
33194 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
33195 !CYTHON_COMPILING_IN_GRAAL
33196 gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
33198 if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
33199 if (unlikely(!gc))
return -1;
33200 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
33201 if (unlikely(!py_status)) {
33205 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
33206 Py_DECREF(py_status);
33207 if (gc_was_enabled > 0) {
33208 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
33209 if (unlikely(!ret)) {
33214 }
else if (unlikely(gc_was_enabled == -1)) {
33219 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
33220#if PY_VERSION_HEX >= 0x030A0000
33221 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
33223 r = PyType_Ready(t);
33224 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
33225 #if PY_VERSION_HEX >= 0x030A00b1
33226 if (gc_was_enabled)
33229 if (gc_was_enabled) {
33230 PyObject *tp, *
v, *tb;
33231 PyErr_Fetch(&tp, &
v, &tb);
33232 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
33233 if (likely(ret ||
r == -1)) {
33235 PyErr_Restore(tp,
v, tb);
33251#if CYTHON_COMPILING_IN_LIMITED_API
33252static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp) {
33253 static Py_ssize_t tp_dictoffset = 0;
33254 if (unlikely(tp_dictoffset == 0)) {
33255 tp_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)(&PyType_Type), 1);
33256 if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
33261 return *(PyObject**)((
char*)tp + tp_dictoffset);
33266static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
33269#if CYTHON_COMPILING_IN_LIMITED_API
33270 tp_dict = __Pyx_GetTypeTypeDict(tp);
33271 if (unlikely(!tp_dict))
return -1;
33273 tp_dict = tp->tp_dict;
33275 result = PyDict_DelItem(tp_dict, k);
33276 if (likely(!result)) PyType_Modified(tp);
33281static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *
v) {
33284#if CYTHON_COMPILING_IN_LIMITED_API
33285 tp_dict = __Pyx_GetTypeTypeDict(tp);
33286 if (unlikely(!tp_dict))
return -1;
33288 tp_dict = tp->tp_dict;
33290 result = PyDict_SetItem(tp_dict, k,
v);
33291 if (likely(!result)) {
33292 PyType_Modified(tp);
33293 if (unlikely(PyObject_HasAttr(
v, __pyx_mstate_global->__pyx_n_u_set_name))) {
33294 PyObject *setNameResult = PyObject_CallMethodObjArgs(
v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL);
33295 if (!setNameResult)
return -1;
33296 Py_DECREF(setNameResult);
33303static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
33305 PyObject *name_attr;
33306 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_2);
33307 if (likely(name_attr)) {
33308 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
33312 if (unlikely(ret < 0) && __Pyx_IgnoreException(PyExc_Exception)) {
33315 Py_XDECREF(name_attr);
33318static PyObject *__Pyx_setup_reduce_get_reduce_attribute(PyObject *type_obj, PyObject *name,
int allow_not_present) {
33319#if CYTHON_USE_PYTYPE_LOOKUP
33320 CYTHON_UNUSED_VAR(allow_not_present);
33321 return _PyType_Lookup((PyTypeObject*)type_obj, name);
33323 if (allow_not_present) {
33324 return __Pyx_PyObject_GetAttrStrNoError(type_obj, name);
33326 return __Pyx_PyObject_GetAttrStr(type_obj, name);
33330static int __Pyx_setup_reduce(PyObject* type_obj) {
33332 PyObject *object_reduce = NULL;
33333 PyObject *object_getstate = NULL;
33334 PyObject *object_reduce_ex = NULL;
33335 PyObject *reduce = NULL;
33336 PyObject *reduce_ex = NULL;
33337 PyObject *reduce_cython = NULL;
33338 PyObject *setstate = NULL;
33339 PyObject *setstate_cython = NULL;
33340 PyObject *getstate = NULL;
33341 getstate = __Pyx_setup_reduce_get_reduce_attribute(type_obj, __pyx_mstate_global->__pyx_n_u_getstate, 1);
33342 if (!getstate && PyErr_Occurred()) {
33346 object_getstate = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate, 1);
33347 if (!object_getstate && PyErr_Occurred()) {
33350 if (object_getstate != getstate) {
33354 object_reduce_ex = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex, 0);
33355 if (unlikely(!object_reduce_ex))
goto __PYX_BAD;
33356 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
33357 if (reduce_ex == object_reduce_ex) {
33358 object_reduce = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce, 0);
33359 if (!object_reduce)
goto __PYX_BAD;
33360 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
33361 int try_to_replace_reduce = (reduce == object_reduce);
33362 if (!try_to_replace_reduce) {
33363 try_to_replace_reduce = __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython);
33364 if (unlikely(try_to_replace_reduce < 0)) {
33368 if (try_to_replace_reduce) {
33369 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
33370 if (likely(reduce_cython)) {
33371 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
33372 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
33373 }
else if (reduce == object_reduce || PyErr_Occurred()) {
33376 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
33377 int try_to_replace_setstate;
33379 PyObject *exc = PyErr_Occurred();
33380 if (exc && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
33383 try_to_replace_setstate = 1;
33385 try_to_replace_setstate = __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython);
33386 if (unlikely(try_to_replace_setstate < 0)) {
33390 if (try_to_replace_setstate) {
33391 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
33392 if (likely(setstate_cython)) {
33393 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
33394 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
33395 }
else if (!setstate || PyErr_Occurred()) {
33399 PyType_Modified((PyTypeObject*)type_obj);
33404 if (!PyErr_Occurred()) {
33405 __Pyx_RaiseErrorWithType(
33406 PyExc_RuntimeError,
33407 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME,
33408 (PyTypeObject*)type_obj);
33412#if !CYTHON_USE_PYTYPE_LOOKUP
33413 Py_XDECREF(object_reduce);
33414 Py_XDECREF(object_reduce_ex);
33415 Py_XDECREF(object_getstate);
33416 Py_XDECREF(getstate);
33418 Py_XDECREF(reduce);
33419 Py_XDECREF(reduce_ex);
33420 Py_XDECREF(reduce_cython);
33421 Py_XDECREF(setstate);
33422 Py_XDECREF(setstate_cython);
33427#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_PYPY && CYTHON_USE_TYPE_SPECS)
33428int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp,
int is_sequence) {
33430 PyObject *collections_abc = PyImport_ImportModule(
"collections.abc");
33431 if (unlikely(!collections_abc))
return -1;
33432 abc = PyObject_GetAttrString(collections_abc, is_sequence ?
"Sequence":
"Mapping");
33433 Py_DECREF(collections_abc);
33434 if (unlikely(!abc))
return -1;
33435 PyObject *register_result = PyObject_CallMethod(abc,
"register",
"O", (PyObject*)tp);
33437 if (unlikely(!register_result))
return -1;
33438 Py_DECREF(register_result);
33441#elif CYTHON_COMPILING_IN_PYPY
33442int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp,
int is_sequence) {
33443 CYTHON_UNUSED_VAR(tp);
33444 CYTHON_UNUSED_VAR(is_sequence);
33445 return PyErr_WarnEx(
33446 PyExc_RuntimeWarning,
33447 "cython.collection_type only works on PyPy with the C flag CYTHON_USE_TYPE_SPECS=1",
33454static int __Pyx_GetVtable(PyTypeObject *type,
void** table) {
33457#if CYTHON_COMPILING_IN_LIMITED_API
33458 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
33460 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
33464 ptr = PyCapsule_GetPointer(ob, 0);
33465 if (!ptr && !PyErr_Occurred())
33466 PyErr_SetString(PyExc_RuntimeError,
"invalid vtable found for imported type");
33471 if (PyErr_ExceptionMatches(CYTHON_COMPILING_IN_LIMITED_API ? PyExc_AttributeError : PyExc_KeyError)) {
33479static int __Pyx_MergeVtables(PyTypeObject *type) {
33482 void** base_vtables;
33483 void* unknown = (
void*)-1;
33484 PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
33485 int base_depth = 0;
33487 PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
33490 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
33493 base_vtables = (
void**) PyMem_Malloc(
sizeof(
void*) * (
size_t)(base_depth + 1));
33494 if (unlikely(!base_vtables)) {
33498 base_vtables[0] = unknown;
33499#if CYTHON_COMPILING_IN_LIMITED_API
33500 size = PyTuple_Size(bases);
33501 if (size < 0)
goto other_failure;
33503 size = PyTuple_GET_SIZE(bases);
33505 for (i = 1; i < size; i++) {
33508#if CYTHON_AVOID_BORROWED_REFS
33509 basei = PySequence_GetItem(bases, i);
33510 if (unlikely(!basei))
goto other_failure;
33511#elif !CYTHON_ASSUME_SAFE_MACROS
33512 basei = PyTuple_GetItem(bases, i);
33513 if (unlikely(!basei))
goto other_failure;
33515 basei = PyTuple_GET_ITEM(bases, i);
33517 int get_vtable_result = __Pyx_GetVtable((PyTypeObject*)basei, &base_vtable);
33518#if CYTHON_AVOID_BORROWED_REFS
33521 if (get_vtable_result != 1) {
33522 if (get_vtable_result == -1) {
33523 goto other_failure;
33527 assert(base_vtable != NULL);
33529 PyTypeObject* base = __Pyx_PyType_TryGetSlot(type, tp_base, PyTypeObject*);
33530#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33531 if (!base)
goto bad;
33533 for (j = 0; j < base_depth; j++) {
33534 if (base_vtables[j] == unknown) {
33535 switch (__Pyx_GetVtable(base, &base_vtables[j])) {
33537 assert(base_vtables[j] == NULL);
33543 goto other_failure;
33545 base_vtables[j + 1] = unknown;
33547 if (base_vtables[j] == base_vtable) {
33550 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
33551#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33552 if (!base)
goto bad;
33557 PyMem_Free(base_vtables);
33561 PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
33562 PyTypeObject* basei;
33563#if CYTHON_AVOID_BORROWED_REFS
33564 basei = (PyTypeObject*)PySequence_GetItem(bases, i);
33565 if (unlikely(!basei))
goto other_failure;
33566#elif !CYTHON_ASSUME_SAFE_MACROS
33567 basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
33568 if (unlikely(!basei))
goto other_failure;
33570 basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
33572 __Pyx_RaiseTypeErrorWithTypes(
33573 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME
"' and '" __Pyx_FMT_TYPENAME
"'", tp_base, basei);
33574#if CYTHON_AVOID_BORROWED_REFS
33579 PyMem_Free(base_vtables);
33584static int __Pyx_SetVtable(PyTypeObject *type,
void *vtable) {
33585 PyObject *ob = PyCapsule_New(vtable, 0, 0);
33588#if CYTHON_COMPILING_IN_LIMITED_API
33589 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
33591 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
33595 return __Pyx_MergeVtables(type);
33602#ifndef __PYX_HAVE_RT_ImportType_3_3_0
33603#define __PYX_HAVE_RT_ImportType_3_3_0
33604static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module,
const char *module_name,
const char *class_name,
33605 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
33607 PyObject *result = 0;
33608 Py_ssize_t basicsize;
33609 Py_ssize_t itemsize;
33610#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
33611 PyObject *py_basicsize;
33612 PyObject *py_itemsize;
33614 result = PyObject_GetAttrString(module, class_name);
33617 if (!PyType_Check(result)) {
33618 PyErr_Format(PyExc_TypeError,
33619 "%.200s.%.200s is not a type object",
33620 module_name, class_name);
33623#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
33624 basicsize = ((PyTypeObject *)result)->tp_basicsize;
33625 itemsize = ((PyTypeObject *)result)->tp_itemsize;
33628 return (PyTypeObject *)result;
33630 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
33633 basicsize = PyLong_AsSsize_t(py_basicsize);
33634 Py_DECREF(py_basicsize);
33636 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
33638 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
33641 itemsize = PyLong_AsSsize_t(py_itemsize);
33642 Py_DECREF(py_itemsize);
33644 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
33648 if (size % alignment) {
33649 alignment = size % alignment;
33651 if (itemsize < (Py_ssize_t)alignment)
33652 itemsize = (Py_ssize_t)alignment;
33654 if ((
size_t)(basicsize + itemsize) < size) {
33655 PyErr_Format(PyExc_ValueError,
33656 "%.200s.%.200s size changed, may indicate binary incompatibility. "
33657 "Expected %zd from C header, got %zd from PyObject",
33658 module_name, class_name, size, basicsize+itemsize);
33661 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
33662 ((
size_t)basicsize > size || (
size_t)(basicsize + itemsize) < size)) {
33663 PyErr_Format(PyExc_ValueError,
33664 "%.200s.%.200s size changed, may indicate binary incompatibility. "
33665 "Expected %zd from C header, got %zd-%zd from PyObject",
33666 module_name, class_name, size, basicsize, basicsize+itemsize);
33669 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (
size_t)basicsize > size) {
33670 if (PyErr_WarnFormat(NULL, 0,
33671 "%.200s.%.200s size changed, may indicate binary incompatibility. "
33672 "Expected %zd from C header, got %zd from PyObject",
33673 module_name, class_name, size, basicsize) < 0) {
33677 return (PyTypeObject *)result;
33679 Py_XDECREF(result);
33686__Pyx_PEP560_update_bases(PyObject *bases)
33688 Py_ssize_t i, j, size_bases;
33689 PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
33690#if CYTHON_ASSUME_SAFE_SIZE
33691 size_bases = PyTuple_GET_SIZE(bases);
33693 size_bases = PyTuple_Size(bases);
33694 if (size_bases < 0)
return NULL;
33696 for (i = 0; i < size_bases; i++) {
33697#if CYTHON_AVOID_BORROWED_REFS
33700#if CYTHON_ASSUME_SAFE_MACROS
33701 base = PyTuple_GET_ITEM(bases, i);
33703 base = PyTuple_GetItem(bases, i);
33704 if (!base)
goto error;
33706#if CYTHON_AVOID_BORROWED_REFS
33709 if (PyType_Check(base)) {
33711 if (PyList_Append(new_bases, base) < 0) {
33717 meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries);
33718 if (!meth && PyErr_Occurred()) {
33723 if (PyList_Append(new_bases, base) < 0) {
33729 new_base = __Pyx_PyObject_CallOneArg(meth, bases);
33734 if (!PyTuple_Check(new_base)) {
33735 PyErr_SetString(PyExc_TypeError,
33736 "__mro_entries__ must return a tuple");
33737 Py_DECREF(new_base);
33741 if (!(new_bases = PyList_New(i))) {
33744 for (j = 0; j < i; j++) {
33745 PyObject *base_from_list;
33746#if CYTHON_ASSUME_SAFE_MACROS
33747 base_from_list = PyTuple_GET_ITEM(bases, j);
33748 PyList_SET_ITEM(new_bases, j, base_from_list);
33749 Py_INCREF(base_from_list);
33751 base_from_list = PyTuple_GetItem(bases, j);
33752 if (!base_from_list)
goto error;
33753 Py_INCREF(base_from_list);
33754 if (PyList_SetItem(new_bases, j, base_from_list) < 0)
goto error;
33758#if CYTHON_ASSUME_SAFE_SIZE
33759 j = PyList_GET_SIZE(new_bases);
33761 j = PyList_Size(new_bases);
33762 if (j < 0)
goto error;
33764 if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
33767 Py_DECREF(new_base);
33773 result = PyList_AsTuple(new_bases);
33774 Py_DECREF(new_bases);
33775#if CYTHON_AVOID_BORROWED_REFS
33780 Py_XDECREF(new_bases);
33781#if CYTHON_AVOID_BORROWED_REFS
33788static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
33789 Py_ssize_t i, nbases;
33790#if CYTHON_ASSUME_SAFE_SIZE
33791 nbases = PyTuple_GET_SIZE(bases);
33793 nbases = PyTuple_Size(bases);
33794 if (nbases < 0)
return NULL;
33796 for (i=0; i < nbases; i++) {
33797 PyTypeObject *tmptype;
33798#if CYTHON_ASSUME_SAFE_MACROS
33799 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
33801 PyObject *tmp = PyTuple_GetItem(bases, i);
33802 if (!tmp)
return NULL;
33804 tmptype = Py_TYPE(tmp);
33806 metaclass = tmptype;
33809 if (PyType_IsSubtype(metaclass, tmptype))
33811 if (PyType_IsSubtype(tmptype, metaclass)) {
33812 metaclass = tmptype;
33815 PyErr_SetString(PyExc_TypeError,
33816 "metaclass conflict: "
33817 "the metaclass of a derived class "
33818 "must be a (non-strict) subclass "
33819 "of the metaclasses of all its bases");
33823 metaclass = &PyType_Type;
33825 Py_INCREF((PyObject*) metaclass);
33826 return (PyObject*) metaclass;
33830static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
33832#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
33833 PyDict_SetDefaultRef(d, key, default_value, &value);
33834#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
33835 PyObject *args[] = {d, key, default_value};
33836 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
33837#elif CYTHON_COMPILING_IN_LIMITED_API
33838 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
33840 value = PyDict_SetDefault(d, key, default_value);
33841 if (unlikely(!value))
return NULL;
33848#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
33849 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
33850 PyObject *module_dict = PyImport_GetModuleDict();
33852 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
33855 if (m != NULL && PyModule_Check(m)) {
33859 m = PyModule_NewObject(name);
33862 if (PyDict_CheckExact(module_dict)) {
33864 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
33868 if (PyObject_SetItem(module_dict, name, m) != 0) {
33875 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
33876 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
33877 return PyImport_AddModuleRef(name);
33879 PyObject *py_name = PyUnicode_FromString(name);
33880 if (!py_name)
return NULL;
33881 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
33882 Py_DECREF(py_name);
33885#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
33886 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
33887 PyObject *module = PyImport_AddModule(name);
33888 Py_XINCREF(module);
33894static PyObject *__Pyx_FetchSharedCythonABIModule(
void) {
33895 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
33899static int __Pyx_VerifyCachedType(PyObject *cached_type,
33901 Py_ssize_t expected_basicsize) {
33902 Py_ssize_t basicsize;
33903 if (!PyType_Check(cached_type)) {
33904 PyErr_Format(PyExc_TypeError,
33905 "Shared Cython type %.200s is not a type object", name);
33908 if (expected_basicsize == 0) {
33911#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
33912 if (expected_basicsize < 0) {
33913 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
33917 #if CYTHON_COMPILING_IN_LIMITED_API
33918 PyObject *py_basicsize;
33919 py_basicsize = PyObject_GetAttrString(cached_type,
"__basicsize__");
33920 if (unlikely(!py_basicsize))
return -1;
33921 basicsize = PyLong_AsSsize_t(py_basicsize);
33922 Py_DECREF(py_basicsize);
33923 py_basicsize = NULL;
33924 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred())
return -1;
33926 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
33929 if ((expected_basicsize >= 0) ?
33930 (basicsize != expected_basicsize) :
33931 (basicsize < -expected_basicsize)) {
33932 PyErr_Format(PyExc_TypeError,
33933 "Shared Cython type %.200s has the wrong size, try recompiling",
33941#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
33942static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
33943 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
33944 if (result && metaclass) {
33945 PyObject *old_tp = (PyObject*)Py_TYPE(result);
33946 Py_INCREF((PyObject*)metaclass);
33947 Py_SET_TYPE(result, metaclass);
33949 PyType_Modified((PyTypeObject*)result);
33954#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
33956static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
33957 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
33958 int get_item_ref_result;
33959 const char* object_name = strrchr(spec->name,
'.');
33960 object_name = object_name ? object_name+1 : spec->name;
33961 py_object_name = PyUnicode_FromString(object_name);
33962 if (!py_object_name)
return NULL;
33963 abi_module = __Pyx_FetchSharedCythonABIModule();
33964 if (!abi_module)
goto done;
33965 abi_module_dict = PyModule_GetDict(abi_module);
33966 if (!abi_module_dict)
goto done;
33967 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
33968 if (get_item_ref_result == 1) {
33969 if (__Pyx_VerifyCachedType(
33972 spec->basicsize) < 0) {
33976 }
else if (unlikely(get_item_ref_result == -1)) {
33979 cached_type = __Pyx_PyType_FromMetaclass(
33981 CYTHON_USE_MODULE_STATE ? module : abi_module,
33983 if (unlikely(!cached_type))
goto bad;
33984 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
33985 if (unlikely(new_cached_type != cached_type)) {
33986 if (unlikely(!new_cached_type))
goto bad;
33987 Py_DECREF(cached_type);
33988 cached_type = new_cached_type;
33989 if (__Pyx_VerifyCachedType(
33992 spec->basicsize) < 0) {
33997 Py_DECREF(new_cached_type);
34000 Py_XDECREF(abi_module);
34001 Py_DECREF(py_object_name);
34002 assert(cached_type == NULL || PyType_Check(cached_type));
34003 return (PyTypeObject *) cached_type;
34005 Py_XDECREF(cached_type);
34006 cached_type = NULL;
34011static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED
void* context) {
34012 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
34014#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
34015static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
34016 PyErr_SetString(PyExc_TypeError,
"Cannot instantiate Cython internal types");
34019static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
34020 PyErr_SetString(PyExc_TypeError,
"Cython internal types are immutable");
34024static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
34025 {
"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
34028static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
34029 {Py_tp_getset, (
void *)__pyx_CommonTypesMetaclass_getset},
34030 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
34031 {Py_tp_call, (
void*)__pyx_CommonTypesMetaclass_call},
34032 {Py_tp_new, (
void*)__pyx_CommonTypesMetaclass_call},
34033 {Py_tp_setattro, (
void*)__pyx_CommonTypesMetaclass_setattr},
34037static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
34038 __PYX_TYPE_MODULE_PREFIX
"_common_types_metatype",
34041 Py_TPFLAGS_IMMUTABLETYPE |
34042 Py_TPFLAGS_DISALLOW_INSTANTIATION |
34043 Py_TPFLAGS_DEFAULT,
34044 __pyx_CommonTypesMetaclass_slots
34046static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
34047 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
34048 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
34049 if (unlikely(!bases)) {
34052 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
34054 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
34061#if CYTHON_COMPILING_IN_LIMITED_API
34062static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func,
void (*cfunc)(
void)) {
34063 if (__Pyx_CyFunction_Check(func)) {
34064 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
34065 }
else if (PyCFunction_Check(func)) {
34066 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
34070static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
34071 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
34073 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
34074 if (unlikely(!newFunc)) {
34078 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
34079 Py_DECREF(newFunc);
34082 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
34085static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
34086 if (PyMethod_Check(func)) {
34087 func = PyMethod_GET_FUNCTION(func);
34089 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
34092static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj) {
34093#if CYTHON_COMPILING_IN_LIMITED_API
34094 __Pyx_Py_XDECREF_SET(
34095 __Pyx__CyFunction_GetClassObj(
f),
34096 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
34098 __Pyx_Py_XDECREF_SET(
34099 ((PyCMethodObject *) (
f))->mm_class,
34100 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
34103static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
34104 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34105 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL);
34106 if (unlikely(!m->defaults))
34108 return m->defaults;
34110static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
34111 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34112 m->defaults_tuple = tuple;
34115static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
34116 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34117 m->defaults_kwdict = dict;
34120static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
34121 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34122 m->func_annotations = dict;
34127#if CYTHON_COMPILING_IN_LIMITED_API
34128static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
34130 CYTHON_UNUSED_VAR(typ);
34132 return __Pyx_NewRef(func);
34133 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
34135 PyObject *args[] = {func, self};
34136 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
34139 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
34144static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
34145 CYTHON_UNUSED_VAR(typ);
34147 return __Pyx_NewRef(func);
34148 return PyMethod_New(func, self);
34153#if CYTHON_VECTORCALL
34154static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
34156 PyObject *res = NULL;
34158 PyObject **newargs;
34159 PyObject **kwvalues;
34161 #if CYTHON_AVOID_BORROWED_REFS
34167 PyObject *key, *value;
34168 unsigned long keys_are_strings;
34169 #if !CYTHON_ASSUME_SAFE_SIZE
34170 Py_ssize_t nkw = PyDict_Size(kw);
34171 if (unlikely(nkw == -1))
return NULL;
34173 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
34175 newargs = (PyObject **)PyMem_Malloc((nargs + (
size_t)nkw) *
sizeof(args[0]));
34176 if (unlikely(newargs == NULL)) {
34180 for (j = 0; j < nargs; j++) newargs[j] = args[j];
34181 kwnames = PyTuple_New(nkw);
34182 if (unlikely(kwnames == NULL)) {
34183 PyMem_Free(newargs);
34186 kwvalues = newargs + nargs;
34189 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
34190 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
34191 keys_are_strings &=
34192 #if CYTHON_COMPILING_IN_LIMITED_API
34193 PyType_GetFlags(Py_TYPE(key));
34195 Py_TYPE(key)->tp_flags;
34197 #if !CYTHON_ASSUME_SAFE_MACROS
34198 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0))
goto cleanup;
34200 PyTuple_SET_ITEM(kwnames, i, key);
34202 kwvalues[i] = value;
34205 if (unlikely(!keys_are_strings)) {
34206 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
34209 res = vc(func, newargs, nargs, kwnames);
34211 #if CYTHON_AVOID_BORROWED_REFS
34214 Py_DECREF(kwnames);
34215 for (i = 0; i < nkw; i++)
34216 Py_DECREF(kwvalues[i]);
34217 PyMem_Free(newargs);
34220static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
34222 Py_ssize_t kw_size =
34223 likely(kw == NULL) ?
34225#if !CYTHON_ASSUME_SAFE_SIZE
34228 PyDict_GET_SIZE(kw);
34230 if (kw_size == 0) {
34231 return vc(func, args, nargs, NULL);
34233#if !CYTHON_ASSUME_SAFE_SIZE
34234 else if (unlikely(kw_size == -1)) {
34238 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
34244__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
34246 if (unlikely(op->func_doc == NULL)) {
34247#if CYTHON_COMPILING_IN_LIMITED_API
34248 const char *doc = op->func_methoddef->ml_doc;
34250 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
34253 op->func_doc = PyUnicode_FromString(doc);
34254 if (unlikely(op->func_doc == NULL))
34257 Py_INCREF(Py_None);
34261 Py_INCREF(op->func_doc);
34262 return op->func_doc;
34265__Pyx_CyFunction_get_doc(PyObject *op_in,
void *closure) {
34267 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34268 CYTHON_UNUSED_VAR(closure);
34269 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34270 result = __Pyx_CyFunction_get_doc_locked(op);
34271 __Pyx_END_CRITICAL_SECTION();
34275__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value,
void *context)
34277 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34278 CYTHON_UNUSED_VAR(context);
34279 if (value == NULL) {
34283 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34284 __Pyx_Py_XDECREF_SET(op->func_doc, value);
34285 __Pyx_END_CRITICAL_SECTION();
34289__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
34291 if (unlikely(op->func_name == NULL)) {
34292#if CYTHON_COMPILING_IN_LIMITED_API
34293 const char *name = op->func_methoddef->ml_name;
34295 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
34297 op->func_name = PyUnicode_InternFromString(name);
34298 if (unlikely(op->func_name == NULL))
34301 Py_INCREF(op->func_name);
34302 return op->func_name;
34305__Pyx_CyFunction_get_name(PyObject *op,
void *context)
34307 PyObject *result = NULL;
34308 CYTHON_UNUSED_VAR(context);
34309 __Pyx_BEGIN_CRITICAL_SECTION(op);
34310 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
34311 __Pyx_END_CRITICAL_SECTION();
34315__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value,
void *context)
34317 CYTHON_UNUSED_VAR(context);
34318 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
34319 PyErr_SetString(PyExc_TypeError,
34320 "__name__ must be set to a string object");
34323 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34325 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34326 __Pyx_Py_XDECREF_SET(op->func_name, value);
34327 __Pyx_END_CRITICAL_SECTION();
34331__Pyx_CyFunction_get_qualname(PyObject *op_in,
void *context)
34333 CYTHON_UNUSED_VAR(context);
34334 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34336 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34337 Py_INCREF(op->func_qualname);
34338 result = op->func_qualname;
34339 __Pyx_END_CRITICAL_SECTION();
34343__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value,
void *context)
34345 CYTHON_UNUSED_VAR(context);
34346 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
34347 PyErr_SetString(PyExc_TypeError,
34348 "__qualname__ must be set to a string object");
34351 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34353 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34354 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
34355 __Pyx_END_CRITICAL_SECTION();
34358#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34360__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op,
void *context)
34362 CYTHON_UNUSED_VAR(context);
34363 if (unlikely(op->func_dict == NULL)) {
34364 op->func_dict = PyDict_New();
34365 if (unlikely(op->func_dict == NULL))
34368 Py_INCREF(op->func_dict);
34369 return op->func_dict;
34373__Pyx_CyFunction_get_globals(PyObject *op_in,
void *context)
34375 CYTHON_UNUSED_VAR(context);
34376 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34377 Py_INCREF(op->func_globals);
34378 return op->func_globals;
34381__Pyx_CyFunction_get_closure(PyObject *op,
void *context)
34383 CYTHON_UNUSED_VAR(op);
34384 CYTHON_UNUSED_VAR(context);
34385 Py_INCREF(Py_None);
34389__Pyx_CyFunction_get_code(PyObject *op_in,
void *context)
34391 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34392 PyObject* result = (op->func_code) ? op->func_code : Py_None;
34393 CYTHON_UNUSED_VAR(context);
34398__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
34400 PyObject *res = op->defaults_getter(op_obj);
34401 if (unlikely(!res))
34403 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34404 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
34405 Py_INCREF(op->defaults_tuple);
34406 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
34407 Py_INCREF(op->defaults_kwdict);
34409 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
34410 if (unlikely(!op->defaults_tuple)) result = -1;
34412 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
34413 if (unlikely(!op->defaults_kwdict)) result = -1;
34420__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value,
void *context) {
34421 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34422 CYTHON_UNUSED_VAR(context);
34425 }
else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
34426 PyErr_SetString(PyExc_TypeError,
34427 "__defaults__ must be set to a tuple object");
34430 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__defaults__ will not "
34431 "currently affect the values used in function calls", 1);
34433 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34434 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
34435 __Pyx_END_CRITICAL_SECTION();
34439__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
34440 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34441 PyObject* result = op->defaults_tuple;
34442 if (unlikely(!result)) {
34443 if (op->defaults_getter) {
34444 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
34445 result = op->defaults_tuple;
34454__Pyx_CyFunction_get_defaults(PyObject *op,
void *context) {
34455 PyObject* result = NULL;
34456 CYTHON_UNUSED_VAR(context);
34457 __Pyx_BEGIN_CRITICAL_SECTION(op);
34458 result = __Pyx_CyFunction_get_defaults_locked(op);
34459 __Pyx_END_CRITICAL_SECTION();
34463__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value,
void *context) {
34464 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34465 CYTHON_UNUSED_VAR(context);
34468 }
else if (unlikely(value != Py_None && !PyDict_Check(value))) {
34469 PyErr_SetString(PyExc_TypeError,
34470 "__kwdefaults__ must be set to a dict object");
34473 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__kwdefaults__ will not "
34474 "currently affect the values used in function calls", 1);
34476 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34477 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
34478 __Pyx_END_CRITICAL_SECTION();
34482__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
34483 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34484 PyObject* result = op->defaults_kwdict;
34485 if (unlikely(!result)) {
34486 if (op->defaults_getter) {
34487 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
34488 result = op->defaults_kwdict;
34497__Pyx_CyFunction_get_kwdefaults(PyObject *op,
void *context) {
34499 CYTHON_UNUSED_VAR(context);
34500 __Pyx_BEGIN_CRITICAL_SECTION(op);
34501 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
34502 __Pyx_END_CRITICAL_SECTION();
34505static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
34507__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value,
void *context) {
34508 CYTHON_UNUSED_VAR(context);
34509 if (!value || value == Py_None) {
34511 }
else if (unlikely(!PyDict_Check(value))) {
34512 PyErr_SetString(PyExc_TypeError,
34513 "__annotations__ must be set to a dict object");
34516 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34518 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34519 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
34520 __Pyx_END_CRITICAL_SECTION();
34521 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0))
return -1;
34525__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
34528#if CYTHON_COMPILING_IN_PYPY
34529 *dict = PyObject_GenericGetDict(op_in, NULL);
34530#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
34531 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
34533 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
34534 *dict = likely(dictptr) ? *dictptr : NULL;
34536 return *dict ? 1 : 0;
34539__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
34543 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
34544 if (!dict_found)
return 0;
34545 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
34548__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
34551 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
34552 if (!dict_found)
return 0;
34554 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
34556#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
34557 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
34559 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
34561 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
34568__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
34571#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34572 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
34574 dict = PyObject_GenericGetDict(op_in, NULL);
34576 if (unlikely(!dict))
return -1;
34577 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
34582__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
34583 PyObject* result = op->func_annotations;
34584 if (unlikely(!result)) {
34585 result = PyDict_New();
34586 if (unlikely(!result))
return NULL;
34587 op->func_annotations = result;
34593__Pyx_CyFunction_get_annotations(PyObject *op_in,
void *context) {
34594 PyObject *annotate = NULL;
34595 PyObject *result = NULL;
34596 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34597 CYTHON_UNUSED_VAR(context);
34598 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34599 result = __Pyx_XNewRef(op->func_annotations);
34600 __Pyx_END_CRITICAL_SECTION();
34601 if (result)
return result;
34602 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
34603 if (!annotate || annotate == Py_None) {
34604 Py_XDECREF(annotate);
34605 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34606 result = __Pyx_CyFunction_get_annotations_locked(op);
34607 __Pyx_END_CRITICAL_SECTION();
34610 PyObject *format = PyLong_FromLong(1L);
34611 if (likely(format)) {
34612 if (!Py_EnterRecursiveCall(
" cyfunction __annotations__.__get__")) {
34613 result = __Pyx_PyObject_CallOneArg(annotate, format);
34614 Py_LeaveRecursiveCall();
34618 Py_DECREF(annotate);
34619 if (unlikely(!result))
return NULL;
34620 if (unlikely(!PyDict_Check(result))) {
34621 PyErr_SetString(PyExc_TypeError,
"__annotate__ must return a dict");
34625 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34626 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
34627 __Pyx_END_CRITICAL_SECTION();
34630static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
34631 CYTHON_UNUSED_VAR(arg);
34632 if (unlikely(!self)) {
34633 PyErr_SetString(PyExc_SystemError,
"cython __annotate__ called without 'self' argument");
34637 if (Py_EnterRecursiveCall(
" in cyfunction annotate")) {
34640 result = __Pyx_CyFunction_get_annotations(self, NULL);
34641 Py_LeaveRecursiveCall();
34645__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context);
34647__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value,
void *context) {
34648 CYTHON_UNUSED_VAR(context);
34649 if (value == NULL) {
34650 PyErr_SetString(PyExc_TypeError,
"__annotate__ cannot be deleted");
34653 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
34654 PyErr_SetString(PyExc_TypeError,
"__annotate__ must be callable or None");
34657 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
34658#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
34659 PyCFunction cfunction = PyCFunction_GetFunction(value);
34660 if (unlikely(!cfunction))
return -1;
34661 PyObject *value_self = PyCFunction_GetSelf(value);
34662 if (unlikely(!value_self && PyErr_Occurred()))
return -1;
34664 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
34665 PyObject *value_self = PyCFunction_GET_SELF(value);
34667 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
34668 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
34671 if (value != Py_None) {
34672 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34673 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34674 Py_CLEAR(op->func_annotations);
34675 __Pyx_END_CRITICAL_SECTION();
34677 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
34679#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
34681__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
34682 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
34683 if (is_coroutine) {
34684 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
34685 fromlist = PyList_New(1);
34686 if (unlikely(!fromlist))
return NULL;
34688#if CYTHON_ASSUME_SAFE_MACROS
34689 PyList_SET_ITEM(fromlist, 0, marker);
34691 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
34692 Py_DECREF(fromlist);
34696 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
34697 Py_DECREF(fromlist);
34698 if (unlikely(!module)) {
34699 goto ignore_or_error;
34701 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
34703 if (likely(is_coroutine_value)) {
34704 return is_coroutine_value;
34707 if (!__Pyx_IgnoreException(PyExc_Exception)) {
34711 return __Pyx_PyBool_FromLong(is_coroutine);
34714__Pyx_CyFunction_get_is_coroutine(PyObject *op_in,
void *context) {
34715 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34717 CYTHON_UNUSED_VAR(context);
34718 if (op->func_is_coroutine) {
34719 return __Pyx_NewRef(op->func_is_coroutine);
34721 result = __Pyx_CyFunction_get_is_coroutine_value(op);
34722 if (unlikely(!result))
34724 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34725 if (op->func_is_coroutine) {
34727 result = __Pyx_NewRef(op->func_is_coroutine);
34729 op->func_is_coroutine = __Pyx_NewRef(result);
34731 __Pyx_END_CRITICAL_SECTION();
34735static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func,
const char* message, Py_ssize_t size) {
34736#if CYTHON_COMPILING_IN_LIMITED_API
34737 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
34738 if (!py_name)
return;
34739 PyErr_Format(PyExc_TypeError,
34740 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
34741 py_name, message, size);
34742 Py_DECREF(py_name);
34744 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
34745 PyErr_Format(PyExc_TypeError,
34746 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
34747 name, message, size);
34750static void __Pyx_CyFunction_raise_type_error(PyObject *func,
const char* message) {
34751#if CYTHON_COMPILING_IN_LIMITED_API
34752 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
34753 if (!py_name)
return;
34754 PyErr_Format(PyExc_TypeError,
34757 Py_DECREF(py_name);
34759 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
34760 PyErr_Format(PyExc_TypeError,
34765#if CYTHON_COMPILING_IN_LIMITED_API
34767__Pyx_CyFunction_get_module(PyObject *op_in,
void *context) {
34768 CYTHON_UNUSED_VAR(context);
34769 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34770 Py_INCREF(op->func_module);
34771 return op->func_module;
34774__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value,
void *context) {
34775 CYTHON_UNUSED_VAR(context);
34776 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34777 if (value == NULL) {
34781 PyObject *old = op->func_module;
34782 op->func_module = value;
34787static PyGetSetDef __pyx_CyFunction_getsets[] = {
34788 {
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
34789 {
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
34790 {
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
34791 {
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
34792 {
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
34793#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34794 {
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
34795 {
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
34797 {
"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
34798 {
"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
34800 {
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
34801 {
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
34802 {
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
34803 {
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
34804 {
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
34805 {
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
34806 {
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
34807 {
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
34808 {
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
34809 {
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
34810 {
"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
34811#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
34812 {
"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
34814#if CYTHON_COMPILING_IN_LIMITED_API
34815 {
"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
34819static PyMemberDef __pyx_CyFunction_members[] = {
34820#if !CYTHON_COMPILING_IN_LIMITED_API
34821 {
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
34823#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
34824 {
"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
34825 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
34827#if CYTHON_VECTORCALL
34828#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
34829 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
34830 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
34832 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
34834#if CYTHON_COMPILING_IN_LIMITED_API
34835 {
"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
34836 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
34838 {
"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
34844__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
34846 PyObject *result = NULL;
34847 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
34848 CYTHON_UNUSED_VAR(args);
34849 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
34850 Py_INCREF(m->func_qualname);
34851 result = m->func_qualname;
34852 __Pyx_END_CRITICAL_SECTION();
34855static PyMethodDef __pyx_CyFunction_methods[] = {
34856 {
"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
34857 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
34858 "on Cython functions."},
34859 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
34863__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context) {
34864 PyObject *annotate = NULL;
34865 CYTHON_UNUSED_VAR(context);
34866 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
34867 if (annotate)
return annotate;
34868 PyObject *method = PyCFunction_New(
34869 &__pyx_CyFunction_methods[0],
34873#if CYTHON_COMPILING_IN_LIMITED_API
34874#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
34876#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
34878static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
34879 PyMethodDef *ml,
int flags, PyObject* qualname,
34880 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
34881 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
34882#if !CYTHON_COMPILING_IN_LIMITED_API
34883 PyCFunctionObject *cf = (PyCFunctionObject*) op;
34885 if (unlikely(op == NULL))
34887#if CYTHON_COMPILING_IN_LIMITED_API
34888 op->func_methoddef = ml;
34890 op->func_module =
module;
34893 __Pyx_CyFunction_weakreflist(op) = NULL;
34894#if !CYTHON_COMPILING_IN_LIMITED_API
34896 cf->m_self = (PyObject *) op;
34898 Py_XINCREF(closure);
34899 op->func_closure = closure;
34900#if !CYTHON_COMPILING_IN_LIMITED_API
34901 Py_XINCREF(module);
34902 cf->m_module =
module;
34904#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
34905 op->func_dict = NULL;
34907 op->func_name = NULL;
34908 Py_INCREF(qualname);
34909 op->func_qualname = qualname;
34910 op->func_doc = NULL;
34911#if CYTHON_COMPILING_IN_LIMITED_API
34912 op->func_classobj = NULL;
34914 ((PyCMethodObject*)op)->mm_class = NULL;
34916 op->func_globals = globals;
34917 Py_INCREF(op->func_globals);
34919 op->func_code = code;
34920 op->defaults = NULL;
34921 op->defaults_tuple = NULL;
34922 op->defaults_kwdict = NULL;
34923 op->defaults_getter = NULL;
34924 op->func_annotations = NULL;
34925#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
34926 op->func_is_coroutine = NULL;
34928#if CYTHON_VECTORCALL
34929 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
34931 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
34934 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
34936 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
34937 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
34939 case METH_FASTCALL | METH_KEYWORDS:
34940 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
34942 case METH_VARARGS | METH_KEYWORDS:
34943 __Pyx_CyFunction_func_vectorcall(op) = NULL;
34946 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
34953static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
34955 Py_CLEAR(m->func_closure);
34956#if CYTHON_COMPILING_IN_LIMITED_API
34957 Py_CLEAR(m->func_module);
34959 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
34961#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
34962 Py_CLEAR(m->func_dict);
34963#elif PY_VERSION_HEX < 0x030d0000
34964 _PyObject_ClearManagedDict((PyObject*)m);
34966 PyObject_ClearManagedDict((PyObject*)m);
34968 Py_CLEAR(m->func_name);
34969 Py_CLEAR(m->func_qualname);
34970 Py_CLEAR(m->func_doc);
34971 Py_CLEAR(m->func_globals);
34972 Py_CLEAR(m->func_code);
34973#if CYTHON_COMPILING_IN_LIMITED_API
34974 Py_CLEAR(m->func_classobj);
34977 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
34978 ((PyCMethodObject *) (m))->mm_class = NULL;
34982 Py_CLEAR(m->defaults_tuple);
34983 Py_CLEAR(m->defaults_kwdict);
34984 Py_CLEAR(m->func_annotations);
34985#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
34986 Py_CLEAR(m->func_is_coroutine);
34988 Py_CLEAR(m->defaults);
34992__Pyx_CyFunction_clear(PyObject *m)
34994 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
34996static void __Pyx__CyFunction_dealloc(PyObject *m)
34998 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
34999 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
35000 PyObject_ClearWeakRefs(m);
35001 __Pyx__CyFunction_clear(cyfunc);
35002 __Pyx_PyHeapTypeObject_GC_Del(m);
35004static void __Pyx_CyFunction_dealloc(PyObject *m)
35006 PyObject_GC_UnTrack(m);
35007 __Pyx__CyFunction_dealloc(m);
35009static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit,
void *arg)
35011 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
35013 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
35016 Py_VISIT(m->func_closure);
35017#if CYTHON_COMPILING_IN_LIMITED_API
35018 Py_VISIT(m->func_module);
35020 Py_VISIT(((PyCFunctionObject*)m)->m_module);
35022#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35023 Py_VISIT(m->func_dict);
35027#if PY_VERSION_HEX < 0x030d0000
35028 _PyObject_VisitManagedDict
35030 PyObject_VisitManagedDict
35032 ((PyObject*)m, visit, arg);
35033 if (e != 0)
return e;
35036 __Pyx_VISIT_CONST(m->func_name);
35037 __Pyx_VISIT_CONST(m->func_qualname);
35038 Py_VISIT(m->func_doc);
35039 Py_VISIT(m->func_globals);
35040 __Pyx_VISIT_CONST(m->func_code);
35041 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
35042 Py_VISIT(m->defaults_tuple);
35043 Py_VISIT(m->defaults_kwdict);
35044 Py_VISIT(m->func_annotations);
35045#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35046 Py_VISIT(m->func_is_coroutine);
35048 Py_VISIT(m->defaults);
35052__Pyx_CyFunction_repr(PyObject *op_in)
35054 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35056 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35057 repr = PyUnicode_FromFormat(
"<cyfunction %U at %p>",
35058 op->func_qualname, (
void *)op);
35059 __Pyx_END_CRITICAL_SECTION();
35062static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
35063#if CYTHON_COMPILING_IN_LIMITED_API
35064 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35065 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35066 int flags = cyfunc->func_methoddef->ml_flags;
35068 PyCFunctionObject*
f = (PyCFunctionObject*)func;
35069 PyCFunction meth =
f->m_ml->ml_meth;
35070 int flags =
f->m_ml->ml_flags;
35073 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
35075 if (likely(kw == NULL || PyDict_Size(kw) == 0))
35076 return (*meth)(self, arg);
35078 case METH_VARARGS | METH_KEYWORDS:
35079 return (*(PyCFunctionWithKeywords)(
void(*)(
void))meth)(self, arg, kw);
35081 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
35082#if CYTHON_ASSUME_SAFE_SIZE
35083 size = PyTuple_GET_SIZE(arg);
35085 size = PyTuple_Size(arg);
35086 if (unlikely(size < 0))
return NULL;
35088 if (likely(size == 0))
35089 return (*meth)(self, NULL);
35090 __Pyx_CyFunction_raise_argument_count_error(
35092 "takes no arguments", size);
35097 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
35098#if CYTHON_ASSUME_SAFE_SIZE
35099 size = PyTuple_GET_SIZE(arg);
35101 size = PyTuple_Size(arg);
35102 if (unlikely(size < 0))
return NULL;
35104 if (likely(size == 1)) {
35105 PyObject *result, *arg0;
35106 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35107 arg0 = PyTuple_GET_ITEM(arg, 0);
35109 arg0 = __Pyx_PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
35111 result = (*meth)(self, arg0);
35112 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
35117 __Pyx_CyFunction_raise_argument_count_error(
35119 "takes exactly one argument", size);
35124 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
35127 __Pyx_CyFunction_raise_type_error(
35128 func,
"takes no keyword arguments");
35131static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
35133 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
35136static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
35138 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35139#if CYTHON_VECTORCALL
35140 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
35142#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
35143 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (
size_t)PyTuple_GET_SIZE(args), kw);
35145 (void) &__Pyx_PyVectorcall_FastCallDict;
35146 return PyVectorcall_Call(func, args, kw);
35150 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
35152 PyObject *new_args;
35154#if CYTHON_ASSUME_SAFE_SIZE
35155 argc = PyTuple_GET_SIZE(args);
35157 argc = PyTuple_Size(args);
35158 if (unlikely(argc < 0))
return NULL;
35160 new_args = PyTuple_GetSlice(args, 1, argc);
35161 if (unlikely(!new_args))
35163 self = PyTuple_GetItem(args, 0);
35164 if (unlikely(!self)) {
35165 Py_DECREF(new_args);
35166 PyErr_Format(PyExc_TypeError,
35167 "unbound method %.200S() needs an argument",
35168 cyfunc->func_qualname);
35171 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
35172 Py_DECREF(new_args);
35174 result = __Pyx_CyFunction_Call(func, args, kw);
35178#if CYTHON_VECTORCALL
35179static CYTHON_INLINE
int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
35182 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
35183 if (unlikely(nargs < 1)) {
35184 __Pyx_CyFunction_raise_type_error(
35185 func,
"needs an argument");
35190 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
35191 __Pyx_CyFunction_raise_type_error(
35192 func,
"takes no keyword arguments");
35197static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
35199 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35200 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35202#if CYTHON_COMPILING_IN_LIMITED_API
35203 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35204 if (unlikely(!meth))
return NULL;
35206 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35208 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
35220 if (unlikely(nargs != 0)) {
35221 __Pyx_CyFunction_raise_argument_count_error(
35222 func,
"takes no arguments", nargs);
35225 return meth(self, NULL);
35227static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
35229 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35230 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35232#if CYTHON_COMPILING_IN_LIMITED_API
35233 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35234 if (unlikely(!meth))
return NULL;
35236 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35238 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
35250 if (unlikely(nargs != 1)) {
35251 __Pyx_CyFunction_raise_argument_count_error(
35252 func,
"takes exactly one argument", nargs);
35255 return meth(self, args[0]);
35257static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
35259 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35260 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35262#if CYTHON_COMPILING_IN_LIMITED_API
35263 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35264 if (unlikely(!meth))
return NULL;
35266 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35268 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
35280 return ((__Pyx_PyCFunctionFastWithKeywords)(
void(*)(
void))meth)(self, args, nargs, kwnames);
35282static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
35284 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35285 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
35286 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35288#if CYTHON_COMPILING_IN_LIMITED_API
35289 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35290 if (unlikely(!meth))
return NULL;
35292 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35294 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
35306 #if PY_VERSION_HEX < 0x030e00A6
35307 size_t nargs_value = (size_t) nargs;
35309 Py_ssize_t nargs_value = nargs;
35311 return ((__Pyx_PyCMethod)(
void(*)(
void))meth)(self, cls, args, nargs_value, kwnames);
35314static PyType_Slot __pyx_CyFunctionType_slots[] = {
35315 {Py_tp_dealloc, (
void *)__Pyx_CyFunction_dealloc},
35316 {Py_tp_repr, (
void *)__Pyx_CyFunction_repr},
35317 {Py_tp_call, (
void *)__Pyx_CyFunction_CallAsMethod},
35318 {Py_tp_traverse, (
void *)__Pyx_CyFunction_traverse},
35319 {Py_tp_clear, (
void *)__Pyx_CyFunction_clear},
35320 {Py_tp_methods, (
void *)__pyx_CyFunction_methods},
35321 {Py_tp_members, (
void *)__pyx_CyFunction_members},
35322 {Py_tp_getset, (
void *)__pyx_CyFunction_getsets},
35323 {Py_tp_descr_get, (
void *)__Pyx_PyMethod_New},
35326static PyType_Spec __pyx_CyFunctionType_spec = {
35327 __PYX_TYPE_MODULE_PREFIX
"cython_function_or_method",
35328 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
35330#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
35331 Py_TPFLAGS_METHOD_DESCRIPTOR |
35333#if CYTHON_VECTORCALL
35334#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
35335 Py_TPFLAGS_HAVE_VECTORCALL |
35336#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
35337 _Py_TPFLAGS_HAVE_VECTORCALL |
35340#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
35341 Py_TPFLAGS_MANAGED_DICT |
35343 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
35344 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
35345 __pyx_CyFunctionType_slots
35347static int __pyx_CyFunction_init(PyObject *module) {
35348 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
35349 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
35350 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
35351 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
35358static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
35359 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
35360 (void)&__Pyx_Get_CyFunction_Type;
35361 PyObject *op = __Pyx_CyFunction_Init(
35362 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
35363 ml, flags, qualname, closure, module, globals, code
35366 PyObject_GC_Track(op);
35370static PyTypeObject *__Pyx_Get_CyFunction_Type(
void) {
35371 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
35372 Py_INCREF((PyObject*)tp);
35377static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
35378 PyObject *args[3] = {NULL, arg1, arg2};
35379 return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
35383#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
35384static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name,
int with_error) {
35386 PyTypeObject *tp = Py_TYPE(obj);
35387 res = _PyType_Lookup(tp, attr_name);
35389 descrgetfunc
f = Py_TYPE(res)->tp_descr_get;
35393 res =
f(res, obj, (PyObject *)tp);
35395 }
else if (with_error) {
35396 PyErr_SetObject(PyExc_AttributeError, attr_name);
35403static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
35404 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
35407 PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare);
35409 PyObject *pargs[3] = {NULL, name, bases};
35410 ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
35413 if (unlikely(PyErr_Occurred()))
35422 if (unlikely(PyObject_SetItem(
ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0))
goto bad;
35423 if (unlikely(PyObject_SetItem(
ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0))
goto bad;
35424 if (unlikely(doc && PyObject_SetItem(
ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0))
goto bad;
35430static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
35431 PyObject *dict, PyObject *mkw,
35432 int calculate_metaclass,
int allow_py2_metaclass) {
35434 PyObject *owned_metaclass = NULL;
35435 PyObject *margs[4] = {NULL, name, bases, dict};
35436 if (allow_py2_metaclass) {
35437 owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass);
35438 if (owned_metaclass) {
35439 metaclass = owned_metaclass;
35440 }
else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
35446 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
35447 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
35448 Py_XDECREF(owned_metaclass);
35449 if (unlikely(!metaclass))
35451 owned_metaclass = metaclass;
35453 result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
35454 Py_XDECREF(owned_metaclass);
35459#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
35460#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
35461#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
35462#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35463#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
35465PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
35466 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
35467 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
35470static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
35471 PyObject *use_cline = NULL;
35472 PyObject *ptype, *pvalue, *ptraceback;
35473 PyObject *cython_runtime_dict;
35474 CYTHON_MAYBE_UNUSED_VAR(tstate);
35475 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
35478 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
35479 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
35480 if (likely(cython_runtime_dict)) {
35481 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
35482 use_cline, cython_runtime_dict,
35483 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
35485 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
35488 Py_XDECREF(use_cline);
35489 Py_XDECREF(cython_runtime_dict);
35490 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
35496static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
35497 int start = 0, mid = 0, end = count - 1;
35498 if (end >= 0 && code_line > entries[end].code_line) {
35501 while (start < end) {
35502 mid = start + (end - start) / 2;
35503 if (code_line < entries[mid].code_line) {
35505 }
else if (code_line > entries[mid].code_line) {
35511 if (code_line <= entries[mid].code_line) {
35517static __Pyx_CachedCodeObjectType *__pyx__find_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line) {
35518 __Pyx_CachedCodeObjectType* code_object;
35520 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
35523 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
35524 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
35527 code_object = code_cache->entries[pos].code_object;
35528 Py_INCREF(code_object);
35529 return code_object;
35531static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line) {
35532#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
35533 (void)__pyx__find_code_object;
35536 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
35537#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35538 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
35539 if (old_count < 0) {
35540 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
35544 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
35545#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35546 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
35551static void __pyx__insert_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line, __Pyx_CachedCodeObjectType* code_object)
35554 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
35555 if (unlikely(!code_line)) {
35558 if (unlikely(!entries)) {
35559 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
35560 if (likely(entries)) {
35561 code_cache->entries = entries;
35562 code_cache->max_count = 64;
35563 code_cache->count = 1;
35564 entries[0].code_line = code_line;
35565 entries[0].code_object = code_object;
35566 Py_INCREF(code_object);
35570 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
35571 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
35572 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
35573 entries[pos].code_object = code_object;
35574 Py_INCREF(code_object);
35578 if (code_cache->count == code_cache->max_count) {
35579 int new_max = code_cache->max_count + 64;
35580 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
35581 code_cache->entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
35582 if (unlikely(!entries)) {
35585 code_cache->entries = entries;
35586 code_cache->max_count = new_max;
35588 for (i=code_cache->count; i>pos; i--) {
35589 entries[i] = entries[i-1];
35591 entries[pos].code_line = code_line;
35592 entries[pos].code_object = code_object;
35593 code_cache->count++;
35594 Py_INCREF(code_object);
35596static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object) {
35597#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
35598 (void)__pyx__insert_code_object;
35601 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
35602#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35603 __pyx_nonatomic_int_type expected = 0;
35604 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
35608 __pyx__insert_code_object(code_cache, code_line, code_object);
35609#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35610 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
35616#include "compile.h"
35617#include "frameobject.h"
35618#include "traceback.h"
35619#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
35620 #ifndef Py_BUILD_CORE
35621 #define Py_BUILD_CORE 1
35623 #include "internal/pycore_frame.h"
35625#if CYTHON_COMPILING_IN_LIMITED_API
35626static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
35627 PyObject *firstlineno, PyObject *name) {
35628 PyObject *replace = NULL;
35629 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_firstlineno", firstlineno)))
return NULL;
35630 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_name", name)))
return NULL;
35631 replace = PyObject_GetAttrString(code,
"replace");
35632 if (likely(replace)) {
35633 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
35634 Py_DECREF(replace);
35639static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
35640 int py_line,
const char *filename) {
35641 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
35642 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
35643 PyObject *exc_type, *exc_value, *exc_traceback;
35646 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
35648 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
35649 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
35650 if (!code_object) {
35651 code_object = Py_CompileString(
"_getframe()", filename, Py_eval_input);
35652 if (unlikely(!code_object))
goto bad;
35653 py_py_line = PyLong_FromLong(py_line);
35654 if (unlikely(!py_py_line))
goto bad;
35656 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
35658 py_funcname = PyUnicode_FromString(funcname);
35660 if (unlikely(!py_funcname))
goto bad;
35661 dict = PyDict_New();
35662 if (unlikely(!dict))
goto bad;
35664 PyObject *old_code_object = code_object;
35665 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
35666 Py_DECREF(old_code_object);
35668 if (unlikely(!code_object))
goto bad;
35669 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
35671 dict = PyDict_New();
35673 getframe = PySys_GetObject(
"_getframe");
35674 if (unlikely(!getframe))
goto bad;
35675 if (unlikely(PyDict_SetItemString(dict,
"_getframe", getframe)))
goto bad;
35676 frame = PyEval_EvalCode(code_object, dict, dict);
35677 if (unlikely(!frame) || frame == Py_None)
goto bad;
35680 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
35681 Py_XDECREF(code_object);
35682 Py_XDECREF(py_py_line);
35683 Py_XDECREF(py_funcname);
35685 Py_XDECREF(replace);
35688 (
struct _frame*)frame);
35693static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
35694 const char *funcname,
int c_line,
35695 int py_line,
const char *filename) {
35696 PyCodeObject *py_code = NULL;
35697 PyObject *py_funcname = NULL;
35699 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
35700 if (!py_funcname)
goto bad;
35701 funcname = PyUnicode_AsUTF8(py_funcname);
35702 if (!funcname)
goto bad;
35704 py_code = PyCode_NewEmpty(filename, funcname, py_line);
35705 Py_XDECREF(py_funcname);
35708 Py_XDECREF(py_funcname);
35711static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
35712 int py_line,
const char *filename) {
35713 PyCodeObject *py_code = 0;
35714 PyFrameObject *py_frame = 0;
35715 PyThreadState *tstate = __Pyx_PyThreadState_Current;
35716 PyObject *ptype, *pvalue, *ptraceback;
35718 c_line = __Pyx_CLineForTraceback(tstate, c_line);
35720 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
35722 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
35723 py_code = __Pyx_CreateCodeObjectForTraceback(
35724 funcname, c_line, py_line, filename);
35729 Py_XDECREF(pvalue);
35730 Py_XDECREF(ptraceback);
35733 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
35734 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
35736 py_frame = PyFrame_New(
35739 __pyx_mstate_global->__pyx_d,
35742 if (!py_frame)
goto bad;
35743 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
35744 PyTraceBack_Here(py_frame);
35746 Py_XDECREF(py_code);
35747 Py_XDECREF(py_frame);
35753#ifndef _Py_NO_RETURN
35754#define _Py_NO_RETURN
35757static void __pyx_fatalerror(
const char *fmt, ...) {
35760#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
35761 va_start(vargs, fmt);
35765 vsnprintf(msg, 200, fmt, vargs);
35767 Py_FatalError(msg);
35769static CYTHON_INLINE
int
35770__pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
35771 PyThread_type_lock lock)
35774 PyThread_acquire_lock(lock, 1);
35775 result = (*acquisition_count)++;
35776 PyThread_release_lock(lock);
35779static CYTHON_INLINE
int
35780__pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
35781 PyThread_type_lock lock)
35784 PyThread_acquire_lock(lock, 1);
35785 result = (*acquisition_count)--;
35786 PyThread_release_lock(lock);
35789static CYTHON_INLINE
void
35790__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
35792 __pyx_nonatomic_int_type old_acquisition_count;
35793 struct __pyx_memoryview_obj *memview = memslice->memview;
35794 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
35797 old_acquisition_count = __pyx_add_acquisition_count(memview);
35798 if (unlikely(old_acquisition_count <= 0)) {
35799 if (likely(old_acquisition_count == 0)) {
35801 Py_INCREF((PyObject *) memview);
35803 PyGILState_STATE _gilstate = PyGILState_Ensure();
35804 Py_INCREF((PyObject *) memview);
35805 PyGILState_Release(_gilstate);
35808 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
35809 old_acquisition_count+1, lineno);
35813static CYTHON_INLINE
void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
35814 int have_gil,
int lineno) {
35815 __pyx_nonatomic_int_type old_acquisition_count;
35816 struct __pyx_memoryview_obj *memview = memslice->memview;
35817 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
35818 memslice->memview = NULL;
35821 old_acquisition_count = __pyx_sub_acquisition_count(memview);
35822 memslice->data = NULL;
35823 if (likely(old_acquisition_count > 1)) {
35824 memslice->memview = NULL;
35825 }
else if (likely(old_acquisition_count == 1)) {
35827 Py_CLEAR(memslice->memview);
35829 PyGILState_STATE _gilstate = PyGILState_Ensure();
35830 Py_CLEAR(memslice->memview);
35831 PyGILState_Release(_gilstate);
35834 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
35835 old_acquisition_count-1, lineno);
35841__pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
35843 int i, index, step, start;
35844 Py_ssize_t itemsize = mvs.memview->view.itemsize;
35845 if (order ==
'F') {
35852 for (i = 0; i < ndim; i++) {
35853 index = start + step * i;
35854 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
35856 itemsize *= mvs.shape[index];
35863__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
35864 void **out_start,
void **out_end,
35865 int ndim,
size_t itemsize)
35869 start = end = slice->data;
35870 for (i = 0; i < ndim; i++) {
35871 Py_ssize_t stride = slice->strides[i];
35872 Py_ssize_t extent = slice->shape[i];
35874 *out_start = *out_end = start;
35878 end += stride * (extent - 1);
35880 start += stride * (extent - 1);
35883 *out_start = start;
35884 *out_end = end + itemsize;
35887__pyx_slices_overlap(__Pyx_memviewslice *slice1,
35888 __Pyx_memviewslice *slice2,
35889 int ndim,
size_t itemsize)
35891 void *start1, *end1, *start2, *end2;
35892 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
35893 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
35894 return (start1 < end2) && (start2 < end1);
35899__Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
35901 __Pyx_memviewslice *memviewslice,
35902 int memview_is_new_reference)
35904 __Pyx_RefNannyDeclarations
35906 Py_buffer *buf = &memview->view;
35907 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
35908 if (unlikely(memviewslice->memview || memviewslice->data)) {
35909 PyErr_SetString(PyExc_ValueError,
35910 "memviewslice is already initialized!");
35913 if (buf->strides) {
35914 for (i = 0; i < ndim; i++) {
35915 memviewslice->strides[i] = buf->strides[i];
35918 Py_ssize_t stride = buf->itemsize;
35919 for (i = ndim - 1; i >= 0; i--) {
35920 memviewslice->strides[i] = stride;
35921 stride *= buf->shape[i];
35924 for (i = 0; i < ndim; i++) {
35925 memviewslice->shape[i] = buf->shape[i];
35926 if (buf->suboffsets) {
35927 memviewslice->suboffsets[i] = buf->suboffsets[i];
35929 memviewslice->suboffsets[i] = -1;
35932 memviewslice->memview = memview;
35933 memviewslice->data = (
char *)buf->buf;
35934 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
35935 Py_INCREF((PyObject*)memview);
35940 memviewslice->memview = 0;
35941 memviewslice->data = 0;
35944 __Pyx_RefNannyFinishContext();
35949static void __pyx_memoryview_slice_memviewslice_err_dim(PyObject *error,
const char* msg,
int dim) {
35950 PyGILState_STATE gilstate = PyGILState_Ensure();
35951 PyErr_Format(error, msg, dim);
35952 PyGILState_Release(gilstate);
35954static CYTHON_INLINE
int __pyx_memoryview_slice_memviewslice(
35955 __Pyx_memviewslice *dst,
35956 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
35957 int dim,
int new_ndim,
int *suboffset_dim,
35958 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
35959 int have_start,
int have_stop,
int have_step,
35965 if (unlikely(!(0 <= start && start < shape))) {
35966 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_IndexError,
"Index out of bounds (axis %d)", dim);
35972 negative_step = step < 0;
35973 if (unlikely(step == 0)) {
35974 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_ValueError,
"Step may not be zero (axis %d)", dim);
35987 }
else if (start >= shape) {
35988 start = negative_step ? (shape - 1) : shape;
35991 start = negative_step ? (shape - 1) : 0;
35999 }
else if (stop > shape) {
36003 stop = negative_step ? -1 : shape;
36005 Py_ssize_t new_shape = (stop - start) / step;
36006 if ((stop - start) - step * new_shape) {
36009 if (new_shape < 0) {
36012 dst->strides[new_ndim] = stride * step;
36013 dst->shape[new_ndim] = new_shape;
36014 dst->suboffsets[new_ndim] = suboffset;
36016 if (suboffset_dim[0] < 0) {
36017 dst->data += start * stride;
36019 dst->suboffsets[suboffset_dim[0]] += start * stride;
36021 if (suboffset >= 0) {
36023 if (likely(new_ndim == 0)) {
36024 dst->data = ((
char **)(dst->data))[0] + suboffset;
36026 __pyx_memoryview_slice_memviewslice_err_dim(
36028 "All dimensions preceding dimension %d must be indexed and not sliced",
36033 suboffset_dim[0] = new_ndim;
36040#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
36041 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
36042#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
36043 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
36044#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
36046 func_type value = func_value;\
36047 if (sizeof(target_type) < sizeof(func_type)) {\
36048 if (unlikely(value != (func_type) (target_type) value)) {\
36049 func_type zero = 0;\
36050 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
36051 return (target_type) -1;\
36052 if (is_unsigned && unlikely(value < zero))\
36053 goto raise_neg_overflow;\
36055 goto raise_overflow;\
36058 return (target_type) value;\
36062static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
36068 S.u32 = 0x01020304;
36069 return S.u8[0] == 4;
36073static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
36074 __Pyx_BufFmt_StackElem* stack,
36075 const __Pyx_TypeInfo* type) {
36076 stack[0].field = &ctx->root;
36077 stack[0].parent_offset = 0;
36078 ctx->root.type = type;
36079 ctx->root.name =
"buffer dtype";
36080 ctx->root.offset = 0;
36082 ctx->head->field = &ctx->root;
36083 ctx->fmt_offset = 0;
36084 ctx->head->parent_offset = 0;
36085 ctx->new_packmode =
'@';
36086 ctx->enc_packmode =
'@';
36087 ctx->new_count = 1;
36088 ctx->enc_count = 0;
36090 ctx->is_complex = 0;
36091 ctx->is_valid_array = 0;
36092 ctx->struct_alignment = 0;
36093 while (type->typegroup ==
'S') {
36095 ctx->head->field = type->fields;
36096 ctx->head->parent_offset = 0;
36097 type = type->fields->type;
36100static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
36102 const char* t = *ts;
36103 if (*t <
'0' || *t >
'9') {
36106 count = *t++ -
'0';
36107 while (*t >=
'0' && *t <=
'9') {
36109 count += *t++ -
'0';
36115static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
36116 int number = __Pyx_BufFmt_ParseNumber(ts);
36118 PyErr_Format(PyExc_ValueError,\
36119 "Does not understand character buffer dtype format string ('%c')", **ts);
36122static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
36123 PyErr_Format(PyExc_ValueError,
36124 "Unexpected format string character: '%c'", ch);
36126static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
36128 case '?':
return "'bool'";
36129 case 'c':
return "'char'";
36130 case 'b':
return "'signed char'";
36131 case 'B':
return "'unsigned char'";
36132 case 'h':
return "'short'";
36133 case 'H':
return "'unsigned short'";
36134 case 'i':
return "'int'";
36135 case 'I':
return "'unsigned int'";
36136 case 'l':
return "'long'";
36137 case 'L':
return "'unsigned long'";
36138 case 'q':
return "'long long'";
36139 case 'Q':
return "'unsigned long long'";
36140 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
36141 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
36142 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
36143 case 'T':
return "a struct";
36144 case 'O':
return "Python object";
36145 case 'P':
return "a pointer";
36146 case 's':
case 'p':
return "a string";
36147 case 0:
return "end";
36148 default:
return "unparsable format string";
36151static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
36153 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
36154 case 'h':
case 'H':
return 2;
36155 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
36156 case 'q':
case 'Q':
return 8;
36157 case 'f':
return (is_complex ? 8 : 4);
36158 case 'd':
return (is_complex ? 16 : 8);
36160 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
36163 case 'O':
case 'P':
return sizeof(
void*);
36165 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36169static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
36171 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
36172 case 'h':
case 'H':
return sizeof(short);
36173 case 'i':
case 'I':
return sizeof(int);
36174 case 'l':
case 'L':
return sizeof(long);
36175 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
36176 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
36177 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
36178 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
36179 case 'O':
case 'P':
return sizeof(
void*);
36181 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36186typedef struct {
char c;
short x; } __Pyx_st_short;
36187typedef struct {
char c;
int x; } __Pyx_st_int;
36188typedef struct {
char c;
long x; } __Pyx_st_long;
36189typedef struct {
char c;
float x; } __Pyx_st_float;
36190typedef struct {
char c;
double x; } __Pyx_st_double;
36191typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
36192typedef struct {
char c;
void *x; } __Pyx_st_void_p;
36193typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
36194static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch,
int is_complex) {
36195 CYTHON_UNUSED_VAR(is_complex);
36197 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
36198 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
36199 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
36200 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
36201 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
36202 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
36203 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
36204 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
36205 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
36207 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36215typedef struct {
short x;
char c; } __Pyx_pad_short;
36216typedef struct {
int x;
char c; } __Pyx_pad_int;
36217typedef struct {
long x;
char c; } __Pyx_pad_long;
36218typedef struct {
float x;
char c; } __Pyx_pad_float;
36219typedef struct {
double x;
char c; } __Pyx_pad_double;
36220typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
36221typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
36222typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
36223static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch,
int is_complex) {
36224 CYTHON_UNUSED_VAR(is_complex);
36226 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
36227 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
36228 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
36229 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
36230 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
36231 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
36232 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
36233 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
36234 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
36236 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36240static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
36244 case 'b':
case 'h':
case 'i':
36245 case 'l':
case 'q':
case 's':
case 'p':
36247 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
36249 case 'f':
case 'd':
case 'g':
36250 return (is_complex ?
'C' :
'R');
36256 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36261static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
36262 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
36263 const char* expected;
36265 if (ctx->head == NULL) {
36269 expected = ctx->head->field->type->name;
36272 PyErr_Format(PyExc_ValueError,
36273 "Buffer dtype mismatch, expected %s%s%s but got %s",
36274 quote, expected, quote,
36275 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
36277 const __Pyx_StructField* field = ctx->head->field;
36278 const __Pyx_StructField* parent = (ctx->head - 1)->field;
36279 PyErr_Format(PyExc_ValueError,
36280 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
36281 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
36282 parent->type->name, field->name);
36285static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
36287 size_t size, offset, arraysize = 1;
36288 if (ctx->enc_type == 0)
return 0;
36289 if (ctx->head->field->type->arraysize[0]) {
36291 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
36292 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
36294 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
36295 PyErr_Format(PyExc_ValueError,
36296 "Expected a dimension of size %zu, got %zu",
36297 ctx->head->field->type->arraysize[0], ctx->enc_count);
36301 if (!ctx->is_valid_array) {
36302 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
36303 ctx->head->field->type->ndim, ndim);
36306 for (i = 0; i < ctx->head->field->type->ndim; i++) {
36307 arraysize *= ctx->head->field->type->arraysize[i];
36309 ctx->is_valid_array = 0;
36310 ctx->enc_count = 1;
36312 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
36314 const __Pyx_StructField* field = ctx->head->field;
36315 const __Pyx_TypeInfo* type = field->type;
36316 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
36317 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
36319 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
36321 if (ctx->enc_packmode ==
'@') {
36322 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
36323 size_t align_mod_offset;
36324 if (align_at == 0)
return -1;
36325 align_mod_offset = ctx->fmt_offset % align_at;
36326 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
36327 if (ctx->struct_alignment == 0)
36328 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
36331 if (type->size != size || type->typegroup != group) {
36332 if (type->typegroup ==
'C' && type->fields != NULL) {
36333 size_t parent_offset = ctx->head->parent_offset + field->offset;
36335 ctx->head->field = type->fields;
36336 ctx->head->parent_offset = parent_offset;
36339 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
36341 __Pyx_BufFmt_RaiseExpected(ctx);
36345 offset = ctx->head->parent_offset + field->offset;
36346 if (ctx->fmt_offset != offset) {
36347 PyErr_Format(PyExc_ValueError,
36348 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
36349 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
36352 ctx->fmt_offset += size;
36354 ctx->fmt_offset += (arraysize - 1) * size;
36357 if (field == &ctx->root) {
36359 if (ctx->enc_count != 0) {
36360 __Pyx_BufFmt_RaiseExpected(ctx);
36365 ctx->head->field = ++field;
36366 if (field->type == NULL) {
36368 field = ctx->head->field;
36370 }
else if (field->type->typegroup ==
'S') {
36371 size_t parent_offset = ctx->head->parent_offset + field->offset;
36372 if (field->type->fields->type == NULL)
continue;
36373 field = field->type->fields;
36375 ctx->head->field = field;
36376 ctx->head->parent_offset = parent_offset;
36382 }
while (ctx->enc_count);
36384 ctx->is_complex = 0;
36388__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
36390 const char *ts = *tsp;
36391 int i = 0,
number, ndim;
36393 if (ctx->new_count != 1) {
36394 PyErr_SetString(PyExc_ValueError,
36395 "Cannot handle repeated arrays in format string");
36398 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return -1;
36399 ndim = ctx->head->field->type->ndim;
36400 while (*ts && *ts !=
')') {
36402 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
36405 number = __Pyx_BufFmt_ExpectNumber(&ts);
36406 if (
number == -1)
return -1;
36407 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i]) {
36408 PyErr_Format(PyExc_ValueError,
36409 "Expected a dimension of size %zu, got %d",
36410 ctx->head->field->type->arraysize[i],
number);
36413 if (*ts !=
',' && *ts !=
')') {
36414 PyErr_Format(PyExc_ValueError,
36415 "Expected a comma in format string, got '%c'", *ts);
36418 if (*ts ==
',') ts++;
36422 PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
36423 ctx->head->field->type->ndim, i);
36427 PyErr_SetString(PyExc_ValueError,
36428 "Unexpected end of format string, expected ')'");
36431 ctx->is_valid_array = 1;
36432 ctx->new_count = 1;
36436static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
36441 if (ctx->enc_type != 0 && ctx->head == NULL) {
36442 __Pyx_BufFmt_RaiseExpected(ctx);
36445 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
36446 if (ctx->head != NULL) {
36447 __Pyx_BufFmt_RaiseExpected(ctx);
36457 if (!__Pyx_Is_Little_Endian()) {
36458 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
36461 ctx->new_packmode =
'=';
36466 if (__Pyx_Is_Little_Endian()) {
36467 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
36470 ctx->new_packmode =
'=';
36476 ctx->new_packmode = *ts++;
36480 const char* ts_after_sub;
36481 size_t i, struct_count = ctx->new_count;
36482 size_t struct_alignment = ctx->struct_alignment;
36483 ctx->new_count = 1;
36485 if (*ts !=
'\x7B') {
36486 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '\x7B' after 'T'");
36489 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
36491 ctx->enc_count = 0;
36492 ctx->struct_alignment = 0;
36495 for (i = 0; i != struct_count; ++i) {
36496 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
36497 if (!ts_after_sub)
return NULL;
36500 if (struct_alignment) ctx->struct_alignment = struct_alignment;
36505 size_t alignment = ctx->struct_alignment;
36507 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
36509 if (alignment && ctx->fmt_offset % alignment) {
36510 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
36515 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
36516 ctx->fmt_offset += ctx->new_count;
36517 ctx->new_count = 1;
36518 ctx->enc_count = 0;
36520 ctx->enc_packmode = ctx->new_packmode;
36526 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
36527 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
36530 CYTHON_FALLTHROUGH;
36531 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
36532 case 'l':
case 'L':
case 'q':
case 'Q':
36533 case 'f':
case 'd':
case 'g':
36534 case 'O':
case 'p':
36535 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
36536 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
36537 ctx->enc_count += ctx->new_count;
36538 ctx->new_count = 1;
36543 CYTHON_FALLTHROUGH;
36545 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
36546 ctx->enc_count = ctx->new_count;
36547 ctx->enc_packmode = ctx->new_packmode;
36548 ctx->enc_type = *ts;
36549 ctx->is_complex = got_Z;
36551 ctx->new_count = 1;
36556 while(*ts !=
':') ++ts;
36560 if (__pyx_buffmt_parse_array(ctx, &ts) < 0)
return NULL;
36564 int number = __Pyx_BufFmt_ExpectNumber(&ts);
36565 if (
number == -1)
return NULL;
36566 ctx->new_count = (size_t)
number;
36574__pyx_typeinfo_cmp(
const __Pyx_TypeInfo *a,
const __Pyx_TypeInfo *b)
36581 if (a->size != b->size || a->typegroup != b->typegroup ||
36582 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
36583 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
36584 return a->size == b->size;
36590 for (i = 0; i < a->ndim; i++)
36591 if (a->arraysize[i] != b->arraysize[i])
36594 if (a->typegroup ==
'S') {
36595 if (a->flags != b->flags)
36597 if (a->fields || b->fields) {
36598 if (!(a->fields && b->fields))
36600 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
36601 const __Pyx_StructField *field_a = a->fields + i;
36602 const __Pyx_StructField *field_b = b->fields + i;
36603 if (field_a->offset != field_b->offset ||
36604 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
36607 return !a->fields[i].type && !b->fields[i].type;
36615__pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
36617 if (buf->shape[dim] <= 1)
36619 if (buf->strides) {
36620 if (spec & __Pyx_MEMVIEW_CONTIG) {
36621 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
36622 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
36623 PyErr_Format(PyExc_ValueError,
36624 "Buffer is not indirectly contiguous "
36625 "in dimension %d.", dim);
36628 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
36629 PyErr_SetString(PyExc_ValueError,
36630 "Buffer and memoryview are not contiguous "
36631 "in the same dimension.");
36635 if (spec & __Pyx_MEMVIEW_FOLLOW) {
36636 Py_ssize_t stride = buf->strides[dim];
36639 if (unlikely(stride < buf->itemsize)) {
36640 PyErr_SetString(PyExc_ValueError,
36641 "Buffer and memoryview are not contiguous "
36642 "in the same dimension.");
36647 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
36648 PyErr_Format(PyExc_ValueError,
36649 "C-contiguous buffer is not contiguous in "
36650 "dimension %d", dim);
36652 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
36653 PyErr_Format(PyExc_ValueError,
36654 "C-contiguous buffer is not indirect in "
36655 "dimension %d", dim);
36657 }
else if (unlikely(buf->suboffsets)) {
36658 PyErr_SetString(PyExc_ValueError,
36659 "Buffer exposes suboffsets but no strides");
36668__pyx_check_suboffsets(Py_buffer *buf,
int dim,
int ndim,
int spec)
36670 CYTHON_UNUSED_VAR(ndim);
36671 if (spec & __Pyx_MEMVIEW_DIRECT) {
36672 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
36673 PyErr_Format(PyExc_ValueError,
36674 "Buffer not compatible with direct access "
36675 "in dimension %d.", dim);
36679 if (spec & __Pyx_MEMVIEW_PTR) {
36680 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
36681 PyErr_Format(PyExc_ValueError,
36682 "Buffer is not indirectly accessible "
36683 "in dimension %d.", dim);
36692__pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
36695 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
36696 Py_ssize_t stride = 1;
36697 for (i = 0; i < ndim; i++) {
36698 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
36699 PyErr_SetString(PyExc_ValueError,
36700 "Buffer not fortran contiguous.");
36703 stride = stride * buf->shape[i];
36705 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
36706 Py_ssize_t stride = 1;
36707 for (i = ndim - 1; i >- 1; i--) {
36708 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
36709 PyErr_SetString(PyExc_ValueError,
36710 "Buffer not C contiguous.");
36713 stride = stride * buf->shape[i];
36720static int __Pyx_ValidateAndInit_memviewslice(
36725 const __Pyx_TypeInfo *dtype,
36726 __Pyx_BufFmt_StackElem stack[],
36727 __Pyx_memviewslice *memviewslice,
36728 PyObject *original_obj)
36730 struct __pyx_memoryview_obj *memview, *new_memview;
36731 __Pyx_RefNannyDeclarations
36733 int i, spec = 0, retval = -1;
36734 __Pyx_BufFmt_Context ctx;
36735 int from_memoryview = __pyx_memoryview_check(original_obj);
36736 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
36737 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
36738 original_obj)->typeinfo)) {
36739 memview = (
struct __pyx_memoryview_obj *) original_obj;
36740 new_memview = NULL;
36742 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
36743 original_obj, buf_flags, 0, dtype);
36744 new_memview = memview;
36745 if (unlikely(!memview))
36748 buf = &memview->view;
36749 if (unlikely(buf->ndim != ndim)) {
36750 PyErr_Format(PyExc_ValueError,
36751 "Buffer has wrong number of dimensions (expected %d, got %d)",
36756 __Pyx_BufFmt_Init(&ctx, stack, dtype);
36757 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
36759 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
36760 PyErr_Format(PyExc_ValueError,
36761 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
36762 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
36764 (buf->itemsize > 1) ?
"s" :
"",
36767 (dtype->size > 1) ?
"s" :
"");
36770 if (buf->len > 0) {
36771 for (i = 0; i < ndim; i++) {
36772 spec = axes_specs[i];
36773 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
36775 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
36778 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
36781 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
36782 new_memview != NULL) == -1)) {
36788 Py_XDECREF((PyObject*)new_memview);
36791 __Pyx_RefNannyFinishContext();
36796static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
36797 __Pyx_memviewslice result = __Pyx_MEMSLICE_INIT;
36798 __Pyx_BufFmt_StackElem stack[1];
36799 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
36801 if (obj == Py_None) {
36802 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
36805 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
36806 PyBUF_RECORDS_RO | writable_flag, 1,
36807 &__Pyx_TypeInfo_double, stack,
36809 if (unlikely(retcode == -1))
36813 result.memview = NULL;
36814 result.data = NULL;
36819static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj,
int writable_flag) {
36820 __Pyx_memviewslice result = __Pyx_MEMSLICE_INIT;
36821 __Pyx_BufFmt_StackElem stack[1];
36822 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
36824 if (obj == Py_None) {
36825 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
36828 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
36829 PyBUF_RECORDS_RO | writable_flag, 1,
36830 &__Pyx_TypeInfo_int, stack,
36832 if (unlikely(retcode == -1))
36836 result.memview = NULL;
36837 result.data = NULL;
36842#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
36844 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
36845 return ::std::complex< float >(x, y);
36848 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
36849 return x + y*(__pyx_t_float_complex)_Complex_I;
36853 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
36854 __pyx_t_float_complex
z;
36862#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
36864 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36865 return (a.real == b.real) && (a.imag == b.imag);
36867 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36868 __pyx_t_float_complex
z;
36869 z.real = a.real + b.real;
36870 z.imag = a.imag + b.imag;
36873 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36874 __pyx_t_float_complex
z;
36875 z.real = a.real - b.real;
36876 z.imag = a.imag - b.imag;
36879 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36880 __pyx_t_float_complex
z;
36881 z.real = a.real * b.real - a.imag * b.imag;
36882 z.imag = a.real * b.imag + a.imag * b.real;
36886 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36888 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
36889 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
36890 if (b.real == 0 && b.imag == 0) {
36891 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
36893 float r = b.imag / b.real;
36894 float s = (float)(1.0) / (b.real + b.imag *
r);
36895 return __pyx_t_float_complex_from_parts(
36896 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
36899 float r = b.real / b.imag;
36900 float s = (float)(1.0) / (b.imag + b.real *
r);
36901 return __pyx_t_float_complex_from_parts(
36902 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
36906 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36908 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
36910 float denom = b.real * b.real + b.imag * b.imag;
36911 return __pyx_t_float_complex_from_parts(
36912 (a.real * b.real + a.imag * b.imag) / denom,
36913 (a.imag * b.real - a.real * b.imag) / denom);
36917 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
36918 __pyx_t_float_complex
z;
36923 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
36924 return (a.real == 0) && (a.imag == 0);
36926 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
36927 __pyx_t_float_complex
z;
36933 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
36934 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
36935 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
36937 return hypotf(
z.real,
z.imag);
36940 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36941 __pyx_t_float_complex
z;
36942 float r, lnr, theta, z_r, z_theta;
36943 if (b.imag == 0 && b.real == (
int)b.real) {
36945 float denom = a.real * a.real + a.imag * a.imag;
36946 a.real = a.real / denom;
36947 a.imag = -a.imag / denom;
36950 switch ((
int)b.real) {
36958 return __Pyx_c_prod_float(a, a);
36960 z = __Pyx_c_prod_float(a, a);
36961 return __Pyx_c_prod_float(
z, a);
36963 z = __Pyx_c_prod_float(a, a);
36964 return __Pyx_c_prod_float(
z,
z);
36970 }
else if ((b.imag == 0) && (a.real >= 0)) {
36971 z.real = powf(a.real, b.real);
36974 }
else if (a.real > 0) {
36979 theta = atan2f(0.0, -1.0);
36982 r = __Pyx_c_abs_float(a);
36983 theta = atan2f(a.imag, a.real);
36986 z_r = expf(lnr * b.real - theta * b.imag);
36987 z_theta = theta * b.real + lnr * b.imag;
36988 z.real = z_r * cosf(z_theta);
36989 z.imag = z_r * sinf(z_theta);
36996#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
36998 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
36999 return ::std::complex< double >(x, y);
37002 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
37003 return x + y*(__pyx_t_double_complex)_Complex_I;
37007 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
37008 __pyx_t_double_complex
z;
37016#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37018 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37019 return (a.real == b.real) && (a.imag == b.imag);
37021 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37022 __pyx_t_double_complex
z;
37023 z.real = a.real + b.real;
37024 z.imag = a.imag + b.imag;
37027 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37028 __pyx_t_double_complex
z;
37029 z.real = a.real - b.real;
37030 z.imag = a.imag - b.imag;
37033 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37034 __pyx_t_double_complex
z;
37035 z.real = a.real * b.real - a.imag * b.imag;
37036 z.imag = a.real * b.imag + a.imag * b.real;
37040 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37042 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37043 }
else if (fabs(b.real) >= fabs(b.imag)) {
37044 if (b.real == 0 && b.imag == 0) {
37045 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
37047 double r = b.imag / b.real;
37048 double s = (double)(1.0) / (b.real + b.imag *
r);
37049 return __pyx_t_double_complex_from_parts(
37050 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
37053 double r = b.real / b.imag;
37054 double s = (double)(1.0) / (b.imag + b.real *
r);
37055 return __pyx_t_double_complex_from_parts(
37056 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
37060 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37062 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37064 double denom = b.real * b.real + b.imag * b.imag;
37065 return __pyx_t_double_complex_from_parts(
37066 (a.real * b.real + a.imag * b.imag) / denom,
37067 (a.imag * b.real - a.real * b.imag) / denom);
37071 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
37072 __pyx_t_double_complex
z;
37077 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
37078 return (a.real == 0) && (a.imag == 0);
37080 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
37081 __pyx_t_double_complex
z;
37087 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
37088 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
37089 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
37091 return hypot(
z.real,
z.imag);
37094 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37095 __pyx_t_double_complex
z;
37096 double r, lnr, theta, z_r, z_theta;
37097 if (b.imag == 0 && b.real == (
int)b.real) {
37099 double denom = a.real * a.real + a.imag * a.imag;
37100 a.real = a.real / denom;
37101 a.imag = -a.imag / denom;
37104 switch ((
int)b.real) {
37112 return __Pyx_c_prod_double(a, a);
37114 z = __Pyx_c_prod_double(a, a);
37115 return __Pyx_c_prod_double(
z, a);
37117 z = __Pyx_c_prod_double(a, a);
37118 return __Pyx_c_prod_double(
z,
z);
37124 }
else if ((b.imag == 0) && (a.real >= 0)) {
37125 z.real = pow(a.real, b.real);
37128 }
else if (a.real > 0) {
37133 theta = atan2(0.0, -1.0);
37136 r = __Pyx_c_abs_double(a);
37137 theta = atan2(a.imag, a.real);
37140 z_r = exp(lnr * b.real - theta * b.imag);
37141 z_theta = theta * b.real + lnr * b.imag;
37142 z.real = z_r * cos(z_theta);
37143 z.imag = z_r * sin(z_theta);
37150#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37152 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
37153 return ::std::complex< long double >(x, y);
37156 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
37157 return x + y*(__pyx_t_long_double_complex)_Complex_I;
37161 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
37162 __pyx_t_long_double_complex
z;
37170#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37172 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37173 return (a.real == b.real) && (a.imag == b.imag);
37175 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) {
37176 __pyx_t_long_double_complex
z;
37177 z.real = a.real + b.real;
37178 z.imag = a.imag + b.imag;
37181 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) {
37182 __pyx_t_long_double_complex
z;
37183 z.real = a.real - b.real;
37184 z.imag = a.imag - b.imag;
37187 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) {
37188 __pyx_t_long_double_complex
z;
37189 z.real = a.real * b.real - a.imag * b.imag;
37190 z.imag = a.real * b.imag + a.imag * b.real;
37194 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) {
37196 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37197 }
else if (fabsl(b.real) >= fabsl(b.imag)) {
37198 if (b.real == 0 && b.imag == 0) {
37199 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
37201 long double r = b.imag / b.real;
37202 long double s = (
long double)(1.0) / (b.real + b.imag *
r);
37203 return __pyx_t_long_double_complex_from_parts(
37204 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
37207 long double r = b.real / b.imag;
37208 long double s = (
long double)(1.0) / (b.imag + b.real *
r);
37209 return __pyx_t_long_double_complex_from_parts(
37210 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
37214 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) {
37216 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37218 long double denom = b.real * b.real + b.imag * b.imag;
37219 return __pyx_t_long_double_complex_from_parts(
37220 (a.real * b.real + a.imag * b.imag) / denom,
37221 (a.imag * b.real - a.real * b.imag) / denom);
37225 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
37226 __pyx_t_long_double_complex
z;
37231 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
37232 return (a.real == 0) && (a.imag == 0);
37234 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
37235 __pyx_t_long_double_complex
z;
37241 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex
z) {
37242 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
37243 return sqrtl(
z.real*
z.real +
z.imag*
z.imag);
37245 return hypotl(
z.real,
z.imag);
37248 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) {
37249 __pyx_t_long_double_complex
z;
37250 long double r, lnr, theta, z_r, z_theta;
37251 if (b.imag == 0 && b.real == (
int)b.real) {
37253 long double denom = a.real * a.real + a.imag * a.imag;
37254 a.real = a.real / denom;
37255 a.imag = -a.imag / denom;
37258 switch ((
int)b.real) {
37266 return __Pyx_c_prod_long__double(a, a);
37268 z = __Pyx_c_prod_long__double(a, a);
37269 return __Pyx_c_prod_long__double(
z, a);
37271 z = __Pyx_c_prod_long__double(a, a);
37272 return __Pyx_c_prod_long__double(
z,
z);
37278 }
else if ((b.imag == 0) && (a.real >= 0)) {
37279 z.real = powl(a.real, b.real);
37282 }
else if (a.real > 0) {
37287 theta = atan2l(0.0, -1.0);
37290 r = __Pyx_c_abs_long__double(a);
37291 theta = atan2l(a.imag, a.real);
37294 z_r = expl(lnr * b.real - theta * b.imag);
37295 z_theta = theta * b.real + lnr * b.imag;
37296 z.real = z_r * cosl(z_theta);
37297 z.imag = z_r * sinl(z_theta);
37304static __Pyx_memviewslice
37305__pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
37306 const char *mode,
int ndim,
37307 Py_ssize_t sizeof_dtype,
int contig_flag,
37308 int dtype_is_object)
37310 __Pyx_RefNannyDeclarations
37312 __Pyx_memviewslice new_mvs = __Pyx_MEMSLICE_INIT;
37313 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
37314 Py_buffer *buf = &from_memview->view;
37315 PyObject *shape_tuple = NULL;
37316 struct __pyx_array_obj *array_obj = NULL;
37317 struct __pyx_memoryview_obj *memview_obj = NULL;
37318 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
37319 for (i = 0; i < ndim; i++) {
37320 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
37321 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
37322 "indirect dimensions (axis %d)", i);
37326 shape_tuple = PyTuple_New(ndim);
37327 if (unlikely(!shape_tuple)) {
37330 __Pyx_GOTREF(shape_tuple);
37331 for(i = 0; i < ndim; i++) {
37332 PyObject *temp_int = PyLong_FromSsize_t(from_mvs->shape[i]);
37333 if(unlikely(!temp_int)) {
37336#if CYTHON_ASSUME_SAFE_MACROS
37337 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
37339 if (PyTuple_SetItem(shape_tuple, i, temp_int) < 0) {
37345 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, mode, NULL);
37346 if (unlikely(!array_obj)) {
37349 __Pyx_GOTREF(array_obj);
37350 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
37351 (PyObject *) array_obj, contig_flag,
37353 from_mvs->memview->typeinfo);
37354 if (unlikely(!memview_obj))
37356 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
37358 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
37359 dtype_is_object) < 0))
37363 __Pyx_XDECREF((PyObject *) new_mvs.memview);
37364 new_mvs.memview = NULL;
37365 new_mvs.data = NULL;
37367 __Pyx_XDECREF(shape_tuple);
37368 __Pyx_XDECREF((PyObject *) array_obj);
37369 __Pyx_RefNannyFinishContext();
37374static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
37375static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(
void) {
37376 const char* type_name =
"int";
37377 PyErr_Format(PyExc_OverflowError,
37378 "can't convert negative value to %.200s", type_name);
37381static int __Pyx_raise_overflow___Pyx_PyLong_As_int(
void) {
37382 const char* type_name =
"int";
37383 PyErr_Format(PyExc_OverflowError,
37384 "value too large to convert to %.200s", type_name);
37387static CYTHON_INLINE
int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
37388 const int is_unsigned = 1;
37389#if CYTHON_USE_PYLONG_INTERNALS
37391 const digit* digits = __Pyx_PyLong_Digits(x);
37392 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37393 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
37394 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
37395 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
37396 }
else if ((8 *
sizeof(
int) >= 2 * PyLong_SHIFT)) {
37397 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37400 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
37401 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
37402 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
37403 }
else if ((8 *
sizeof(
int) >= 3 * PyLong_SHIFT)) {
37404 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37407 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
37408 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
37409 __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])))
37410 }
else if ((8 *
sizeof(
int) >= 4 * PyLong_SHIFT)) {
37411 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37416#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
37417 if (unlikely(Py_SIZE(x) < 0)) {
37418 goto raise_neg_overflow;
37422 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37423 if (unlikely(result < 0))
37425 if (unlikely(result == 1))
37426 goto raise_neg_overflow;
37429 if ((
sizeof(
int) <=
sizeof(
unsigned long))) {
37430 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
37431 }
else if ((
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG))) {
37432 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37434 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
37436 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37438 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37440static CYTHON_INLINE
int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
37441 const int is_unsigned = 0;
37442#if CYTHON_USE_PYLONG_INTERNALS
37443 if (__Pyx_PyLong_IsNeg(x)) {
37444 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37445 const digit* digits = __Pyx_PyLong_Digits(x);
37446 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
37447 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
37448 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
37449 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
37450 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
37451 return (
int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37454 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
37455 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
37456 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
37457 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
37458 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
37459 return (
int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37462 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
37463 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
37464 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]));
37465 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
37466 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
37467 return (
int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37472 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37473 const digit* digits = __Pyx_PyLong_Digits(x);
37474 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
37475 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
37476 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
37477 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
37478 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37481 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
37482 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
37483 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
37484 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
37485 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37488 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
37489 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
37490 __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])))
37491 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
37492 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37498 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
37499 if ((
sizeof(
int) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
37500 __PYX_VERIFY_RETURN_INT_EXC(
int,
int, PyLong_AsInt(x))
37503 if ((
sizeof(
int) <=
sizeof(
long))) {
37504 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
37505 }
else if ((
sizeof(
int) <=
sizeof(PY_LONG_LONG))) {
37506 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
37508 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
37510 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37512 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37514static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
37515#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37516#pragma GCC diagnostic push
37517#pragma GCC diagnostic ignored "-Wconversion"
37519 const int neg_one = (int) -1, const_zero = (
int) 0;
37520#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37521#pragma GCC diagnostic pop
37523 const int is_unsigned = neg_one > const_zero;
37526#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
37527 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
37528 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
37529 if (unlikely(bytes_copied == -1)) {
37530 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
37531 goto raise_overflow;
37535#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
37536 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
37537 unsigned char *bytes = (
unsigned char *)&val;
37538 ret = _PyLong_AsByteArray((PyLongObject *)x,
37539 bytes,
sizeof(val),
37540 is_little, !is_unsigned);
37541 if ((0))
goto raise_overflow;
37544 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
37545 int bits, remaining_bits, is_negative = 0;
37546 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
37547 if (likely(PyLong_CheckExact(x))) {
37548 v = __Pyx_NewRef(x);
37550 v = PyNumber_Long(x);
37551 if (unlikely(!
v))
return (
int) -1;
37552 assert(PyLong_CheckExact(
v));
37555 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
37556 if (unlikely(result < 0)) {
37560 is_negative = result == 1;
37562 if (is_unsigned && unlikely(is_negative)) {
37564 PyErr_SetString(PyExc_OverflowError,
37565 "can't convert negative value to int");
37567 }
else if (is_negative) {
37568 stepval = PyNumber_Invert(
v);
37570 if (unlikely(!stepval))
37577 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
37578 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
37579 for (bits = 0; bits < (int)
sizeof(int) * 8 - chunk_size; bits += chunk_size) {
37580 PyObject *tmp, *digit;
37582 digit = PyNumber_And(stepval, mask);
37583 if (unlikely(!digit))
goto done;
37584 idigit = PyLong_AsLong(digit);
37586 if (unlikely(idigit < 0))
goto done;
37587 val |= ((int) idigit) << bits;
37588 tmp = PyNumber_Rshift(stepval, shift);
37589 if (unlikely(!tmp))
goto done;
37590 Py_DECREF(stepval); stepval = tmp;
37592 Py_DECREF(shift); shift = NULL;
37593 Py_DECREF(mask); mask = NULL;
37595 long idigit = PyLong_AsLong(stepval);
37596 if (unlikely(idigit < 0))
goto done;
37597 remaining_bits = ((int)
sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
37598 if (unlikely(idigit >= (1L << remaining_bits)))
37599 goto raise_overflow;
37600 val |= ((int) idigit) << bits;
37602 if (!is_unsigned) {
37603 if (unlikely(val & (((
int) 1) << (
sizeof(
int) * 8 - 1))))
37604 goto raise_overflow;
37612 Py_XDECREF(stepval);
37618 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37620static CYTHON_INLINE
int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
37621#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37622#pragma GCC diagnostic push
37623#pragma GCC diagnostic ignored "-Wconversion"
37625 const int neg_one = (int) -1, const_zero = (
int) 0;
37626#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37627#pragma GCC diagnostic pop
37629 const int is_unsigned = neg_one > const_zero;
37631 #if CYTHON_USE_PYLONG_INTERNALS
37632 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
37633 goto raise_neg_overflow;
37634 }
else if (__Pyx_PyLong_IsCompact(x)) {
37635 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
37639 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
37642 #if CYTHON_USE_PYLONG_INTERNALS
37643 if (__Pyx_PyLong_IsCompact(x)) {
37644 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
37648 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
37651#if CYTHON_USE_PYLONG_INTERNALS
37653 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37655 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37658static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
37660 PyObject *tmp = __Pyx_PyNumber_Long(x);
37661 if (!tmp)
return (
int) -1;
37662 val = __Pyx_PyLong_As_int(tmp);
37666static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *x) {
37667 if (likely(PyLong_Check(x))) {
37668 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
37670 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
37675static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
37676#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
37677 PyObject *args[2] = {obj, arg};
37678 return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
37679#elif CYTHON_COMPILING_IN_LIMITED_API
37680 return PyObject_CallMethodObjArgs(obj, method_name, arg, NULL);
37682 return PyObject_CallMethodOneArg(obj, method_name, arg);
37687static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
37688 PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
37689 if (unlikely(!state_dict)) {
37692 int non_empty = PyObject_IsTrue(state_dict);
37693 if (non_empty == 0) {
37694 Py_DECREF(state_dict);
37696 }
else if (unlikely(non_empty == -1)) {
37700 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
37701 dict = PyObject_GetAttrString(obj,
"__dict__");
37703 dict = PyObject_GenericGetDict(obj, NULL);
37705 if (unlikely(!dict)) {
37706 Py_DECREF(state_dict);
37710 if (likely(PyDict_CheckExact(dict))) {
37711 result = PyDict_Update(dict, state_dict);
37713 PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
37714 if (likely(obj_result)) {
37715 Py_DECREF(obj_result);
37721 Py_DECREF(state_dict);
37725static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
37726 Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
37727 #if !CYTHON_ASSUME_SAFE_SIZE
37728 if (unlikely(state_size == -1))
return -1;
37730 if (state_size <= index) {
37733 return __Pyx__UpdateUnpickledDict(obj, state, index);
37737static void __Pyx_RaiseUnpickleChecksumError(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members) {
37738 PyObject *pickle_module = PyImport_ImportModule(
"pickle");
37739 if (unlikely(!pickle_module))
return;
37740 PyObject *pickle_error = PyObject_GetAttrString(pickle_module,
"PickleError");
37741 Py_DECREF(pickle_module);
37742 if (unlikely(!pickle_error))
return;
37743 if (checksum2 == checksum1) {
37744 PyErr_Format(pickle_error,
"Incompatible checksums (0x%x vs (0x%x) = (%s))",
37745 checksum, checksum1, members);
37746 }
else if (checksum3 == checksum2) {
37747 PyErr_Format(pickle_error,
"Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
37748 checksum, checksum1, checksum2, members);
37750 PyErr_Format(pickle_error,
"Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
37751 checksum, checksum1, checksum2, checksum3, members);
37753 Py_DECREF(pickle_error);
37757static int __Pyx_CheckUnpickleChecksum(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members) {
37759 found |= checksum1 == checksum;
37760 found |= checksum2 == checksum;
37761 found |= checksum3 == checksum;
37764 __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
37769static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
37770static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(
void) {
37771 const char* type_name =
"long";
37772 PyErr_Format(PyExc_OverflowError,
37773 "can't convert negative value to %.200s", type_name);
37776static long __Pyx_raise_overflow___Pyx_PyLong_As_long(
void) {
37777 const char* type_name =
"long";
37778 PyErr_Format(PyExc_OverflowError,
37779 "value too large to convert to %.200s", type_name);
37782static CYTHON_INLINE
long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
37783 const int is_unsigned = 1;
37784#if CYTHON_USE_PYLONG_INTERNALS
37786 const digit* digits = __Pyx_PyLong_Digits(x);
37787 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37788 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
37789 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
37790 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
37791 }
else if ((8 *
sizeof(
long) >= 2 * PyLong_SHIFT)) {
37792 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37795 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
37796 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
37797 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
37798 }
else if ((8 *
sizeof(
long) >= 3 * PyLong_SHIFT)) {
37799 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37802 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
37803 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
37804 __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])))
37805 }
else if ((8 *
sizeof(
long) >= 4 * PyLong_SHIFT)) {
37806 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37811#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
37812 if (unlikely(Py_SIZE(x) < 0)) {
37813 goto raise_neg_overflow;
37817 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37818 if (unlikely(result < 0))
37820 if (unlikely(result == 1))
37821 goto raise_neg_overflow;
37824 if ((
sizeof(
long) <=
sizeof(
unsigned long))) {
37825 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
37826 }
else if ((
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG))) {
37827 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37829 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
37831 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
37833 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
37835static CYTHON_INLINE
long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
37836 const int is_unsigned = 0;
37837#if CYTHON_USE_PYLONG_INTERNALS
37838 if (__Pyx_PyLong_IsNeg(x)) {
37839 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37840 const digit* digits = __Pyx_PyLong_Digits(x);
37841 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
37842 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
37843 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
37844 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
37845 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
37846 return (
long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37849 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
37850 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
37851 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
37852 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
37853 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
37854 return (
long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37857 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
37858 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
37859 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]));
37860 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
37861 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
37862 return (
long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37867 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37868 const digit* digits = __Pyx_PyLong_Digits(x);
37869 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
37870 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
37871 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
37872 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
37873 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37876 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
37877 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
37878 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
37879 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
37880 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37883 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
37884 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
37885 __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])))
37886 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
37887 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37893 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
37894 if ((
sizeof(
long) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
37895 __PYX_VERIFY_RETURN_INT_EXC(
long,
int, PyLong_AsInt(x))
37898 if ((
sizeof(
long) <=
sizeof(
long))) {
37899 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
37900 }
else if ((
sizeof(
long) <=
sizeof(PY_LONG_LONG))) {
37901 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
37903 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
37905 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
37907 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
37909static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
37910#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37911#pragma GCC diagnostic push
37912#pragma GCC diagnostic ignored "-Wconversion"
37914 const long neg_one = (long) -1, const_zero = (
long) 0;
37915#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37916#pragma GCC diagnostic pop
37918 const int is_unsigned = neg_one > const_zero;
37921#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
37922 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
37923 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
37924 if (unlikely(bytes_copied == -1)) {
37925 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
37926 goto raise_overflow;
37930#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
37931 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
37932 unsigned char *bytes = (
unsigned char *)&val;
37933 ret = _PyLong_AsByteArray((PyLongObject *)x,
37934 bytes,
sizeof(val),
37935 is_little, !is_unsigned);
37936 if ((0))
goto raise_overflow;
37939 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
37940 int bits, remaining_bits, is_negative = 0;
37941 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
37942 if (likely(PyLong_CheckExact(x))) {
37943 v = __Pyx_NewRef(x);
37945 v = PyNumber_Long(x);
37946 if (unlikely(!
v))
return (
long) -1;
37947 assert(PyLong_CheckExact(
v));
37950 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
37951 if (unlikely(result < 0)) {
37955 is_negative = result == 1;
37957 if (is_unsigned && unlikely(is_negative)) {
37959 PyErr_SetString(PyExc_OverflowError,
37960 "can't convert negative value to long");
37962 }
else if (is_negative) {
37963 stepval = PyNumber_Invert(
v);
37965 if (unlikely(!stepval))
37972 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
37973 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
37974 for (bits = 0; bits < (int)
sizeof(long) * 8 - chunk_size; bits += chunk_size) {
37975 PyObject *tmp, *digit;
37977 digit = PyNumber_And(stepval, mask);
37978 if (unlikely(!digit))
goto done;
37979 idigit = PyLong_AsLong(digit);
37981 if (unlikely(idigit < 0))
goto done;
37982 val |= ((long) idigit) << bits;
37983 tmp = PyNumber_Rshift(stepval, shift);
37984 if (unlikely(!tmp))
goto done;
37985 Py_DECREF(stepval); stepval = tmp;
37987 Py_DECREF(shift); shift = NULL;
37988 Py_DECREF(mask); mask = NULL;
37990 long idigit = PyLong_AsLong(stepval);
37991 if (unlikely(idigit < 0))
goto done;
37992 remaining_bits = ((int)
sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
37993 if (unlikely(idigit >= (1L << remaining_bits)))
37994 goto raise_overflow;
37995 val |= ((long) idigit) << bits;
37997 if (!is_unsigned) {
37998 if (unlikely(val & (((
long) 1) << (
sizeof(
long) * 8 - 1))))
37999 goto raise_overflow;
38007 Py_XDECREF(stepval);
38013 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
38015static CYTHON_INLINE
long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
38016#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38017#pragma GCC diagnostic push
38018#pragma GCC diagnostic ignored "-Wconversion"
38020 const long neg_one = (long) -1, const_zero = (
long) 0;
38021#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38022#pragma GCC diagnostic pop
38024 const int is_unsigned = neg_one > const_zero;
38026 #if CYTHON_USE_PYLONG_INTERNALS
38027 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
38028 goto raise_neg_overflow;
38029 }
else if (__Pyx_PyLong_IsCompact(x)) {
38030 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
38034 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
38037 #if CYTHON_USE_PYLONG_INTERNALS
38038 if (__Pyx_PyLong_IsCompact(x)) {
38039 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
38043 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
38046#if CYTHON_USE_PYLONG_INTERNALS
38048 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
38050 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
38053static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
38055 PyObject *tmp = __Pyx_PyNumber_Long(x);
38056 if (!tmp)
return (
long) -1;
38057 val = __Pyx_PyLong_As_long(tmp);
38061static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *x) {
38062 if (likely(PyLong_Check(x))) {
38063 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
38065 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
38070#if CYTHON_VECTORCALL
38071CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
38072 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
38073#if !CYTHON_ASSUME_SAFE_MACROS
38074 if (unlikely(!key))
return -1;
38076 if (unlikely(!PyUnicode_Check(key))) {
38077 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
38083CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n) {
38084 PyObject *out = PyDict_New();
38085 if (unlikely(!out))
return NULL;
38086 for (Py_ssize_t i=0; i<
n; ++i) {
38087 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
38094CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
38095 PyObject *key = kwnames[i];
38096 if (unlikely(!PyUnicode_Check(key))) {
38097 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
38105#if !CYTHON_VECTORCALL
38106static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
38108 PyObject *obj = PyObject_GetAttr(args[0], name);
38109 if (unlikely(!obj))
38111 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
38118static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(
int value) {
38119#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38120#pragma GCC diagnostic push
38121#pragma GCC diagnostic ignored "-Wconversion"
38123 const int neg_one = (int) -1, const_zero = (
int) 0;
38124#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38125#pragma GCC diagnostic pop
38127 const int is_unsigned = neg_one > const_zero;
38129 if (
sizeof(
int) <
sizeof(
long)) {
38130 return PyLong_FromLong((
long) value);
38131 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
38132 return PyLong_FromUnsignedLong((
unsigned long) value);
38133#if !CYTHON_COMPILING_IN_PYPY
38134 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
38135 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
38139 if (
sizeof(
int) <=
sizeof(
long)) {
38140 return PyLong_FromLong((
long) value);
38141 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
38142 return PyLong_FromLongLong((PY_LONG_LONG) value);
38146 unsigned char *bytes = (
unsigned char *)&value;
38147#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
38149 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
38151 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
38153#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
38154 int one = 1;
int little = (int)*(
unsigned char *)&one;
38155 return _PyLong_FromByteArray(bytes,
sizeof(
int),
38156 little, !is_unsigned);
38158 int one = 1;
int little = (int)*(
unsigned char *)&one;
38159 PyObject *result = NULL, *kwds = NULL;
38160 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
38161 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
int));
38162 if (!py_bytes)
goto limited_bad;
38163 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
38164 if (!from_bytes_str)
goto limited_bad;
38165 order_str = PyUnicode_FromString(little ?
"little" :
"big");
38166 if (!order_str)
goto limited_bad;
38168 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
38169 if (!is_unsigned) {
38170 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
38171 if (!signed_str)
goto limited_bad;
38172#if CYTHON_VECTORCALL
38173 kwds = PyTuple_Pack(1, signed_str);
38176 PyObject *keys[] = {signed_str};
38177 PyObject *values[] = {Py_True};
38178 kwds = __Pyx_MakeKwargDict(keys, values, 1);
38181 Py_DECREF(signed_str);
38182 if (unlikely(!kwds))
goto limited_bad;
38184 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
38188 Py_XDECREF(order_str);
38189 Py_XDECREF(py_bytes);
38190 Py_XDECREF(from_bytes_str);
38197static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value) {
38198#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38199#pragma GCC diagnostic push
38200#pragma GCC diagnostic ignored "-Wconversion"
38202 const long neg_one = (long) -1, const_zero = (
long) 0;
38203#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38204#pragma GCC diagnostic pop
38206 const int is_unsigned = neg_one > const_zero;
38208 if (
sizeof(
long) <
sizeof(
long)) {
38209 return PyLong_FromLong((
long) value);
38210 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
38211 return PyLong_FromUnsignedLong((
unsigned long) value);
38212#if !CYTHON_COMPILING_IN_PYPY
38213 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
38214 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
38218 if (
sizeof(
long) <=
sizeof(
long)) {
38219 return PyLong_FromLong((
long) value);
38220 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
38221 return PyLong_FromLongLong((PY_LONG_LONG) value);
38225 unsigned char *bytes = (
unsigned char *)&value;
38226#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
38228 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
38230 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
38232#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
38233 int one = 1;
int little = (int)*(
unsigned char *)&one;
38234 return _PyLong_FromByteArray(bytes,
sizeof(
long),
38235 little, !is_unsigned);
38237 int one = 1;
int little = (int)*(
unsigned char *)&one;
38238 PyObject *result = NULL, *kwds = NULL;
38239 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
38240 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
long));
38241 if (!py_bytes)
goto limited_bad;
38242 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
38243 if (!from_bytes_str)
goto limited_bad;
38244 order_str = PyUnicode_FromString(little ?
"little" :
"big");
38245 if (!order_str)
goto limited_bad;
38247 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
38248 if (!is_unsigned) {
38249 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
38250 if (!signed_str)
goto limited_bad;
38251#if CYTHON_VECTORCALL
38252 kwds = PyTuple_Pack(1, signed_str);
38255 PyObject *keys[] = {signed_str};
38256 PyObject *values[] = {Py_True};
38257 kwds = __Pyx_MakeKwargDict(keys, values, 1);
38260 Py_DECREF(signed_str);
38261 if (unlikely(!kwds))
goto limited_bad;
38263 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
38267 Py_XDECREF(order_str);
38268 Py_XDECREF(py_bytes);
38269 Py_XDECREF(from_bytes_str);
38276static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x);
38277static char __Pyx_raise_neg_overflow___Pyx_PyLong_As_char(
void) {
38278 const char* type_name =
"char";
38279 PyErr_Format(PyExc_OverflowError,
38280 "can't convert negative value to %.200s", type_name);
38283static char __Pyx_raise_overflow___Pyx_PyLong_As_char(
void) {
38284 const char* type_name =
"char";
38285 PyErr_Format(PyExc_OverflowError,
38286 "value too large to convert to %.200s", type_name);
38289static CYTHON_INLINE
char __Pyx_PyULong___Pyx_PyLong_As_char(PyObject *x) {
38290 const int is_unsigned = 1;
38291#if CYTHON_USE_PYLONG_INTERNALS
38293 const digit* digits = __Pyx_PyLong_Digits(x);
38294 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38295 if (size == 2 && (8 *
sizeof(
char) > 1 * PyLong_SHIFT)) {
38296 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
38297 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38298 }
else if ((8 *
sizeof(
char) >= 2 * PyLong_SHIFT)) {
38299 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38302 if (size == 3 && (8 *
sizeof(
char) > 2 * PyLong_SHIFT)) {
38303 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
38304 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38305 }
else if ((8 *
sizeof(
char) >= 3 * PyLong_SHIFT)) {
38306 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38309 if (size == 4 && (8 *
sizeof(
char) > 3 * PyLong_SHIFT)) {
38310 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
38311 __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])))
38312 }
else if ((8 *
sizeof(
char) >= 4 * PyLong_SHIFT)) {
38313 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38318#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
38319 if (unlikely(Py_SIZE(x) < 0)) {
38320 goto raise_neg_overflow;
38324 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
38325 if (unlikely(result < 0))
38327 if (unlikely(result == 1))
38328 goto raise_neg_overflow;
38331 if ((
sizeof(
char) <=
sizeof(
unsigned long))) {
38332 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
38333 }
else if ((
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG))) {
38334 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
38336 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
38338 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
38340 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38342static CYTHON_INLINE
char __Pyx_PySLong___Pyx_PyLong_As_char(PyObject *x) {
38343 const int is_unsigned = 0;
38344#if CYTHON_USE_PYLONG_INTERNALS
38345 if (__Pyx_PyLong_IsNeg(x)) {
38346 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38347 const digit* digits = __Pyx_PyLong_Digits(x);
38348 if (size == 2 && (8 *
sizeof(
char) > 1 * PyLong_SHIFT)) {
38349 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
38350 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38351 __PYX_VERIFY_RETURN_INT(
char,
long, ival)
38352 }
else if ((8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT)) {
38353 return (
char) (((char) -1) * (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38356 if (size == 3 && (8 *
sizeof(
char) > 2 * PyLong_SHIFT)) {
38357 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
38358 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38359 __PYX_VERIFY_RETURN_INT(
char,
long, ival)
38360 }
else if ((8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT)) {
38361 return (
char) (((char) -1) * (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38364 if (size == 4 && (8 *
sizeof(
char) > 3 * PyLong_SHIFT)) {
38365 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
38366 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]));
38367 __PYX_VERIFY_RETURN_INT(
char,
long, ival)
38368 }
else if ((8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT)) {
38369 return (
char) (((char) -1) * (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38374 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38375 const digit* digits = __Pyx_PyLong_Digits(x);
38376 if (size == 2 && (8 *
sizeof(
char) > 1 * PyLong_SHIFT)) {
38377 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
38378 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38379 }
else if ((8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT)) {
38380 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38383 if (size == 3 && (8 *
sizeof(
char) > 2 * PyLong_SHIFT)) {
38384 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
38385 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38386 }
else if ((8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT)) {
38387 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38390 if (size == 4 && (8 *
sizeof(
char) > 3 * PyLong_SHIFT)) {
38391 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
38392 __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])))
38393 }
else if ((8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT)) {
38394 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38400 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
38401 if ((
sizeof(
char) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
38402 __PYX_VERIFY_RETURN_INT_EXC(
char,
int, PyLong_AsInt(x))
38405 if ((
sizeof(
char) <=
sizeof(
long))) {
38406 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
38407 }
else if ((
sizeof(
char) <=
sizeof(PY_LONG_LONG))) {
38408 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
38410 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
38412 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
38414 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38416static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x) {
38417#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38418#pragma GCC diagnostic push
38419#pragma GCC diagnostic ignored "-Wconversion"
38421 const char neg_one = (char) -1, const_zero = (
char) 0;
38422#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38423#pragma GCC diagnostic pop
38425 const int is_unsigned = neg_one > const_zero;
38428#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
38429 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
38430 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
38431 if (unlikely(bytes_copied == -1)) {
38432 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
38433 goto raise_overflow;
38437#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
38438 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
38439 unsigned char *bytes = (
unsigned char *)&val;
38440 ret = _PyLong_AsByteArray((PyLongObject *)x,
38441 bytes,
sizeof(val),
38442 is_little, !is_unsigned);
38443 if ((0))
goto raise_overflow;
38446 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
38447 int bits, remaining_bits, is_negative = 0;
38448 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
38449 if (likely(PyLong_CheckExact(x))) {
38450 v = __Pyx_NewRef(x);
38452 v = PyNumber_Long(x);
38453 if (unlikely(!
v))
return (
char) -1;
38454 assert(PyLong_CheckExact(
v));
38457 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
38458 if (unlikely(result < 0)) {
38462 is_negative = result == 1;
38464 if (is_unsigned && unlikely(is_negative)) {
38466 PyErr_SetString(PyExc_OverflowError,
38467 "can't convert negative value to char");
38469 }
else if (is_negative) {
38470 stepval = PyNumber_Invert(
v);
38472 if (unlikely(!stepval))
38479 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
38480 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
38481 for (bits = 0; bits < (int)
sizeof(char) * 8 - chunk_size; bits += chunk_size) {
38482 PyObject *tmp, *digit;
38484 digit = PyNumber_And(stepval, mask);
38485 if (unlikely(!digit))
goto done;
38486 idigit = PyLong_AsLong(digit);
38488 if (unlikely(idigit < 0))
goto done;
38489 val |= ((char) idigit) << bits;
38490 tmp = PyNumber_Rshift(stepval, shift);
38491 if (unlikely(!tmp))
goto done;
38492 Py_DECREF(stepval); stepval = tmp;
38494 Py_DECREF(shift); shift = NULL;
38495 Py_DECREF(mask); mask = NULL;
38497 long idigit = PyLong_AsLong(stepval);
38498 if (unlikely(idigit < 0))
goto done;
38499 remaining_bits = ((int)
sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
38500 if (unlikely(idigit >= (1L << remaining_bits)))
38501 goto raise_overflow;
38502 val |= ((char) idigit) << bits;
38504 if (!is_unsigned) {
38505 if (unlikely(val & (((
char) 1) << (
sizeof(
char) * 8 - 1))))
38506 goto raise_overflow;
38514 Py_XDECREF(stepval);
38520 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38522static CYTHON_INLINE
char __Pyx_PyLong___Pyx_PyLong_As_char(PyObject *x) {
38523#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38524#pragma GCC diagnostic push
38525#pragma GCC diagnostic ignored "-Wconversion"
38527 const char neg_one = (char) -1, const_zero = (
char) 0;
38528#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38529#pragma GCC diagnostic pop
38531 const int is_unsigned = neg_one > const_zero;
38533 #if CYTHON_USE_PYLONG_INTERNALS
38534 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
38535 goto raise_neg_overflow;
38536 }
else if (__Pyx_PyLong_IsCompact(x)) {
38537 __PYX_VERIFY_RETURN_INT(
char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
38541 return __Pyx_PyULong___Pyx_PyLong_As_char(x);
38544 #if CYTHON_USE_PYLONG_INTERNALS
38545 if (__Pyx_PyLong_IsCompact(x)) {
38546 __PYX_VERIFY_RETURN_INT(
char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
38550 return __Pyx_PySLong___Pyx_PyLong_As_char(x);
38553#if CYTHON_USE_PYLONG_INTERNALS
38555 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
38557 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38560static char __Pyx_NonPyLong___Pyx_PyLong_As_char(PyObject *x) {
38562 PyObject *tmp = __Pyx_PyNumber_Long(x);
38563 if (!tmp)
return (
char) -1;
38564 val = __Pyx_PyLong_As_char(tmp);
38568static CYTHON_INLINE
char __Pyx_PyLong_As_char(PyObject *x) {
38569 if (likely(PyLong_Check(x))) {
38570 return __Pyx_PyLong___Pyx_PyLong_As_char(x);
38572 return __Pyx_NonPyLong___Pyx_PyLong_As_char(x);
38577#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
38578void __Pyx_init_runtime_version(
void) {
38579 if (__Pyx_cached_runtime_version == 0) {
38580 const char* rt_version = Py_GetVersion();
38581 unsigned long version = 0;
38582 unsigned long factor = 0x01000000UL;
38583 unsigned int digit = 0;
38586 while (
'0' <= rt_version[i] && rt_version[i] <=
'9') {
38587 digit = digit * 10 + (
unsigned int) (rt_version[i] -
'0');
38590 version += factor * digit;
38591 if (rt_version[i] !=
'.')
38597 __Pyx_cached_runtime_version = version;
38601static unsigned long __Pyx_get_runtime_version(
void) {
38602#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
38603 return Py_Version & ~0xFFUL;
38605 return __Pyx_cached_runtime_version;
38610static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer) {
38611 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
38612 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
38614 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
38618 PyOS_snprintf(message,
sizeof(message),
38619 "compile time Python version %d.%d "
38620 "of module '%.100s' "
38622 "runtime version %d.%d",
38623 (
int) (ct_version >> 24), (
int) ((ct_version >> 16) & 0xFF),
38625 (allow_newer) ?
"was newer than" :
"does not match",
38626 (
int) (rt_version >> 24), (
int) ((rt_version >> 16) & 0xFF)
38628 return PyErr_WarnEx(NULL, message, 1);
38633#if CYTHON_COMPILING_IN_LIMITED_API
38634 static PyObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
38635 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
38636 PyObject *fv, PyObject *cell, PyObject* fn,
38637 PyObject *name,
int fline, PyObject *lnos) {
38638 PyObject *exception_table = NULL;
38639 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
38640 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
38641 PyObject *version_info;
38642 PyObject *py_minor_version = NULL;
38644 long minor_version = 0;
38645 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
38646 minor_version = 11;
38648 if (!(version_info = PySys_GetObject(
"version_info")))
goto end;
38649 if (!(py_minor_version = PySequence_GetItem(version_info, 1)))
goto end;
38650 minor_version = PyLong_AsLong(py_minor_version);
38651 Py_DECREF(py_minor_version);
38652 if (minor_version == -1 && PyErr_Occurred())
goto end;
38654 if (!(types_module = PyImport_ImportModule(
"types")))
goto end;
38655 if (!(code_type = PyObject_GetAttrString(types_module,
"CodeType")))
goto end;
38656 if (minor_version <= 10) {
38657 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOiOOO", a,p, k, l,
s,
f, code,
38658 c,
n,
v, fn, name, fline, lnos, fv, cell);
38660 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0)))
goto end;
38661 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOOiOOOO", a,p, k, l,
s,
f, code,
38662 c,
n,
v, fn, name, name, fline, lnos, exception_table, fv, cell);
38665 Py_XDECREF(code_type);
38666 Py_XDECREF(exception_table);
38667 Py_XDECREF(types_module);
38669 PyObject *exc_type, *exc_value, *exc_tb;
38670 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
38671 if (PyErr_WarnFormat(
38672 PyExc_RuntimeWarning, 1,
38673 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
38674 exc_value ? exc_value : exc_type) == 0) {
38678 Py_DECREF(exc_type);
38679 Py_XDECREF(exc_value);
38680 Py_XDECREF(exc_tb);
38684#elif PY_VERSION_HEX >= 0x030B0000
38685 static PyCodeObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
38686 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
38687 PyObject *fv, PyObject *cell, PyObject* fn,
38688 PyObject *name,
int fline, PyObject *lnos) {
38689 PyCodeObject *result;
38691 #if PY_VERSION_HEX >= 0x030C0000
38692 PyUnstable_Code_NewWithPosOnlyArgs
38694 PyCode_NewWithPosOnlyArgs
38696 (a, p, k, l,
s,
f, code,
c,
n,
v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
38697 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
38698 if (likely(result))
38699 result->_co_firsttraceable = 0;
38703#elif !CYTHON_COMPILING_IN_PYPY
38704 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
38705 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
38707 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
38708 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
38710static PyObject* __Pyx_PyCode_New(
38711 const __Pyx_PyCode_New_function_description descr,
38712 PyObject *
const *varnames,
38713 PyObject *filename,
38714 PyObject *funcname,
38715 PyObject *line_table,
38716 PyObject *tuple_dedup_map
38718 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
38719 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
38720 PyObject *varnames_tuple = PyTuple_New(var_count);
38721 if (unlikely(!varnames_tuple))
return NULL;
38722 for (Py_ssize_t i=0; i < var_count; i++) {
38723 Py_INCREF(varnames[i]);
38724 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0))
goto done;
38726 #if CYTHON_COMPILING_IN_LIMITED_API
38727 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
38728 if (!varnames_tuple_dedup) {
38729 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0))
goto done;
38730 varnames_tuple_dedup = varnames_tuple;
38733 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
38734 if (unlikely(!varnames_tuple_dedup))
goto done;
38736 #if CYTHON_AVOID_BORROWED_REFS
38737 Py_INCREF(varnames_tuple_dedup);
38739 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
38740 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
38741 #if !CYTHON_ASSUME_SAFE_SIZE
38742 if (unlikely(line_table_length == -1))
goto done;
38744 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
38745 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
38746 if (unlikely(!code_bytes))
goto done;
38747 char* c_code_bytes = PyBytes_AsString(code_bytes);
38748 if (unlikely(!c_code_bytes))
goto done;
38749 memset(c_code_bytes, 0, (
size_t) code_len);
38751 code_obj = (PyObject*) __Pyx__PyCode_New(
38752 (
int) descr.argcount,
38753 (
int) descr.num_posonly_args,
38754 (
int) descr.num_kwonly_args,
38755 (
int) descr.nlocals,
38758 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
38759 __pyx_mstate_global->__pyx_empty_tuple,
38760 __pyx_mstate_global->__pyx_empty_tuple,
38761 varnames_tuple_dedup,
38762 __pyx_mstate_global->__pyx_empty_tuple,
38763 __pyx_mstate_global->__pyx_empty_tuple,
38766 (
int) descr.first_line,
38767 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
38770 Py_XDECREF(code_bytes);
38771 #if CYTHON_AVOID_BORROWED_REFS
38772 Py_XDECREF(varnames_tuple_dedup);
38774 Py_DECREF(varnames_tuple);
38780static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo) {
38781#ifdef __Pyx_DecompressString_UNUSED
38782 CYTHON_UNUSED_VAR(
s);
38783 CYTHON_UNUSED_VAR(length);
38784 CYTHON_UNUSED_VAR(algo);
38787 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
38788 const char* module_name = algo == 3 ?
"compression.zstd" : algo == 2 ?
"bz2" :
"zlib";
38789 PyObject *methodname = PyUnicode_FromString(
"decompress");
38790 if (unlikely(!methodname))
return NULL;
38791 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
38793 PyObject *fromlist = Py_BuildValue(
"[O]", methodname);
38794 if (unlikely(!fromlist))
goto bad;
38795 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
38796 Py_DECREF(fromlist);
38799 module = PyImport_ImportModule(module_name);
38800 if (unlikely(!module))
goto import_failed;
38801 decompress = PyObject_GetAttr(module, methodname);
38802 if (unlikely(!decompress))
goto import_failed;
38805 char *memview_bytes =
const_cast<char*
>(
s);
38807 #if defined(__clang__)
38808 #pragma clang diagnostic push
38809 #pragma clang diagnostic ignored "-Wcast-qual"
38810 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
38811 #pragma GCC diagnostic push
38812 #pragma GCC diagnostic ignored "-Wcast-qual"
38814 char *memview_bytes = (
char*)
s;
38815 #if defined(__clang__)
38816 #pragma clang diagnostic pop
38817 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
38818 #pragma GCC diagnostic pop
38821 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
38822 int memview_flags = 0x100;
38824 int memview_flags = PyBUF_READ;
38826 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
38828 if (unlikely(!compressed_bytes)) {
38829 Py_DECREF(decompress);
38832 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
38833 Py_DECREF(compressed_bytes);
38834 Py_DECREF(decompress);
38836 Py_DECREF(methodname);
38837 return decompressed;
38839 PyErr_Format(PyExc_ImportError,
38840 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
38841 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
38842 module_name, algo);
38844 Py_XDECREF(module);
38845 Py_DECREF(methodname);
38851#ifndef __Pyx_DecompressString_LZSS_UNUSED
38853static CYTHON_SMALL_CODE
size_t __pyx_lzss_decompress(
const uint8_t* src, uint8_t* dst,
size_t dst_len) {
38854 size_t pos = 0, out_pos = 0;
38856 uint32_t flags = src[pos++] | 0xFF00;
38857 while (flags & 0x100) {
38859 dst[out_pos++] = src[pos++];
38861 uint32_t lo = src[pos++], hi = src[pos++];
38862 uint32_t end_offset_of_last_occurrence, match_length;
38863 if (!(lo & 0x80)) {
38864 end_offset_of_last_occurrence = lo;
38866 }
else if (!(hi & 0x80)) {
38867 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
38868 match_length = hi & 0x1F;
38870 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
38871 match_length = src[pos++];
38874 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
38875 memcpy(dst + out_pos, dst + ref_pos, match_length);
38876 out_pos += match_length;
38878 if (out_pos >= dst_len)
return pos;
38884static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(
const char *
s,
size_t compressed_length,
size_t uncompressed_length) {
38885#ifdef __Pyx_DecompressString_LZSS_UNUSED
38886 CYTHON_UNUSED_VAR(
s);
38887 CYTHON_UNUSED_VAR(compressed_length);
38888 CYTHON_UNUSED_VAR(uncompressed_length);
38892 unsigned char *result_data;
38894 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
38895 if (unlikely(!result))
return NULL;
38896 result_data = __Pyx_PyBytes_AsWritableUString(result);
38897 if (unlikely(!result_data))
goto bad;
38898 src_length = __pyx_lzss_decompress((
const uint8_t*)
s, result_data, uncompressed_length);
38899 if (unlikely(src_length != compressed_length))
goto decompression_failed;
38901decompression_failed:
38902 PyErr_SetString(PyExc_RuntimeError,
"LZSS string data decompression failed");
38910static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s) {
38911 size_t len = strlen(
s);
38912 if (unlikely(len > (
size_t) PY_SSIZE_T_MAX)) {
38913 PyErr_SetString(PyExc_OverflowError,
"byte string is too long");
38916 return (Py_ssize_t) len;
38918static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
38919 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
38920 if (unlikely(len < 0))
return NULL;
38921 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
38923static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char* c_str) {
38924 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
38925 if (unlikely(len < 0))
return NULL;
38926 return PyByteArray_FromStringAndSize(c_str, len);
38928static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
38930 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
38932#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
38933static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
38934 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
38935#if CYTHON_COMPILING_IN_LIMITED_API
38937 const char* result;
38938 Py_ssize_t unicode_length;
38939 CYTHON_MAYBE_UNUSED_VAR(unicode_length);
38940 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
38941 if (unlikely(PyArg_Parse(o,
"s#", &result, length) < 0))
return NULL;
38943 result = PyUnicode_AsUTF8AndSize(o, length);
38945 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
38946 unicode_length = PyUnicode_GetLength(o);
38947 if (unlikely(unicode_length < 0))
return NULL;
38948 if (unlikely(unicode_length != *length)) {
38949 PyUnicode_AsASCIIString(o);
38956#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
38957 if (likely(PyUnicode_IS_ASCII(o))) {
38958 *length = PyUnicode_GET_LENGTH(o);
38959 return PyUnicode_AsUTF8(o);
38961 PyUnicode_AsASCIIString(o);
38965 return PyUnicode_AsUTF8AndSize(o, length);
38970static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
38971#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
38972 if (PyUnicode_Check(o)) {
38973 return __Pyx_PyUnicode_AsStringAndSize(o, length);
38976 if (PyByteArray_Check(o)) {
38977#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
38978 *length = PyByteArray_GET_SIZE(o);
38979 return PyByteArray_AS_STRING(o);
38981 *length = PyByteArray_Size(o);
38982 if (*length == -1)
return NULL;
38983 return PyByteArray_AsString(o);
38988 int r = PyBytes_AsStringAndSize(o, &result, length);
38989 if (unlikely(
r < 0)) {
38996static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
38997 int is_true = x == Py_True;
38998 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
38999 else return PyObject_IsTrue(x);
39001static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
39003 if (unlikely(!x))
return -1;
39004 retval = __Pyx_PyObject_IsTrue(x);
39008static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
39009 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
39010 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
39011 if (unlikely(!result_type_name))
goto bad;
39013 if (PyLong_Check(result)) {
39014 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
39015 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
"). "
39016 "The ability to return an instance of a strict subclass of int is deprecated, "
39017 "and may be removed in a future version of Python.",
39018 result_type_name)) {
39019 __Pyx_DECREF_TypeName(result_type_name);
39022 __Pyx_DECREF_TypeName(result_type_name);
39025 PyErr_Format(PyExc_TypeError,
39026 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
")",
39028 __Pyx_DECREF_TypeName(result_type_name);
39033static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
39034#if CYTHON_USE_TYPE_SLOTS
39035 PyNumberMethods *m;
39037 PyObject *res = NULL;
39038 if (likely(PyLong_Check(x)))
39039 return __Pyx_NewRef(x);
39040#if CYTHON_USE_TYPE_SLOTS
39041 m = Py_TYPE(x)->tp_as_number;
39042 if (likely(m && m->nb_int)) {
39043 res = m->nb_int(x);
39046 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
39047 res = PyNumber_Long(x);
39051 if (unlikely(!PyLong_CheckExact(res))) {
39052 return __Pyx_PyNumber_LongWrongResultType(res);
39055 else if (!PyErr_Occurred()) {
39056 PyErr_SetString(PyExc_TypeError,
39057 "an integer is required");
39061static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
39062 #if CYTHON_USE_PYLONG_INTERNALS
39064 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
39065 const int is_neg = __Pyx_PyLong_IsNeg(b);
39066 const digit* digits = __Pyx_PyLong_Digits(b);
39067 if (size == 0)
return 0;
39068 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
39070 ival = (Py_ssize_t) (((
size_t)digits[0]));
39073 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
39075 ival = (Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
39078 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
39080 ival = (Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
39083 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
39085 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]));
39088 return PyLong_AsSsize_t(b);
39089 return is_neg ? -ival : ival;
39091 return PyLong_AsSsize_t(b);
39094static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
39095 if (likely(PyLong_Check(b))) {
39096 return __Pyx_PyLong_AsSsize_t(b);
39099 PyObject *x = PyNumber_Index(b);
39100 if (unlikely(!x))
return -1;
39101 ival = __Pyx_PyLong_AsSsize_t(x);
39106static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
39107 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
39108 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
39112 x = PyNumber_Index(o);
39114 ival = PyLong_AsLong(x);
39119static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b) {
39120 CYTHON_UNUSED_VAR(b);
39121 return __Pyx_NewRef(Py_None);
39123static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
39124 return __Pyx_NewRef(b ? Py_True: Py_False);
39126static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t ival) {
39127 return PyLong_FromSize_t(ival);
39132#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
39133#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39134#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
39135 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
39137 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
39140#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
39141#error "Module state with PEP489 requires atomics. Currently that's one of\
39142 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
39144#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39145#define __Pyx_ModuleStateLookup_Lock()
39146#define __Pyx_ModuleStateLookup_Unlock()
39147#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
39148static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
39149#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
39150#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
39151#elif defined(__cplusplus) && __cplusplus >= 201103L
39153static std::mutex __Pyx_ModuleStateLookup_mutex;
39154#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
39155#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
39156#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
39157#include <threads.h>
39158static mtx_t __Pyx_ModuleStateLookup_mutex;
39159static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
39160static void __Pyx_ModuleStateLookup_initialize_mutex(
void) {
39161 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
39163#define __Pyx_ModuleStateLookup_Lock()\
39164 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
39165 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
39166#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
39167#elif defined(HAVE_PTHREAD_H)
39168#include <pthread.h>
39169static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
39170#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
39171#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
39172#elif defined(_WIN32)
39173#include <Windows.h>
39174static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
39175#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
39176#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
39178#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
39179 Requires C standard >= C11, or C++ standard >= C++11,\
39180 or pthreads, or the Windows 32 API, or Python >= 3.13."
39185} __Pyx_InterpreterIdAndModule;
39187 char interpreter_id_as_index;
39189 Py_ssize_t allocated;
39190 __Pyx_InterpreterIdAndModule table[1];
39191} __Pyx_ModuleStateLookupData;
39192#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
39193#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39194static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
39196#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39197static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
39199static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
39201static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
39202 __Pyx_InterpreterIdAndModule* table,
39204 int64_t interpreterId) {
39205 __Pyx_InterpreterIdAndModule* begin = table;
39206 __Pyx_InterpreterIdAndModule* end = begin + count;
39207 if (begin->id == interpreterId) {
39210 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
39211 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
39212 if (halfway->id == interpreterId) {
39215 if (halfway->id < interpreterId) {
39221 for (; begin < end; ++begin) {
39222 if (begin->id >= interpreterId)
return begin;
39226static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED
void* dummy) {
39227 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
39228 if (interpreter_id == -1)
return NULL;
39229#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39230 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
39232 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
39233 if (likely(data)) {
39234 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
39235 if (likely(data == new_data)) {
39236 goto read_finished;
39239 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
39240 __Pyx_ModuleStateLookup_Lock();
39241 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
39242 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
39243 __Pyx_ModuleStateLookup_Unlock();
39247 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
39249 __Pyx_InterpreterIdAndModule* found = NULL;
39250 if (unlikely(!data))
goto end;
39251 if (data->interpreter_id_as_index) {
39252 if (interpreter_id < data->count) {
39253 found = data->table+interpreter_id;
39256 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
39257 data->table, data->count, interpreter_id);
39261 PyObject *result=NULL;
39262 if (found && found->id == interpreter_id) {
39263 result = found->module;
39265#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39266 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
39271#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39272static void __Pyx_ModuleStateLookup_wait_until_no_readers(
void) {
39273 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
39276#define __Pyx_ModuleStateLookup_wait_until_no_readers()
39278static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
39279 Py_ssize_t to_allocate = (*old_data)->allocated;
39280 while (to_allocate <= interpreter_id) {
39281 if (to_allocate == 0) to_allocate = 1;
39282 else to_allocate *= 2;
39284 __Pyx_ModuleStateLookupData *new_data = *old_data;
39285 if (to_allocate != (*old_data)->allocated) {
39286 new_data = (__Pyx_ModuleStateLookupData *)realloc(
39288 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
39293 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
39294 new_data->table[i].id = i;
39295 new_data->table[i].module = NULL;
39297 new_data->allocated = to_allocate;
39299 new_data->table[interpreter_id].module =
module;
39300 if (new_data->count < interpreter_id+1) {
39301 new_data->count = interpreter_id+1;
39303 *old_data = new_data;
39306static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
39307 __Pyx_InterpreterIdAndModule *read = data->table;
39308 __Pyx_InterpreterIdAndModule *write = data->table;
39309 __Pyx_InterpreterIdAndModule *end = read + data->count;
39310 for (; read<end; ++read) {
39311 if (read->module) {
39312 write->id = read->id;
39313 write->module = read->module;
39317 data->count = write - data->table;
39318 for (; write<end; ++write) {
39320 write->module = NULL;
39322 data->interpreter_id_as_index = 0;
39324static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED
void* dummy) {
39325 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
39326 if (interpreter_id == -1)
return -1;
39328 __Pyx_ModuleStateLookup_Lock();
39329#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39330 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
39331 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
39333 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
39335 __Pyx_ModuleStateLookupData *new_data = old_data;
39337 new_data = (__Pyx_ModuleStateLookupData *)calloc(1,
sizeof(__Pyx_ModuleStateLookupData));
39343 new_data->allocated = 1;
39344 new_data->interpreter_id_as_index = 1;
39346 __Pyx_ModuleStateLookup_wait_until_no_readers();
39347 if (new_data->interpreter_id_as_index) {
39348 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
39349 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
39352 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
39355 Py_ssize_t insert_at = 0;
39357 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
39358 new_data->table, new_data->count, interpreter_id);
39359 assert(lower_bound);
39360 insert_at = lower_bound - new_data->table;
39361 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
39362 lower_bound->module =
module;
39366 if (new_data->count+1 >= new_data->allocated) {
39367 Py_ssize_t to_allocate = (new_data->count+1)*2;
39369 (__Pyx_ModuleStateLookupData*)realloc(
39371 sizeof(__Pyx_ModuleStateLookupData) +
39372 (to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
39375 new_data = old_data;
39379 new_data->allocated = to_allocate;
39382 int64_t last_id = interpreter_id;
39383 PyObject *last_module =
module;
39384 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
39385 int64_t current_id = new_data->table[i].id;
39386 new_data->table[i].id = last_id;
39387 last_id = current_id;
39388 PyObject *current_module = new_data->table[i].module;
39389 new_data->table[i].module = last_module;
39390 last_module = current_module;
39394#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39395 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
39397 __Pyx_ModuleStateLookup_data = new_data;
39399 __Pyx_ModuleStateLookup_Unlock();
39402static int __Pyx_State_RemoveModule(CYTHON_UNUSED
void* dummy) {
39403 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
39404 if (interpreter_id == -1)
return -1;
39405 __Pyx_ModuleStateLookup_Lock();
39406#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39407 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
39408 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
39410 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
39412 if (data->interpreter_id_as_index) {
39413 if (interpreter_id < data->count) {
39414 data->table[interpreter_id].module = NULL;
39419 __Pyx_ModuleStateLookup_wait_until_no_readers();
39420 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
39421 data->table, data->count, interpreter_id);
39422 if (!lower_bound)
goto done;
39423 if (lower_bound->id != interpreter_id)
goto done;
39424 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
39425 for (;lower_bound<end-1; ++lower_bound) {
39426 lower_bound->id = (lower_bound+1)->
id;
39427 lower_bound->module = (lower_bound+1)->module;
39431 if (data->count == 0) {
39436#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39437 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
39439 __Pyx_ModuleStateLookup_data = data;
39441 __Pyx_ModuleStateLookup_Unlock();
39448#pragma warning( pop )
void asm_NR_prepare(SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots)
void gauss_seidel_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
void asm_NR_solve(SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots)
void nl_gauss_seidel_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
void gauss_seidel_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
void basm_NR_prepare(int rowBlocks, int N, SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
void basm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots, PROTEUS_LAPACK_INTEGER **subdomain_col_pivots)
void nl_jacobi_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
void basm_NR_solve(int rowBlocks, int N, SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
void jacobi_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
void asm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots)
int basm_NR_init(int rowBlocks, SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p, PROTEUS_LAPACK_INTEGER ***subdomain_col_pivots_p)
int asm_NR_init(SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p)
void jacobi_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
C implementations of multilevel smoother algorithms.