29#ifndef PY_SSIZE_T_CLEAN
30#define PY_SSIZE_T_CLEAN
33#if defined(Py_LIMITED_API)
34 #if !defined(CYTHON_LIMITED_API)
35 #define CYTHON_LIMITED_API 1
37#elif defined(CYTHON_LIMITED_API)
39 #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.")
41 #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.
47 #error Python headers needed to compile C extensions, please install development version of Python.
48#elif PY_VERSION_HEX < 0x03090000
49 #error Cython requires Python 3.9+.
50#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
51 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
53#define __PYX_ABI_VERSION "3_3_0"
54#define CYTHON_HEX_VERSION 0x030300F0
55#define CYTHON_FUTURE_DIVISION 1
59 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
61#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
73 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
75 #define __Pyx_has_cbuiltin(name) (0)
78 #define DL_IMPORT(t) t
81 #define DL_EXPORT(t) t
85 #define PY_LONG_LONG LONG_LONG
88 #define Py_HUGE_VAL HUGE_VAL
90#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
91#if defined(CYTHON_LIMITED_API)
93 #undef __PYX_LIMITED_VERSION_HEX
94 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
95 #if Py_LIMITED_API < 0x03090000
96 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
99 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
101 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
102 code for PyPy and GraalPy and is unlikely to work.")
104 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
105 code for PyPy and GraalPy and is unlikely to work."
108 #define CYTHON_COMPILING_IN_PYPY 0
109 #define CYTHON_COMPILING_IN_CPYTHON 0
110 #define CYTHON_COMPILING_IN_LIMITED_API 1
111 #define CYTHON_COMPILING_IN_GRAAL 0
112 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
113 #undef CYTHON_USE_TYPE_SLOTS
114 #define CYTHON_USE_TYPE_SLOTS 0
115 #undef CYTHON_USE_TYPE_SPECS
116 #define CYTHON_USE_TYPE_SPECS 1
117 #undef CYTHON_USE_PYTYPE_LOOKUP
118 #define CYTHON_USE_PYTYPE_LOOKUP 0
119 #undef CYTHON_USE_PYLIST_INTERNALS
120 #define CYTHON_USE_PYLIST_INTERNALS 0
121 #undef CYTHON_USE_UNICODE_INTERNALS
122 #define CYTHON_USE_UNICODE_INTERNALS 0
123 #ifndef CYTHON_USE_UNICODE_WRITER
124 #define CYTHON_USE_UNICODE_WRITER 0
126 #undef CYTHON_USE_PYLONG_INTERNALS
127 #define CYTHON_USE_PYLONG_INTERNALS 0
128 #ifndef CYTHON_AVOID_BORROWED_REFS
129 #define CYTHON_AVOID_BORROWED_REFS 0
131 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
132 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
134 #undef CYTHON_ASSUME_SAFE_MACROS
135 #define CYTHON_ASSUME_SAFE_MACROS 0
136 #undef CYTHON_ASSUME_SAFE_SIZE
137 #define CYTHON_ASSUME_SAFE_SIZE 0
138 #undef CYTHON_UNPACK_METHODS
139 #define CYTHON_UNPACK_METHODS 0
140 #undef CYTHON_FAST_THREAD_STATE
141 #define CYTHON_FAST_THREAD_STATE 0
142 #undef CYTHON_FAST_GIL
143 #define CYTHON_FAST_GIL 0
144 #undef CYTHON_VECTORCALL
145 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
146 #ifndef CYTHON_VECTORCALL_TPNEW
147 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
149 #ifndef CYTHON_PEP487_INIT_SUBCLASS
150 #define CYTHON_PEP487_INIT_SUBCLASS 1
152 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
153 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
155 #ifndef CYTHON_USE_MODULE_STATE
156 #define CYTHON_USE_MODULE_STATE 0
158 #undef CYTHON_USE_SYS_MONITORING
159 #define CYTHON_USE_SYS_MONITORING 0
160 #ifndef CYTHON_USE_TP_FINALIZE
161 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
163 #ifndef CYTHON_USE_AM_SEND
164 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
166 #undef CYTHON_USE_DICT_VERSIONS
167 #define CYTHON_USE_DICT_VERSIONS 0
168 #undef CYTHON_USE_EXC_INFO_STACK
169 #define CYTHON_USE_EXC_INFO_STACK 0
170 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
171 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
173 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
174 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
176 #ifndef CYTHON_USE_FREELISTS
177 #define CYTHON_USE_FREELISTS 1
179 #undef CYTHON_IMMORTAL_CONSTANTS
180 #define CYTHON_IMMORTAL_CONSTANTS 0
181 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
182 #undef CYTHON_OPAQUE_OBJECTS
183 #define CYTHON_OPAQUE_OBJECTS 0
184 #elif !defined(CYTHON_OPAQUE_OBJECTS)
185 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
187#elif defined(GRAALVM_PYTHON)
190 #define CYTHON_COMPILING_IN_PYPY 0
191 #define CYTHON_COMPILING_IN_CPYTHON 0
192 #define CYTHON_COMPILING_IN_LIMITED_API 0
193 #define CYTHON_COMPILING_IN_GRAAL 1
194 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
195 #ifndef CYTHON_USE_TYPE_SLOTS
196 #define CYTHON_USE_TYPE_SLOTS 0
198 #undef CYTHON_USE_TYPE_SPECS
199 #define CYTHON_USE_TYPE_SPECS 0
200 #undef CYTHON_USE_PYTYPE_LOOKUP
201 #define CYTHON_USE_PYTYPE_LOOKUP 0
202 #undef CYTHON_USE_PYLIST_INTERNALS
203 #define CYTHON_USE_PYLIST_INTERNALS 0
204 #undef CYTHON_USE_UNICODE_INTERNALS
205 #define CYTHON_USE_UNICODE_INTERNALS 0
206 #undef CYTHON_USE_UNICODE_WRITER
207 #define CYTHON_USE_UNICODE_WRITER 0
208 #undef CYTHON_USE_PYLONG_INTERNALS
209 #define CYTHON_USE_PYLONG_INTERNALS 0
210 #undef CYTHON_AVOID_BORROWED_REFS
211 #define CYTHON_AVOID_BORROWED_REFS 1
212 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
213 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
214 #undef CYTHON_ASSUME_SAFE_MACROS
215 #define CYTHON_ASSUME_SAFE_MACROS 0
216 #undef CYTHON_ASSUME_SAFE_SIZE
217 #define CYTHON_ASSUME_SAFE_SIZE 0
218 #undef CYTHON_UNPACK_METHODS
219 #define CYTHON_UNPACK_METHODS 0
220 #undef CYTHON_FAST_THREAD_STATE
221 #define CYTHON_FAST_THREAD_STATE 0
222 #undef CYTHON_FAST_GIL
223 #define CYTHON_FAST_GIL 0
224 #ifndef CYTHON_VECTORCALL
225 #define CYTHON_VECTORCALL 1
227 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
228 #undef CYTHON_VECTORCALL_TPNEW
229 #define CYTHON_VECTORCALL_TPNEW 0
230 #elif !defined(CYTHON_VECTORCALL_TPNEW)
231 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
233 #ifndef CYTHON_PEP487_INIT_SUBCLASS
234 #define CYTHON_PEP487_INIT_SUBCLASS 1
236 #undef CYTHON_PEP489_MULTI_PHASE_INIT
237 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
238 #undef CYTHON_USE_MODULE_STATE
239 #define CYTHON_USE_MODULE_STATE 0
240 #undef CYTHON_USE_SYS_MONITORING
241 #define CYTHON_USE_SYS_MONITORING 0
242 #undef CYTHON_USE_TP_FINALIZE
243 #define CYTHON_USE_TP_FINALIZE 0
244 #undef CYTHON_USE_AM_SEND
245 #define CYTHON_USE_AM_SEND 0
246 #undef CYTHON_USE_DICT_VERSIONS
247 #define CYTHON_USE_DICT_VERSIONS 0
248 #undef CYTHON_USE_EXC_INFO_STACK
249 #define CYTHON_USE_EXC_INFO_STACK 1
250 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
251 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
253 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
254 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
256 #undef CYTHON_USE_FREELISTS
257 #define CYTHON_USE_FREELISTS 0
258 #undef CYTHON_IMMORTAL_CONSTANTS
259 #define CYTHON_IMMORTAL_CONSTANTS 0
260 #undef CYTHON_OPAQUE_OBJECTS
261 #define CYTHON_OPAQUE_OBJECTS 0
262#elif defined(PYPY_VERSION)
263 #define CYTHON_COMPILING_IN_PYPY 1
264 #define CYTHON_COMPILING_IN_CPYTHON 0
265 #define CYTHON_COMPILING_IN_LIMITED_API 0
266 #define CYTHON_COMPILING_IN_GRAAL 0
267 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
268 #undef CYTHON_USE_TYPE_SLOTS
269 #define CYTHON_USE_TYPE_SLOTS 1
270 #ifndef CYTHON_USE_TYPE_SPECS
271 #define CYTHON_USE_TYPE_SPECS 0
273 #undef CYTHON_USE_PYTYPE_LOOKUP
274 #define CYTHON_USE_PYTYPE_LOOKUP 0
275 #undef CYTHON_USE_PYLIST_INTERNALS
276 #define CYTHON_USE_PYLIST_INTERNALS 0
277 #undef CYTHON_USE_UNICODE_INTERNALS
278 #define CYTHON_USE_UNICODE_INTERNALS 0
279 #undef CYTHON_USE_UNICODE_WRITER
280 #define CYTHON_USE_UNICODE_WRITER 0
281 #undef CYTHON_USE_PYLONG_INTERNALS
282 #define CYTHON_USE_PYLONG_INTERNALS 0
283 #undef CYTHON_AVOID_BORROWED_REFS
284 #define CYTHON_AVOID_BORROWED_REFS 1
285 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
286 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
287 #undef CYTHON_ASSUME_SAFE_MACROS
288 #define CYTHON_ASSUME_SAFE_MACROS 0
289 #ifndef CYTHON_ASSUME_SAFE_SIZE
290 #define CYTHON_ASSUME_SAFE_SIZE 1
292 #undef CYTHON_UNPACK_METHODS
293 #define CYTHON_UNPACK_METHODS 0
294 #undef CYTHON_FAST_THREAD_STATE
295 #define CYTHON_FAST_THREAD_STATE 0
296 #undef CYTHON_FAST_GIL
297 #define CYTHON_FAST_GIL 0
298 #ifndef CYTHON_VECTORCALL
299 #define CYTHON_VECTORCALL 1
301 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
302 #undef CYTHON_VECTORCALL_TPNEW
303 #define CYTHON_VECTORCALL_TPNEW 0
304 #elif !defined(CYTHON_VECTORCALL_TPNEW)
305 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
307 #ifndef CYTHON_PEP487_INIT_SUBCLASS
308 #define CYTHON_PEP487_INIT_SUBCLASS 1
310 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
311 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
313 #undef CYTHON_USE_MODULE_STATE
314 #define CYTHON_USE_MODULE_STATE 0
315 #undef CYTHON_USE_SYS_MONITORING
316 #define CYTHON_USE_SYS_MONITORING 0
317 #ifndef CYTHON_USE_TP_FINALIZE
318 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
320 #undef CYTHON_USE_AM_SEND
321 #define CYTHON_USE_AM_SEND 0
322 #undef CYTHON_USE_DICT_VERSIONS
323 #define CYTHON_USE_DICT_VERSIONS 0
324 #undef CYTHON_USE_EXC_INFO_STACK
325 #define CYTHON_USE_EXC_INFO_STACK 0
326 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
327 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
329 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
330 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
332 #undef CYTHON_USE_FREELISTS
333 #define CYTHON_USE_FREELISTS 0
334 #undef CYTHON_IMMORTAL_CONSTANTS
335 #define CYTHON_IMMORTAL_CONSTANTS 0
336 #undef CYTHON_OPAQUE_OBJECTS
337 #define CYTHON_OPAQUE_OBJECTS 0
339 #define CYTHON_COMPILING_IN_PYPY 0
340 #define CYTHON_COMPILING_IN_CPYTHON 1
341 #define CYTHON_COMPILING_IN_LIMITED_API 0
342 #define CYTHON_COMPILING_IN_GRAAL 0
343 #ifdef Py_GIL_DISABLED
344 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
346 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
348 #if PY_VERSION_HEX < 0x030A0000
349 #undef CYTHON_USE_TYPE_SLOTS
350 #define CYTHON_USE_TYPE_SLOTS 1
351 #elif !defined(CYTHON_USE_TYPE_SLOTS)
352 #define CYTHON_USE_TYPE_SLOTS 1
354 #ifndef CYTHON_USE_TYPE_SPECS
355 #define CYTHON_USE_TYPE_SPECS 0
357 #ifndef CYTHON_USE_PYTYPE_LOOKUP
358 #define CYTHON_USE_PYTYPE_LOOKUP 1
360 #ifndef CYTHON_USE_PYLONG_INTERNALS
361 #define CYTHON_USE_PYLONG_INTERNALS 1
363 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
364 #undef CYTHON_USE_PYLIST_INTERNALS
365 #define CYTHON_USE_PYLIST_INTERNALS 0
366 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
367 #define CYTHON_USE_PYLIST_INTERNALS 1
369 #ifndef CYTHON_USE_UNICODE_INTERNALS
370 #define CYTHON_USE_UNICODE_INTERNALS 1
372 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
373 #undef CYTHON_USE_UNICODE_WRITER
374 #define CYTHON_USE_UNICODE_WRITER 0
375 #elif !defined(CYTHON_USE_UNICODE_WRITER)
376 #define CYTHON_USE_UNICODE_WRITER 1
378 #ifndef CYTHON_AVOID_BORROWED_REFS
379 #define CYTHON_AVOID_BORROWED_REFS 0
381 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
382 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
383 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
384 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
385 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
387 #ifndef CYTHON_ASSUME_SAFE_MACROS
388 #define CYTHON_ASSUME_SAFE_MACROS 1
390 #ifndef CYTHON_ASSUME_SAFE_SIZE
391 #define CYTHON_ASSUME_SAFE_SIZE 1
393 #ifndef CYTHON_UNPACK_METHODS
394 #define CYTHON_UNPACK_METHODS 1
396 #ifndef CYTHON_FAST_THREAD_STATE
397 #define CYTHON_FAST_THREAD_STATE 1
399 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
400 #undef CYTHON_FAST_GIL
401 #define CYTHON_FAST_GIL 0
402 #elif !defined(CYTHON_FAST_GIL)
403 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
405 #ifndef CYTHON_VECTORCALL
406 #define CYTHON_VECTORCALL 1
408 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
409 #undef CYTHON_VECTORCALL_TPNEW
410 #define CYTHON_VECTORCALL_TPNEW 0
411 #elif !defined(CYTHON_VECTORCALL_TPNEW)
412 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
414 #ifndef CYTHON_PEP487_INIT_SUBCLASS
415 #define CYTHON_PEP487_INIT_SUBCLASS 1
417 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
418 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
420 #ifndef CYTHON_USE_MODULE_STATE
421 #define CYTHON_USE_MODULE_STATE 0
423 #ifndef CYTHON_USE_SYS_MONITORING
424 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
426 #ifndef CYTHON_USE_TP_FINALIZE
427 #define CYTHON_USE_TP_FINALIZE 1
429 #ifndef CYTHON_USE_AM_SEND
430 #define CYTHON_USE_AM_SEND 1
432 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
433 #undef CYTHON_USE_DICT_VERSIONS
434 #define CYTHON_USE_DICT_VERSIONS 0
435 #elif !defined(CYTHON_USE_DICT_VERSIONS)
436 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
438 #ifndef CYTHON_USE_EXC_INFO_STACK
439 #define CYTHON_USE_EXC_INFO_STACK 1
441 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
442 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
444 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
445 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
447 #ifndef CYTHON_USE_FREELISTS
448 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
450 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
451 #undef CYTHON_IMMORTAL_CONSTANTS
452 #define CYTHON_IMMORTAL_CONSTANTS 0
453 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
454 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
456 #ifndef CYTHON_OPAQUE_OBJECTS
457 #define CYTHON_OPAQUE_OBJECTS 0
460#if CYTHON_USE_PYLONG_INTERNALS
465 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
468#ifndef __has_attribute
469 #define __has_attribute(x) 0
471#ifndef __has_cpp_attribute
472 #define __has_cpp_attribute(x) 0
474#ifndef CYTHON_RESTRICT
475 #if defined(__GNUC__)
476 #define CYTHON_RESTRICT __restrict__
477 #elif defined(_MSC_VER) && _MSC_VER >= 1400
478 #define CYTHON_RESTRICT __restrict
479 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
480 #define CYTHON_RESTRICT restrict
482 #define CYTHON_RESTRICT
486 #if defined(__cplusplus)
489 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
490 #if __has_cpp_attribute(maybe_unused)
491 #define CYTHON_UNUSED [[maybe_unused]]
494 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
495 #define CYTHON_UNUSED [[maybe_unused]]
499# if defined(__GNUC__)
500# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
501# define CYTHON_UNUSED __attribute__ ((__unused__))
503# define CYTHON_UNUSED
505# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
506# define CYTHON_UNUSED __attribute__ ((__unused__))
508# define CYTHON_UNUSED
511#ifndef CYTHON_UNUSED_VAR
512# if defined(__cplusplus)
513 template<
class T>
void CYTHON_UNUSED_VAR(
const T& ) { }
515# define CYTHON_UNUSED_VAR(x) (void)(x)
518#ifndef CYTHON_MAYBE_UNUSED_VAR
519 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
521#ifndef CYTHON_NCP_UNUSED
522# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
523# define CYTHON_NCP_UNUSED
525# define CYTHON_NCP_UNUSED CYTHON_UNUSED
528#ifndef CYTHON_USE_CPP_STD_MOVE
529 #if defined(__cplusplus) && (\
530 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
531 #define CYTHON_USE_CPP_STD_MOVE 1
533 #define CYTHON_USE_CPP_STD_MOVE 0
536#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
538typedef uintptr_t __pyx_uintptr_t;
539#ifndef CYTHON_FALLTHROUGH
540 #if defined(__cplusplus)
543 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
544 #if __has_cpp_attribute(fallthrough)
545 #define CYTHON_FALLTHROUGH [[fallthrough]]
548 #ifndef CYTHON_FALLTHROUGH
549 #if __has_cpp_attribute(clang::fallthrough)
550 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
551 #elif __has_cpp_attribute(gnu::fallthrough)
552 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
556 #ifndef CYTHON_FALLTHROUGH
557 #if __has_attribute(fallthrough)
558 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
560 #define CYTHON_FALLTHROUGH
563 #if defined(__clang__) && defined(__apple_build_version__)
564 #if __apple_build_version__ < 7000000
565 #undef CYTHON_FALLTHROUGH
566 #define CYTHON_FALLTHROUGH
571 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
572#elif __Pyx_has_cbuiltin(__builtin_unreachable)
573 #define __Pyx_UNREACHABLE() __builtin_unreachable()
574#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
575 #define __Pyx_UNREACHABLE() __builtin_unreachable()
576#elif defined(_MSC_VER)
577 #define __Pyx_UNREACHABLE() __assume(0)
579 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
581#ifndef Py_UNREACHABLE
582 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
585 template <
typename T>
586 struct __PYX_IS_UNSIGNED_IMPL {
static const bool value =
T(0) <
T(-1);};
587 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
589 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
591#if CYTHON_COMPILING_IN_PYPY == 1
592 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
594 #define __PYX_NEED_TP_PRINT_SLOT 0
596#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
597#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
598#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
599#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
601#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
602#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
607 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
610 #if defined(__clang__)
611 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
613 #define CYTHON_INLINE inline
617void __Pyx_call_destructor(
T& x) {
621class __Pyx_FakeReference {
623 __Pyx_FakeReference() : ptr(NULL) { }
624 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<
T*>(&ref)) { }
625 T *operator->() {
return ptr; }
626 T *operator&() {
return ptr; }
627 operator T&() {
return *ptr; }
628 template<
typename U>
bool operator ==(
const U& other)
const {
return *ptr == other; }
629 template<
typename U>
bool operator !=(
const U& other)
const {
return *ptr != other; }
630 template<
typename U>
bool operator==(
const __Pyx_FakeReference<U>& other)
const {
return *ptr == *other.ptr; }
631 template<
typename U>
bool operator!=(
const __Pyx_FakeReference<U>& other)
const {
return *ptr != *other.ptr; }
637#define __PYX_BUILD_PY_SSIZE_T "n"
638#define CYTHON_FORMAT_SSIZE_T "z"
639#define __Pyx_BUILTIN_MODULE_NAME "builtins"
640#define __Pyx_DefaultClassType PyType_Type
641#if CYTHON_COMPILING_IN_LIMITED_API
643 static int CO_OPTIMIZED;
646 static int CO_NEWLOCALS;
649 static int CO_VARARGS;
651 #ifndef CO_VARKEYWORDS
652 static int CO_VARKEYWORDS;
654 #ifndef CO_ASYNC_GENERATOR
655 static int CO_ASYNC_GENERATOR;
658 static int CO_GENERATOR;
661 static int CO_COROUTINE;
665 #define CO_COROUTINE 0x80
667 #ifndef CO_ASYNC_GENERATOR
668 #define CO_ASYNC_GENERATOR 0x200
671static int __Pyx_init_co_variables(
void);
672#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
673 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
675 #define __Pyx_Py_Is(x, y) ((x) == (y))
677#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
678 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
680 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
682#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
683 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
685 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
687#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
688 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
690 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
692#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
693#if CYTHON_COMPILING_IN_PYPY
694 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
696 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
698#if CYTHON_COMPILING_IN_LIMITED_API
699static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
700static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
702#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
703#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
705static int __Pyx_init_tpflags_variables(
void);
706#ifndef Py_TPFLAGS_HAVE_FINALIZE
707 #define Py_TPFLAGS_HAVE_FINALIZE 0
709#ifndef Py_TPFLAGS_SEQUENCE
710 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
712#ifndef Py_TPFLAGS_MAPPING
713 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
715#ifndef Py_TPFLAGS_IMMUTABLETYPE
716 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
718#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
719 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
721#ifndef METH_STACKLESS
722 #define METH_STACKLESS 0
724#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
725 #ifndef METH_FASTCALL
726 #define METH_FASTCALL 0x80
728 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *
const *args, Py_ssize_t nargs);
729 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *
const *args,
730 Py_ssize_t nargs, PyObject *kwnames);
732 #if PY_VERSION_HEX >= 0x030d00A4
733 # define __Pyx_PyCFunctionFast PyCFunctionFast
734 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
736 # define __Pyx_PyCFunctionFast _PyCFunctionFast
737 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
741 #define __Pyx_METH_FASTCALL METH_FASTCALL
742 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
743 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
745 #define __Pyx_METH_FASTCALL METH_VARARGS
746 #define __Pyx_PyCFunction_FastCall PyCFunction
747 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
750 #define __pyx_vectorcallfunc vectorcallfunc
751 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
752 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
754 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
755 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
757#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
758#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
759#if CYTHON_COMPILING_IN_CPYTHON
760#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
761#elif !CYTHON_COMPILING_IN_LIMITED_API
762#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
764#if CYTHON_COMPILING_IN_CPYTHON
765#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
766static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
767 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
770static CYTHON_INLINE
int __Pyx__IsSameCFunction(PyObject *func,
void (*cfunc)(
void)) {
771#if CYTHON_COMPILING_IN_LIMITED_API
772 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
774 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
777#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
778#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
779 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
781 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
783#if CYTHON_COMPILING_IN_PYPY
784 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *
const *, size_t, PyObject *);
786 #define __Pyx_PyCMethod PyCMethod
789 #define METH_METHOD 0x200
791#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
792 #define PyObject_Malloc(s) PyMem_Malloc(s)
793 #define PyObject_Free(p) PyMem_Free(p)
794 #define PyObject_Realloc(p) PyMem_Realloc(p)
796#if CYTHON_COMPILING_IN_LIMITED_API
797 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
798#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
799 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
800 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
801#elif CYTHON_COMPILING_IN_GRAAL
802 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
803 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
805 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
806 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
808#if CYTHON_COMPILING_IN_LIMITED_API
809 #define __Pyx_PyThreadState_Current PyThreadState_Get()
810#elif !CYTHON_FAST_THREAD_STATE
811 #define __Pyx_PyThreadState_Current PyThreadState_GET()
812#elif PY_VERSION_HEX >= 0x030d00A1
813 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
815 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
817#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
818 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
819 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
820 #define CYTHON_OPAQUE_SHARED_TYPES 1
822 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
823 #define __PYX_SHARED_RELATIVE_OFFSET 0
824 #define CYTHON_OPAQUE_SHARED_TYPES 0
826#if CYTHON_USE_MODULE_STATE
827static CYTHON_INLINE
void *__Pyx__PyModule_GetState(PyObject *op)
830 result = PyModule_GetState(op);
832 Py_FatalError(
"Couldn't find the module state");
835#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
837#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
839#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
840#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
841#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
842#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
843#if CYTHON_USE_TYPE_SLOTS
844 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
845 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
846 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
847 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
849 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
850 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
851 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
852 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
853 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
854 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
855 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
857#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
858#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
860#define __Pyx_PyDict_NewPresized(n) PyDict_New()
862#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
863#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
864#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
865#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
866static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
867 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
868 if (res == NULL && PyErr_Occurred()) {
869 PyErr_WriteUnraisable(NULL);
873#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
874#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
875#define __Pyx_PyDict_GetItemStr PyDict_GetItem
877static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
878#if CYTHON_COMPILING_IN_PYPY
879 return PyDict_GetItem(dict, name);
882 PyDictObject *mp = (PyDictObject*) dict;
883 long hash = ((PyStringObject *) name)->ob_shash;
885 ep = (mp->ma_lookup)(mp, name, hash);
892#define __Pyx_PyDict_GetItemStr PyDict_GetItem
894#if CYTHON_USE_TYPE_SLOTS
895 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
896 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
898 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
899 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
901#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
902#if CYTHON_USE_TYPE_SPECS
903#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
904 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
905 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
906 PyObject_GC_Del(obj);\
910#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
912#if CYTHON_COMPILING_IN_LIMITED_API
913 #define __Pyx_PyUnicode_READY(op) (0)
914 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
915 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
916 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
917 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
918 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
919 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
920 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
922 #if PY_VERSION_HEX >= 0x030C0000
923 #define __Pyx_PyUnicode_READY(op) (0)
925 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
926 0 : _PyUnicode_Ready((PyObject *)(op)))
928 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
929 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
930 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
931 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
932 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
933 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
934 #if PY_VERSION_HEX >= 0x030C0000
935 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
937 #if CYTHON_COMPILING_IN_CPYTHON
938 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
940 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
943 static CYTHON_INLINE
int __Pyx_PyUnicode_KIND_04(PyObject *o) {
944 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
947#if CYTHON_COMPILING_IN_PYPY
948 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
949 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
951 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
952 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
953 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
955#if CYTHON_COMPILING_IN_PYPY
956 #if !defined(PyUnicode_DecodeUnicodeEscape)
957 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
959 #if !defined(PyUnicode_Contains)
960 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
962 #if !defined(PyByteArray_Check)
963 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
965 #if !defined(PyObject_Format)
966 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
969#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
970#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
971 #define __Pyx_PySequence_ListKeepNew(obj)\
972 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
973#elif CYTHON_COMPILING_IN_CPYTHON
974 #define __Pyx_PySequence_ListKeepNew(obj)\
975 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
977 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
979#ifndef PySet_CheckExact
980 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
982enum __Pyx_ReferenceSharing {
983 __Pyx_ReferenceSharing_DefinitelyUnique,
984 __Pyx_ReferenceSharing_OwnStrongReference,
985 __Pyx_ReferenceSharing_FunctionArgument,
986 __Pyx_ReferenceSharing_SharedReference,
988#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
989#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
990 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
991 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
992 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
993#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
994#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
996#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
998#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
999 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1000#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1001 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1002 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1004 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1006#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1007 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1009 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1010 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1012#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1013 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1014 __Pyx_PyList_GetItemRef(o, i))
1015#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1016 #if CYTHON_ASSUME_SAFE_MACROS
1017 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1018 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1019 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1021 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1022 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1023 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1025#elif CYTHON_ASSUME_SAFE_MACROS
1026 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1027 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1029 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1030 __Pyx_XNewRef(PyList_GetItem(o, i)))
1032#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1033#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1034#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1035static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1036 *result = PyObject_GetItem(dict, key);
1037 if (*result == NULL) {
1038 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1047static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1048 *result = PyDict_GetItemWithError(dict, key);
1049 if (*result == NULL) {
1050 return PyErr_Occurred() ? -1 : 0;
1056#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1057 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1059 #define __Pyx_VISIT_CONST(obj)
1061#if CYTHON_ASSUME_SAFE_MACROS
1062 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1063 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1064 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1065 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1066 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1067 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1069 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1070 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1071 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1072 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1073 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1074 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1076#if CYTHON_ASSUME_SAFE_SIZE
1077 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1078 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1079 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1080 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1081 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1082 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1083 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1085 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1086 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1087 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1088 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1089 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1090 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1091 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1093#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1094 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1096#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1097#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1098#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1099 #define __Pyx_PySendResult PySendResult
1105 } __Pyx_PySendResult;
1107#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1108 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1110 #define __Pyx_pyiter_sendfunc sendfunc
1112#if !CYTHON_USE_AM_SEND
1113#define __PYX_HAS_PY_AM_SEND 0
1114#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1115#define __PYX_HAS_PY_AM_SEND 1
1117#define __PYX_HAS_PY_AM_SEND 2
1119#if __PYX_HAS_PY_AM_SEND < 2
1120 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1126 __Pyx_pyiter_sendfunc am_send;
1127 } __Pyx_PyAsyncMethodsStruct;
1128 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1130#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1131 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1133 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1135#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1139PyAPI_FUNC(
void *) PyMem_Calloc(
size_t nelem,
size_t elsize);
1141#if CYTHON_COMPILING_IN_LIMITED_API
1142static int __Pyx_init_co_variable(PyObject *inspect,
const char* name,
int *write_to) {
1144 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1145 if (!py_value)
return 0;
1146 value = (int) PyLong_AsLong(py_value);
1147 Py_DECREF(py_value);
1149 return value != -1 || !PyErr_Occurred();
1151static int __Pyx_init_co_variables(
void) {
1154 inspect = PyImport_ImportModule(
"inspect");
1156#if !defined(CO_OPTIMIZED)
1157 __Pyx_init_co_variable(inspect,
"CO_OPTIMIZED", &CO_OPTIMIZED) &&
1159#if !defined(CO_NEWLOCALS)
1160 __Pyx_init_co_variable(inspect,
"CO_NEWLOCALS", &CO_NEWLOCALS) &&
1162#if !defined(CO_VARARGS)
1163 __Pyx_init_co_variable(inspect,
"CO_VARARGS", &CO_VARARGS) &&
1165#if !defined(CO_VARKEYWORDS)
1166 __Pyx_init_co_variable(inspect,
"CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1168#if !defined(CO_ASYNC_GENERATOR)
1169 __Pyx_init_co_variable(inspect,
"CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1171#if !defined(CO_GENERATOR)
1172 __Pyx_init_co_variable(inspect,
"CO_GENERATOR", &CO_GENERATOR) &&
1174#if !defined(CO_COROUTINE)
1175 __Pyx_init_co_variable(inspect,
"CO_COROUTINE", &CO_COROUTINE) &&
1179 return result ? 0 : -1;
1181static int __Pyx_init_tpflags_bitcount(
unsigned long flag) {
1184 count += (int) (flag & 1);
1189static int __Pyx_init_tpflags_variables(
void) {
1190 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1193 PyObject *collections_abc = PyImport_ImportModule(
"collections.abc");
1194 if (!collections_abc)
return -1;
1196 PyObject *sequence = NULL, *mapping = NULL;
1197#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1198 if (PyObject_GetOptionalAttrString(collections_abc,
"Sequence", &sequence) != 1)
goto fail;
1199 if (PyObject_GetOptionalAttrString(collections_abc,
"Mapping", &mapping) != 1)
goto fail;
1201 sequence = PyObject_GetAttrString(collections_abc,
"Sequence");
1202 if (!sequence)
goto fail_attr_lookup;
1203 mapping = PyObject_GetAttrString(collections_abc,
"Mapping");
1204 if (!mapping)
goto fail_attr_lookup;
1206 if (!PyType_Check(sequence) || !PyType_Check(mapping))
goto fail;
1208 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1209 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1210 unsigned long mutual_flags = sequence_flags & mapping_flags;
1211 sequence_flags = sequence_flags ^ mutual_flags;
1212 mapping_flags = mapping_flags ^ mutual_flags;
1213 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1214 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1216 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1217 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1221 Py_XDECREF(mapping);
1222 Py_XDECREF(sequence);
1223 Py_DECREF(collections_abc);
1225#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1227 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1232 result = PyErr_Occurred() ? -1 : 0;
1236static int __Pyx_init_co_variables(
void) {
1239static int __Pyx_init_tpflags_variables(
void) {
1245#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1246 #ifndef _USE_MATH_DEFINES
1247 #define _USE_MATH_DEFINES
1251#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1252#define __Pyx_truncl trunc
1254#define __Pyx_truncl truncl
1257#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1258#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1260#ifndef CYTHON_CLINE_IN_TRACEBACK
1261#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1263#if CYTHON_CLINE_IN_TRACEBACK
1264#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; }
1266#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; }
1268#define __PYX_ERR(f_index, lineno, Ln_error) \
1269 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1271#ifdef CYTHON_EXTERN_C
1272 #undef __PYX_EXTERN_C
1273 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1274#elif defined(__PYX_EXTERN_C)
1276 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1278 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1281 #define __PYX_EXTERN_C extern "C++"
1284#define __PYX_HAVE__csparsity
1285#define __PYX_HAVE_API__csparsity
1293#include "numpy/arrayobject.h"
1294#include "numpy/ndarrayobject.h"
1295#include "numpy/ndarraytypes.h"
1296#include "numpy/arrayscalars.h"
1297#include "numpy/ufuncobject.h"
1298#include "pythread.h"
1300 typedef int (*__pyx_memoryview_to_dtype_func_type)(
char*, PyObject*);
1307#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1308#define CYTHON_WITHOUT_ASSERTIONS
1311#ifdef CYTHON_FREETHREADING_COMPATIBLE
1312#if CYTHON_FREETHREADING_COMPATIBLE
1313#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1315#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1318#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1320#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1321#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1322#define __PYX_DEFAULT_STRING_ENCODING ""
1323#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1324#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1325#define __Pyx_uchar_cast(c) ((unsigned char)c)
1326#define __Pyx_long_cast(x) ((long)x)
1327#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1328 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1329 (sizeof(type) > sizeof(Py_ssize_t) &&\
1330 likely(v < (type)PY_SSIZE_T_MAX ||\
1331 v == (type)PY_SSIZE_T_MAX) &&\
1332 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1333 v == (type)PY_SSIZE_T_MIN))) ||\
1334 (sizeof(type) == sizeof(Py_ssize_t) &&\
1335 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1336 v == (type)PY_SSIZE_T_MAX))) )
1337static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1338 return (
size_t) i < (size_t) limit;
1340#if defined (__cplusplus) && __cplusplus >= 201103L
1342 #define __Pyx_sst_abs(value) std::abs(value)
1343#elif SIZEOF_INT >= SIZEOF_SIZE_T
1344 #define __Pyx_sst_abs(value) abs(value)
1345#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1346 #define __Pyx_sst_abs(value) labs(value)
1347#elif defined (_MSC_VER)
1348 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1349#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1350 #define __Pyx_sst_abs(value) llabs(value)
1351#elif defined (__GNUC__)
1352 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1354 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1356static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s);
1357static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
1358static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1359static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char*);
1360#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1361#define __Pyx_PyBytes_FromString PyBytes_FromString
1362#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1363static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
1364#if CYTHON_ASSUME_SAFE_MACROS
1365 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1366 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1367 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1368 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1369 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1370 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1371 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1373 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1374 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1375 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1376 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1377 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1378 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1379 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1381#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1382#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1383#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1384#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1385#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1386#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1387#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1388#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1389#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1390#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1391#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1392static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1393#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1394 return Py_NewRef(obj);
1400static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1401#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1402 return Py_XNewRef(obj);
1408static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b);
1409static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1410static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1411static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1412static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1413#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1414#define __Pyx_PySequence_Tuple(obj)\
1415 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1416static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1417static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t);
1418static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1419#if CYTHON_ASSUME_SAFE_MACROS
1420#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1421#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1422#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1424#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1425#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1426#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1428#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1429#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1430#if CYTHON_USE_PYLONG_INTERNALS
1431 #if PY_VERSION_HEX >= 0x030C00A7
1432 #ifndef _PyLong_SIGN_MASK
1433 #define _PyLong_SIGN_MASK 3
1435 #ifndef _PyLong_NON_SIZE_BITS
1436 #define _PyLong_NON_SIZE_BITS 3
1438 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1439 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1440 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1441 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1442 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1443 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1444 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1445 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1446 #define __Pyx_PyLong_SignedDigitCount(x)\
1447 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1448 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1449 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1450 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1452 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1453 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1455 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1456 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1457 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1458 if (tag_a == tag_b)
return 0;
1459 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1460 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1461 if (sign_a > sign_b)
return -1;
1462 if (sign_a < sign_b)
return 1;
1463 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1464 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1465 return (1 - sign_a) * (size_a - size_b);
1467 typedef Py_ssize_t __Pyx_compact_pylong;
1468 typedef size_t __Pyx_compact_upylong;
1470 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1471 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1472 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1473 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1474 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1475 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1476 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1477 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1478 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1479 #define __Pyx_PyLong_CompactValue(x)\
1480 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1481 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1482 typedef sdigit __Pyx_compact_pylong;
1483 typedef digit __Pyx_compact_upylong;
1485 #if PY_VERSION_HEX >= 0x030C00A5
1486 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1488 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1490 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1492 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1494#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1495 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1496#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1497 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1499 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1504#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1505 #define likely(x) __builtin_expect(!!(x), 1)
1506 #define unlikely(x) __builtin_expect(!!(x), 0)
1508 #define likely(x) (x)
1509 #define unlikely(x) (x)
1513#if __cplusplus > 201103L
1514#include <type_traits>
1516template <
typename T>
1517static void __Pyx_pretend_to_initialize(
T* ptr) {
1518#if __cplusplus > 201103L
1519 if ((std::is_trivially_default_constructible<T>::value))
1525static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1529#if !CYTHON_USE_MODULE_STATE
1530static PyObject *__pyx_m = NULL;
1532static const char *
const __pyx_cfilenm = __FILE__;
1535#if !defined(CYTHON_CCOMPLEX)
1536 #if defined(__cplusplus)
1537 #define CYTHON_CCOMPLEX 1
1538 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1539 #define CYTHON_CCOMPLEX 1
1541 #define CYTHON_CCOMPLEX 0
1548 #include <complex.h>
1551#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1553 #define _Complex_I 1.0fj
1558static const char*
const __pyx_f[] = {
1559 "proteus/csparsity.pyx",
1561 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1566#include <pythread.h>
1567#ifndef CYTHON_ATOMICS
1568 #define CYTHON_ATOMICS 1
1570#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1571#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1572#define __pyx_atomic_int_type int
1573#define __pyx_nonatomic_int_type int
1574#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1575 (__STDC_VERSION__ >= 201112L) &&\
1576 !defined(__STDC_NO_ATOMICS__))
1577 #include <stdatomic.h>
1578#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1579 (__cplusplus >= 201103L) ||\
1580 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1583#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1584 (__STDC_VERSION__ >= 201112L) &&\
1585 !defined(__STDC_NO_ATOMICS__) &&\
1586 ATOMIC_INT_LOCK_FREE == 2)
1587 #undef __pyx_atomic_int_type
1588 #define __pyx_atomic_int_type atomic_int
1589 #define __pyx_atomic_ptr_type atomic_uintptr_t
1590 #define __pyx_nonatomic_ptr_type uintptr_t
1591 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1592 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1593 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1594 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1595 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1596 #define __pyx_atomic_load(value) atomic_load(value)
1597 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1598 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1599 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1600 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1601 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1602 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1603 #pragma message ("Using standard C atomics")
1604 #elif defined(__PYX_DEBUG_ATOMICS)
1605 #warning "Using standard C atomics"
1607#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1608 (__cplusplus >= 201103L) ||\
1610 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1611 ATOMIC_INT_LOCK_FREE == 2)
1612 #undef __pyx_atomic_int_type
1613 #define __pyx_atomic_int_type std::atomic_int
1614 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1615 #define __pyx_nonatomic_ptr_type uintptr_t
1616 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1617 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1618 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1619 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1620 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1621 #define __pyx_atomic_load(value) std::atomic_load(value)
1622 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1623 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1624 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1625 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1626 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1627 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1628 #pragma message ("Using standard C++ atomics")
1629 #elif defined(__PYX_DEBUG_ATOMICS)
1630 #warning "Using standard C++ atomics"
1632#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1633 (__GNUC_MINOR__ > 1 ||\
1634 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1635 #define __pyx_atomic_ptr_type void*
1636 #define __pyx_nonatomic_ptr_type void*
1637 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1638 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1639 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1640 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1641 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1642 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1643 int result = old == *expected;
1647 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1648 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1649 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1650 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1651 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1652 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1653 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1654 int result = old == *expected;
1658 #ifdef __PYX_DEBUG_ATOMICS
1659 #warning "Using GNU atomics"
1661#elif CYTHON_ATOMICS && defined(_MSC_VER)
1663 #undef __pyx_atomic_int_type
1664 #define __pyx_atomic_int_type long
1665 #define __pyx_atomic_ptr_type void*
1666 #undef __pyx_nonatomic_int_type
1667 #define __pyx_nonatomic_int_type long
1668 #define __pyx_nonatomic_ptr_type void*
1669 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1670 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1671 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1672 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1673 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1674 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1675 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1676 int result = old == *expected;
1680 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1681 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1682 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1683 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1684 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1685 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1686 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1687 int result = old == *expected;
1691 #ifdef __PYX_DEBUG_ATOMICS
1692 #pragma message ("Using MSVC atomics")
1695 #undef CYTHON_ATOMICS
1696 #define CYTHON_ATOMICS 0
1697 #ifdef __PYX_DEBUG_ATOMICS
1698 #warning "Not using atomics"
1703#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1704#define __Pyx_PyCriticalSection void*
1705#define __Pyx_PyCriticalSection2 void*
1706#define __Pyx_PyCriticalSection_End(cs)
1707#define __Pyx_PyCriticalSection2_End(cs)
1709#define __Pyx_PyCriticalSection PyCriticalSection
1710#define __Pyx_PyCriticalSection2 PyCriticalSection2
1711#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1712#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1716#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1717#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1718#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1720#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1721#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1723#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1724#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1725#define __Pyx_END_CRITICAL_SECTION() }
1727#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1728#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1732#ifndef __PYX_FORCE_INIT_THREADS
1733 #define __PYX_FORCE_INIT_THREADS 0
1737#define __Pyx_PyGILState_Ensure PyGILState_Ensure
1738#define __Pyx_PyGILState_Release PyGILState_Release
1739#define __Pyx_FastGIL_Remember()
1740#define __Pyx_FastGIL_Forget()
1741#define __Pyx_FastGilFuncInit()
1744#include <structmember.h>
1747struct __Pyx_StructField_;
1748#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1751 const struct __Pyx_StructField_* fields;
1753 size_t arraysize[8];
1759typedef struct __Pyx_StructField_ {
1760 const __Pyx_TypeInfo* type;
1765 const __Pyx_StructField* field;
1766 size_t parent_offset;
1767} __Pyx_BufFmt_StackElem;
1769 __Pyx_StructField root;
1770 __Pyx_BufFmt_StackElem* head;
1772 size_t new_count, enc_count;
1773 size_t struct_alignment;
1778 char is_valid_array;
1779} __Pyx_BufFmt_Context;
1782struct __pyx_memoryview_obj;
1784 struct __pyx_memoryview_obj *memview;
1786 Py_ssize_t shape[8];
1787 Py_ssize_t strides[8];
1788 Py_ssize_t suboffsets[8];
1789} __Pyx_memviewslice;
1790#define __Pyx_MemoryView_Len(m) (m.shape[0])
1791#define __Pyx_MEMVIEW_DIRECT 1
1792#define __Pyx_MEMVIEW_PTR 2
1793#define __Pyx_MEMVIEW_FULL 4
1794#define __Pyx_MEMVIEW_CONTIG 8
1795#define __Pyx_MEMVIEW_STRIDED 16
1796#define __Pyx_MEMVIEW_FOLLOW 32
1797#define __Pyx_IS_C_CONTIG 1
1798#define __Pyx_IS_F_CONTIG 2
1799#define __Pyx_MEMSLICE_INIT { 0, 0, { 0 }, { 0 }, { 0 } }
1801 #define __pyx_add_acquisition_count(memview)\
1802 __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
1803 #define __pyx_sub_acquisition_count(memview)\
1804 __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
1806 #define __pyx_add_acquisition_count(memview)\
1807 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1808 #define __pyx_sub_acquisition_count(memview)\
1809 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1821typedef npy_int8 __pyx_t_5numpy_int8_t;
1830typedef npy_int16 __pyx_t_5numpy_int16_t;
1839typedef npy_int32 __pyx_t_5numpy_int32_t;
1848typedef npy_int64 __pyx_t_5numpy_int64_t;
1857typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1866typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1875typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1884typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1893typedef npy_float32 __pyx_t_5numpy_float32_t;
1902typedef npy_float64 __pyx_t_5numpy_float64_t;
1911typedef npy_longlong __pyx_t_5numpy_longlong_t;
1920typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1929typedef npy_intp __pyx_t_5numpy_intp_t;
1938typedef npy_uintp __pyx_t_5numpy_uintp_t;
1947typedef npy_double __pyx_t_5numpy_float_t;
1956typedef npy_double __pyx_t_5numpy_double_t;
1965typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1968#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1970 typedef ::std::complex< float > __pyx_t_float_complex;
1972 typedef float _Complex __pyx_t_float_complex;
1975 typedef struct {
float real, imag; } __pyx_t_float_complex;
1977static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1980#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1982 typedef ::std::complex< double > __pyx_t_double_complex;
1984 typedef double _Complex __pyx_t_double_complex;
1987 typedef struct {
double real, imag; } __pyx_t_double_complex;
1989static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1992#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1994 typedef ::std::complex< long double > __pyx_t_long_double_complex;
1996 typedef long double _Complex __pyx_t_long_double_complex;
1999 typedef struct {
long double real, imag; } __pyx_t_long_double_complex;
2001static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double,
long double);
2006struct __pyx_obj_9csparsity_PySparsityInfo;
2007struct __pyx_array_obj;
2008struct __pyx_MemviewEnum_obj;
2009struct __pyx_memoryview_obj;
2010struct __pyx_memoryviewslice_obj;
2019struct __pyx_obj_9csparsity_PySparsityInfo {
2021 proteus::SparsityInfo cpp;
2032struct __pyx_array_obj {
2034 struct __pyx_vtabstruct_array *__pyx_vtab;
2040 Py_ssize_t *_strides;
2041 Py_ssize_t itemsize;
2044 void (*callback_free_data)(
void *);
2046 int dtype_is_object;
2057struct __pyx_MemviewEnum_obj {
2070struct __pyx_memoryview_obj {
2072 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2076 PyThread_type_lock lock;
2077 __pyx_atomic_int_type acquisition_count;
2080 int dtype_is_object;
2081 __Pyx_TypeInfo
const *typeinfo;
2092struct __pyx_memoryviewslice_obj {
2093 struct __pyx_memoryview_obj __pyx_base;
2094 __Pyx_memviewslice from_slice;
2095 PyObject *from_object;
2096 PyObject *(*to_object_func)(
char *);
2097 __pyx_memoryview_to_dtype_func_type to_dtype_func;
2110struct __pyx_vtabstruct_array {
2111 PyObject *(*get_memview)(
struct __pyx_array_obj *);
2113static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2124struct __pyx_vtabstruct_memoryview {
2125 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
2126 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
2127 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2128 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
2129 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2130 PyObject *(*setitem_indexed1)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2131 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
2132 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
2133 PyObject *(*_get_base)(
struct __pyx_memoryview_obj *);
2135static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2146struct __pyx_vtabstruct__memoryviewslice {
2147 struct __pyx_vtabstruct_memoryview __pyx_base;
2149static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2154#ifndef CYTHON_REFNANNY
2155 #define CYTHON_REFNANNY 0
2159 void (*INCREF)(
void*, PyObject*, Py_ssize_t);
2160 void (*DECREF)(
void*, PyObject*, Py_ssize_t);
2161 void (*GOTREF)(
void*, PyObject*, Py_ssize_t);
2162 void (*GIVEREF)(
void*, PyObject*, Py_ssize_t);
2163 void* (*SetupContext)(
const char*, Py_ssize_t,
const char*);
2164 void (*FinishContext)(
void**);
2165 } __Pyx_RefNannyAPIStruct;
2166 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2167 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
2168 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2169 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2171 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2172 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2173 PyGILState_Release(__pyx_gilstate_save);\
2175 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2177 #define __Pyx_RefNannyFinishContextNogil() {\
2178 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2179 __Pyx_RefNannyFinishContext();\
2180 PyGILState_Release(__pyx_gilstate_save);\
2182 #define __Pyx_RefNannyFinishContextNogil() {\
2183 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2184 __Pyx_RefNannyFinishContext();\
2185 PyGILState_Release(__pyx_gilstate_save);\
2187 #define __Pyx_RefNannyFinishContext()\
2188 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2189 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2190 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2191 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2192 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2193 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2194 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2195 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2196 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2198 #define __Pyx_RefNannyDeclarations
2199 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2200 #define __Pyx_RefNannyFinishContextNogil()
2201 #define __Pyx_RefNannyFinishContext()
2202 #define __Pyx_INCREF(r) Py_INCREF(r)
2203 #define __Pyx_DECREF(r) Py_DECREF(r)
2204 #define __Pyx_GOTREF(r)
2205 #define __Pyx_GIVEREF(r)
2206 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2207 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2208 #define __Pyx_XGOTREF(r)
2209 #define __Pyx_XGIVEREF(r)
2211#define __Pyx_Py_XDECREF_SET(r, v) do {\
2212 PyObject *tmp = (PyObject *) r;\
2213 r = v; Py_XDECREF(tmp);\
2215#define __Pyx_XDECREF_SET(r, v) do {\
2216 PyObject *tmp = (PyObject *) r;\
2217 r = v; __Pyx_XDECREF(tmp);\
2219#define __Pyx_DECREF_SET(r, v) do {\
2220 PyObject *tmp = (PyObject *) r;\
2221 r = v; __Pyx_DECREF(tmp);\
2223#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2224#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2227#if CYTHON_COMPILING_IN_CPYTHON
2228static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2232#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2233#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2235CYTHON_UNUSED
static PyObject *
2236__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n);
2246static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop);
2249#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2252#if CYTHON_AVOID_BORROWED_REFS
2253 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2254#elif CYTHON_ASSUME_SAFE_MACROS
2255 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2257 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2259#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2260#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2261#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2262#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2263#if CYTHON_VECTORCALL
2264 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2265 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2266 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2267 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s);
2268 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2269 CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues);
2271 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2274 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2275 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2276 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2277 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2278 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2280#if CYTHON_VECTORCALL_TPNEW
2281 #if !CYTHON_VECTORCALL
2282 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2284 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2285 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2286 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2287 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2288 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2290 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2291 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2292 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2293 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2294 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2296#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2297#if CYTHON_VECTORCALL
2298#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2300#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2304#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2305#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2306#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2307static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2310#define __Pyx_CallCFunction(cfunc, self, args)\
2311 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2312#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2313 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2314#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2315 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2316#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2317 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2320#if CYTHON_COMPILING_IN_CPYTHON
2321static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2323#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2327#if CYTHON_COMPILING_IN_CPYTHON
2328static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2332#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2333static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const*args,
size_t nargsf, PyObject *kwargs);
2336static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2341 PyObject **method_name;
2345#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2346 __pyx_atomic_int_type initialized;
2348} __Pyx_CachedCFunction;
2351static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2352#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2355#if CYTHON_COMPILING_IN_CPYTHON
2356#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2357#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2358static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2359static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2360#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2362#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2363#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2364#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2368#if CYTHON_USE_TYPE_SLOTS
2369static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2371#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2375static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2378#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2379static CYTHON_INLINE
int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2383 __pyx_nonatomic_int_type expected = 0;
2384 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2390static CYTHON_INLINE
void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2392 __pyx_atomic_store(&cfunc->initialized, 2);
2396#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2397#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2402static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2403#if CYTHON_COMPILING_IN_CPYTHON
2404static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2406#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2410#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2411#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2412#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2413static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2416#if CYTHON_AVOID_BORROWED_REFS
2417static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2420static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2424static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
2427static int __Pyx_ParseKeywordsTuple(
2429 PyObject *
const *kwvalues,
2430 PyObject **
const argnames[],
2433 Py_ssize_t num_pos_args,
2434 Py_ssize_t num_kwargs,
2435 const char* function_name,
2436 int ignore_unknown_kwargs
2438static int __Pyx_ParseKeywordDictToDict(
2440 PyObject **
const argnames[],
2443 Py_ssize_t num_pos_args,
2444 const char* function_name
2446static int __Pyx_ParseKeywordDict(
2448 PyObject **
const argnames[],
2450 Py_ssize_t num_pos_args,
2451 Py_ssize_t num_kwargs,
2452 const char* function_name,
2453 int ignore_unknown_kwargs
2458static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2459#if CYTHON_COMPILING_IN_CPYTHON
2460static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2462#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2466static CYTHON_INLINE
int __Pyx_ParseKeywords(
2467 PyObject *kwds, PyObject *
const *kwvalues, PyObject **
const argnames[],
2468 PyObject *kwds2, PyObject *values[],
2469 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2470 const char* function_name,
2471 int ignore_unknown_kwargs
2475static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
2476 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2479static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2482static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
const char *name,
int exact);
2485#if CYTHON_FAST_THREAD_STATE
2486#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2487#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2488#if PY_VERSION_HEX >= 0x030C00A6
2489#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2490#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2492#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2493#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2496#define __Pyx_PyThreadState_declare
2497#define __Pyx_PyThreadState_assign
2498#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2499#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2503#if CYTHON_FAST_THREAD_STATE
2504#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2505#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2506#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2507#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2508#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2509static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2510static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2511#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2512#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2514#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2517#define __Pyx_PyErr_Clear() PyErr_Clear()
2518#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2519#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2520#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2521#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2522#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2523#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2524#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2528#if CYTHON_COMPILING_IN_CPYTHON
2529static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2530static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2532#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2533static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2534 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2537#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2540#if CYTHON_FAST_THREAD_STATE
2541#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2542static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2544#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2548static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2551static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2554#if CYTHON_VECTORCALL
2555#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
2557static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *
const *args,
size_t nargsf);
2561#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2562typedef PyObject *__Pyx_TypeName;
2563#define __Pyx_FMT_TYPENAME "%N"
2564#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2565#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2566#elif CYTHON_COMPILING_IN_LIMITED_API
2567typedef PyObject *__Pyx_TypeName;
2568#define __Pyx_FMT_TYPENAME "%U"
2569#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2570static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2572typedef const char *__Pyx_TypeName;
2573#define __Pyx_FMT_TYPENAME "%.200s"
2574#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2575#define __Pyx_DECREF_TypeName(obj)
2579#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
2580#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
2582static void __Pyx_RaiseErrorWithType1(PyObject* exc_type,
const char* message,
const char *arg, PyTypeObject *type_obj);
2586static int __Pyx_RaiseUnexpectedTypeError(
const char *expected, PyObject *obj);
2589#define __Pyx_PyExc_MemoryError_Check(obj) __Pyx_TypeCheck(obj, PyExc_MemoryError)
2592static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2595#define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError)
2598static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength,
const char* chars,
int clength,
2599 int prepend_sign,
char padding_char);
2602static CYTHON_INLINE
int __Pyx_CheckUnicodeValue(
int value);
2603static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(
int value, Py_ssize_t width,
char padding_char);
2606#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2607#define __Pyx_HAS_GCC_DIAGNOSTIC
2614#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\
2615 ((format_char) == ('c')) ?\
2616 __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\
2617 __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\
2619static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(
int value, Py_ssize_t width,
char padding_char);
2620static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(
int value, Py_ssize_t width,
char padding_char,
char format_char);
2623#define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\
2624 ((format_char) == ('c')) ?\
2625 __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
2626 __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
2628static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width,
char padding_char);
2629static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width,
char padding_char,
char format_char);
2632#define __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH\
2633 (!CYTHON_COMPILING_IN_GRAAL && !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API)
2636static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
int kind);
2639#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
2640#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2641 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2642 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2643 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2646#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2647 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2648 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2649 (likely((s1_is_str) || PyUnicode_CheckExact(s1)) ?\
2650 __Pyx__PyUnicode_EqualsUCS4(s1, ch2, equals) :\
2651 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2653static CYTHON_INLINE
int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2,
int equals);
2657#define __Pyx_PyObject_Equals_obj_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 0)
2660static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2,
int pyop);
2663#if CYTHON_COMPILING_IN_PYPY
2664 #define __Pyx_PyObject_FormatSimple(s, f) (\
2665 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2666 PyObject_Format(s, f))
2667#elif CYTHON_USE_TYPE_SLOTS
2668 #define __Pyx_PyObject_FormatSimple(s, f) (\
2669 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2670 likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2671 likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2672 PyObject_Format(s, f))
2674 #define __Pyx_PyObject_FormatSimple(s, f) (\
2675 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2676 PyObject_Format(s, f))
2680static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2,
int pyop);
2682CYTHON_UNUSED
static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2684#define __Pyx_PyObject_Equals_str_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 1)
2686static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2688static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2691#if CYTHON_COMPILING_IN_LIMITED_API
2692#define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
2693#define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
2694static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
2695#define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
2696#define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
2697#define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
2698#define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
2699static CYTHON_INLINE
int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
2700 return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
2702#define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
2703static CYTHON_INLINE
int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
2704 return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
2706#elif PY_VERSION_HEX >= 0x030f00a6 ||\
2707 (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
2708#define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
2709#define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
2710#define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
2711#define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
2712#define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
2713#define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
2714#define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
2716#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
2717static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
2719 return PyDict_New();
2720 }
else if (PyDict_Check(it)) {
2721 return PyDict_Copy(it);
2723 PyObject *dict = PyDict_New();
2724 if (!dict)
return NULL;
2725 PyObject *result = PyNumber_InPlaceOr(dict, it);
2730#define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
2731#define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
2732#define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
2733#define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
2734#define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
2738#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2739 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2740 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2741 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
2742#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2743 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2744 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2745 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2746static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2747 int wraparound,
int boundscheck,
int unsafe_shared);
2748#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2749 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2750 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2751 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2752static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2753 int wraparound,
int boundscheck,
int unsafe_shared);
2754static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2755static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2756 int wraparound,
int boundscheck,
int unsafe_shared);
2759#define __Pyx_RaiseTypeErrorWithObjectType(message, obj) __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
2760#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj) __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
2762static void __Pyx_RaiseErrorWithType(PyObject* exc_type,
const char* message, PyTypeObject *type_obj);
2765#if CYTHON_USE_TYPE_SLOTS
2766static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2768#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2772static void __Pyx_RejectKeywords(
const char* function_name, PyObject *kwds);
2775#define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError)
2778static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t,
int b_is_constant);
2781#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2782 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2785static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2788#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2789#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2790#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2791#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2792 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2793 (cache_var) = (value);
2794#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2795 static PY_UINT64_T __pyx_dict_version = 0;\
2796 static PyObject *__pyx_dict_cached_value = NULL;\
2797 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2798 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2800 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2801 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2804static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2805static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2806static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2808#define __PYX_GET_DICT_VERSION(dict) (0)
2809#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2810#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2814#if CYTHON_USE_DICT_VERSIONS
2815#define __Pyx_GetModuleGlobalName(var, name) do {\
2816 static PY_UINT64_T __pyx_dict_version = 0;\
2817 static PyObject *__pyx_dict_cached_value = NULL;\
2818 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
2819 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2820 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2822#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2823 PY_UINT64_T __pyx_dict_version;\
2824 PyObject *__pyx_dict_cached_value;\
2825 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2827static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2829#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2830#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2831static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2835#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
2836 static int __pyx_assertions_enabled_flag;
2837 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2838 #if __clang__ || __GNUC__
2839 __attribute__((no_sanitize(
"thread")))
2841 static int __Pyx_init_assertions_enabled(
void) {
2842 PyObject *builtins, *debug, *debug_str;
2844 builtins = PyEval_GetBuiltins();
2845 if (!builtins)
goto bad;
2846 debug_str = PyUnicode_FromStringAndSize(
"__debug__", 9);
2847 if (!debug_str)
goto bad;
2848 debug = PyObject_GetItem(builtins, debug_str);
2849 Py_DECREF(debug_str);
2850 if (!debug)
goto bad;
2851 flag = PyObject_IsTrue(debug);
2853 if (flag == -1)
goto bad;
2854 __pyx_assertions_enabled_flag = flag;
2857 __pyx_assertions_enabled_flag = 1;
2861 #define __Pyx_init_assertions_enabled() (0)
2862 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2866#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
2869static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2872static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2875static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2878#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2879static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2883#if CYTHON_FAST_THREAD_STATE
2884#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2885static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2886#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2887static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2889#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2890#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2894#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
2895#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
2896#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
2898static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type,
const char *message,
const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
2901static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2904#if CYTHON_FAST_THREAD_STATE
2905#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2906static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2908static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2912#if CYTHON_FAST_THREAD_STATE
2913#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2914static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2916static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2920#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2921#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
2923static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2927CYTHON_UNUSED
static PyObject *
2928__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n);
2934static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level);
2937static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level);
2939CYTHON_UNUSED
static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2941static CYTHON_INLINE
int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x);
2944#define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
2945#if !CYTHON_USE_TYPE_SLOTS
2946#define __Pyx_PySequence_Multiply PySequence_Repeat
2948static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
2952#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2953#define __Pyx_PyNumber_Multiply_object_int(op1, op2) PyNumber_Multiply(op1, op2)
2954#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
2956#define __Pyx_PyNumber_Multiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 0)
2957#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 1)
2958static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2,
int inplace);
2962static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject*
s, PyObject*
f);
2963static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject*
s, PyObject*
f);
2966#if CYTHON_USE_UNICODE_WRITER
2967static PyObject* __Pyx_PyObject_Format(PyObject*
s, PyObject*
f);
2969#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
2973#define __Pyx_PyObject_Unicode(obj)\
2974 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2977#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2978 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2979 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, wraparound, boundscheck, unsafe_shared) :\
2980 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
2981static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v);
2982static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *
v,
2983 int wraparound,
int boundscheck,
int unsafe_shared);
2986static void __Pyx_RaiseUnboundLocalError(
const char *varname);
2989static CYTHON_INLINE
long __Pyx_div_long(
long,
long,
int b_is_constant);
2992#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
2993static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x);
2995#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2999static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3002static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
3005#define __Pyx_PyUnicode_From_size_t(value, width, padding_char, format_char) (\
3006 ((format_char) == ('c')) ?\
3007 __Pyx_uchar___Pyx_PyUnicode_From_size_t(value, width, padding_char) :\
3008 __Pyx____Pyx_PyUnicode_From_size_t(value, width, padding_char, format_char)\
3010static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_size_t(
size_t value, Py_ssize_t width,
char padding_char);
3011static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_size_t(
size_t value, Py_ssize_t width,
char padding_char,
char format_char);
3014#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3017#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
3022void __Pyx_default_placement_construct(
T* x) {
3023 new (
static_cast<void*
>(x))
T();
3027static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t,
int is_final);
3030#if CYTHON_VECTORCALL_TPNEW
3031typedef PyObject * (*__Pyx_tpnewvectorcallfunc)(PyTypeObject* o, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames);
3032static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc
f, PyTypeObject* o, PyObject *a, PyObject *k);
3036#if CYTHON_VECTORCALL_TPNEW
3037static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3041#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3042#define __Pyx_DeallocKeepAliveBegin(o) do {\
3043 _Py_atomic_store_uintptr_relaxed(&(o)->ob_tid, _Py_ThreadId());\
3044 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 1);\
3045 _Py_atomic_store_ssize_relaxed(&(o)->ob_ref_shared, 0);\
3047#define __Pyx_DeallocKeepAliveEnd(o)\
3048 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 0)
3050#define __Pyx_DeallocKeepAliveBegin(o) Py_SET_REFCNT(o, Py_REFCNT(o) + 1)
3051#define __Pyx_DeallocKeepAliveEnd(o) Py_SET_REFCNT(o, Py_REFCNT(o) - 1)
3055#if CYTHON_VECTORCALL_TPNEW
3056typedef int (*__Pyx_tpinitvectorcallfunc)(PyObject* o, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames);
3057static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc
f, PyObject* o, PyObject *a, PyObject *k);
3061#if !CYTHON_USE_TYPE_SPECS
3062#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
3064static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg);
3068static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
3071#if !CYTHON_USE_TYPE_SLOTS
3072CYTHON_UNUSED
static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp,
int require_cython_valid_result);
3076#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
3077static int __Pyx_validate_bases_tuple(
const char *type_name,
int has_dictoffset, PyObject *bases);
3081CYTHON_UNUSED
static int __Pyx_PyType_Ready(PyTypeObject *t);
3084#if CYTHON_COMPILING_IN_LIMITED_API
3085static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp);
3089#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)
3092static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
3095#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
3098static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *
v);
3101static int __Pyx_setup_reduce(PyObject* type_obj);
3104#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3105int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp,
int is_sequence);
3107#define __Pyx_ApplySequenceOrMappingFlag(tp, is_sequence) (0)
3111static int __Pyx_GetVtable(PyTypeObject *type,
void** table);
3114static int __Pyx_MergeVtables(PyTypeObject *type);
3117static int __Pyx_SetVtable(PyTypeObject* typeptr ,
void* vtable);
3120#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
3121#define __PYX_HAVE_RT_ImportType_proto_3_3_0
3122#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
3123#include <stdalign.h>
3125#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
3126#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
3128#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
3130enum __Pyx_ImportType_CheckSize_3_3_0 {
3131 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
3132 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
3133 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
3135static 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);
3139static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
3142#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
3143 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
3144 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name);
3146 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
3150static PyObject *__Pyx_FetchSharedCythonABIModule(
void);
3153static int __Pyx_VerifyCachedType(PyObject *cached_type,
3155 Py_ssize_t expected_basicsize);
3158static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
3161static int __pyx_CommonTypesMetaclass_init(PyObject *module);
3162#define __Pyx_CommonTypesMetaclass_USED
3165#define __Pyx_CyFunction_USED
3166#if CYTHON_OPAQUE_SHARED_TYPES
3167#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
3169#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
3171#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
3172#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
3173#define __Pyx_CYFUNCTION_CCLASS 0x04
3174#define __Pyx_CYFUNCTION_COROUTINE 0x08
3175#define __Pyx_CyFunction_GetClosure(f)\
3176 ((__Pyx_as_CyFunctionObject(f))->func_closure)
3177#if CYTHON_COMPILING_IN_LIMITED_API
3178 #define __Pyx__CyFunction_GetClassObj(f)\
3179 ((f)->func_classobj)
3181 #define __Pyx__CyFunction_GetClassObj(f)\
3182 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
3184#define __Pyx_CyFunction_GetClassObj(f)\
3185 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
3186#define __Pyx_CyFunction_SetClassObj(f, classobj)\
3187 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
3188#define __Pyx_CyFunction_Defaults(type, f)\
3189 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
3190#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
3191 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
3193#if CYTHON_COMPILING_IN_LIMITED_API
3194#if !CYTHON_OPAQUE_OBJECTS
3197 PyMethodDef *func_methoddef;
3198 PyObject *func_module;
3200 PyCMethodObject func;
3202#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
3203 __pyx_vectorcallfunc func_vectorcall;
3205#if CYTHON_COMPILING_IN_LIMITED_API
3206 PyObject *func_weakreflist;
3208#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
3209 PyObject *func_dict;
3211 PyObject *func_name;
3212 PyObject *func_qualname;
3214 PyObject *func_globals;
3215 PyObject *func_code;
3216 PyObject *func_closure;
3217#if CYTHON_COMPILING_IN_LIMITED_API
3218 PyObject *func_classobj;
3222 PyObject *defaults_tuple;
3223 PyObject *defaults_kwdict;
3224 PyObject *(*defaults_getter)(PyObject *);
3225 PyObject *func_annotations;
3226#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
3227 PyObject *func_is_coroutine;
3229} __pyx_CyFunctionObject;
3230#undef __Pyx_CyOrPyCFunction_Check
3231#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3232#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
3233#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3234static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void));
3235#undef __Pyx_IsSameCFunction
3236#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
3237static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj);
3238static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
3239 PyTypeObject *defaults_type);
3240static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
3242static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3244static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
3246static int __pyx_CyFunction_init(PyObject *module);
3247#if CYTHON_VECTORCALL
3248#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3249#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
3251#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3256static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
3259#if CYTHON_VECTORCALL
3260static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw);
3264static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
3265 int flags, PyObject* qualname,
3267 PyObject *module, PyObject *globals,
3269#if CYTHON_VECTORCALL
3270static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3271static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3272static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3273static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3277static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3278 int flags, PyObject* qualname,
3280 PyObject *module, PyObject *globals,
3282static PyTypeObject *__Pyx_Get_CyFunction_Type(
void);
3285#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
3286static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
3288#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3292#if CYTHON_COMPILING_IN_LIMITED_API
3293typedef PyObject __Pyx_CachedCodeObjectType;
3295typedef PyCodeObject __Pyx_CachedCodeObjectType;
3298 __Pyx_CachedCodeObjectType* code_object;
3300} __Pyx_CodeObjectCacheEntry;
3301struct __Pyx_CodeObjectCache {
3304 __Pyx_CodeObjectCacheEntry* entries;
3305 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3306 __pyx_atomic_int_type accessor_count;
3309static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
3310static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line);
3311static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object);
3314static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
3315 int py_line,
const char *filename);
3318static CYTHON_INLINE PyObject *__pyx_memview_get_int(
const char *itemp);
3319static CYTHON_INLINE
int __pyx_memview_set_int(
char *itemp, PyObject *obj);
3322static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp);
3323static CYTHON_INLINE
int __pyx_memview_set_double(
char *itemp, PyObject *obj);
3328 #define __Pyx_CREAL(z) ((z).real())
3329 #define __Pyx_CIMAG(z) ((z).imag())
3331 #define __Pyx_CREAL(z) (__real__(z))
3332 #define __Pyx_CIMAG(z) (__imag__(z))
3335 #define __Pyx_CREAL(z) ((z).real)
3336 #define __Pyx_CIMAG(z) ((z).imag)
3338#if defined(__cplusplus) && CYTHON_CCOMPLEX\
3339 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3340 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3341 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3343 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3344 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3348#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3349 #define __Pyx_c_eq_float(a, b) ((a)==(b))
3350 #define __Pyx_c_sum_float(a, b) ((a)+(b))
3351 #define __Pyx_c_diff_float(a, b) ((a)-(b))
3352 #define __Pyx_c_prod_float(a, b) ((a)*(b))
3353 #define __Pyx_c_quot_float(a, b) ((a)/(b))
3354 #define __Pyx_c_neg_float(a) (-(a))
3356 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3357 #define __Pyx_c_conj_float(z) (::std::conj(z))
3359 #define __Pyx_c_abs_float(z) (::std::abs(z))
3360 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3363 #define __Pyx_c_is_zero_float(z) ((z)==0)
3364 #define __Pyx_c_conj_float(z) (conjf(z))
3366 #define __Pyx_c_abs_float(z) (cabsf(z))
3367 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3371 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3372 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3373 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3374 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3375 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3376 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3377 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3378 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3380 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
3381 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3386#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3387 #define __Pyx_c_eq_double(a, b) ((a)==(b))
3388 #define __Pyx_c_sum_double(a, b) ((a)+(b))
3389 #define __Pyx_c_diff_double(a, b) ((a)-(b))
3390 #define __Pyx_c_prod_double(a, b) ((a)*(b))
3391 #define __Pyx_c_quot_double(a, b) ((a)/(b))
3392 #define __Pyx_c_neg_double(a) (-(a))
3394 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3395 #define __Pyx_c_conj_double(z) (::std::conj(z))
3397 #define __Pyx_c_abs_double(z) (::std::abs(z))
3398 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3401 #define __Pyx_c_is_zero_double(z) ((z)==0)
3402 #define __Pyx_c_conj_double(z) (conj(z))
3404 #define __Pyx_c_abs_double(z) (cabs(z))
3405 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3409 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3410 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3411 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3412 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3413 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3414 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3415 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3416 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3418 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
3419 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3424#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3425 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3426 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3427 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3428 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3429 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3430 #define __Pyx_c_neg_long__double(a) (-(a))
3432 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3433 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3435 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3436 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3439 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3440 #define __Pyx_c_conj_long__double(z) (conjl(z))
3442 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3443 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3447 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3448 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3449 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3450 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3451 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3452 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3453 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3454 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3456 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3457 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3463 Py_ssize_t shape, strides, suboffsets;
3470 __Pyx_Buffer *rcbuffer;
3472 __Pyx_Buf_DimInfo diminfo[8];
3476static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
3477 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3478static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
3479 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3480#define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3481#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3482#define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3483static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
3484static CYTHON_INLINE
void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *,
int,
int);
3487static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
3490static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3491 __Pyx_memviewslice *slice2,
3492 int ndim,
size_t itemsize);
3495static int __Pyx_init_memviewslice(
3496 struct __pyx_memoryview_obj *memview,
3498 __Pyx_memviewslice *memviewslice,
3499 int memview_is_new_reference);
3502static CYTHON_INLINE
int __pyx_memoryview_slice_memviewslice(
3503 __Pyx_memviewslice *dst,
3504 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
3505 int dim,
int new_ndim,
int *suboffset_dim,
3506 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
3507 int have_start,
int have_stop,
int have_step,
3511static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *);
3514#if CYTHON_VECTORCALL
3515#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
3516CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
3518#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
3519CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n);
3520CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
3524#if CYTHON_VECTORCALL
3525#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
3527static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3531static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(
int value);
3534struct __pyx_typeinfo_string {
3537static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(const __Pyx_TypeInfo *type);
3540static __Pyx_memviewslice
3541__pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
3542 const char *mode,
int ndim,
3543 Py_ssize_t sizeof_dtype,
int contig_flag,
3544 int dtype_is_object);
3547static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);
3550static void __Pyx_RaiseUnpickleChecksumError(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members);
3553static CYTHON_INLINE
int __Pyx_CheckUnpickleChecksum(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members);
3556static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *);
3559static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value);
3562static CYTHON_INLINE
char __Pyx_PyLong_As_char(PyObject *);
3565#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
3566static unsigned long __Pyx_cached_runtime_version = 0;
3567static void __Pyx_init_runtime_version(
void);
3569#define __Pyx_init_runtime_version()
3571static unsigned long __Pyx_get_runtime_version(
void);
3574static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer);
3577static PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo);
3580static PyObject *__Pyx_DecompressString_LZSS(
const char *
s,
size_t compressed_length,
size_t uncompressed_length);
3583#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
3585static PyObject *__Pyx_State_FindModule(
void*);
3586static int __Pyx_State_AddModule(PyObject* module,
void*);
3587static int __Pyx_State_RemoveModule(
void*);
3588#elif CYTHON_USE_MODULE_STATE
3589#define __Pyx_State_FindModule PyState_FindModule
3590#define __Pyx_State_AddModule PyState_AddModule
3591#define __Pyx_State_RemoveModule PyState_RemoveModule
3596#if CYTHON_COMPILING_IN_LIMITED_API
3597 #if CYTHON_VECTORCALL
3598 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
3600 #define __PYX_VECTORCALL_ABI_SUFFIX
3602 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
3604 #define __PYX_LIMITED_ABI_SUFFIX
3606#if __PYX_HAS_PY_AM_SEND == 1
3607 #define __PYX_AM_SEND_ABI_SUFFIX
3608#elif __PYX_HAS_PY_AM_SEND == 2
3609 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
3611 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
3613#ifndef __PYX_MONITORING_ABI_SUFFIX
3614 #define __PYX_MONITORING_ABI_SUFFIX
3616#if CYTHON_USE_TP_FINALIZE
3617 #define __PYX_TP_FINALIZE_ABI_SUFFIX
3619 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
3621#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
3622 #define __PYX_FREELISTS_ABI_SUFFIX
3624 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
3626#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
3627 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
3629 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3631#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
3632#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
3633#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
3635static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
3636static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
3637static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
3638static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
3639static 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);
3640static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value);
3641static PyObject *__pyx_memoryview_setitem_indexed1(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
3642static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
3643static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
3644static PyObject *__pyx_memoryview__get_base(
struct __pyx_memoryview_obj *__pyx_v_self);
3645static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
3646static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
3647static PyObject *__pyx_memoryviewslice__get_base(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3648static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self);
3649static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self);
3650static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self);
3651static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self);
3652static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self);
3653static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self);
3654static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self);
3655static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self);
3656static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self);
3657static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self);
3658static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self);
3659static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self);
3660static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self);
3661static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self);
3662static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self);
3663static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self);
3664static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self);
3665static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self);
3666static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self);
3667static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self);
3668static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self);
3669static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self);
3670static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self);
3671static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self);
3672static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self);
3673static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self);
3674static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self);
3675static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self);
3676static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self);
3677static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self);
3678static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self);
3679static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self);
3680static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self);
3681static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self);
3682static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self);
3703static PyObject *__pyx_collections_abc_Sequence = 0;
3704static PyObject *
generic = 0;
3705static PyObject *strided = 0;
3706static PyObject *indirect = 0;
3707static PyObject *contiguous = 0;
3708static PyObject *indirect_contiguous = 0;
3709static int __pyx_memoryview_thread_locks_used;
3710static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3711static int __pyx_array_allocate_buffer(
struct __pyx_array_obj *);
3712static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char const *,
char *);
3713static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo
const *);
3714static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
3715static int __pyx_memoryview_err_invalid_index(PyObject *);
3716static PyObject *_unellipsify_index_tuple(PyObject *,
int);
3717static PyObject *_unellipsify(PyObject *,
int);
3718static int assert_direct_dimensions(Py_ssize_t *,
int);
3719static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
3720static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
3721static int __pyx_memslice_transpose(__Pyx_memviewslice *);
3722static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *), __pyx_memoryview_to_dtype_func_type,
int);
3723static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
3724static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
3725static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
3726static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
3727static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
3728static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
3729static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
3730static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
3731static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
3732static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
3733static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
3734static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
3735static int __pyx_memoryview_err_dim(PyObject *,
char const *,
int);
3736static int __pyx_memoryview_err(PyObject *,
char const *);
3737static int __pyx_memoryview_err_no_memory(
void);
3738static int __pyx_memoryview_err_ValueError(
char const *);
3739static int __pyx_memoryview_err_IndexError(
char const *, Py_ssize_t);
3740static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
3741static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
3742static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
3743static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
3744static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
3745static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
3746static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
3747static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
3748static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo
const *);
3750static const __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, __PYX_IS_UNSIGNED(
int) ?
'U' :
'I', __PYX_IS_UNSIGNED(
int), 0 };
3751static const __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
3753#define __Pyx_MODULE_NAME "csparsity"
3754extern int __pyx_module_is_main_csparsity;
3755int __pyx_module_is_main_csparsity = 0;
3759static PyObject *__pyx_builtin___import__;
3760static PyObject *__pyx_builtin_enumerate;
3761static PyObject *__pyx_builtin_Ellipsis;
3762static PyObject *__pyx_builtin_id;
3764static const char __pyx_k_c[] =
"c";
3765static const char __pyx_k_name[] =
"name";
3766static const char __pyx_k_fortran[] =
"fortran";
3767static const char __pyx_k_Dimension_d_is_not_direct[] =
"Dimension %d is not direct";
3768static const char __pyx_k_Cannot_index_with_type_200U[] =
"Cannot index with type \047%.200U\047";
3769static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
3770static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
3771static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
3772static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
3773static const char __pyx_k_Cannot_transpose_memoryview_with[] =
"Cannot transpose memoryview with indirect dimensions";
3774static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
3775static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
3776static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %zd)";
3777static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
3778static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %zd and %zd)";
3780static 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);
3781static 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);
3782static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
3783static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
3784static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
3785static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
3786static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
3787static 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);
3788static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
3789static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3790static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
3791static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3792static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3793static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3794static 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);
3795static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
3796static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
3797static 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);
3798static 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);
3799static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3800static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3801static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3802static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3803static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3804static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3805static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3806static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3807static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3808static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
3809static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
3810static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
3811static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3812static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3813static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
3814static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
3815static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
3816static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3817static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3818static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3819static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3820static 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);
3821static int __pyx_pf_9csparsity_14PySparsityInfo___cinit__(CYTHON_UNUSED
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self);
3822static void __pyx_pf_9csparsity_14PySparsityInfo_2__dealloc__(CYTHON_UNUSED
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self);
3823static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_4findNonzeros(
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self,
int __pyx_v_nElements_global,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_nFreeDOF_test, PyArrayObject *__pyx_v_freeGlobal_test, PyArrayObject *__pyx_v_nFreeDOF_trial, PyArrayObject *__pyx_v_freeGlobal_trial,
int __pyx_v_offset_test,
int __pyx_v_stride_test,
int __pyx_v_offset_trial,
int __pyx_v_stride_trial,
int __pyx_v_hasNumericalFlux,
int __pyx_v_hasDiffusionInMixedForm,
int __pyx_v_needNumericalFluxJacobian,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray,
int __pyx_v_nInteriorElementBoundaries_global, PyArrayObject *__pyx_v_interiorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray,
int __pyx_v_hasFluxBoundaryConditions,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray,
int __pyx_v_hasOutflowBoundary,
int __pyx_v_needOutflowJacobian);
3824static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_6getOffsets_CSR(
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self,
int __pyx_v_nElements_global,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_nFreeDOF_test, PyArrayObject *__pyx_v_freeGlobal_test, PyArrayObject *__pyx_v_nFreeDOF_trial, PyArrayObject *__pyx_v_freeGlobal_trial,
int __pyx_v_offset_test,
int __pyx_v_stride_test,
int __pyx_v_offset_trial,
int __pyx_v_stride_trial,
int __pyx_v_hasNumericalFlux,
int __pyx_v_hasDiffusionInMixedForm,
int __pyx_v_needNumericalFluxJacobian,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray,
int __pyx_v_nInteriorElementBoundaries_global, PyArrayObject *__pyx_v_interiorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray,
int __pyx_v_hasFluxBoundaryConditions,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray,
int __pyx_v_hasOutflowBoundary,
int __pyx_v_needOutflowJacobian, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_csrRowIndeces, PyArrayObject *__pyx_v_csrColumnOffsets, PyArrayObject *__pyx_v_csrColumnOffsets_eNebN, PyArrayObject *__pyx_v_csrColumnOffsets_eb, PyArrayObject *__pyx_v_csrColumnOffsets_eb_eNebN);
3825static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_8getCSR(
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self);
3826static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_10__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self);
3827static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_12__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3828static PyObject *__pyx_tp_new__initialisation_9csparsity_PySparsityInfo(PyObject *o,
3829#
if CYTHON_VECTORCALL_TPNEW
3830 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
3832 PyObject *a, PyObject *k
3835static PyObject *__pyx_tp_new_vectorcall_9csparsity_PySparsityInfo(PyTypeObject *t,
3836#
if CYTHON_VECTORCALL_TPNEW
3837 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
3839 PyObject *a, PyObject *k
3842#if CYTHON_VECTORCALL_TPNEW
3843static PyObject *__pyx_tp_new_9csparsity_PySparsityInfo(PyTypeObject *t, PyObject *a, PyObject *k);
3845#if !CYTHON_VECTORCALL_TPNEW
3846#define __pyx_tp_new_9csparsity_PySparsityInfo __pyx_tp_new_vectorcall_9csparsity_PySparsityInfo
3848#if CYTHON_VECTORCALL_TPNEW
3849static PyObject *__pyx_tp_vectorcall_9csparsity_PySparsityInfo(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3851static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
3852#
if CYTHON_VECTORCALL_TPNEW
3853 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
3855 PyObject *a, PyObject *k
3858static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
3859#
if CYTHON_VECTORCALL_TPNEW
3860 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
3862 PyObject *a, PyObject *k
3865#if CYTHON_VECTORCALL_TPNEW
3866static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
3868#if !CYTHON_VECTORCALL_TPNEW
3869#define __pyx_tp_new_array __pyx_tp_new_vectorcall_array
3871#if CYTHON_VECTORCALL_TPNEW
3872static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3874static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
3875#
if CYTHON_VECTORCALL_TPNEW
3876 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
3878 PyObject *a, PyObject *k
3881static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
3882#
if CYTHON_VECTORCALL_TPNEW
3883 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
3885 PyObject *a, PyObject *k
3888#if CYTHON_VECTORCALL_TPNEW
3889static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
3891#if !CYTHON_VECTORCALL_TPNEW
3892#define __pyx_tp_new_Enum __pyx_tp_new_vectorcall_Enum
3894#if CYTHON_VECTORCALL_TPNEW
3895static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3897#if CYTHON_VECTORCALL_TPNEW
3898static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds);
3900#if !CYTHON_VECTORCALL_TPNEW
3901#define __pyx_tp_init_Enum __pyx_MemviewEnum___init__
3903static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
3904#
if CYTHON_VECTORCALL_TPNEW
3905 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
3907 PyObject *a, PyObject *k
3910static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
3911#
if CYTHON_VECTORCALL_TPNEW
3912 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
3914 PyObject *a, PyObject *k
3917#if CYTHON_VECTORCALL_TPNEW
3918static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
3920#if !CYTHON_VECTORCALL_TPNEW
3921#define __pyx_tp_new_memoryview __pyx_tp_new_vectorcall_memoryview
3923#if CYTHON_VECTORCALL_TPNEW
3924static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3926static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
3927#
if CYTHON_VECTORCALL_TPNEW
3928 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
3930 PyObject *a, PyObject *k
3933static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
3934#
if CYTHON_VECTORCALL_TPNEW
3935 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
3937 PyObject *a, PyObject *k
3940#if CYTHON_VECTORCALL_TPNEW
3941static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
3943#if !CYTHON_VECTORCALL_TPNEW
3944#define __pyx_tp_new__memoryviewslice __pyx_tp_new_vectorcall__memoryviewslice
3946#if CYTHON_VECTORCALL_TPNEW
3947static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3952#ifndef CYTHON_SMALL_CODE
3953#if defined(__clang__)
3954 #define CYTHON_SMALL_CODE
3955#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3956 #define CYTHON_SMALL_CODE __attribute__((cold))
3958 #define CYTHON_SMALL_CODE
3968 PyObject *__pyx_cython_runtime;
3969 PyObject *__pyx_empty_tuple;
3970 PyObject *__pyx_empty_bytes;
3971 PyObject *__pyx_empty_unicode;
3972 PyTypeObject *__pyx_ptype_7cpython_4type_type;
3973 PyTypeObject *__pyx_ptype_5numpy_dtype;
3974 PyTypeObject *__pyx_ptype_5numpy_flatiter;
3975 PyTypeObject *__pyx_ptype_5numpy_broadcast;
3976 PyTypeObject *__pyx_ptype_5numpy_ndarray;
3977 PyTypeObject *__pyx_ptype_5numpy_generic;
3978 PyTypeObject *__pyx_ptype_5numpy_number;
3979 PyTypeObject *__pyx_ptype_5numpy_integer;
3980 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3981 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3982 PyTypeObject *__pyx_ptype_5numpy_inexact;
3983 PyTypeObject *__pyx_ptype_5numpy_floating;
3984 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3985 PyTypeObject *__pyx_ptype_5numpy_flexible;
3986 PyTypeObject *__pyx_ptype_5numpy_character;
3987 PyTypeObject *__pyx_ptype_5numpy_ufunc;
3988 PyObject *__pyx_type_9csparsity_PySparsityInfo;
3989 PyObject *__pyx_type___pyx_array;
3990 PyObject *__pyx_type___pyx_MemviewEnum;
3991 PyObject *__pyx_type___pyx_memoryview;
3992 PyObject *__pyx_type___pyx_memoryviewslice;
3993 PyTypeObject *__pyx_ptype_9csparsity_PySparsityInfo;
3994 PyTypeObject *__pyx_array_type;
3995 PyTypeObject *__pyx_MemviewEnum_type;
3996 PyTypeObject *__pyx_memoryview_type;
3997 PyTypeObject *__pyx_memoryviewslice_type;
3998 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
3999 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
4000 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
4001 PyObject *__pyx_slice[1];
4002 PyObject *__pyx_tuple[2];
4003 PyObject *__pyx_codeobj_tab[5];
4004 PyObject *__pyx_string_tab[155];
4005 PyObject *__pyx_number_tab[3];
4008#if CYTHON_COMPILING_IN_LIMITED_API
4009PyObject *__Pyx_PyFrozenDictType;
4013PyTypeObject *__pyx_CommonTypesMetaclassType;
4016#if CYTHON_COMPILING_IN_LIMITED_API
4017PyObject *__Pyx_CachedMethodType;
4021PyTypeObject *__pyx_CyFunctionType;
4024struct __Pyx_CodeObjectCache __pyx_code_cache;
4032#if CYTHON_USE_MODULE_STATE
4035extern struct PyModuleDef __pyx_moduledef;
4038static struct PyModuleDef __pyx_moduledef;
4041#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
4043#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
4045static __pyx_mstatetype __pyx_mstate_global_static =
4051static __pyx_mstatetype *
const __pyx_mstate_global = &__pyx_mstate_global_static;
4054#define __pyx_kp_u_at_0x __pyx_string_tab[0]
4055#define __pyx_kp_u_object __pyx_string_tab[1]
4056#define __pyx_kp_u__9 __pyx_string_tab[2]
4057#define __pyx_kp_u_tree_fragment __pyx_string_tab[3]
4058#define __pyx_kp_u__11 __pyx_string_tab[4]
4059#define __pyx_kp_u__10 __pyx_string_tab[5]
4060#define __pyx_kp_u__3 __pyx_string_tab[6]
4061#define __pyx_kp_u__2 __pyx_string_tab[7]
4062#define __pyx_kp_u_MemoryView_of __pyx_string_tab[8]
4063#define __pyx_kp_u_contiguous_and_direct __pyx_string_tab[9]
4064#define __pyx_kp_u_contiguous_and_indirect __pyx_string_tab[10]
4065#define __pyx_kp_u_strided_and_direct_or_indirect __pyx_string_tab[11]
4066#define __pyx_kp_u_strided_and_direct __pyx_string_tab[12]
4067#define __pyx_kp_u_strided_and_indirect __pyx_string_tab[13]
4068#define __pyx_kp_u__4 __pyx_string_tab[14]
4069#define __pyx_kp_u_ __pyx_string_tab[15]
4070#define __pyx_kp_u_Cannot_assign_to_read_only_memor __pyx_string_tab[16]
4071#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_string_tab[17]
4072#define __pyx_kp_u_Invalid_shape_in_axis __pyx_string_tab[18]
4073#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[19]
4074#define __pyx_kp_u_add_note __pyx_string_tab[20]
4075#define __pyx_kp_u_collections_abc __pyx_string_tab[21]
4076#define __pyx_kp_u_disable __pyx_string_tab[22]
4077#define __pyx_kp_u_enable __pyx_string_tab[23]
4078#define __pyx_kp_u_gc __pyx_string_tab[24]
4079#define __pyx_kp_u_isenabled __pyx_string_tab[25]
4080#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[26]
4081#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[27]
4082#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[28]
4083#define __pyx_kp_u_proteus_csparsity_pyx __pyx_string_tab[29]
4084#define __pyx_kp_u_unable_to_allocate_array_data __pyx_string_tab[30]
4085#define __pyx_kp_u_unable_to_allocate_shape_and_str __pyx_string_tab[31]
4086#define __pyx_n_u_ASCII __pyx_string_tab[32]
4087#define __pyx_n_u_Ellipsis __pyx_string_tab[33]
4088#define __pyx_n_u_PySparsityInfo __pyx_string_tab[34]
4089#define __pyx_n_u_PySparsityInfo___reduce_cython __pyx_string_tab[35]
4090#define __pyx_n_u_PySparsityInfo___setstate_cython __pyx_string_tab[36]
4091#define __pyx_n_u_PySparsityInfo_findNonzeros __pyx_string_tab[37]
4092#define __pyx_n_u_PySparsityInfo_getCSR __pyx_string_tab[38]
4093#define __pyx_n_u_PySparsityInfo_getOffsets_CSR __pyx_string_tab[39]
4094#define __pyx_n_u_Sequence __pyx_string_tab[40]
4095#define __pyx_n_u_View_MemoryView __pyx_string_tab[41]
4096#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[42]
4097#define __pyx_n_u_annotate __pyx_string_tab[43]
4098#define __pyx_n_u_class __pyx_string_tab[44]
4099#define __pyx_n_u_class_getitem __pyx_string_tab[45]
4100#define __pyx_n_u_dict __pyx_string_tab[46]
4101#define __pyx_n_u_func __pyx_string_tab[47]
4102#define __pyx_n_u_getstate __pyx_string_tab[48]
4103#define __pyx_n_u_import __pyx_string_tab[49]
4104#define __pyx_n_u_main __pyx_string_tab[50]
4105#define __pyx_n_u_module __pyx_string_tab[51]
4106#define __pyx_n_u_name_2 __pyx_string_tab[52]
4107#define __pyx_n_u_new __pyx_string_tab[53]
4108#define __pyx_n_u_pyx_checksum __pyx_string_tab[54]
4109#define __pyx_n_u_pyx_state __pyx_string_tab[55]
4110#define __pyx_n_u_pyx_type __pyx_string_tab[56]
4111#define __pyx_n_u_pyx_unpickle_Enum __pyx_string_tab[57]
4112#define __pyx_n_u_pyx_vtable __pyx_string_tab[58]
4113#define __pyx_n_u_qualname __pyx_string_tab[59]
4114#define __pyx_n_u_reduce __pyx_string_tab[60]
4115#define __pyx_n_u_reduce_cython __pyx_string_tab[61]
4116#define __pyx_n_u_reduce_ex __pyx_string_tab[62]
4117#define __pyx_n_u_set_name __pyx_string_tab[63]
4118#define __pyx_n_u_setstate __pyx_string_tab[64]
4119#define __pyx_n_u_setstate_cython __pyx_string_tab[65]
4120#define __pyx_n_u_test __pyx_string_tab[66]
4121#define __pyx_n_u_is_coroutine __pyx_string_tab[67]
4122#define __pyx_n_u_abc __pyx_string_tab[68]
4123#define __pyx_n_u_allocate_buffer __pyx_string_tab[69]
4124#define __pyx_n_u_asarray __pyx_string_tab[70]
4125#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[71]
4126#define __pyx_n_u_base __pyx_string_tab[72]
4127#define __pyx_n_u_c __pyx_string_tab[73]
4128#define __pyx_n_u_cline_in_traceback __pyx_string_tab[74]
4129#define __pyx_n_u_count __pyx_string_tab[75]
4130#define __pyx_n_u_csparsity __pyx_string_tab[76]
4131#define __pyx_n_u_csrColumnOffsets __pyx_string_tab[77]
4132#define __pyx_n_u_csrColumnOffsets_eNebN __pyx_string_tab[78]
4133#define __pyx_n_u_csrColumnOffsets_eb __pyx_string_tab[79]
4134#define __pyx_n_u_csrColumnOffsets_eb_eNebN __pyx_string_tab[80]
4135#define __pyx_n_u_csrRowIndeces __pyx_string_tab[81]
4136#define __pyx_n_u_dtype_is_object __pyx_string_tab[82]
4137#define __pyx_n_u_elementBoundaryElementsArray __pyx_string_tab[83]
4138#define __pyx_n_u_elementBoundaryLocalElementBound __pyx_string_tab[84]
4139#define __pyx_n_u_elementNeighborsArray __pyx_string_tab[85]
4140#define __pyx_n_u_encode __pyx_string_tab[86]
4141#define __pyx_n_u_enumerate __pyx_string_tab[87]
4142#define __pyx_n_u_error __pyx_string_tab[88]
4143#define __pyx_n_u_exteriorElementBoundariesArray __pyx_string_tab[89]
4144#define __pyx_n_u_findNonzeros __pyx_string_tab[90]
4145#define __pyx_n_u_flags __pyx_string_tab[91]
4146#define __pyx_n_u_format __pyx_string_tab[92]
4147#define __pyx_n_u_fortran __pyx_string_tab[93]
4148#define __pyx_n_u_freeGlobal_test __pyx_string_tab[94]
4149#define __pyx_n_u_freeGlobal_trial __pyx_string_tab[95]
4150#define __pyx_n_u_getCSR __pyx_string_tab[96]
4151#define __pyx_n_u_getOffsets_CSR __pyx_string_tab[97]
4152#define __pyx_n_u_hasDiffusionInMixedForm __pyx_string_tab[98]
4153#define __pyx_n_u_hasFluxBoundaryConditions __pyx_string_tab[99]
4154#define __pyx_n_u_hasNumericalFlux __pyx_string_tab[100]
4155#define __pyx_n_u_hasOutflowBoundary __pyx_string_tab[101]
4156#define __pyx_n_u_id __pyx_string_tab[102]
4157#define __pyx_n_u_index __pyx_string_tab[103]
4158#define __pyx_n_u_interiorElementBoundariesArray __pyx_string_tab[104]
4159#define __pyx_n_u_items __pyx_string_tab[105]
4160#define __pyx_n_u_itemsize __pyx_string_tab[106]
4161#define __pyx_n_u_join __pyx_string_tab[107]
4162#define __pyx_n_u_memview __pyx_string_tab[108]
4163#define __pyx_n_u_mode __pyx_string_tab[109]
4164#define __pyx_n_u_nDOF_test_element __pyx_string_tab[110]
4165#define __pyx_n_u_nDOF_trial_element __pyx_string_tab[111]
4166#define __pyx_n_u_nElementBoundaries_element __pyx_string_tab[112]
4167#define __pyx_n_u_nElements_global __pyx_string_tab[113]
4168#define __pyx_n_u_nExteriorElementBoundaries_globa __pyx_string_tab[114]
4169#define __pyx_n_u_nFreeDOF_test __pyx_string_tab[115]
4170#define __pyx_n_u_nFreeDOF_trial __pyx_string_tab[116]
4171#define __pyx_n_u_nInteriorElementBoundaries_globa __pyx_string_tab[117]
4172#define __pyx_n_u_name __pyx_string_tab[118]
4173#define __pyx_n_u_ndim __pyx_string_tab[119]
4174#define __pyx_n_u_needNumericalFluxJacobian __pyx_string_tab[120]
4175#define __pyx_n_u_needOutflowJacobian __pyx_string_tab[121]
4176#define __pyx_n_u_np __pyx_string_tab[122]
4177#define __pyx_n_u_numpy __pyx_string_tab[123]
4178#define __pyx_n_u_obj __pyx_string_tab[124]
4179#define __pyx_n_u_offset_test __pyx_string_tab[125]
4180#define __pyx_n_u_offset_trial __pyx_string_tab[126]
4181#define __pyx_n_u_pack __pyx_string_tab[127]
4182#define __pyx_n_u_pop __pyx_string_tab[128]
4183#define __pyx_n_u_register __pyx_string_tab[129]
4184#define __pyx_n_u_rowptr __pyx_string_tab[130]
4185#define __pyx_n_u_self __pyx_string_tab[131]
4186#define __pyx_n_u_setdefault __pyx_string_tab[132]
4187#define __pyx_n_u_shape __pyx_string_tab[133]
4188#define __pyx_n_u_size __pyx_string_tab[134]
4189#define __pyx_n_u_start __pyx_string_tab[135]
4190#define __pyx_n_u_step __pyx_string_tab[136]
4191#define __pyx_n_u_stop __pyx_string_tab[137]
4192#define __pyx_n_u_stride_test __pyx_string_tab[138]
4193#define __pyx_n_u_stride_trial __pyx_string_tab[139]
4194#define __pyx_n_u_struct __pyx_string_tab[140]
4195#define __pyx_n_u_unpack __pyx_string_tab[141]
4196#define __pyx_n_u_update __pyx_string_tab[142]
4197#define __pyx_n_u_values __pyx_string_tab[143]
4198#define __pyx_n_u_x __pyx_string_tab[144]
4199#define __pyx_kp_b__6 __pyx_string_tab[145]
4200#define __pyx_kp_b__7 __pyx_string_tab[146]
4201#define __pyx_n_b_O __pyx_string_tab[147]
4202#define __pyx_kp_b_T __pyx_string_tab[148]
4203#define __pyx_kp_b__5 __pyx_string_tab[149]
4204#define __pyx_kp_b__8 __pyx_string_tab[150]
4205#define __pyx_kp_b_iso88591_Q __pyx_string_tab[151]
4206#define __pyx_kp_b_iso88591_A_D_q_6_T_T_6_T_t4q_D_9D_F_d __pyx_string_tab[152]
4207#define __pyx_kp_b_iso88591_A4_D_Qa__A_1_5Q_C1_A_Oq_C1 __pyx_string_tab[153]
4208#define __pyx_kp_b_iso88591_A_D_q_A_a_Q_7q_A_EQ_C1_QQR_EQ_vQ __pyx_string_tab[154]
4209#define __pyx_int_0 __pyx_number_tab[0]
4210#define __pyx_int_neg_1 __pyx_number_tab[1]
4211#define __pyx_int_136983863 __pyx_number_tab[2]
4213#if CYTHON_USE_MODULE_STATE
4214static CYTHON_SMALL_CODE
int __pyx_m_clear(PyObject *m) {
4215 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
4216 if (!clear_module_state)
return 0;
4217 Py_CLEAR(clear_module_state->__pyx_d);
4218 Py_CLEAR(clear_module_state->__pyx_b);
4219 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4220 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4221 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4222 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4223 #if CYTHON_PEP489_MULTI_PHASE_INIT
4224 __Pyx_State_RemoveModule(NULL);
4226 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4227 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4228 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4229 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4230 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4231 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4232 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4233 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4234 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4235 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4236 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4237 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4238 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4239 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4240 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4241 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4242 Py_CLEAR(clear_module_state->__pyx_ptype_9csparsity_PySparsityInfo);
4243 Py_CLEAR(clear_module_state->__pyx_type_9csparsity_PySparsityInfo);
4244 Py_CLEAR(clear_module_state->__pyx_array_type);
4245 Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
4246 Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
4247 Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
4248 Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4249 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4250 Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4251 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4252 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
4253 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
4254 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
4255 for (
int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
4256 for (
int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
4257 for (
int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
4258 for (
int i=0; i<155; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
4259 for (
int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
4262Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
4265Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4272#if CYTHON_USE_MODULE_STATE
4273static CYTHON_SMALL_CODE
int __pyx_m_traverse(PyObject *m, visitproc visit,
void *arg) {
4274 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
4275 if (!traverse_module_state)
return 0;
4276 Py_VISIT(traverse_module_state->__pyx_d);
4277 Py_VISIT(traverse_module_state->__pyx_b);
4278 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4279 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
4280 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
4281 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
4282 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4283 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4284 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4285 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4286 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4287 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4288 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4289 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4290 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4291 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4292 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4293 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4294 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4295 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4296 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4297 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4298 Py_VISIT(traverse_module_state->__pyx_ptype_9csparsity_PySparsityInfo);
4299 Py_VISIT(traverse_module_state->__pyx_type_9csparsity_PySparsityInfo);
4300 Py_VISIT(traverse_module_state->__pyx_array_type);
4301 Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4302 Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4303 Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4304 Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4305 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4306 Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4307 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4308 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
4309 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
4310 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
4311 for (
int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
4312 for (
int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
4313 for (
int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
4314 for (
int i=0; i<155; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4315 for (
int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
4318Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
4321Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4338static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4339#
if CYTHON_VECTORCALL_TPNEW
4340PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4342PyObject *__pyx_args, PyObject *__pyx_kwds
4345static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4346#
if CYTHON_VECTORCALL_TPNEW
4347PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4349PyObject *__pyx_args, PyObject *__pyx_kwds
4352 PyObject *__pyx_v_shape = 0;
4353 Py_ssize_t __pyx_v_itemsize;
4354 PyObject *__pyx_v_format = 0;
4355 PyObject *__pyx_v_mode = 0;
4356 int __pyx_v_allocate_buffer;
4357 #if !CYTHON_VECTORCALL_TPNEW
4358 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
4360 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
4361 PyObject* values[5] = {0,0,0,0,0};
4362 int __pyx_lineno = 0;
4363 const char *__pyx_filename = NULL;
4364 int __pyx_clineno = 0;
4366 __Pyx_RefNannyDeclarations
4367 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
4368 #if !CYTHON_VECTORCALL_TPNEW
4369 #if CYTHON_ASSUME_SAFE_SIZE
4370 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
4372 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
4375 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
4377 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};
4378 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
4379 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 147, __pyx_L3_error)
4380 if (__pyx_kwds_len > 0) {
4381 switch (__pyx_nargs) {
4383 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4384 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4387 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4388 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4391 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4392 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4395 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4396 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4399 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4400 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4403 default:
goto __pyx_L5_argtuple_error;
4405 const Py_ssize_t kwd_pos_args = __pyx_nargs;
4406 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)
4407 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4408 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
4409 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, i); __PYX_ERR(1, 147, __pyx_L3_error) }
4412 switch (__pyx_nargs) {
4414 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4415 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4418 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4419 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4422 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4423 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4424 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4425 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4426 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4427 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4429 default:
goto __pyx_L5_argtuple_error;
4431 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4433 __pyx_v_shape = ((PyObject*)values[0]);
4434 __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)
4435 __pyx_v_format = values[2];
4436 __pyx_v_mode = values[3];
4438 __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)
4448 __pyx_v_allocate_buffer = ((int)1);
4452 __pyx_L5_argtuple_error:;
4453 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 147, __pyx_L3_error)
4455 goto __pyx_L4_argument_unpacking_done;
4457 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
4458 Py_XDECREF(values[__pyx_temp]);
4460 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4461 __Pyx_RefNannyFinishContext();
4463 __pyx_L4_argument_unpacking_done:;
4464 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 147, __pyx_L1_error)
4465 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
4466 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 147, __pyx_L1_error)
4468 __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);
4482 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
4483 Py_XDECREF(values[__pyx_temp]);
4485 goto __pyx_L7_cleaned_up;
4487 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
4488 Py_XDECREF(values[__pyx_temp]);
4490 __pyx_L7_cleaned_up:;
4493 __Pyx_RefNannyFinishContext();
4497static 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) {
4499 Py_ssize_t __pyx_v_dim;
4502 __Pyx_RefNannyDeclarations
4503 Py_ssize_t __pyx_t_1;
4507 PyObject *__pyx_t_5 = NULL;
4508 PyObject *__pyx_t_6 = NULL;
4511 Py_ssize_t __pyx_t_9;
4512 PyObject *__pyx_t_10 = NULL;
4513 PyObject *__pyx_t_11[5];
4515 PyObject *__pyx_t_13 = NULL;
4516 int __pyx_lineno = 0;
4517 const char *__pyx_filename = NULL;
4518 int __pyx_clineno = 0;
4519 __Pyx_RefNannySetupContext(
"__cinit__", 0);
4520 __Pyx_INCREF(__pyx_v_format);
4529 if (unlikely(__pyx_v_shape == Py_None)) {
4530 PyErr_SetString(PyExc_TypeError,
"object of type \047NoneType\047 has no len()");
4531 __PYX_ERR(1, 153, __pyx_L1_error)
4533 __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)
4534 __pyx_v_self->ndim = ((int)__pyx_t_1);
4544 __pyx_v_self->itemsize = __pyx_v_itemsize;
4553 __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
4555 if (unlikely(__pyx_t_2)) {
4565 __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)
4584 __pyx_t_2 = (__pyx_v_itemsize <= 0);
4586 if (unlikely(__pyx_t_2)) {
4596 __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)
4615 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
4616 __pyx_t_4 = (!__pyx_t_2);
4629 __pyx_t_6 = __pyx_v_format;
4630 __Pyx_INCREF(__pyx_t_6);
4633 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ASCII};
4634 __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));
4635 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4636 if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
4637 __Pyx_GOTREF(__pyx_t_5);
4639 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
4658 __pyx_t_5 = __pyx_v_format;
4659 __Pyx_INCREF(__pyx_t_5);
4660 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)
4661 __Pyx_GIVEREF(__pyx_t_5);
4662 __Pyx_GOTREF(__pyx_v_self->_format);
4663 __Pyx_DECREF(__pyx_v_self->_format);
4664 __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
4674 if (unlikely(__pyx_v_self->_format == Py_None)) {
4675 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
4676 __PYX_ERR(1, 165, __pyx_L1_error)
4678 __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 165, __pyx_L1_error)
4679 __pyx_v_self->format = __pyx_t_8;
4688 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * 2) * ((
size_t)__pyx_v_self->ndim))));
4697 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
4706 __pyx_t_4 = (!(__pyx_v_self->_shape != 0));
4708 if (unlikely(__pyx_t_4)) {
4718 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_shape_and_str, 0, 0);
4719 __PYX_ERR(1, 172, __pyx_L1_error)
4739 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5);
4743 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
4744 #if !CYTHON_ASSUME_SAFE_SIZE
4745 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 175, __pyx_L1_error)
4747 if (__pyx_t_1 >= __pyx_temp)
break;
4749 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4750 __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1));
4752 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_1);
4755 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 175, __pyx_L1_error)
4756 __Pyx_GOTREF(__pyx_t_6);
4757 __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)
4758 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4759 __pyx_v_dim = __pyx_t_9;
4760 __pyx_v_idx = __pyx_t_3;
4761 __pyx_t_3 = (__pyx_t_3 + 1);
4770 __pyx_t_4 = (__pyx_v_dim <= 0);
4772 if (unlikely(__pyx_t_4)) {
4782 __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0,
' ',
'd');
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
4783 __Pyx_GOTREF(__pyx_t_6);
4784 __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)
4785 __Pyx_GOTREF(__pyx_t_10);
4786 __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis;
4787 __pyx_t_11[1] = __pyx_t_6;
4788 __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u__2;
4789 __pyx_t_11[3] = __pyx_t_10;
4790 __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__3;
4792 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
4793 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]);
4796 __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_9, __pyx_t_12);
4797 if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 177, __pyx_L1_error)
4798 __Pyx_GOTREF(__pyx_t_13);
4799 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4800 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4801 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
4802 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4803 __PYX_ERR(1, 177, __pyx_L1_error)
4821 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
4831 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4840 __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)
4851 __pyx_v_order =
'C';
4860 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
4861 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_c);
4862 __Pyx_GOTREF(__pyx_v_self->mode);
4863 __Pyx_DECREF(__pyx_v_self->mode);
4864 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_c;
4883 __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)
4884 if (likely(__pyx_t_4)) {
4894 __pyx_v_order =
'F';
4903 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
4904 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fortran);
4905 __Pyx_GOTREF(__pyx_v_self->mode);
4906 __Pyx_DECREF(__pyx_v_self->mode);
4907 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_fortran;
4927 __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)
4928 __Pyx_GOTREF(__pyx_t_5);
4929 __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)
4930 __Pyx_GOTREF(__pyx_t_13);
4931 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4932 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
4933 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4934 __PYX_ERR(1, 188, __pyx_L1_error)
4945 __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);
4954 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
4963 __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)
4964 __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)
4965 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4966 __pyx_v_self->dtype_is_object = __pyx_t_4;
4975 if (__pyx_v_allocate_buffer) {
4984 __pyx_t_3 = __pyx_array_allocate_buffer(__pyx_v_self);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 196, __pyx_L1_error)
5008 __Pyx_XDECREF(__pyx_t_5);
5009 __Pyx_XDECREF(__pyx_t_6);
5010 __Pyx_XDECREF(__pyx_t_10);
5011 __Pyx_XDECREF(__pyx_t_13);
5012 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5018 __Pyx_XDECREF(__pyx_v_format);
5020 __Pyx_RefNannyFinishContext();
5033CYTHON_UNUSED
static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
5034CYTHON_UNUSED
static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
5035 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5037 __Pyx_RefNannyDeclarations
5038 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
5039 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5040 __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));
5045 __Pyx_RefNannyFinishContext();
5049static 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) {
5050 int __pyx_v_bufmode;
5052 __Pyx_RefNannyDeclarations
5056 Py_ssize_t __pyx_t_4;
5057 Py_ssize_t *__pyx_t_5;
5058 int __pyx_lineno = 0;
5059 const char *__pyx_filename = NULL;
5060 int __pyx_clineno = 0;
5061 if (unlikely(__pyx_v_info == NULL)) {
5062 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
5065 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
5066 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5067 __Pyx_GIVEREF(__pyx_v_info->obj);
5076 __pyx_v_bufmode = -1;
5085 __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
5097 __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)
5108 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5127 __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)
5138 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5157 __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5159 if (unlikely(__pyx_t_1)) {
5169 __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)
5197 __pyx_t_3 = __pyx_v_self->data;
5199 __pyx_v_info->buf = __pyx_t_3;
5208 __pyx_t_4 = __pyx_v_self->len;
5210 __pyx_v_info->len = __pyx_t_4;
5219 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5231 __pyx_t_2 = __pyx_v_self->ndim;
5233 __pyx_v_info->ndim = __pyx_t_2;
5242 __pyx_t_5 = __pyx_v_self->_shape;
5244 __pyx_v_info->shape = __pyx_t_5;
5253 __pyx_t_5 = __pyx_v_self->_strides;
5255 __pyx_v_info->strides = __pyx_t_5;
5275 __pyx_v_info->ndim = 1;
5284 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5288 __pyx_t_5 = (&__pyx_v_self->len);
5294 __pyx_v_info->shape = __pyx_t_5;
5303 __pyx_v_info->strides = NULL;
5314 __pyx_v_info->suboffsets = NULL;
5323 __pyx_t_4 = __pyx_v_self->itemsize;
5325 __pyx_v_info->itemsize = __pyx_t_4;
5334 __pyx_v_info->readonly = 0;
5343 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5347 __pyx_t_3 = __pyx_v_self->format;
5353 __pyx_v_info->format = __pyx_t_3;
5362 __Pyx_INCREF((PyObject *)__pyx_v_self);
5363 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5364 __Pyx_GOTREF(__pyx_v_info->obj);
5365 __Pyx_DECREF(__pyx_v_info->obj);
5366 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5380 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5382 if (__pyx_v_info->obj != NULL) {
5383 __Pyx_GOTREF(__pyx_v_info->obj);
5384 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5388 if (__pyx_v_info->obj == Py_None) {
5389 __Pyx_GOTREF(__pyx_v_info->obj);
5390 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5395 __Pyx_RefNannyFinishContext();
5408static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
5409static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
5410 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5411 __Pyx_RefNannyDeclarations
5412 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
5413 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5414 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
5417 __Pyx_RefNannyFinishContext();
5420static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
5431 __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
5443 __pyx_v_self->callback_free_data(__pyx_v_self->data);
5462 if (__pyx_v_self->free_data) {
5465 __pyx_t_1 = __pyx_v_self->free_data;
5466 goto __pyx_L4_bool_binop_done;
5468 __pyx_t_2 = (__pyx_v_self->data != NULL);
5471 __pyx_t_1 = __pyx_t_2;
5473 __pyx_L4_bool_binop_done:;
5484 if (__pyx_v_self->dtype_is_object) {
5493 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
5511 free(__pyx_v_self->data);
5530 PyObject_Free(__pyx_v_self->_shape);
5553static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
5554static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
5555 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5556 PyObject *__pyx_r = 0;
5557 __Pyx_RefNannyDeclarations
5558 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
5559 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5560 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
5563 __Pyx_RefNannyFinishContext();
5567static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
5568 PyObject *__pyx_r = NULL;
5569 __Pyx_RefNannyDeclarations
5570 PyObject *__pyx_t_1 = NULL;
5571 int __pyx_lineno = 0;
5572 const char *__pyx_filename = NULL;
5573 int __pyx_clineno = 0;
5574 __Pyx_RefNannySetupContext(
"__get__", 0);
5583 __pyx_t_1 = __pyx_array_get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
5584 __Pyx_GOTREF(__pyx_t_1);
5586 PyObject *__pyx_temp;
5588 __pyx_temp = __pyx_r;
5589 __pyx_r = __pyx_t_1;
5591 __Pyx_XDECREF(__pyx_temp);
5606 __Pyx_XDECREF(__pyx_t_1);
5607 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5610 __Pyx_XGIVEREF(__pyx_r);
5611 __Pyx_RefNannyFinishContext();
5623static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
5625 PyObject *__pyx_r = NULL;
5626 __Pyx_RefNannyDeclarations
5627 PyObject *__pyx_t_1 = NULL;
5628 PyObject *__pyx_t_2 = NULL;
5629 PyObject *__pyx_t_3 = NULL;
5630 PyObject *__pyx_t_4 = NULL;
5632 int __pyx_lineno = 0;
5633 const char *__pyx_filename = NULL;
5634 int __pyx_clineno = 0;
5635 __Pyx_RefNannySetupContext(
"get_memview", 0);
5644 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
5654 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 243, __pyx_L1_error)
5655 __Pyx_GOTREF(__pyx_t_3);
5656 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 243, __pyx_L1_error)
5657 __Pyx_GOTREF(__pyx_t_4);
5660 PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4};
5661 __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));
5662 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5663 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5664 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5665 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
5666 __Pyx_GOTREF((PyObject *)__pyx_t_1);
5669 PyObject *__pyx_temp;
5671 __pyx_temp = __pyx_r;
5672 __pyx_r = ((PyObject *)__pyx_t_1);
5674 __Pyx_XDECREF(__pyx_temp);
5689 __Pyx_XDECREF(__pyx_t_1);
5690 __Pyx_XDECREF(__pyx_t_2);
5691 __Pyx_XDECREF(__pyx_t_3);
5692 __Pyx_XDECREF(__pyx_t_4);
5693 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
5697 __Pyx_XGIVEREF(__pyx_r);
5698 __Pyx_RefNannyFinishContext();
5711static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
5712static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
5713 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5715 __Pyx_RefNannyDeclarations
5716 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
5717 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5718 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
5721 __Pyx_RefNannyFinishContext();
5725static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
5737 __pyx_r = (__pyx_v_self->_shape[0]);
5764static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
5765static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
5766 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5767 PyObject *__pyx_r = 0;
5768 __Pyx_RefNannyDeclarations
5769 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
5770 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5771 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
5774 __Pyx_RefNannyFinishContext();
5778static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
5779 PyObject *__pyx_r = NULL;
5780 __Pyx_RefNannyDeclarations
5781 PyObject *__pyx_t_1 = NULL;
5782 PyObject *__pyx_t_2 = NULL;
5783 int __pyx_lineno = 0;
5784 const char *__pyx_filename = NULL;
5785 int __pyx_clineno = 0;
5786 __Pyx_RefNannySetupContext(
"__getattr__", 0);
5795 __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)
5796 __Pyx_GOTREF(__pyx_t_1);
5797 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
5798 __Pyx_GOTREF(__pyx_t_2);
5799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5801 PyObject *__pyx_temp;
5803 __pyx_temp = __pyx_r;
5804 __pyx_r = __pyx_t_2;
5806 __Pyx_XDECREF(__pyx_temp);
5821 __Pyx_XDECREF(__pyx_t_1);
5822 __Pyx_XDECREF(__pyx_t_2);
5823 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5826 __Pyx_XGIVEREF(__pyx_r);
5827 __Pyx_RefNannyFinishContext();
5840static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
5841static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
5842 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5843 PyObject *__pyx_r = 0;
5844 __Pyx_RefNannyDeclarations
5845 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
5846 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5847 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
5850 __Pyx_RefNannyFinishContext();
5854static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
5855 PyObject *__pyx_r = NULL;
5856 __Pyx_RefNannyDeclarations
5857 PyObject *__pyx_t_1 = NULL;
5858 PyObject *__pyx_t_2 = NULL;
5859 int __pyx_lineno = 0;
5860 const char *__pyx_filename = NULL;
5861 int __pyx_clineno = 0;
5862 __Pyx_RefNannySetupContext(
"__getitem__", 0);
5871 __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)
5872 __Pyx_GOTREF(__pyx_t_1);
5873 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
5874 __Pyx_GOTREF(__pyx_t_2);
5875 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5877 PyObject *__pyx_temp;
5879 __pyx_temp = __pyx_r;
5880 __pyx_r = __pyx_t_2;
5882 __Pyx_XDECREF(__pyx_temp);
5897 __Pyx_XDECREF(__pyx_t_1);
5898 __Pyx_XDECREF(__pyx_t_2);
5899 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5902 __Pyx_XGIVEREF(__pyx_r);
5903 __Pyx_RefNannyFinishContext();
5916static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
5917static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
5918 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5920 __Pyx_RefNannyDeclarations
5921 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
5922 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5923 __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));
5926 __Pyx_RefNannyFinishContext();
5930static 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) {
5932 __Pyx_RefNannyDeclarations
5933 PyObject *__pyx_t_1 = NULL;
5934 int __pyx_lineno = 0;
5935 const char *__pyx_filename = NULL;
5936 int __pyx_clineno = 0;
5937 __Pyx_RefNannySetupContext(
"__setitem__", 0);
5946 __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)
5947 __Pyx_GOTREF(__pyx_t_1);
5948 if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 255, __pyx_L1_error)
5949 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5963 __Pyx_XDECREF(__pyx_t_1);
5964 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5968 __Pyx_RefNannyFinishContext();
5979static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
5980#
if CYTHON_VECTORCALL
5981PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5983PyObject *__pyx_args, PyObject *__pyx_kwds
5986static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
5987#
if CYTHON_VECTORCALL
5988PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5990PyObject *__pyx_args, PyObject *__pyx_kwds
5993 #if !CYTHON_VECTORCALL
5994 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5996 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5997 PyObject *__pyx_r = 0;
5998 __Pyx_RefNannyDeclarations
5999 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
6000 #if !CYTHON_VECTORCALL
6001 #if CYTHON_ASSUME_SAFE_SIZE
6002 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6004 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6007 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6008 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
6009 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6010 if (unlikely(__pyx_kwds_len < 0))
return NULL;
6011 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
6012 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
6015 __Pyx_RefNannyFinishContext();
6019static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
6020 PyObject *__pyx_r = NULL;
6021 __Pyx_RefNannyDeclarations
6022 int __pyx_lineno = 0;
6023 const char *__pyx_filename = NULL;
6024 int __pyx_clineno = 0;
6025 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
6033 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6034 __PYX_ERR(1, 2, __pyx_L1_error)
6044 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6046 __Pyx_XGIVEREF(__pyx_r);
6047 __Pyx_RefNannyFinishContext();
6059static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6060#
if CYTHON_VECTORCALL
6061PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6063PyObject *__pyx_args, PyObject *__pyx_kwds
6066static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6067#
if CYTHON_VECTORCALL
6068PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6070PyObject *__pyx_args, PyObject *__pyx_kwds
6073 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6074 #if !CYTHON_VECTORCALL
6075 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6077 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6078 PyObject* values[1] = {0};
6079 int __pyx_lineno = 0;
6080 const char *__pyx_filename = NULL;
6081 int __pyx_clineno = 0;
6082 PyObject *__pyx_r = 0;
6083 __Pyx_RefNannyDeclarations
6084 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
6085 #if !CYTHON_VECTORCALL
6086 #if CYTHON_ASSUME_SAFE_SIZE
6087 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6089 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6092 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6094 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
6095 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6096 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
6097 if (__pyx_kwds_len > 0) {
6098 switch (__pyx_nargs) {
6100 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6101 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6104 default:
goto __pyx_L5_argtuple_error;
6106 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6107 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)
6108 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6109 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
6111 }
else if (unlikely(__pyx_nargs != 1)) {
6112 goto __pyx_L5_argtuple_error;
6114 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6115 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6117 __pyx_v___pyx_state = values[0];
6120 __pyx_L5_argtuple_error:;
6121 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6123 goto __pyx_L4_argument_unpacking_done;
6125 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6126 Py_XDECREF(values[__pyx_temp]);
6128 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6129 __Pyx_RefNannyFinishContext();
6131 __pyx_L4_argument_unpacking_done:;
6132 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
6135 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6136 Py_XDECREF(values[__pyx_temp]);
6138 __Pyx_RefNannyFinishContext();
6142static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6143 PyObject *__pyx_r = NULL;
6144 __Pyx_RefNannyDeclarations
6145 int __pyx_lineno = 0;
6146 const char *__pyx_filename = NULL;
6147 int __pyx_clineno = 0;
6148 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
6155 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6156 __PYX_ERR(1, 4, __pyx_L1_error)
6167 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6169 __Pyx_XGIVEREF(__pyx_r);
6170 __Pyx_RefNannyFinishContext();
6182static int __pyx_array_allocate_buffer(
struct __pyx_array_obj *__pyx_v_self) {
6183 Py_ssize_t __pyx_v_i;
6184 PyObject **__pyx_v_p;
6187 Py_ssize_t __pyx_t_2;
6188 Py_ssize_t __pyx_t_3;
6189 Py_ssize_t __pyx_t_4;
6190 int __pyx_lineno = 0;
6191 const char *__pyx_filename = NULL;
6192 int __pyx_clineno = 0;
6201 __pyx_v_self->free_data = 1;
6210 __pyx_v_self->data = ((
char *)malloc(((
size_t)__pyx_v_self->len)));
6219 __pyx_t_1 = (!(__pyx_v_self->data != 0));
6221 if (unlikely(__pyx_t_1)) {
6231 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_array_data, 0, 0);
6232 __PYX_ERR(1, 274, __pyx_L1_error)
6250 if (__pyx_v_self->dtype_is_object) {
6259 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6268 if (unlikely(__pyx_v_self->itemsize == 0)) {
6269 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
6270 __PYX_ERR(1, 278, __pyx_L1_error)
6272 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))) {
6273 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
6274 __PYX_ERR(1, 278, __pyx_L1_error)
6277 __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize, 0);
6278 __pyx_t_3 = __pyx_t_2;
6280 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6281 __pyx_v_i = __pyx_t_4;
6290 (__pyx_v_p[__pyx_v_i]) = Py_None;
6335 __Pyx_AddTraceback(
"View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6352static 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) {
6353 struct __pyx_array_obj *__pyx_v_result = 0;
6354 PyObject *__pyx_v_mode = 0;
6355 struct __pyx_array_obj *__pyx_r = NULL;
6356 __Pyx_RefNannyDeclarations
6357 PyObject *__pyx_t_1 = NULL;
6359 PyObject *__pyx_t_3 = NULL;
6360 PyObject *__pyx_t_4 = NULL;
6361 int __pyx_lineno = 0;
6362 const char *__pyx_filename = NULL;
6363 int __pyx_clineno = 0;
6364 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
6373 __pyx_t_2 = ((__pyx_v_c_mode[0]) ==
'f');
6376 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
6377 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
6379 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
6380 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
6383 __pyx_v_mode = ((PyObject*)__pyx_t_1);
6393 __pyx_t_2 = (__pyx_v_buf == NULL);
6405 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
6406 __Pyx_GOTREF(__pyx_t_1);
6407 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
6408 __Pyx_GOTREF(__pyx_t_3);
6409 __pyx_t_4 = PyTuple_New(4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 290, __pyx_L1_error)
6410 __Pyx_GOTREF(__pyx_t_4);
6411 __Pyx_INCREF(__pyx_v_shape);
6412 __Pyx_GIVEREF(__pyx_v_shape);
6413 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6414 __Pyx_GIVEREF(__pyx_t_1);
6415 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6416 __Pyx_GIVEREF(__pyx_t_3);
6417 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6418 __Pyx_INCREF(__pyx_v_mode);
6419 __Pyx_GIVEREF(__pyx_v_mode);
6420 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6423 __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)
6424 __Pyx_GOTREF(__pyx_t_3);
6425 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6426 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_3);
6447 __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
6448 __Pyx_GOTREF(__pyx_t_3);
6449 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6450 __Pyx_GOTREF(__pyx_t_4);
6451 __pyx_t_1 = PyTuple_New(4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
6452 __Pyx_GOTREF(__pyx_t_1);
6453 __Pyx_INCREF(__pyx_v_shape);
6454 __Pyx_GIVEREF(__pyx_v_shape);
6455 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6456 __Pyx_GIVEREF(__pyx_t_3);
6457 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6458 __Pyx_GIVEREF(__pyx_t_4);
6459 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6460 __Pyx_INCREF(__pyx_v_mode);
6461 __Pyx_GIVEREF(__pyx_v_mode);
6462 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6465 __pyx_t_4 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6466 __Pyx_GOTREF(__pyx_t_4);
6467 if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_allocate_buffer, Py_False) < (0)) __PYX_ERR(1, 292, __pyx_L1_error)
6468 __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)
6469 __Pyx_GOTREF(__pyx_t_3);
6470 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6471 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6472 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_3);
6482 __pyx_v_result->data = __pyx_v_buf;
6494 struct __pyx_array_obj *__pyx_temp;
6496 __pyx_temp = __pyx_r;
6497 __Pyx_INCREF((PyObject *)__pyx_v_result);
6498 __pyx_r = __pyx_v_result;
6500 __Pyx_XDECREF((PyObject *)__pyx_temp);
6514 __Pyx_XDECREF(__pyx_t_1);
6515 __Pyx_XDECREF(__pyx_t_3);
6516 __Pyx_XDECREF(__pyx_t_4);
6517 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
6520 __Pyx_XDECREF((PyObject *)__pyx_v_result);
6521 __Pyx_XDECREF(__pyx_v_mode);
6522 __Pyx_XGIVEREF((PyObject *)__pyx_r);
6523 __Pyx_RefNannyFinishContext();
6536static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6537#
if CYTHON_VECTORCALL_TPNEW
6538PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6540PyObject *__pyx_args, PyObject *__pyx_kwds
6543static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6544#
if CYTHON_VECTORCALL_TPNEW
6545PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6547PyObject *__pyx_args, PyObject *__pyx_kwds
6550 PyObject *__pyx_v_name = 0;
6551 #if !CYTHON_VECTORCALL_TPNEW
6552 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6554 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6555 PyObject* values[1] = {0};
6556 int __pyx_lineno = 0;
6557 const char *__pyx_filename = NULL;
6558 int __pyx_clineno = 0;
6560 __Pyx_RefNannyDeclarations
6561 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
6562 #if !CYTHON_VECTORCALL_TPNEW
6563 #if CYTHON_ASSUME_SAFE_SIZE
6564 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6566 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
6569 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
6571 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
6572 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
6573 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 321, __pyx_L3_error)
6574 if (__pyx_kwds_len > 0) {
6575 switch (__pyx_nargs) {
6577 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6578 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6581 default:
goto __pyx_L5_argtuple_error;
6583 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6584 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)
6585 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6586 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, i); __PYX_ERR(1, 321, __pyx_L3_error) }
6588 }
else if (unlikely(__pyx_nargs != 1)) {
6589 goto __pyx_L5_argtuple_error;
6591 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6592 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6594 __pyx_v_name = values[0];
6597 __pyx_L5_argtuple_error:;
6598 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 321, __pyx_L3_error)
6600 goto __pyx_L4_argument_unpacking_done;
6602 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6603 Py_XDECREF(values[__pyx_temp]);
6605 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6606 __Pyx_RefNannyFinishContext();
6608 __pyx_L4_argument_unpacking_done:;
6609 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
6612 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6613 Py_XDECREF(values[__pyx_temp]);
6615 __Pyx_RefNannyFinishContext();
6619static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
6621 __Pyx_RefNannyDeclarations
6622 __Pyx_RefNannySetupContext(
"__init__", 0);
6631 __Pyx_INCREF(__pyx_v_name);
6632 __Pyx_GIVEREF(__pyx_v_name);
6633 __Pyx_GOTREF(__pyx_v_self->name);
6634 __Pyx_DECREF(__pyx_v_self->name);
6635 __pyx_v_self->name = __pyx_v_name;
6648 __Pyx_RefNannyFinishContext();
6661static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
6662static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
6663 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6664 PyObject *__pyx_r = 0;
6665 __Pyx_RefNannyDeclarations
6666 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
6667 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6668 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6671 __Pyx_RefNannyFinishContext();
6675static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6676 PyObject *__pyx_r = NULL;
6677 __Pyx_RefNannyDeclarations
6678 __Pyx_RefNannySetupContext(
"__repr__", 0);
6688 PyObject *__pyx_temp;
6690 __pyx_temp = __pyx_r;
6691 __Pyx_INCREF(__pyx_v_self->name);
6692 __pyx_r = __pyx_v_self->name;
6694 __Pyx_XDECREF(__pyx_temp);
6708 __Pyx_XGIVEREF(__pyx_r);
6709 __Pyx_RefNannyFinishContext();
6720static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
6721#
if CYTHON_VECTORCALL
6722PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6724PyObject *__pyx_args, PyObject *__pyx_kwds
6727static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
6728#
if CYTHON_VECTORCALL
6729PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6731PyObject *__pyx_args, PyObject *__pyx_kwds
6734 #if !CYTHON_VECTORCALL
6735 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6737 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6738 PyObject *__pyx_r = 0;
6739 __Pyx_RefNannyDeclarations
6740 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
6741 #if !CYTHON_VECTORCALL
6742 #if CYTHON_ASSUME_SAFE_SIZE
6743 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6745 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6748 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6749 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
6750 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6751 if (unlikely(__pyx_kwds_len < 0))
return NULL;
6752 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
6753 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6756 __Pyx_RefNannyFinishContext();
6760static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6761 PyObject *__pyx_v_state = 0;
6762 PyObject *__pyx_v__dict = 0;
6763 int __pyx_v_use_setstate;
6764 PyObject *__pyx_r = NULL;
6765 __Pyx_RefNannyDeclarations
6766 PyObject *__pyx_t_1 = NULL;
6767 PyObject *__pyx_t_2 = NULL;
6770 PyObject *__pyx_t_5 = NULL;
6771 int __pyx_lineno = 0;
6772 const char *__pyx_filename = NULL;
6773 int __pyx_clineno = 0;
6774 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
6784 __Pyx_PyCriticalSection __pyx_cs;
6785 __pyx_t_1 = ((PyObject *)__pyx_v_self);
6786 __Pyx_INCREF(__pyx_t_1);
6787 __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
6797 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L4_error)
6798 __Pyx_GOTREF(__pyx_t_2);
6799 __Pyx_INCREF(__pyx_v_self->name);
6800 __Pyx_GIVEREF(__pyx_v_self->name);
6801 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name) != (0)) __PYX_ERR(1, 6, __pyx_L4_error);
6802 __pyx_v_state = ((PyObject*)__pyx_t_2);
6812 __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)
6813 __Pyx_GOTREF(__pyx_t_2);
6814 __pyx_v__dict = __pyx_t_2;
6827 __Pyx_PyCriticalSection_End(&__pyx_cs);
6831 __Pyx_PyCriticalSection_End(&__pyx_cs);
6832 goto __pyx_L1_error;
6836 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6846 __pyx_t_4 = (__pyx_v__dict != Py_None);
6851 __pyx_t_3 = __pyx_t_4;
6853 goto __pyx_L7_bool_binop_done;
6855 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict);
if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 8, __pyx_L1_error)
6857 __pyx_t_3 = __pyx_t_4;
6859 __pyx_L7_bool_binop_done:;
6870 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
6871 __Pyx_GOTREF(__pyx_t_1);
6872 __Pyx_INCREF(__pyx_v__dict);
6873 __Pyx_GIVEREF(__pyx_v__dict);
6874 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 9, __pyx_L1_error);
6875 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
6876 __Pyx_GOTREF(__pyx_t_2);
6877 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6878 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
6888 __pyx_v_use_setstate = 1;
6908 __pyx_t_3 = (__pyx_v_self->name != Py_None);
6909 __pyx_v_use_setstate = __pyx_t_3;
6920 if (__pyx_v_use_setstate) {
6929 __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)
6930 __Pyx_GOTREF(__pyx_t_2);
6931 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6932 __Pyx_GOTREF(__pyx_t_1);
6933 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6934 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6935 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6936 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
6937 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
6938 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6939 __Pyx_INCREF(Py_None);
6940 __Pyx_GIVEREF(Py_None);
6941 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6942 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
6943 __Pyx_GOTREF(__pyx_t_5);
6944 __Pyx_GIVEREF(__pyx_t_2);
6945 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6946 __Pyx_GIVEREF(__pyx_t_1);
6947 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6948 __Pyx_INCREF(__pyx_v_state);
6949 __Pyx_GIVEREF(__pyx_v_state);
6950 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6954 PyObject *__pyx_temp;
6956 __pyx_temp = __pyx_r;
6957 __pyx_r = __pyx_t_5;
6959 __Pyx_XDECREF(__pyx_temp);
6981 __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)
6982 __Pyx_GOTREF(__pyx_t_5);
6983 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
6984 __Pyx_GOTREF(__pyx_t_1);
6985 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6986 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6987 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
6988 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
6989 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
6990 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
6991 __Pyx_INCREF(__pyx_v_state);
6992 __Pyx_GIVEREF(__pyx_v_state);
6993 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
6994 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
6995 __Pyx_GOTREF(__pyx_t_2);
6996 __Pyx_GIVEREF(__pyx_t_5);
6997 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
6998 __Pyx_GIVEREF(__pyx_t_1);
6999 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7003 PyObject *__pyx_temp;
7005 __pyx_temp = __pyx_r;
7006 __pyx_r = __pyx_t_2;
7008 __Pyx_XDECREF(__pyx_temp);
7022 __Pyx_XDECREF(__pyx_t_1);
7023 __Pyx_XDECREF(__pyx_t_2);
7024 __Pyx_XDECREF(__pyx_t_5);
7025 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7028 __Pyx_XDECREF(__pyx_v_state);
7029 __Pyx_XDECREF(__pyx_v__dict);
7031 __Pyx_XGIVEREF(__pyx_r);
7032 __Pyx_RefNannyFinishContext();
7044static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7045#
if CYTHON_VECTORCALL
7046PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7048PyObject *__pyx_args, PyObject *__pyx_kwds
7051static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7052#
if CYTHON_VECTORCALL
7053PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7055PyObject *__pyx_args, PyObject *__pyx_kwds
7058 PyObject *__pyx_v___pyx_state = 0;
7059 #if !CYTHON_VECTORCALL
7060 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7062 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7063 PyObject* values[1] = {0};
7064 int __pyx_lineno = 0;
7065 const char *__pyx_filename = NULL;
7066 int __pyx_clineno = 0;
7067 PyObject *__pyx_r = 0;
7068 __Pyx_RefNannyDeclarations
7069 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
7070 #if !CYTHON_VECTORCALL
7071 #if CYTHON_ASSUME_SAFE_SIZE
7072 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7074 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
7077 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7079 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
7080 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7081 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 17, __pyx_L3_error)
7082 if (__pyx_kwds_len > 0) {
7083 switch (__pyx_nargs) {
7085 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7086 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7089 default:
goto __pyx_L5_argtuple_error;
7091 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7092 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)
7093 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
7094 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 17, __pyx_L3_error) }
7096 }
else if (unlikely(__pyx_nargs != 1)) {
7097 goto __pyx_L5_argtuple_error;
7099 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7100 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7102 __pyx_v___pyx_state = values[0];
7105 __pyx_L5_argtuple_error:;
7106 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 17, __pyx_L3_error)
7108 goto __pyx_L4_argument_unpacking_done;
7110 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7111 Py_XDECREF(values[__pyx_temp]);
7113 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7114 __Pyx_RefNannyFinishContext();
7116 __pyx_L4_argument_unpacking_done:;
7117 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
7120 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7121 Py_XDECREF(values[__pyx_temp]);
7123 __Pyx_RefNannyFinishContext();
7127static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7128 PyObject *__pyx_r = NULL;
7129 __Pyx_RefNannyDeclarations
7130 PyObject *__pyx_t_1 = NULL;
7131 PyObject *__pyx_t_2 = NULL;
7132 int __pyx_lineno = 0;
7133 const char *__pyx_filename = NULL;
7134 int __pyx_clineno = 0;
7135 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
7142 __pyx_t_1 = __pyx_v___pyx_state;
7143 __Pyx_INCREF(__pyx_t_1);
7144 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)
7145 if (unlikely(__pyx_t_1 == Py_None)) {
7146 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
7147 __PYX_ERR(1, 18, __pyx_L1_error)
7149 __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)
7150 __Pyx_GOTREF(__pyx_t_2);
7151 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7152 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7162 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7165 __Pyx_XDECREF(__pyx_t_1);
7166 __Pyx_XDECREF(__pyx_t_2);
7167 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7170 __Pyx_XGIVEREF(__pyx_r);
7171 __Pyx_RefNannyFinishContext();
7184static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7185#
if CYTHON_VECTORCALL_TPNEW
7186PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7188PyObject *__pyx_args, PyObject *__pyx_kwds
7191static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7192#
if CYTHON_VECTORCALL_TPNEW
7193PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7195PyObject *__pyx_args, PyObject *__pyx_kwds
7198 PyObject *__pyx_v_obj = 0;
7200 int __pyx_v_dtype_is_object;
7201 #if !CYTHON_VECTORCALL_TPNEW
7202 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7204 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7205 PyObject* values[3] = {0,0,0};
7206 int __pyx_lineno = 0;
7207 const char *__pyx_filename = NULL;
7208 int __pyx_clineno = 0;
7210 __Pyx_RefNannyDeclarations
7211 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
7212 #if !CYTHON_VECTORCALL_TPNEW
7213 #if CYTHON_ASSUME_SAFE_SIZE
7214 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7216 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
7219 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
7221 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};
7222 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
7223 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 367, __pyx_L3_error)
7224 if (__pyx_kwds_len > 0) {
7225 switch (__pyx_nargs) {
7227 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7228 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7231 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7232 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7235 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7236 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7239 default:
goto __pyx_L5_argtuple_error;
7241 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7242 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)
7243 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
7244 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, i); __PYX_ERR(1, 367, __pyx_L3_error) }
7247 switch (__pyx_nargs) {
7249 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7250 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7253 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7254 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7255 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7256 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7258 default:
goto __pyx_L5_argtuple_error;
7261 __pyx_v_obj = values[0];
7262 __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)
7264 __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)
7266 __pyx_v_dtype_is_object = ((int)0);
7270 __pyx_L5_argtuple_error:;
7271 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 367, __pyx_L3_error)
7273 goto __pyx_L4_argument_unpacking_done;
7275 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7276 Py_XDECREF(values[__pyx_temp]);
7278 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7279 __Pyx_RefNannyFinishContext();
7281 __pyx_L4_argument_unpacking_done:;
7282 __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);
7285 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7286 Py_XDECREF(values[__pyx_temp]);
7290 __Pyx_RefNannyFinishContext();
7294static 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) {
7296 __Pyx_RefNannyDeclarations
7300 int __pyx_lineno = 0;
7301 const char *__pyx_filename = NULL;
7302 int __pyx_clineno = 0;
7303 __Pyx_RefNannySetupContext(
"__cinit__", 0);
7312 __Pyx_INCREF(__pyx_v_obj);
7313 __Pyx_GIVEREF(__pyx_v_obj);
7314 __Pyx_GOTREF(__pyx_v_self->obj);
7315 __Pyx_DECREF(__pyx_v_self->obj);
7316 __pyx_v_self->obj = __pyx_v_obj;
7325 __pyx_v_self->flags = __pyx_v_flags;
7334 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type));
7339 __pyx_t_1 = __pyx_t_2;
7341 goto __pyx_L4_bool_binop_done;
7343 __pyx_t_2 = (__pyx_v_obj != Py_None);
7345 __pyx_t_1 = __pyx_t_2;
7347 __pyx_L4_bool_binop_done:;
7358 __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)
7368 __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
7380 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7416 __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
7428 __pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
7434 __pyx_t_1 = __pyx_t_2;
7436 goto __pyx_L9_bool_binop_done;
7446 __pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
7449 __pyx_t_1 = __pyx_t_2;
7451 __pyx_L9_bool_binop_done:;
7470 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7479 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
7497 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7509 __pyx_v_self->lock = PyThread_allocate_lock();
7518 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7520 if (unlikely(__pyx_t_1)) {
7530 PyErr_NoMemory(); __PYX_ERR(1, 386, __pyx_L1_error)
7566 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7578 __pyx_t_2 = ((__pyx_v_self->view.format[0]) ==
'O');
7584 __pyx_t_1 = __pyx_t_2;
7586 goto __pyx_L14_bool_binop_done;
7588 __pyx_t_2 = ((__pyx_v_self->view.format[1]) ==
'\x00');
7591 __pyx_t_1 = __pyx_t_2;
7593 __pyx_L14_bool_binop_done:;
7594 __pyx_v_self->dtype_is_object = __pyx_t_1;
7614 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
7625 #ifndef CYTHON_WITHOUT_ASSERTIONS
7626 if (unlikely(__pyx_assertions_enabled())) {
7627 __pyx_t_1 = ((((__pyx_uintptr_t)(&__pyx_v_self->acquisition_count)) % (
sizeof(__pyx_atomic_int_type))) == 0);
7629 if (unlikely(!__pyx_t_1)) {
7630 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
7631 __PYX_ERR(1, 394, __pyx_L1_error)
7636 if ((1));
else __PYX_ERR(1, 394, __pyx_L1_error)
7646 __pyx_v_self->typeinfo = NULL;
7660 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7664 __Pyx_RefNannyFinishContext();
7677static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
7678static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
7679 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7680 __Pyx_RefNannyDeclarations
7681 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7682 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7683 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
7686 __Pyx_RefNannyFinishContext();
7689static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
7692 Py_ssize_t __pyx_t_2;
7693 Py_ssize_t __pyx_t_3;
7695 PyThread_type_lock __pyx_t_5;
7696 PyThread_type_lock __pyx_t_6;
7705 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
7716 PyBuffer_Release((&__pyx_v_self->view));
7735 __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
7747 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
7775 __pyx_t_1 = (__pyx_v_self->lock != NULL);
7787 __pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
7794 __pyx_t_2 = __pyx_memoryview_thread_locks_used;
7797 __pyx_t_3 = __pyx_t_2;
7799 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
7800 __pyx_v_i = __pyx_t_4;
7809 __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
7821 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
7830 __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
7842 __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7844 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
7854 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
7856 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
7875 goto __pyx_L6_break;
7895 PyThread_free_lock(__pyx_v_self->lock);
7931static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
7932 Py_ssize_t __pyx_v_dim;
7933 char *__pyx_v_itemp;
7934 PyObject *__pyx_v_idx = NULL;
7936 __Pyx_RefNannyDeclarations
7937 Py_ssize_t __pyx_t_1;
7938 PyObject *__pyx_t_2 = NULL;
7939 Py_ssize_t __pyx_t_3;
7940 PyObject *__pyx_t_4 = NULL;
7941 Py_ssize_t __pyx_t_5;
7943 int __pyx_lineno = 0;
7944 const char *__pyx_filename = NULL;
7945 int __pyx_clineno = 0;
7946 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
7955 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
7966 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
7970 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
7971 #if !CYTHON_ASSUME_SAFE_SIZE
7972 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 423, __pyx_L1_error)
7974 if (__pyx_t_3 >= __pyx_temp)
break;
7976 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7977 __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
7979 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
7982 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
7983 __Pyx_GOTREF(__pyx_t_4);
7984 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
7986 __pyx_v_dim = __pyx_t_1;
7987 __pyx_t_1 = (__pyx_t_1 + 1);
7996 __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)
7997 __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)
7998 __pyx_v_itemp = __pyx_t_6;
8009 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8020 __pyx_r = __pyx_v_itemp;
8034 __Pyx_XDECREF(__pyx_t_2);
8035 __Pyx_XDECREF(__pyx_t_4);
8036 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8041 __Pyx_XDECREF(__pyx_v_idx);
8043 __Pyx_RefNannyFinishContext();
8056static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
8057static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8058 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
8059 PyObject *__pyx_r = 0;
8060 __Pyx_RefNannyDeclarations
8061 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
8062 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8063 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8066 __Pyx_RefNannyFinishContext();
8070static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8071 char *__pyx_v_buffer;
8072 int __pyx_v_have_slices;
8073 PyObject *__pyx_v_indices = NULL;
8074 char *__pyx_v_itemp;
8075 PyObject *__pyx_r = NULL;
8076 __Pyx_RefNannyDeclarations
8079 Py_ssize_t __pyx_t_3;
8081 PyObject *__pyx_t_5 = NULL;
8082 PyObject *__pyx_t_6 = NULL;
8083 PyObject *__pyx_t_7 = NULL;
8084 int __pyx_lineno = 0;
8085 const char *__pyx_filename = NULL;
8086 int __pyx_clineno = 0;
8087 __Pyx_RefNannySetupContext(
"__getitem__", 0);
8096 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8102 __pyx_t_1 = __pyx_t_2;
8104 goto __pyx_L4_bool_binop_done;
8106 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8108 __pyx_t_1 = __pyx_t_2;
8110 __pyx_L4_bool_binop_done:;
8121 __pyx_v_buffer = ((
char *)__pyx_v_self->view.buf);
8130 __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)
8131 __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)
8140 __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)
8141 __Pyx_GOTREF(__pyx_t_5);
8145 PyObject *__pyx_temp;
8147 __pyx_temp = __pyx_r;
8148 __pyx_r = __pyx_t_5;
8150 __Pyx_XDECREF(__pyx_temp);
8171 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8183 PyObject *__pyx_temp;
8185 __pyx_temp = __pyx_r;
8186 __Pyx_INCREF((PyObject *)__pyx_v_self);
8187 __pyx_r = ((PyObject *)__pyx_v_self);
8189 __Pyx_XDECREF(__pyx_temp);
8209 __pyx_t_5 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 439, __pyx_L1_error)
8210 __Pyx_GOTREF(__pyx_t_5);
8211 if (likely(__pyx_t_5 != Py_None)) {
8212 PyObject* sequence = __pyx_t_5;
8213 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8214 if (unlikely(size != 2)) {
8215 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8216 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8217 __PYX_ERR(1, 439, __pyx_L1_error)
8219 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8220 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
8221 __Pyx_INCREF(__pyx_t_6);
8222 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
8223 __Pyx_INCREF(__pyx_t_7);
8225 __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 439, __pyx_L1_error)
8226 __Pyx_GOTREF(__pyx_t_6);
8227 __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L1_error)
8228 __Pyx_GOTREF(__pyx_t_7);
8230 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8232 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 439, __pyx_L1_error)
8234 __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)
8235 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8236 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)
8237 __pyx_v_have_slices = __pyx_t_1;
8238 __pyx_v_indices = ((PyObject*)__pyx_t_7);
8248 if (__pyx_v_have_slices) {
8257 __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)
8258 __Pyx_GOTREF(__pyx_t_5);
8260 PyObject *__pyx_temp;
8262 __pyx_temp = __pyx_r;
8263 __pyx_r = __pyx_t_5;
8265 __Pyx_XDECREF(__pyx_temp);
8287 if (unlikely(__pyx_v_indices == Py_None)) {
8288 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
8289 __PYX_ERR(1, 445, __pyx_L1_error)
8291 __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)
8292 __pyx_v_itemp = __pyx_t_4;
8301 __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)
8302 __Pyx_GOTREF(__pyx_t_5);
8304 PyObject *__pyx_temp;
8306 __pyx_temp = __pyx_r;
8307 __pyx_r = __pyx_t_5;
8309 __Pyx_XDECREF(__pyx_temp);
8325 __Pyx_XDECREF(__pyx_t_5);
8326 __Pyx_XDECREF(__pyx_t_6);
8327 __Pyx_XDECREF(__pyx_t_7);
8328 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8333 __Pyx_XDECREF(__pyx_v_indices);
8335 __Pyx_XGIVEREF(__pyx_r);
8336 __Pyx_RefNannyFinishContext();
8349static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
8350static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8351 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
8353 __Pyx_RefNannyDeclarations
8354 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
8355 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8356 __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));
8359 __Pyx_RefNannyFinishContext();
8363static 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) {
8364 int __pyx_v_have_slices;
8365 PyObject *__pyx_v_indices = NULL;
8366 PyObject *__pyx_v_obj = NULL;
8367 struct __pyx_memoryview_obj *__pyx_v_target_slice = NULL;
8369 __Pyx_RefNannyDeclarations
8372 PyObject *__pyx_t_3 = NULL;
8373 PyObject *__pyx_t_4 = NULL;
8374 PyObject *__pyx_t_5 = NULL;
8375 int __pyx_lineno = 0;
8376 const char *__pyx_filename = NULL;
8377 int __pyx_clineno = 0;
8378 __Pyx_RefNannySetupContext(
"__setitem__", 0);
8387 if (unlikely(__pyx_v_self->view.readonly)) {
8396 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_read_only_memor, 0, 0);
8397 __PYX_ERR(1, 450, __pyx_L1_error)
8415 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8421 __pyx_t_1 = __pyx_t_2;
8423 goto __pyx_L5_bool_binop_done;
8425 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8427 __pyx_t_1 = __pyx_t_2;
8429 __pyx_L5_bool_binop_done:;
8440 __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)
8441 __Pyx_GOTREF(__pyx_t_3);
8442 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8472 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 456, __pyx_L1_error)
8473 __Pyx_GOTREF(__pyx_t_3);
8474 if (likely(__pyx_t_3 != Py_None)) {
8475 PyObject* sequence = __pyx_t_3;
8476 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8477 if (unlikely(size != 2)) {
8478 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8479 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8480 __PYX_ERR(1, 456, __pyx_L1_error)
8482 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8483 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
8484 __Pyx_INCREF(__pyx_t_4);
8485 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
8486 __Pyx_INCREF(__pyx_t_5);
8488 __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 456, __pyx_L1_error)
8489 __Pyx_GOTREF(__pyx_t_4);
8490 __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error)
8491 __Pyx_GOTREF(__pyx_t_5);
8493 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8495 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 456, __pyx_L1_error)
8497 __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)
8498 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8499 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)
8500 __pyx_v_have_slices = __pyx_t_1;
8501 __pyx_v_indices = ((PyObject*)__pyx_t_5);
8511 if (__pyx_v_have_slices) {
8520 __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)
8521 __Pyx_GOTREF(__pyx_t_3);
8522 __pyx_v_obj = __pyx_t_3;
8532 __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)
8533 __Pyx_GOTREF(__pyx_t_3);
8534 __pyx_v_target_slice = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
8544 __pyx_t_1 = (__pyx_v_obj != Py_None);
8555 __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)
8556 __Pyx_GOTREF(__pyx_t_3);
8557 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8577 __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)
8578 __Pyx_GOTREF(__pyx_t_3);
8579 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8601 if (unlikely(__pyx_v_indices == Py_None)) {
8602 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
8603 __PYX_ERR(1, 466, __pyx_L1_error)
8605 __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)
8606 __Pyx_GOTREF(__pyx_t_3);
8607 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8623 __Pyx_XDECREF(__pyx_t_3);
8624 __Pyx_XDECREF(__pyx_t_4);
8625 __Pyx_XDECREF(__pyx_t_5);
8626 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8630 __Pyx_XDECREF(__pyx_v_indices);
8631 __Pyx_XDECREF(__pyx_v_obj);
8632 __Pyx_XDECREF((PyObject *)__pyx_v_target_slice);
8634 __Pyx_RefNannyFinishContext();
8646static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
8647 PyObject *__pyx_r = NULL;
8648 __Pyx_RefNannyDeclarations
8651 PyObject *__pyx_t_3 = NULL;
8652 PyObject *__pyx_t_4 = NULL;
8653 PyObject *__pyx_t_5 = NULL;
8654 PyObject *__pyx_t_6 = NULL;
8655 PyObject *__pyx_t_7 = NULL;
8656 PyObject *__pyx_t_8 = NULL;
8657 PyObject *__pyx_t_9 = NULL;
8660 int __pyx_lineno = 0;
8661 const char *__pyx_filename = NULL;
8662 int __pyx_clineno = 0;
8663 __Pyx_RefNannySetupContext(
"is_slice", 0);
8664 __Pyx_INCREF(__pyx_v_obj);
8673 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_memoryview_type);
8674 __pyx_t_2 = (!__pyx_t_1);
8688 __Pyx_PyThreadState_declare
8689 __Pyx_PyThreadState_assign
8690 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8691 __Pyx_XGOTREF(__pyx_t_3);
8692 __Pyx_XGOTREF(__pyx_t_4);
8693 __Pyx_XGOTREF(__pyx_t_5);
8704 __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)
8705 __Pyx_GOTREF(__pyx_t_8);
8714 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 473, __pyx_L4_error)
8715 __Pyx_GOTREF(__pyx_t_9);
8718 PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_obj, __pyx_t_8, __pyx_t_9};
8719 __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));
8720 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8721 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8722 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8723 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 472, __pyx_L4_error)
8724 __Pyx_GOTREF((PyObject *)__pyx_t_6);
8726 __Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
8737 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8738 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8739 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8740 goto __pyx_L9_try_end;
8742 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8743 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8744 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8745 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8754 __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
8756 __Pyx_ErrRestore(0,0,0);
8766 PyObject *__pyx_temp;
8768 __pyx_temp = __pyx_r;
8769 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8771 __Pyx_XDECREF(__pyx_temp);
8773 goto __pyx_L7_except_return;
8775 goto __pyx_L6_except_error;
8784 __pyx_L6_except_error:;
8785 __Pyx_XGIVEREF(__pyx_t_3);
8786 __Pyx_XGIVEREF(__pyx_t_4);
8787 __Pyx_XGIVEREF(__pyx_t_5);
8788 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8789 goto __pyx_L1_error;
8790 __pyx_L7_except_return:;
8791 __Pyx_XGIVEREF(__pyx_t_3);
8792 __Pyx_XGIVEREF(__pyx_t_4);
8793 __Pyx_XGIVEREF(__pyx_t_5);
8794 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8816 PyObject *__pyx_temp;
8818 __pyx_temp = __pyx_r;
8819 __Pyx_INCREF(__pyx_v_obj);
8820 __pyx_r = __pyx_v_obj;
8822 __Pyx_XDECREF(__pyx_temp);
8836 __Pyx_XDECREF(__pyx_t_6);
8837 __Pyx_XDECREF(__pyx_t_7);
8838 __Pyx_XDECREF(__pyx_t_8);
8839 __Pyx_XDECREF(__pyx_t_9);
8840 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
8843 __Pyx_XDECREF(__pyx_v_obj);
8844 __Pyx_XGIVEREF(__pyx_r);
8845 __Pyx_RefNannyFinishContext();
8857static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
8858 __Pyx_memviewslice __pyx_v_dst_slice;
8859 __Pyx_memviewslice __pyx_v_src_slice;
8860 __Pyx_memviewslice __pyx_v_msrc;
8861 __Pyx_memviewslice __pyx_v_mdst;
8862 PyObject *__pyx_r = NULL;
8863 __Pyx_RefNannyDeclarations
8864 __Pyx_memviewslice *__pyx_t_1;
8865 PyObject *__pyx_t_2 = NULL;
8869 int __pyx_lineno = 0;
8870 const char *__pyx_filename = NULL;
8871 int __pyx_clineno = 0;
8872 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
8881 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)
8882 __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)
8883 __pyx_v_msrc = (__pyx_t_1[0]);
8893 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)
8894 __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)
8895 __pyx_v_mdst = (__pyx_t_1[0]);
8905 __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)
8906 __Pyx_GOTREF(__pyx_t_2);
8907 __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)
8908 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8909 __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)
8910 __Pyx_GOTREF(__pyx_t_2);
8911 __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)
8912 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8913 __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)
8927 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8930 __Pyx_XDECREF(__pyx_t_2);
8931 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
8938 __Pyx_XGIVEREF(__pyx_r);
8939 __Pyx_RefNannyFinishContext();
8951static 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) {
8952 int __pyx_v_array[128];
8955 __Pyx_memviewslice *__pyx_v_dst_slice;
8956 __Pyx_memviewslice __pyx_v_tmp_slice;
8957 PyObject *__pyx_r = NULL;
8958 __Pyx_RefNannyDeclarations
8959 __Pyx_memviewslice *__pyx_t_1;
8961 PyObject *__pyx_t_3 = NULL;
8964 char const *__pyx_t_6;
8965 PyObject *__pyx_t_7 = NULL;
8966 PyObject *__pyx_t_8 = NULL;
8967 PyObject *__pyx_t_9 = NULL;
8968 PyObject *__pyx_t_10 = NULL;
8969 PyObject *__pyx_t_11 = NULL;
8970 PyObject *__pyx_t_12 = NULL;
8971 int __pyx_lineno = 0;
8972 const char *__pyx_filename = NULL;
8973 int __pyx_clineno = 0;
8974 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
8992 __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)
8993 __pyx_v_dst_slice = __pyx_t_1;
9002 __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array)));
9014 __pyx_v_tmp = PyMem_Malloc(((
size_t)__pyx_v_self->view.itemsize));
9023 __pyx_t_2 = (__pyx_v_tmp == NULL);
9025 if (unlikely(__pyx_t_2)) {
9035 PyErr_NoMemory(); __PYX_ERR(1, 501, __pyx_L1_error)
9053 __pyx_v_item = __pyx_v_tmp;
9073 __pyx_v_item = ((
void *)__pyx_v_array);
9093 if (__pyx_v_self->dtype_is_object) {
9102 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9122 __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)
9123 __Pyx_GOTREF(__pyx_t_3);
9124 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9135 __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9147 __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)
9166 __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);
9178 PyMem_Free(__pyx_v_tmp);
9183 __Pyx_PyThreadState_declare
9184 __Pyx_PyThreadState_assign
9185 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9186 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9187 __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9188 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);
9189 __Pyx_XGOTREF(__pyx_t_7);
9190 __Pyx_XGOTREF(__pyx_t_8);
9191 __Pyx_XGOTREF(__pyx_t_9);
9192 __Pyx_XGOTREF(__pyx_t_10);
9193 __Pyx_XGOTREF(__pyx_t_11);
9194 __Pyx_XGOTREF(__pyx_t_12);
9195 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9197 PyMem_Free(__pyx_v_tmp);
9199 __Pyx_XGIVEREF(__pyx_t_10);
9200 __Pyx_XGIVEREF(__pyx_t_11);
9201 __Pyx_XGIVEREF(__pyx_t_12);
9202 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9203 __Pyx_XGIVEREF(__pyx_t_7);
9204 __Pyx_XGIVEREF(__pyx_t_8);
9205 __Pyx_XGIVEREF(__pyx_t_9);
9206 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9207 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9208 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9209 goto __pyx_L1_error;
9223 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9226 __Pyx_XDECREF(__pyx_t_3);
9227 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9235 __Pyx_XGIVEREF(__pyx_r);
9236 __Pyx_RefNannyFinishContext();
9248static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value) {
9249 char *__pyx_v_itemp;
9250 PyObject *__pyx_r = NULL;
9251 __Pyx_RefNannyDeclarations
9253 PyObject *__pyx_t_2 = NULL;
9254 int __pyx_lineno = 0;
9255 const char *__pyx_filename = NULL;
9256 int __pyx_clineno = 0;
9257 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
9266 __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)
9267 __pyx_v_itemp = __pyx_t_1;
9276 __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)
9277 __Pyx_GOTREF(__pyx_t_2);
9278 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9289 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9292 __Pyx_XDECREF(__pyx_t_2);
9293 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9297 __Pyx_XGIVEREF(__pyx_r);
9298 __Pyx_RefNannyFinishContext();
9310static PyObject *__pyx_memoryview_setitem_indexed1(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9311 char *__pyx_v_buffer;
9312 char *__pyx_v_itemp;
9313 PyObject *__pyx_r = NULL;
9314 __Pyx_RefNannyDeclarations
9315 Py_ssize_t __pyx_t_1;
9317 PyObject *__pyx_t_3 = NULL;
9318 int __pyx_lineno = 0;
9319 const char *__pyx_filename = NULL;
9320 int __pyx_clineno = 0;
9321 __Pyx_RefNannySetupContext(
"setitem_indexed1", 0);
9330 __pyx_v_buffer = ((
char *)__pyx_v_self->view.buf);
9339 __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)
9340 __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)
9341 __pyx_v_itemp = __pyx_t_2;
9351 __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)
9352 __Pyx_GOTREF(__pyx_t_3);
9353 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9364 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9367 __Pyx_XDECREF(__pyx_t_3);
9368 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed1", __pyx_clineno, __pyx_lineno, __pyx_filename);
9373 __Pyx_XGIVEREF(__pyx_r);
9374 __Pyx_RefNannyFinishContext();
9386static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
9387 PyObject *__pyx_v_struct = NULL;
9388 PyObject *__pyx_v_bytesitem = 0;
9389 PyObject *__pyx_v_result = NULL;
9390 PyObject *__pyx_r = NULL;
9391 __Pyx_RefNannyDeclarations
9392 PyObject *__pyx_t_1 = NULL;
9393 PyObject *__pyx_t_2 = NULL;
9394 PyObject *__pyx_t_3 = NULL;
9395 PyObject *__pyx_t_4 = NULL;
9396 PyObject *__pyx_t_5 = NULL;
9397 PyObject *__pyx_t_6 = NULL;
9399 Py_ssize_t __pyx_t_8;
9401 PyObject *__pyx_t_10 = NULL;
9403 int __pyx_lineno = 0;
9404 const char *__pyx_filename = NULL;
9405 int __pyx_clineno = 0;
9406 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
9415 __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)
9416 __pyx_t_1 = __pyx_t_2;
9417 __Pyx_GOTREF(__pyx_t_1);
9418 __pyx_v_struct = __pyx_t_1;
9428 __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)
9429 __Pyx_GOTREF(__pyx_t_1);
9430 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9441 __Pyx_PyThreadState_declare
9442 __Pyx_PyThreadState_assign
9443 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9444 __Pyx_XGOTREF(__pyx_t_2);
9445 __Pyx_XGOTREF(__pyx_t_3);
9446 __Pyx_XGOTREF(__pyx_t_4);
9456 __pyx_t_5 = __pyx_v_struct;
9457 __Pyx_INCREF(__pyx_t_5);
9458 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 540, __pyx_L3_error)
9459 __Pyx_GOTREF(__pyx_t_6);
9462 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_bytesitem};
9463 __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));
9464 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9465 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9466 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L3_error)
9467 __Pyx_GOTREF(__pyx_t_1);
9469 __pyx_v_result = __pyx_t_1;
9489 __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)
9490 __pyx_t_9 = (__pyx_t_8 == 1);
9503 __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)
9504 __Pyx_GOTREF(__pyx_t_1);
9506 PyObject *__pyx_temp;
9508 __pyx_temp = __pyx_r;
9509 __pyx_r = __pyx_t_1;
9511 __Pyx_XDECREF(__pyx_temp);
9514 goto __pyx_L6_except_return;
9533 PyObject *__pyx_temp;
9535 __pyx_temp = __pyx_r;
9536 __Pyx_INCREF(__pyx_v_result);
9537 __pyx_r = __pyx_v_result;
9539 __Pyx_XDECREF(__pyx_temp);
9541 goto __pyx_L6_except_return;
9544 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9545 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9546 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9555 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5);
9556 __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)
9557 __Pyx_GOTREF(__pyx_t_10);
9558 __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_10);
9559 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9560 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5);
9561 __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
9563 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9564 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(1, 541, __pyx_L5_except_error)
9565 __Pyx_XGOTREF(__pyx_t_5);
9566 __Pyx_XGOTREF(__pyx_t_6);
9567 __Pyx_XGOTREF(__pyx_t_1);
9576 __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)
9578 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9579 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9580 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9581 goto __pyx_L4_exception_handled;
9583 goto __pyx_L5_except_error;
9592 __pyx_L5_except_error:;
9593 __Pyx_XGIVEREF(__pyx_t_2);
9594 __Pyx_XGIVEREF(__pyx_t_3);
9595 __Pyx_XGIVEREF(__pyx_t_4);
9596 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9597 goto __pyx_L1_error;
9598 __pyx_L6_except_return:;
9599 __Pyx_XGIVEREF(__pyx_t_2);
9600 __Pyx_XGIVEREF(__pyx_t_3);
9601 __Pyx_XGIVEREF(__pyx_t_4);
9602 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9604 __pyx_L4_exception_handled:;
9605 __Pyx_XGIVEREF(__pyx_t_2);
9606 __Pyx_XGIVEREF(__pyx_t_3);
9607 __Pyx_XGIVEREF(__pyx_t_4);
9608 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9620 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9623 __Pyx_XDECREF(__pyx_t_1);
9624 __Pyx_XDECREF(__pyx_t_5);
9625 __Pyx_XDECREF(__pyx_t_6);
9626 __Pyx_XDECREF(__pyx_t_10);
9627 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9630 __Pyx_XDECREF(__pyx_v_struct);
9631 __Pyx_XDECREF(__pyx_v_bytesitem);
9632 __Pyx_XDECREF(__pyx_v_result);
9633 __Pyx_XGIVEREF(__pyx_r);
9634 __Pyx_RefNannyFinishContext();
9646static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
9647 PyObject *__pyx_v_struct = NULL;
9649 PyObject *__pyx_v_bytesvalue = 0;
9650 Py_ssize_t __pyx_v_i;
9651 PyObject *__pyx_r = NULL;
9652 __Pyx_RefNannyDeclarations
9653 PyObject *__pyx_t_1 = NULL;
9654 PyObject *__pyx_t_2 = NULL;
9656 PyObject *__pyx_t_4 = NULL;
9657 PyObject *__pyx_t_5 = NULL;
9658 PyObject *__pyx_t_6 = NULL;
9660 Py_ssize_t __pyx_t_8;
9661 PyObject *__pyx_t_9 = NULL;
9664 Py_ssize_t __pyx_t_12;
9667 int __pyx_lineno = 0;
9668 const char *__pyx_filename = NULL;
9669 int __pyx_clineno = 0;
9670 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
9679 __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)
9680 __pyx_t_1 = __pyx_t_2;
9681 __Pyx_GOTREF(__pyx_t_1);
9682 __pyx_v_struct = __pyx_t_1;
9692 __pyx_t_3 = PyTuple_Check(__pyx_v_value);
9703 __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)
9704 __Pyx_GOTREF(__pyx_t_1);
9705 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
9706 __Pyx_GOTREF(__pyx_t_4);
9707 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
9708 __Pyx_GOTREF(__pyx_t_5);
9709 __Pyx_GIVEREF(__pyx_t_4);
9710 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 557, __pyx_L1_error);
9712 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
9713 __Pyx_GOTREF(__pyx_t_4);
9714 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 557, __pyx_L1_error)
9715 __Pyx_GOTREF(__pyx_t_6);
9716 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9717 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9718 __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)
9719 __Pyx_GOTREF(__pyx_t_4);
9720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9721 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9722 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)
9723 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
9744 __pyx_t_6 = __pyx_v_struct;
9745 __Pyx_INCREF(__pyx_t_6);
9746 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
9747 __Pyx_GOTREF(__pyx_t_1);
9750 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_value};
9751 __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));
9752 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9753 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9754 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 559, __pyx_L1_error)
9755 __Pyx_GOTREF(__pyx_t_4);
9757 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)
9758 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
9772 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
9773 PyErr_SetString(PyExc_TypeError,
"\047NoneType\047 is not iterable");
9774 __PYX_ERR(1, 561, __pyx_L1_error)
9776 __Pyx_INCREF(__pyx_v_bytesvalue);
9777 __pyx_t_9 = __pyx_v_bytesvalue;
9778 __pyx_t_11 = __Pyx_PyBytes_AsWritableString(__pyx_t_9);
if (unlikely(__pyx_t_11 == ((
char *)NULL))) __PYX_ERR(1, 561, __pyx_L1_error)
9779 __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)
9780 __pyx_t_13 = (__pyx_t_11 + __pyx_t_12);
9782 for (__pyx_t_14 = __pyx_t_11; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
9783 __pyx_t_10 = __pyx_t_14;
9784 __pyx_v_c = (__pyx_t_10[0]);
9793 __pyx_v_i = __pyx_t_8;
9802 __pyx_t_8 = (__pyx_t_8 + 1);
9811 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
9816 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9827 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9830 __Pyx_XDECREF(__pyx_t_1);
9831 __Pyx_XDECREF(__pyx_t_4);
9832 __Pyx_XDECREF(__pyx_t_5);
9833 __Pyx_XDECREF(__pyx_t_6);
9834 __Pyx_XDECREF(__pyx_t_9);
9835 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9838 __Pyx_XDECREF(__pyx_v_struct);
9840 __Pyx_XDECREF(__pyx_v_bytesvalue);
9842 __Pyx_XGIVEREF(__pyx_r);
9843 __Pyx_RefNannyFinishContext();
9856CYTHON_UNUSED
static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
9857CYTHON_UNUSED
static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
9858 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
9860 __Pyx_RefNannyDeclarations
9861 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
9862 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9863 __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));
9868 __Pyx_RefNannyFinishContext();
9872static 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) {
9874 __Pyx_RefNannyDeclarations
9878 Py_ssize_t *__pyx_t_4;
9881 Py_ssize_t __pyx_t_7;
9882 int __pyx_lineno = 0;
9883 const char *__pyx_filename = NULL;
9884 int __pyx_clineno = 0;
9885 if (unlikely(__pyx_v_info == NULL)) {
9886 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
9889 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
9890 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9891 __Pyx_GIVEREF(__pyx_v_info->obj);
9900 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
9906 __pyx_t_1 = __pyx_t_2;
9908 goto __pyx_L4_bool_binop_done;
9911 __pyx_t_1 = __pyx_v_self->view.readonly;
9912 __pyx_L4_bool_binop_done:;
9913 if (unlikely(__pyx_t_1)) {
9923 __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)
9942 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
9954 __pyx_t_4 = __pyx_v_self->view.shape;
9956 __pyx_v_info->shape = __pyx_t_4;
9976 __pyx_v_info->shape = NULL;
9987 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
9999 __pyx_t_4 = __pyx_v_self->view.strides;
10001 __pyx_v_info->strides = __pyx_t_4;
10021 __pyx_v_info->strides = NULL;
10032 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10044 __pyx_t_4 = __pyx_v_self->view.suboffsets;
10046 __pyx_v_info->suboffsets = __pyx_t_4;
10066 __pyx_v_info->suboffsets = NULL;
10077 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10089 __pyx_t_5 = __pyx_v_self->view.format;
10091 __pyx_v_info->format = __pyx_t_5;
10111 __pyx_v_info->format = NULL;
10122 __pyx_t_6 = __pyx_v_self->view.buf;
10124 __pyx_v_info->buf = __pyx_t_6;
10133 __pyx_t_3 = __pyx_v_self->view.ndim;
10135 __pyx_v_info->ndim = __pyx_t_3;
10144 __pyx_t_7 = __pyx_v_self->view.itemsize;
10146 __pyx_v_info->itemsize = __pyx_t_7;
10155 __pyx_t_7 = __pyx_v_self->view.len;
10157 __pyx_v_info->len = __pyx_t_7;
10166 __pyx_t_1 = __pyx_v_self->view.readonly;
10168 __pyx_v_info->readonly = __pyx_t_1;
10177 __Pyx_INCREF((PyObject *)__pyx_v_self);
10178 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10179 __Pyx_GOTREF(__pyx_v_info->obj);
10180 __Pyx_DECREF(__pyx_v_info->obj);
10181 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10195 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10197 if (__pyx_v_info->obj != NULL) {
10198 __Pyx_GOTREF(__pyx_v_info->obj);
10199 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10203 if (__pyx_v_info->obj == Py_None) {
10204 __Pyx_GOTREF(__pyx_v_info->obj);
10205 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10209 __Pyx_RefNannyFinishContext();
10222static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
10223static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10224 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10225 PyObject *__pyx_r = 0;
10226 __Pyx_RefNannyDeclarations
10227 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10228 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10229 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10232 __Pyx_RefNannyFinishContext();
10236static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10237 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10238 PyObject *__pyx_r = NULL;
10239 __Pyx_RefNannyDeclarations
10240 PyObject *__pyx_t_1 = NULL;
10242 int __pyx_lineno = 0;
10243 const char *__pyx_filename = NULL;
10244 int __pyx_clineno = 0;
10245 __Pyx_RefNannySetupContext(
"__get__", 0);
10254 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 599, __pyx_L1_error)
10255 __Pyx_GOTREF(__pyx_t_1);
10256 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)
10257 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10267 __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)
10278 PyObject *__pyx_temp;
10280 __pyx_temp = __pyx_r;
10281 __Pyx_INCREF((PyObject *)__pyx_v_result);
10282 __pyx_r = ((PyObject *)__pyx_v_result);
10284 __Pyx_XDECREF(__pyx_temp);
10298 __Pyx_XDECREF(__pyx_t_1);
10299 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10302 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10303 __Pyx_XGIVEREF(__pyx_r);
10304 __Pyx_RefNannyFinishContext();
10317static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
10318static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10319 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10320 PyObject *__pyx_r = 0;
10321 __Pyx_RefNannyDeclarations
10322 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10323 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10324 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10327 __Pyx_RefNannyFinishContext();
10331static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10332 PyObject *__pyx_r = NULL;
10333 __Pyx_RefNannyDeclarations
10334 PyObject *__pyx_t_1 = NULL;
10335 int __pyx_lineno = 0;
10336 const char *__pyx_filename = NULL;
10337 int __pyx_clineno = 0;
10338 __Pyx_RefNannySetupContext(
"__get__", 0);
10347 __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)
10348 __Pyx_GOTREF(__pyx_t_1);
10350 PyObject *__pyx_temp;
10352 __pyx_temp = __pyx_r;
10353 __pyx_r = __pyx_t_1;
10355 __Pyx_XDECREF(__pyx_temp);
10370 __Pyx_XDECREF(__pyx_t_1);
10371 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10374 __Pyx_XGIVEREF(__pyx_r);
10375 __Pyx_RefNannyFinishContext();
10387static PyObject *__pyx_memoryview__get_base(
struct __pyx_memoryview_obj *__pyx_v_self) {
10388 PyObject *__pyx_r = NULL;
10389 __Pyx_RefNannyDeclarations
10390 __Pyx_RefNannySetupContext(
"_get_base", 0);
10400 PyObject *__pyx_temp;
10402 __pyx_temp = __pyx_r;
10403 __Pyx_INCREF(__pyx_v_self->obj);
10404 __pyx_r = __pyx_v_self->obj;
10406 __Pyx_XDECREF(__pyx_temp);
10420 __Pyx_XGIVEREF(__pyx_r);
10421 __Pyx_RefNannyFinishContext();
10434static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
10435static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10436 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10437 PyObject *__pyx_r = 0;
10438 __Pyx_RefNannyDeclarations
10439 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10440 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10441 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10444 __Pyx_RefNannyFinishContext();
10448static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10449 Py_ssize_t __pyx_7genexpr__pyx_v_length;
10450 PyObject *__pyx_r = NULL;
10451 __Pyx_RefNannyDeclarations
10452 PyObject *__pyx_t_1 = NULL;
10453 Py_ssize_t *__pyx_t_2;
10454 Py_ssize_t *__pyx_t_3;
10455 Py_ssize_t *__pyx_t_4;
10456 PyObject *__pyx_t_5 = NULL;
10457 int __pyx_lineno = 0;
10458 const char *__pyx_filename = NULL;
10459 int __pyx_clineno = 0;
10460 __Pyx_RefNannySetupContext(
"__get__", 0);
10470 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
10471 __Pyx_GOTREF(__pyx_t_1);
10472 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10474 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10475 __pyx_t_2 = __pyx_t_4;
10476 __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
10477 __pyx_t_5 = PyLong_FromSsize_t(__pyx_7genexpr__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10478 __Pyx_GOTREF(__pyx_t_5);
10479 __Pyx_GIVEREF(__pyx_t_5);
10480 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, __pyx_t_5))) __PYX_ERR(1, 612, __pyx_L1_error)
10485 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10486 __Pyx_GOTREF(__pyx_t_5);
10487 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10489 PyObject *__pyx_temp;
10491 __pyx_temp = __pyx_r;
10492 __pyx_r = __pyx_t_5;
10494 __Pyx_XDECREF(__pyx_temp);
10509 __Pyx_XDECREF(__pyx_t_1);
10510 __Pyx_XDECREF(__pyx_t_5);
10511 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10515 __Pyx_XGIVEREF(__pyx_r);
10516 __Pyx_RefNannyFinishContext();
10529static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
10530static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10531 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10532 PyObject *__pyx_r = 0;
10533 __Pyx_RefNannyDeclarations
10534 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10535 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10536 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10539 __Pyx_RefNannyFinishContext();
10543static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10544 Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
10545 PyObject *__pyx_r = NULL;
10546 __Pyx_RefNannyDeclarations
10549 PyObject *__pyx_t_3 = NULL;
10550 Py_ssize_t *__pyx_t_4;
10551 Py_ssize_t *__pyx_t_5;
10552 Py_ssize_t *__pyx_t_6;
10553 PyObject *__pyx_t_7 = NULL;
10554 int __pyx_lineno = 0;
10555 const char *__pyx_filename = NULL;
10556 int __pyx_clineno = 0;
10557 __Pyx_RefNannySetupContext(
"__get__", 0);
10566 __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
10568 if (unlikely(__pyx_t_1)) {
10578 __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)
10598 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 620, __pyx_L1_error)
10599 __Pyx_GOTREF(__pyx_t_3);
10600 __pyx_t_5 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
10602 for (__pyx_t_6 = __pyx_v_self->view.strides; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
10603 __pyx_t_4 = __pyx_t_6;
10604 __pyx_8genexpr1__pyx_v_stride = (__pyx_t_4[0]);
10605 __pyx_t_7 = PyLong_FromSsize_t(__pyx_8genexpr1__pyx_v_stride);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10606 __Pyx_GOTREF(__pyx_t_7);
10607 __Pyx_GIVEREF(__pyx_t_7);
10608 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_3, __pyx_t_7))) __PYX_ERR(1, 620, __pyx_L1_error)
10613 __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10614 __Pyx_GOTREF(__pyx_t_7);
10615 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10617 PyObject *__pyx_temp;
10619 __pyx_temp = __pyx_r;
10620 __pyx_r = __pyx_t_7;
10622 __Pyx_XDECREF(__pyx_temp);
10637 __Pyx_XDECREF(__pyx_t_3);
10638 __Pyx_XDECREF(__pyx_t_7);
10639 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10643 __Pyx_XGIVEREF(__pyx_r);
10644 __Pyx_RefNannyFinishContext();
10657static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
10658static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
10659 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10660 PyObject *__pyx_r = 0;
10661 __Pyx_RefNannyDeclarations
10662 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10663 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10664 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10667 __Pyx_RefNannyFinishContext();
10671static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10672 Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
10673 PyObject *__pyx_r = NULL;
10674 __Pyx_RefNannyDeclarations
10676 PyObject *__pyx_t_2 = NULL;
10677 Py_ssize_t *__pyx_t_3;
10678 Py_ssize_t *__pyx_t_4;
10679 Py_ssize_t *__pyx_t_5;
10680 PyObject *__pyx_t_6 = NULL;
10681 int __pyx_lineno = 0;
10682 const char *__pyx_filename = NULL;
10683 int __pyx_clineno = 0;
10684 __Pyx_RefNannySetupContext(
"__get__", 0);
10693 __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
10705 __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)
10706 __Pyx_GOTREF(__pyx_t_2);
10708 PyObject *__pyx_temp;
10710 __pyx_temp = __pyx_r;
10711 __pyx_r = __pyx_t_2;
10713 __Pyx_XDECREF(__pyx_temp);
10735 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error)
10736 __Pyx_GOTREF(__pyx_t_2);
10737 __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
10739 for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10740 __pyx_t_3 = __pyx_t_5;
10741 __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
10742 __pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
10743 __Pyx_GOTREF(__pyx_t_6);
10744 __Pyx_GIVEREF(__pyx_t_6);
10745 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_2, __pyx_t_6))) __PYX_ERR(1, 627, __pyx_L1_error)
10750 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
10751 __Pyx_GOTREF(__pyx_t_6);
10752 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10754 PyObject *__pyx_temp;
10756 __pyx_temp = __pyx_r;
10757 __pyx_r = __pyx_t_6;
10759 __Pyx_XDECREF(__pyx_temp);
10774 __Pyx_XDECREF(__pyx_t_2);
10775 __Pyx_XDECREF(__pyx_t_6);
10776 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10780 __Pyx_XGIVEREF(__pyx_r);
10781 __Pyx_RefNannyFinishContext();
10794static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
10795static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
10796 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10797 PyObject *__pyx_r = 0;
10798 __Pyx_RefNannyDeclarations
10799 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10800 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10801 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10804 __Pyx_RefNannyFinishContext();
10808static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10809 PyObject *__pyx_r = NULL;
10810 __Pyx_RefNannyDeclarations
10811 PyObject *__pyx_t_1 = NULL;
10812 int __pyx_lineno = 0;
10813 const char *__pyx_filename = NULL;
10814 int __pyx_clineno = 0;
10815 __Pyx_RefNannySetupContext(
"__get__", 0);
10824 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 631, __pyx_L1_error)
10825 __Pyx_GOTREF(__pyx_t_1);
10827 PyObject *__pyx_temp;
10829 __pyx_temp = __pyx_r;
10830 __pyx_r = __pyx_t_1;
10832 __Pyx_XDECREF(__pyx_temp);
10847 __Pyx_XDECREF(__pyx_t_1);
10848 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10851 __Pyx_XGIVEREF(__pyx_r);
10852 __Pyx_RefNannyFinishContext();
10865static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
10866static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
10867 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10868 PyObject *__pyx_r = 0;
10869 __Pyx_RefNannyDeclarations
10870 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10871 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10872 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10875 __Pyx_RefNannyFinishContext();
10879static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10880 PyObject *__pyx_r = NULL;
10881 __Pyx_RefNannyDeclarations
10882 PyObject *__pyx_t_1 = NULL;
10883 int __pyx_lineno = 0;
10884 const char *__pyx_filename = NULL;
10885 int __pyx_clineno = 0;
10886 __Pyx_RefNannySetupContext(
"__get__", 0);
10895 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 635, __pyx_L1_error)
10896 __Pyx_GOTREF(__pyx_t_1);
10898 PyObject *__pyx_temp;
10900 __pyx_temp = __pyx_r;
10901 __pyx_r = __pyx_t_1;
10903 __Pyx_XDECREF(__pyx_temp);
10918 __Pyx_XDECREF(__pyx_t_1);
10919 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10922 __Pyx_XGIVEREF(__pyx_r);
10923 __Pyx_RefNannyFinishContext();
10936static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
10937static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
10938 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10939 PyObject *__pyx_r = 0;
10940 __Pyx_RefNannyDeclarations
10941 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10942 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10943 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10946 __Pyx_RefNannyFinishContext();
10950static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10951 PyObject *__pyx_r = NULL;
10952 __Pyx_RefNannyDeclarations
10953 PyObject *__pyx_t_1 = NULL;
10954 PyObject *__pyx_t_2 = NULL;
10955 PyObject *__pyx_t_3 = NULL;
10956 int __pyx_lineno = 0;
10957 const char *__pyx_filename = NULL;
10958 int __pyx_clineno = 0;
10959 __Pyx_RefNannySetupContext(
"__get__", 0);
10968 __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)
10969 __Pyx_GOTREF(__pyx_t_1);
10970 __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
10971 __Pyx_GOTREF(__pyx_t_2);
10972 __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)
10973 __Pyx_GOTREF(__pyx_t_3);
10974 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10975 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10977 PyObject *__pyx_temp;
10979 __pyx_temp = __pyx_r;
10980 __pyx_r = __pyx_t_3;
10982 __Pyx_XDECREF(__pyx_temp);
10997 __Pyx_XDECREF(__pyx_t_1);
10998 __Pyx_XDECREF(__pyx_t_2);
10999 __Pyx_XDECREF(__pyx_t_3);
11000 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11003 __Pyx_XGIVEREF(__pyx_r);
11004 __Pyx_RefNannyFinishContext();
11017static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
11018static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11019 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11020 PyObject *__pyx_r = 0;
11021 __Pyx_RefNannyDeclarations
11022 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11023 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11024 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11027 __Pyx_RefNannyFinishContext();
11031static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11032 size_t __pyx_v_result;
11033 Py_ssize_t __pyx_v_length;
11034 PyObject *__pyx_r = NULL;
11035 __Pyx_RefNannyDeclarations
11037 Py_ssize_t *__pyx_t_2;
11038 Py_ssize_t *__pyx_t_3;
11039 Py_ssize_t *__pyx_t_4;
11040 PyObject *__pyx_t_5 = NULL;
11041 int __pyx_lineno = 0;
11042 const char *__pyx_filename = NULL;
11043 int __pyx_clineno = 0;
11044 __Pyx_RefNannySetupContext(
"__get__", 0);
11053 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11064 __pyx_v_result = 1;
11073 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11075 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11076 __pyx_t_2 = __pyx_t_4;
11077 __pyx_v_length = (__pyx_t_2[0]);
11086 __pyx_v_result = (__pyx_v_result * ((size_t)__pyx_v_length));
11097 __pyx_t_5 = __Pyx_PyLong_FromSize_t(__pyx_v_result);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 650, __pyx_L1_error)
11098 __Pyx_GOTREF(__pyx_t_5);
11099 __Pyx_GIVEREF(__pyx_t_5);
11100 __Pyx_GOTREF(__pyx_v_self->_size);
11101 __Pyx_DECREF(__pyx_v_self->_size);
11102 __pyx_v_self->_size = __pyx_t_5;
11122 PyObject *__pyx_temp;
11124 __pyx_temp = __pyx_r;
11125 __Pyx_INCREF(__pyx_v_self->_size);
11126 __pyx_r = __pyx_v_self->_size;
11128 __Pyx_XDECREF(__pyx_temp);
11142 __Pyx_XDECREF(__pyx_t_5);
11143 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11148 __Pyx_XGIVEREF(__pyx_r);
11149 __Pyx_RefNannyFinishContext();
11162static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
11163static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11164 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11165 Py_ssize_t __pyx_r;
11166 __Pyx_RefNannyDeclarations
11167 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
11168 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11169 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11172 __Pyx_RefNannyFinishContext();
11176static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11177 Py_ssize_t __pyx_r;
11187 __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11201 __pyx_r = (__pyx_v_self->view.shape[0]);
11250static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
11251static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11252 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11253 PyObject *__pyx_r = 0;
11254 __Pyx_RefNannyDeclarations
11255 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
11256 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11257 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11260 __Pyx_RefNannyFinishContext();
11264static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11265 PyObject *__pyx_r = NULL;
11266 __Pyx_RefNannyDeclarations
11267 PyObject *__pyx_t_1 = NULL;
11268 PyObject *__pyx_t_2 = NULL;
11269 PyObject *__pyx_t_3 = NULL;
11270 PyObject *__pyx_t_4[5];
11271 Py_ssize_t __pyx_t_5;
11273 int __pyx_lineno = 0;
11274 const char *__pyx_filename = NULL;
11275 int __pyx_clineno = 0;
11276 __Pyx_RefNannySetupContext(
"__repr__", 0);
11285 __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)
11286 __Pyx_GOTREF(__pyx_t_1);
11287 __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)
11288 __Pyx_GOTREF(__pyx_t_2);
11289 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11290 __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)
11291 __Pyx_GOTREF(__pyx_t_1);
11292 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11293 __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)
11294 __Pyx_GOTREF(__pyx_t_2);
11295 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11304 __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)
11305 __Pyx_GOTREF(__pyx_t_1);
11306 __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)
11307 __Pyx_GOTREF(__pyx_t_3);
11308 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11309 __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11310 __pyx_t_4[1] = __pyx_t_2;
11311 __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
11312 __pyx_t_4[3] = __pyx_t_3;
11313 __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__4;
11323 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11324 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[3]);
11327 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11328 __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[3]);
11330 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6);
11331 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11332 __Pyx_GOTREF(__pyx_t_1);
11333 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11334 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11336 PyObject *__pyx_temp;
11338 __pyx_temp = __pyx_r;
11339 __pyx_r = __pyx_t_1;
11341 __Pyx_XDECREF(__pyx_temp);
11356 __Pyx_XDECREF(__pyx_t_1);
11357 __Pyx_XDECREF(__pyx_t_2);
11358 __Pyx_XDECREF(__pyx_t_3);
11359 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11362 __Pyx_XGIVEREF(__pyx_r);
11363 __Pyx_RefNannyFinishContext();
11376static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
11377static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11378 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11379 PyObject *__pyx_r = 0;
11380 __Pyx_RefNannyDeclarations
11381 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
11382 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11383 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11386 __Pyx_RefNannyFinishContext();
11390static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11391 PyObject *__pyx_r = NULL;
11392 __Pyx_RefNannyDeclarations
11393 PyObject *__pyx_t_1 = NULL;
11394 PyObject *__pyx_t_2 = NULL;
11395 PyObject *__pyx_t_3[3];
11396 Py_ssize_t __pyx_t_4;
11398 int __pyx_lineno = 0;
11399 const char *__pyx_filename = NULL;
11400 int __pyx_clineno = 0;
11401 __Pyx_RefNannySetupContext(
"__str__", 0);
11410 __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)
11411 __Pyx_GOTREF(__pyx_t_1);
11412 __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)
11413 __Pyx_GOTREF(__pyx_t_2);
11414 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11415 __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)
11416 __Pyx_GOTREF(__pyx_t_1);
11417 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11418 __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)
11419 __Pyx_GOTREF(__pyx_t_2);
11420 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11421 __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11422 __pyx_t_3[1] = __pyx_t_2;
11423 __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object;
11425 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11426 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]);
11429 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11430 __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]);
11432 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5);
11433 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11434 __Pyx_GOTREF(__pyx_t_1);
11435 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11437 PyObject *__pyx_temp;
11439 __pyx_temp = __pyx_r;
11440 __pyx_r = __pyx_t_1;
11442 __Pyx_XDECREF(__pyx_temp);
11457 __Pyx_XDECREF(__pyx_t_1);
11458 __Pyx_XDECREF(__pyx_t_2);
11459 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11462 __Pyx_XGIVEREF(__pyx_r);
11463 __Pyx_RefNannyFinishContext();
11476static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11477#
if CYTHON_VECTORCALL
11478PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11480PyObject *__pyx_args, PyObject *__pyx_kwds
11483static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11484#
if CYTHON_VECTORCALL
11485PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11487PyObject *__pyx_args, PyObject *__pyx_kwds
11490 #if !CYTHON_VECTORCALL
11491 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11493 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11494 PyObject *__pyx_r = 0;
11495 __Pyx_RefNannyDeclarations
11496 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
11497 #if !CYTHON_VECTORCALL
11498 #if CYTHON_ASSUME_SAFE_SIZE
11499 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11501 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
11504 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11505 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"is_c_contig", 1, 0, 0, __pyx_nargs);
return NULL; }
11506 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11507 if (unlikely(__pyx_kwds_len < 0))
return NULL;
11508 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"is_c_contig", __pyx_kwds);
return NULL;}
11509 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11512 __Pyx_RefNannyFinishContext();
11516static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
11517 __Pyx_memviewslice *__pyx_v_mslice;
11518 __Pyx_memviewslice __pyx_v_tmp;
11519 PyObject *__pyx_r = NULL;
11520 __Pyx_RefNannyDeclarations
11521 __Pyx_memviewslice *__pyx_t_1;
11522 PyObject *__pyx_t_2 = NULL;
11523 int __pyx_lineno = 0;
11524 const char *__pyx_filename = NULL;
11525 int __pyx_clineno = 0;
11526 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
11535 __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)
11536 __pyx_v_mslice = __pyx_t_1;
11545 __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)
11546 __Pyx_GOTREF(__pyx_t_2);
11548 PyObject *__pyx_temp;
11550 __pyx_temp = __pyx_r;
11551 __pyx_r = __pyx_t_2;
11553 __Pyx_XDECREF(__pyx_temp);
11568 __Pyx_XDECREF(__pyx_t_2);
11569 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11574 __Pyx_XGIVEREF(__pyx_r);
11575 __Pyx_RefNannyFinishContext();
11588static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11589#
if CYTHON_VECTORCALL
11590PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11592PyObject *__pyx_args, PyObject *__pyx_kwds
11595static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11596#
if CYTHON_VECTORCALL
11597PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11599PyObject *__pyx_args, PyObject *__pyx_kwds
11602 #if !CYTHON_VECTORCALL
11603 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11605 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11606 PyObject *__pyx_r = 0;
11607 __Pyx_RefNannyDeclarations
11608 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
11609 #if !CYTHON_VECTORCALL
11610 #if CYTHON_ASSUME_SAFE_SIZE
11611 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11613 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
11616 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11617 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"is_f_contig", 1, 0, 0, __pyx_nargs);
return NULL; }
11618 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11619 if (unlikely(__pyx_kwds_len < 0))
return NULL;
11620 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"is_f_contig", __pyx_kwds);
return NULL;}
11621 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11624 __Pyx_RefNannyFinishContext();
11628static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
11629 __Pyx_memviewslice *__pyx_v_mslice;
11630 __Pyx_memviewslice __pyx_v_tmp;
11631 PyObject *__pyx_r = NULL;
11632 __Pyx_RefNannyDeclarations
11633 __Pyx_memviewslice *__pyx_t_1;
11634 PyObject *__pyx_t_2 = NULL;
11635 int __pyx_lineno = 0;
11636 const char *__pyx_filename = NULL;
11637 int __pyx_clineno = 0;
11638 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
11647 __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)
11648 __pyx_v_mslice = __pyx_t_1;
11657 __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)
11658 __Pyx_GOTREF(__pyx_t_2);
11660 PyObject *__pyx_temp;
11662 __pyx_temp = __pyx_r;
11663 __pyx_r = __pyx_t_2;
11665 __Pyx_XDECREF(__pyx_temp);
11680 __Pyx_XDECREF(__pyx_t_2);
11681 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11686 __Pyx_XGIVEREF(__pyx_r);
11687 __Pyx_RefNannyFinishContext();
11700static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11701#
if CYTHON_VECTORCALL
11702PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11704PyObject *__pyx_args, PyObject *__pyx_kwds
11707static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11708#
if CYTHON_VECTORCALL
11709PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11711PyObject *__pyx_args, PyObject *__pyx_kwds
11714 #if !CYTHON_VECTORCALL
11715 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11717 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11718 PyObject *__pyx_r = 0;
11719 __Pyx_RefNannyDeclarations
11720 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
11721 #if !CYTHON_VECTORCALL
11722 #if CYTHON_ASSUME_SAFE_SIZE
11723 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11725 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
11728 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11729 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"copy", 1, 0, 0, __pyx_nargs);
return NULL; }
11730 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11731 if (unlikely(__pyx_kwds_len < 0))
return NULL;
11732 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"copy", __pyx_kwds);
return NULL;}
11733 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11736 __Pyx_RefNannyFinishContext();
11740static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
11741 __Pyx_memviewslice __pyx_v_mslice;
11743 PyObject *__pyx_r = NULL;
11744 __Pyx_RefNannyDeclarations
11745 __Pyx_memviewslice __pyx_t_1;
11746 PyObject *__pyx_t_2 = NULL;
11747 int __pyx_lineno = 0;
11748 const char *__pyx_filename = NULL;
11749 int __pyx_clineno = 0;
11750 __Pyx_RefNannySetupContext(
"copy", 0);
11759 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
11768 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
11777 __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)
11778 __pyx_v_mslice = __pyx_t_1;
11787 __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)
11788 __Pyx_GOTREF(__pyx_t_2);
11790 PyObject *__pyx_temp;
11792 __pyx_temp = __pyx_r;
11793 __pyx_r = __pyx_t_2;
11795 __Pyx_XDECREF(__pyx_temp);
11810 __Pyx_XDECREF(__pyx_t_2);
11811 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
11816 __Pyx_XGIVEREF(__pyx_r);
11817 __Pyx_RefNannyFinishContext();
11830static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11831#
if CYTHON_VECTORCALL
11832PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11834PyObject *__pyx_args, PyObject *__pyx_kwds
11837static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11838#
if CYTHON_VECTORCALL
11839PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11841PyObject *__pyx_args, PyObject *__pyx_kwds
11844 #if !CYTHON_VECTORCALL
11845 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11847 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11848 PyObject *__pyx_r = 0;
11849 __Pyx_RefNannyDeclarations
11850 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
11851 #if !CYTHON_VECTORCALL
11852 #if CYTHON_ASSUME_SAFE_SIZE
11853 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11855 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
11858 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11859 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"copy_fortran", 1, 0, 0, __pyx_nargs);
return NULL; }
11860 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11861 if (unlikely(__pyx_kwds_len < 0))
return NULL;
11862 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"copy_fortran", __pyx_kwds);
return NULL;}
11863 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11866 __Pyx_RefNannyFinishContext();
11870static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
11871 __Pyx_memviewslice __pyx_v_src;
11872 __Pyx_memviewslice __pyx_v_dst;
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(
"copy_fortran", 0);
11890 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
11899 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
11908 __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)
11909 __pyx_v_dst = __pyx_t_1;
11918 __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)
11919 __Pyx_GOTREF(__pyx_t_2);
11921 PyObject *__pyx_temp;
11923 __pyx_temp = __pyx_r;
11924 __pyx_r = __pyx_t_2;
11926 __Pyx_XDECREF(__pyx_temp);
11941 __Pyx_XDECREF(__pyx_t_2);
11942 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
11948 __Pyx_XGIVEREF(__pyx_r);
11949 __Pyx_RefNannyFinishContext();
11960static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11961#
if CYTHON_VECTORCALL
11962PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11964PyObject *__pyx_args, PyObject *__pyx_kwds
11967static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11968#
if CYTHON_VECTORCALL
11969PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11971PyObject *__pyx_args, PyObject *__pyx_kwds
11974 #if !CYTHON_VECTORCALL
11975 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11977 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11978 PyObject *__pyx_r = 0;
11979 __Pyx_RefNannyDeclarations
11980 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
11981 #if !CYTHON_VECTORCALL
11982 #if CYTHON_ASSUME_SAFE_SIZE
11983 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11985 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
11988 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11989 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
11990 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11991 if (unlikely(__pyx_kwds_len < 0))
return NULL;
11992 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
11993 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11996 __Pyx_RefNannyFinishContext();
12000static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
12001 PyObject *__pyx_r = NULL;
12002 __Pyx_RefNannyDeclarations
12003 int __pyx_lineno = 0;
12004 const char *__pyx_filename = NULL;
12005 int __pyx_clineno = 0;
12006 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
12014 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12015 __PYX_ERR(1, 2, __pyx_L1_error)
12025 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12027 __Pyx_XGIVEREF(__pyx_r);
12028 __Pyx_RefNannyFinishContext();
12040static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12041#
if CYTHON_VECTORCALL
12042PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12044PyObject *__pyx_args, PyObject *__pyx_kwds
12047static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12048#
if CYTHON_VECTORCALL
12049PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12051PyObject *__pyx_args, PyObject *__pyx_kwds
12054 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
12055 #if !CYTHON_VECTORCALL
12056 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12058 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
12059 PyObject* values[1] = {0};
12060 int __pyx_lineno = 0;
12061 const char *__pyx_filename = NULL;
12062 int __pyx_clineno = 0;
12063 PyObject *__pyx_r = 0;
12064 __Pyx_RefNannyDeclarations
12065 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
12066 #if !CYTHON_VECTORCALL
12067 #if CYTHON_ASSUME_SAFE_SIZE
12068 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12070 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
12073 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12075 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
12076 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12077 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
12078 if (__pyx_kwds_len > 0) {
12079 switch (__pyx_nargs) {
12081 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12082 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12083 CYTHON_FALLTHROUGH;
12085 default:
goto __pyx_L5_argtuple_error;
12087 const Py_ssize_t kwd_pos_args = __pyx_nargs;
12088 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)
12089 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
12090 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
12092 }
else if (unlikely(__pyx_nargs != 1)) {
12093 goto __pyx_L5_argtuple_error;
12095 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12096 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12098 __pyx_v___pyx_state = values[0];
12100 goto __pyx_L6_skip;
12101 __pyx_L5_argtuple_error:;
12102 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
12104 goto __pyx_L4_argument_unpacking_done;
12106 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
12107 Py_XDECREF(values[__pyx_temp]);
12109 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12110 __Pyx_RefNannyFinishContext();
12112 __pyx_L4_argument_unpacking_done:;
12113 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
12116 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
12117 Py_XDECREF(values[__pyx_temp]);
12119 __Pyx_RefNannyFinishContext();
12123static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12124 PyObject *__pyx_r = NULL;
12125 __Pyx_RefNannyDeclarations
12126 int __pyx_lineno = 0;
12127 const char *__pyx_filename = NULL;
12128 int __pyx_clineno = 0;
12129 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
12136 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12137 __PYX_ERR(1, 4, __pyx_L1_error)
12148 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12150 __Pyx_XGIVEREF(__pyx_r);
12151 __Pyx_RefNannyFinishContext();
12163static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo
const *__pyx_v_typeinfo) {
12164 struct __pyx_memoryview_obj *__pyx_v_result = 0;
12165 PyObject *__pyx_r = NULL;
12166 __Pyx_RefNannyDeclarations
12167 PyObject *__pyx_t_1 = NULL;
12168 PyObject *__pyx_t_2 = NULL;
12169 PyObject *__pyx_t_3 = NULL;
12170 PyObject *__pyx_t_4 = NULL;
12172 int __pyx_lineno = 0;
12173 const char *__pyx_filename = NULL;
12174 int __pyx_clineno = 0;
12175 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
12185 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 707, __pyx_L1_error)
12186 __Pyx_GOTREF(__pyx_t_3);
12187 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 707, __pyx_L1_error)
12188 __Pyx_GOTREF(__pyx_t_4);
12191 PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_o, __pyx_t_3, __pyx_t_4};
12192 __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));
12193 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12194 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12195 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12196 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 707, __pyx_L1_error)
12197 __Pyx_GOTREF((PyObject *)__pyx_t_1);
12199 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_1);
12209 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12219 PyObject *__pyx_temp;
12221 __pyx_temp = __pyx_r;
12222 __Pyx_INCREF((PyObject *)__pyx_v_result);
12223 __pyx_r = ((PyObject *)__pyx_v_result);
12225 __Pyx_XDECREF(__pyx_temp);
12239 __Pyx_XDECREF(__pyx_t_1);
12240 __Pyx_XDECREF(__pyx_t_2);
12241 __Pyx_XDECREF(__pyx_t_3);
12242 __Pyx_XDECREF(__pyx_t_4);
12243 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12246 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12247 __Pyx_XGIVEREF(__pyx_r);
12248 __Pyx_RefNannyFinishContext();
12260static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12271 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type);
12273 __pyx_r = __pyx_t_1;
12299static int __pyx_memoryview_err_invalid_index(PyObject *__pyx_v_item) {
12300 PyObject *__pyx_v_type_name = NULL;
12302 __Pyx_RefNannyDeclarations
12303 PyObject *__pyx_t_1 = NULL;
12304 int __pyx_lineno = 0;
12305 const char *__pyx_filename = NULL;
12306 int __pyx_clineno = 0;
12307 __Pyx_RefNannySetupContext(
"_err_invalid_index", 0);
12316 __pyx_t_1 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
12317 __Pyx_GOTREF(__pyx_t_1);
12318 __pyx_v_type_name = ((PyObject*)__pyx_t_1);
12328 (void)(PyErr_Format(PyExc_TypeError, __pyx_k_Cannot_index_with_type_200U, ((PyObject *)__pyx_v_type_name)));
12353 __Pyx_XDECREF(__pyx_t_1);
12354 __Pyx_AddTraceback(
"View.MemoryView._err_invalid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
12357 __Pyx_XDECREF(__pyx_v_type_name);
12359 __Pyx_RefNannyFinishContext();
12371static PyObject *_unellipsify_index_tuple(PyObject *__pyx_v_index_tuple,
int __pyx_v_ndim) {
12372 Py_ssize_t __pyx_v_first_ellipsis_index;
12373 Py_ssize_t __pyx_v_idx;
12374 Py_ssize_t __pyx_v_ellipsis_end;
12375 Py_ssize_t __pyx_v_indices_from_ellipsis;
12376 int __pyx_v_have_slices;
12377 PyObject *__pyx_v_item = NULL;
12378 PyObject *__pyx_v_result = NULL;
12379 PyObject *__pyx_r = NULL;
12380 __Pyx_RefNannyDeclarations
12381 PyObject *__pyx_t_1 = NULL;
12382 Py_ssize_t __pyx_t_2;
12383 PyObject *__pyx_t_3 = NULL;
12386 Py_ssize_t __pyx_t_6;
12387 Py_ssize_t __pyx_t_7;
12388 Py_ssize_t __pyx_t_8;
12389 int __pyx_lineno = 0;
12390 const char *__pyx_filename = NULL;
12391 int __pyx_clineno = 0;
12392 __Pyx_RefNannySetupContext(
"_unellipsify_index_tuple", 0);
12393 __Pyx_INCREF(__pyx_v_index_tuple);
12402 __pyx_v_first_ellipsis_index = -1L;
12411 __pyx_v_have_slices = 0;
12429 __pyx_t_1 = __pyx_v_index_tuple; __Pyx_INCREF(__pyx_t_1);
12433 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
12434 #if !CYTHON_ASSUME_SAFE_SIZE
12435 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 733, __pyx_L1_error)
12437 if (__pyx_t_2 >= __pyx_temp)
break;
12439 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12440 __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
12442 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
12445 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 733, __pyx_L1_error)
12446 __Pyx_GOTREF(__pyx_t_3);
12447 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
12457 __pyx_t_4 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12468 __pyx_v_have_slices = 1;
12477 __pyx_t_4 = (__pyx_v_first_ellipsis_index == -1L);
12489 __pyx_v_first_ellipsis_index = __pyx_v_idx;
12517 __pyx_t_4 = PySlice_Check(__pyx_v_item);
12528 __pyx_v_have_slices = 1;
12547 __pyx_t_4 = (!(PyIndex_Check(__pyx_v_item) != 0));
12549 if (unlikely(__pyx_t_4)) {
12559 __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)
12579 __pyx_v_idx = (__pyx_v_idx + 1);
12589 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12598 __pyx_t_4 = (__pyx_v_first_ellipsis_index >= 0);
12610 __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)
12611 __Pyx_GOTREF(__pyx_t_1);
12612 { Py_ssize_t __pyx_temp;
12613 for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
12614 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
12615 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
12616 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 745, __pyx_L1_error);
12619 __pyx_v_result = ((PyObject*)__pyx_t_1);
12630 __pyx_t_2 = __pyx_v_first_ellipsis_index;
12631 __pyx_t_6 = __pyx_t_2;
12633 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12634 __pyx_v_idx = __pyx_t_7;
12643 __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)
12644 __Pyx_GOTREF(__pyx_t_1);
12645 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)
12646 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12657 __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)
12658 __pyx_v_indices_from_ellipsis = (__pyx_t_2 - __pyx_v_first_ellipsis_index);
12668 __pyx_v_ellipsis_end = (__pyx_v_ndim - __pyx_v_indices_from_ellipsis);
12678 __pyx_t_2 = __pyx_v_indices_from_ellipsis;
12679 __pyx_t_6 = __pyx_t_2;
12681 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12682 __pyx_v_idx = __pyx_t_7;
12691 __pyx_t_8 = (__pyx_v_first_ellipsis_index + __pyx_v_idx);
12693 __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)
12694 __Pyx_GOTREF(__pyx_t_1);
12696 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
12706 __pyx_t_4 = (__pyx_v_item != __pyx_builtin_Ellipsis);
12717 __pyx_t_8 = (__pyx_v_ellipsis_end + __pyx_v_idx);
12719 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)
12740 __pyx_t_1 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 758, __pyx_L1_error)
12741 __Pyx_GOTREF(__pyx_t_1);
12742 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_1));
12762 __pyx_t_4 = (__pyx_v_ndim > __pyx_v_idx);
12774 __pyx_v_have_slices = 1;
12783 __pyx_t_2 = (__pyx_v_ndim - __pyx_v_idx);
12785 __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)
12786 __Pyx_GOTREF(__pyx_t_1);
12788 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_index_tuple, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error)
12789 __Pyx_GOTREF(__pyx_t_3);
12790 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12791 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_3));
12811 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 765, __pyx_L1_error)
12812 __Pyx_GOTREF(__pyx_t_3);
12813 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 765, __pyx_L1_error)
12814 __Pyx_GOTREF(__pyx_t_1);
12815 __Pyx_GIVEREF(__pyx_t_3);
12816 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
12817 __Pyx_INCREF(__pyx_v_index_tuple);
12818 __Pyx_GIVEREF(__pyx_v_index_tuple);
12819 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_index_tuple) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
12822 PyObject *__pyx_temp;
12824 __pyx_temp = __pyx_r;
12825 __pyx_r = ((PyObject*)__pyx_t_1);
12827 __Pyx_XDECREF(__pyx_temp);
12842 __Pyx_XDECREF(__pyx_t_1);
12843 __Pyx_XDECREF(__pyx_t_3);
12844 __Pyx_AddTraceback(
"View.MemoryView._unellipsify_index_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
12852 __Pyx_XDECREF(__pyx_v_item);
12853 __Pyx_XDECREF(__pyx_v_result);
12854 __Pyx_XDECREF(__pyx_v_index_tuple);
12855 __Pyx_XGIVEREF(__pyx_r);
12856 __Pyx_RefNannyFinishContext();
12868static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
12869 PyObject *__pyx_v_result = 0;
12870 int __pyx_v_have_slices;
12871 PyObject *__pyx_r = NULL;
12872 __Pyx_RefNannyDeclarations
12874 PyObject *__pyx_t_2 = NULL;
12877 PyObject *__pyx_t_5 = NULL;
12878 PyObject *__pyx_t_6 = NULL;
12879 int __pyx_lineno = 0;
12880 const char *__pyx_filename = NULL;
12881 int __pyx_clineno = 0;
12882 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
12891 __pyx_v_have_slices = 0;
12900 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
12911 __pyx_v_have_slices = 1;
12920 __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)
12921 __Pyx_GOTREF(__pyx_t_2);
12922 __pyx_v_result = ((PyObject*)__pyx_t_2);
12942 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
12953 if (unlikely(__pyx_v_index == Py_None)) {
12954 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
12955 __PYX_ERR(1, 780, __pyx_L1_error)
12957 __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)
12958 __Pyx_GOTREF(__pyx_t_2);
12960 PyObject *__pyx_temp;
12962 __pyx_temp = __pyx_r;
12963 __pyx_r = ((PyObject*)__pyx_t_2);
12965 __Pyx_XDECREF(__pyx_temp);
12987 __pyx_t_1 = PySlice_Check(__pyx_v_index);
12998 __pyx_v_have_slices = 1;
13017 __pyx_t_1 = (!(PyIndex_Check(__pyx_v_index) != 0));
13019 if (unlikely(__pyx_t_1)) {
13029 __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)
13049 switch (__pyx_v_ndim) {
13059 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
13060 __Pyx_GOTREF(__pyx_t_2);
13061 __Pyx_INCREF(__pyx_v_index);
13062 __Pyx_GIVEREF(__pyx_v_index);
13063 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 790, __pyx_L1_error);
13064 __pyx_v_result = ((PyObject*)__pyx_t_2);
13084 __pyx_v_have_slices = 1;
13093 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __pyx_L1_error)
13094 __Pyx_GOTREF(__pyx_t_2);
13095 __Pyx_INCREF(__pyx_v_index);
13096 __Pyx_GIVEREF(__pyx_v_index);
13097 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13098 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
13099 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
13100 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13101 __pyx_v_result = ((PyObject*)__pyx_t_2);
13121 __pyx_v_have_slices = 1;
13130 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 796, __pyx_L1_error)
13131 __Pyx_GOTREF(__pyx_t_2);
13132 __Pyx_INCREF(__pyx_v_index);
13133 __Pyx_GIVEREF(__pyx_v_index);
13134 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 796, __pyx_L1_error);
13135 __pyx_t_4 = (__pyx_v_ndim - 1);
13137 __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)
13138 __Pyx_GOTREF(__pyx_t_5);
13140 __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 796, __pyx_L1_error)
13141 __Pyx_GOTREF(__pyx_t_6);
13142 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13143 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13144 __pyx_v_result = ((PyObject*)__pyx_t_6);
13158 __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 798, __pyx_L1_error)
13159 __Pyx_GOTREF(__pyx_t_6);
13160 __pyx_t_5 = PyTuple_New(2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 798, __pyx_L1_error)
13161 __Pyx_GOTREF(__pyx_t_5);
13162 __Pyx_GIVEREF(__pyx_t_6);
13163 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13164 __Pyx_INCREF(__pyx_v_result);
13165 __Pyx_GIVEREF(__pyx_v_result);
13166 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_result) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13169 PyObject *__pyx_temp;
13171 __pyx_temp = __pyx_r;
13172 __pyx_r = ((PyObject*)__pyx_t_5);
13174 __Pyx_XDECREF(__pyx_temp);
13189 __Pyx_XDECREF(__pyx_t_2);
13190 __Pyx_XDECREF(__pyx_t_5);
13191 __Pyx_XDECREF(__pyx_t_6);
13192 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13195 __Pyx_XDECREF(__pyx_v_result);
13197 __Pyx_XGIVEREF(__pyx_r);
13198 __Pyx_RefNannyFinishContext();
13210static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
13211 Py_ssize_t __pyx_v_suboffset;
13213 Py_ssize_t *__pyx_t_1;
13214 Py_ssize_t *__pyx_t_2;
13215 Py_ssize_t *__pyx_t_3;
13218 int __pyx_lineno = 0;
13219 const char *__pyx_filename = NULL;
13220 int __pyx_clineno = 0;
13229 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13231 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13232 __pyx_t_1 = __pyx_t_3;
13233 __pyx_v_suboffset = (__pyx_t_1[0]);
13242 __pyx_t_4 = (__pyx_v_suboffset >= 0);
13244 if (unlikely(__pyx_t_4)) {
13254 __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)
13291 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13307static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13308 int __pyx_v_new_ndim;
13309 int __pyx_v_suboffset_dim;
13311 __Pyx_memviewslice __pyx_v_src;
13312 __Pyx_memviewslice __pyx_v_dst;
13313 __Pyx_memviewslice *__pyx_v_p_src;
13314 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13315 __Pyx_memviewslice *__pyx_v_p_dst;
13316 int *__pyx_v_p_suboffset_dim;
13317 Py_ssize_t __pyx_v_start;
13318 Py_ssize_t __pyx_v_stop;
13319 Py_ssize_t __pyx_v_step;
13320 Py_ssize_t __pyx_v_cindex;
13321 int __pyx_v_have_start;
13322 int __pyx_v_have_stop;
13323 int __pyx_v_have_step;
13324 PyObject *__pyx_v_index = NULL;
13325 struct __pyx_memoryview_obj *__pyx_r = NULL;
13326 __Pyx_RefNannyDeclarations
13328 PyObject *__pyx_t_2 = NULL;
13329 struct __pyx_memoryview_obj *__pyx_t_3;
13332 Py_ssize_t __pyx_t_6;
13333 PyObject *__pyx_t_7 = NULL;
13334 Py_ssize_t __pyx_t_8;
13336 Py_ssize_t __pyx_t_10;
13337 int __pyx_lineno = 0;
13338 const char *__pyx_filename = NULL;
13339 int __pyx_clineno = 0;
13340 __Pyx_RefNannySetupContext(
"memview_slice", 0);
13349 __pyx_v_new_ndim = 0;
13350 __pyx_v_suboffset_dim = -1;
13359 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
13368 #ifndef CYTHON_WITHOUT_ASSERTIONS
13369 if (unlikely(__pyx_assertions_enabled())) {
13370 __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
13372 if (unlikely(!__pyx_t_1)) {
13373 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
13374 __PYX_ERR(1, 824, __pyx_L1_error)
13379 if ((1));
else __PYX_ERR(1, 824, __pyx_L1_error)
13389 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
13400 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
13401 __Pyx_INCREF(__pyx_t_2);
13402 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)
13403 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
13413 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13433 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13442 __pyx_v_p_src = (&__pyx_v_src);
13453 __pyx_t_3 = __pyx_v_p_src->memview;
13455 __pyx_v_dst.memview = __pyx_t_3;
13464 __pyx_t_4 = __pyx_v_p_src->data;
13466 __pyx_v_dst.data = __pyx_t_4;
13475 __pyx_v_p_dst = (&__pyx_v_dst);
13484 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13495 __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
13499 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
13500 #if !CYTHON_ASSUME_SAFE_SIZE
13501 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 848, __pyx_L1_error)
13503 if (__pyx_t_6 >= __pyx_temp)
break;
13505 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13506 __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
13508 __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
13511 if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 848, __pyx_L1_error)
13512 __Pyx_GOTREF(__pyx_t_7);
13513 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_7);
13515 __pyx_v_dim = __pyx_t_5;
13516 __pyx_t_5 = (__pyx_t_5 + 1);
13525 __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
13537 __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)
13538 __pyx_v_cindex = __pyx_t_8;
13547 __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)
13567 __pyx_t_1 = (__pyx_v_index == Py_None);
13578 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13587 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13596 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13605 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13625 __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)
13626 __Pyx_GOTREF(__pyx_t_7);
13627 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 863, __pyx_L1_error)
13629 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13631 __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)
13632 __pyx_t_8 = __pyx_t_10;
13633 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13634 goto __pyx_L7_bool_binop_done;
13638 __pyx_L7_bool_binop_done:;
13639 __pyx_v_start = __pyx_t_8;
13648 __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)
13649 __Pyx_GOTREF(__pyx_t_7);
13650 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 864, __pyx_L1_error)
13652 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13654 __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)
13655 __pyx_t_8 = __pyx_t_10;
13656 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13657 goto __pyx_L9_bool_binop_done;
13661 __pyx_L9_bool_binop_done:;
13662 __pyx_v_stop = __pyx_t_8;
13671 __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)
13672 __Pyx_GOTREF(__pyx_t_7);
13673 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 865, __pyx_L1_error)
13675 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13677 __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)
13678 __pyx_t_8 = __pyx_t_10;
13679 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13680 goto __pyx_L11_bool_binop_done;
13684 __pyx_L11_bool_binop_done:;
13685 __pyx_v_step = __pyx_t_8;
13694 __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)
13695 __Pyx_GOTREF(__pyx_t_7);
13696 __pyx_t_1 = (__pyx_t_7 != Py_None);
13697 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13698 __pyx_v_have_start = __pyx_t_1;
13707 __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)
13708 __Pyx_GOTREF(__pyx_t_7);
13709 __pyx_t_1 = (__pyx_t_7 != Py_None);
13710 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13711 __pyx_v_have_stop = __pyx_t_1;
13720 __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)
13721 __Pyx_GOTREF(__pyx_t_7);
13722 __pyx_t_1 = (__pyx_t_7 != Py_None);
13723 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13724 __pyx_v_have_step = __pyx_t_1;
13733 __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)
13743 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13755 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13764 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
13775 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 881, __pyx_L1_error) }
13784 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 882, __pyx_L1_error) }
13793 __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)
13794 __Pyx_GOTREF(__pyx_t_2);
13795 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)
13797 struct __pyx_memoryview_obj *__pyx_temp;
13799 __pyx_temp = __pyx_r;
13800 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
13802 __Pyx_XDECREF((PyObject *)__pyx_temp);
13832 __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)
13833 __Pyx_GOTREF(__pyx_t_2);
13842 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)
13844 struct __pyx_memoryview_obj *__pyx_temp;
13846 __pyx_temp = __pyx_r;
13847 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
13849 __Pyx_XDECREF((PyObject *)__pyx_temp);
13865 __Pyx_XDECREF(__pyx_t_2);
13866 __Pyx_XDECREF(__pyx_t_7);
13867 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13876 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
13886 __Pyx_XDECREF(__pyx_v_index);
13887 __Pyx_XGIVEREF((PyObject *)__pyx_r);
13888 __Pyx_RefNannyFinishContext();
13900static 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) {
13901 Py_ssize_t __pyx_v_shape;
13902 Py_ssize_t __pyx_v_stride;
13903 Py_ssize_t __pyx_v_suboffset;
13904 Py_ssize_t __pyx_v_itemsize;
13905 char *__pyx_v_resultp;
13907 Py_ssize_t __pyx_t_1;
13910 int __pyx_lineno = 0;
13911 const char *__pyx_filename = NULL;
13912 int __pyx_clineno = 0;
13922 __pyx_v_suboffset = -1L;
13931 __pyx_t_1 = __pyx_v_view->itemsize;
13933 __pyx_v_itemsize = __pyx_t_1;
13942 __pyx_t_2 = (__pyx_v_view->ndim == 0);
13954 if (unlikely(__pyx_v_itemsize == 0)) {
13955 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
13956 __PYX_ERR(1, 900, __pyx_L1_error)
13958 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))) {
13959 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
13960 __PYX_ERR(1, 900, __pyx_L1_error)
13962 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);
13971 __pyx_v_stride = __pyx_v_itemsize;
13991 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14000 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14009 __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14021 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14041 __pyx_t_2 = (__pyx_v_index < 0);
14053 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14062 __pyx_t_2 = (__pyx_v_index < 0);
14064 if (unlikely(__pyx_t_2)) {
14074 __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)
14102 __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14104 if (unlikely(__pyx_t_2)) {
14114 __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)
14133 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14142 __pyx_t_2 = (__pyx_v_suboffset >= 0);
14154 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14174 __pyx_r = __pyx_v_resultp;
14188 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14209static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14211 Py_ssize_t *__pyx_v_shape;
14212 Py_ssize_t *__pyx_v_strides;
14217 Py_ssize_t *__pyx_t_2;
14220 Py_ssize_t __pyx_t_5;
14221 Py_ssize_t __pyx_t_6;
14225 int __pyx_lineno = 0;
14226 const char *__pyx_filename = NULL;
14227 int __pyx_clineno = 0;
14228 PyGILState_STATE __pyx_gilstate_save;
14237 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14239 __pyx_v_ndim = __pyx_t_1;
14248 __pyx_t_2 = __pyx_v_memslice->shape;
14250 __pyx_v_shape = __pyx_t_2;
14259 __pyx_t_2 = __pyx_v_memslice->strides;
14261 __pyx_v_strides = __pyx_t_2;
14271 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2, 1);
14272 __pyx_t_4 = __pyx_t_3;
14274 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14275 __pyx_v_i = __pyx_t_1;
14284 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14293 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14295 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14297 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14299 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14309 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14311 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14313 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14315 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14325 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14331 __pyx_t_7 = __pyx_t_8;
14333 goto __pyx_L6_bool_binop_done;
14335 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14338 __pyx_t_7 = __pyx_t_8;
14340 __pyx_L6_bool_binop_done:;
14341 if (unlikely(__pyx_t_7)) {
14351 __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)
14388 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14389 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14391 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14410static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
14411static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14412 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
14413 __Pyx_RefNannyDeclarations
14414 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
14415 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
14416 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14419 __Pyx_RefNannyFinishContext();
14422static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14431 __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
14453static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
14454 PyObject *__pyx_r = NULL;
14455 __Pyx_RefNannyDeclarations
14457 PyObject *__pyx_t_2 = NULL;
14458 int __pyx_lineno = 0;
14459 const char *__pyx_filename = NULL;
14460 int __pyx_clineno = 0;
14461 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
14470 __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
14482 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 965, __pyx_L1_error)
14483 __Pyx_GOTREF(__pyx_t_2);
14485 PyObject *__pyx_temp;
14487 __pyx_temp = __pyx_r;
14488 __pyx_r = __pyx_t_2;
14490 __Pyx_XDECREF(__pyx_temp);
14512 __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)
14513 __Pyx_GOTREF(__pyx_t_2);
14515 PyObject *__pyx_temp;
14517 __pyx_temp = __pyx_r;
14518 __pyx_r = __pyx_t_2;
14520 __Pyx_XDECREF(__pyx_temp);
14536 __Pyx_XDECREF(__pyx_t_2);
14537 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14540 __Pyx_XGIVEREF(__pyx_r);
14541 __Pyx_RefNannyFinishContext();
14553static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14554 PyObject *__pyx_r = NULL;
14555 __Pyx_RefNannyDeclarations
14558 PyObject *__pyx_t_3 = NULL;
14559 int __pyx_lineno = 0;
14560 const char *__pyx_filename = NULL;
14561 int __pyx_clineno = 0;
14562 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
14571 __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
14583 __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)
14604 __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)
14605 __Pyx_GOTREF(__pyx_t_3);
14606 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14619 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14622 __Pyx_XDECREF(__pyx_t_3);
14623 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14626 __Pyx_XGIVEREF(__pyx_r);
14627 __Pyx_RefNannyFinishContext();
14639static PyObject *__pyx_memoryviewslice__get_base(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14640 PyObject *__pyx_r = NULL;
14641 __Pyx_RefNannyDeclarations
14642 __Pyx_RefNannySetupContext(
"_get_base", 0);
14652 PyObject *__pyx_temp;
14654 __pyx_temp = __pyx_r;
14655 __Pyx_INCREF(__pyx_v_self->from_object);
14656 __pyx_r = __pyx_v_self->from_object;
14658 __Pyx_XDECREF(__pyx_temp);
14672 __Pyx_XGIVEREF(__pyx_r);
14673 __Pyx_RefNannyFinishContext();
14684static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14685#
if CYTHON_VECTORCALL
14686PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14688PyObject *__pyx_args, PyObject *__pyx_kwds
14691static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14692#
if CYTHON_VECTORCALL
14693PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14695PyObject *__pyx_args, PyObject *__pyx_kwds
14698 #if !CYTHON_VECTORCALL
14699 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14701 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
14702 PyObject *__pyx_r = 0;
14703 __Pyx_RefNannyDeclarations
14704 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
14705 #if !CYTHON_VECTORCALL
14706 #if CYTHON_ASSUME_SAFE_SIZE
14707 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14709 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
14712 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14713 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
14714 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
14715 if (unlikely(__pyx_kwds_len < 0))
return NULL;
14716 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
14717 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14720 __Pyx_RefNannyFinishContext();
14724static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14725 PyObject *__pyx_r = NULL;
14726 __Pyx_RefNannyDeclarations
14727 int __pyx_lineno = 0;
14728 const char *__pyx_filename = NULL;
14729 int __pyx_clineno = 0;
14730 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
14738 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
14739 __PYX_ERR(1, 2, __pyx_L1_error)
14749 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14751 __Pyx_XGIVEREF(__pyx_r);
14752 __Pyx_RefNannyFinishContext();
14764static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14765#
if CYTHON_VECTORCALL
14766PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14768PyObject *__pyx_args, PyObject *__pyx_kwds
14771static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14772#
if CYTHON_VECTORCALL
14773PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14775PyObject *__pyx_args, PyObject *__pyx_kwds
14778 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
14779 #if !CYTHON_VECTORCALL
14780 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14782 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
14783 PyObject* values[1] = {0};
14784 int __pyx_lineno = 0;
14785 const char *__pyx_filename = NULL;
14786 int __pyx_clineno = 0;
14787 PyObject *__pyx_r = 0;
14788 __Pyx_RefNannyDeclarations
14789 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
14790 #if !CYTHON_VECTORCALL
14791 #if CYTHON_ASSUME_SAFE_SIZE
14792 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14794 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
14797 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14799 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
14800 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
14801 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
14802 if (__pyx_kwds_len > 0) {
14803 switch (__pyx_nargs) {
14805 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
14806 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
14807 CYTHON_FALLTHROUGH;
14809 default:
goto __pyx_L5_argtuple_error;
14811 const Py_ssize_t kwd_pos_args = __pyx_nargs;
14812 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)
14813 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
14814 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
14816 }
else if (unlikely(__pyx_nargs != 1)) {
14817 goto __pyx_L5_argtuple_error;
14819 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
14820 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
14822 __pyx_v___pyx_state = values[0];
14824 goto __pyx_L6_skip;
14825 __pyx_L5_argtuple_error:;
14826 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
14828 goto __pyx_L4_argument_unpacking_done;
14830 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
14831 Py_XDECREF(values[__pyx_temp]);
14833 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14834 __Pyx_RefNannyFinishContext();
14836 __pyx_L4_argument_unpacking_done:;
14837 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
14840 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
14841 Py_XDECREF(values[__pyx_temp]);
14843 __Pyx_RefNannyFinishContext();
14847static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14848 PyObject *__pyx_r = NULL;
14849 __Pyx_RefNannyDeclarations
14850 int __pyx_lineno = 0;
14851 const char *__pyx_filename = NULL;
14852 int __pyx_clineno = 0;
14853 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
14860 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
14861 __PYX_ERR(1, 4, __pyx_L1_error)
14872 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14874 __Pyx_XGIVEREF(__pyx_r);
14875 __Pyx_RefNannyFinishContext();
14887static 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) {
14888 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
14889 Py_ssize_t __pyx_v_suboffset;
14890 Py_ssize_t __pyx_v_length;
14891 PyObject *__pyx_r = NULL;
14892 __Pyx_RefNannyDeclarations
14894 PyObject *__pyx_t_2 = NULL;
14895 PyObject *__pyx_t_3 = NULL;
14896 __Pyx_TypeInfo
const *__pyx_t_4;
14897 Py_buffer __pyx_t_5;
14898 Py_ssize_t *__pyx_t_6;
14899 Py_ssize_t *__pyx_t_7;
14900 Py_ssize_t *__pyx_t_8;
14901 Py_ssize_t __pyx_t_9;
14902 int __pyx_lineno = 0;
14903 const char *__pyx_filename = NULL;
14904 int __pyx_clineno = 0;
14905 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
14914 __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
14927 PyObject *__pyx_temp;
14929 __pyx_temp = __pyx_r;
14930 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14932 __Pyx_XDECREF(__pyx_temp);
14952 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
14953 __Pyx_GOTREF(__pyx_t_2);
14954 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1010, __pyx_L1_error)
14955 __Pyx_GOTREF(__pyx_t_3);
14956 __Pyx_INCREF(Py_None);
14957 __Pyx_GIVEREF(Py_None);
14958 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
14959 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
14960 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
14961 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
14962 __Pyx_GIVEREF(__pyx_t_2);
14963 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
14965 __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)
14966 __Pyx_GOTREF(__pyx_t_2);
14967 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14968 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
14978 __pyx_v_result->from_slice = __pyx_v_memviewslice;
14987 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
14996 __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)
14997 __Pyx_GOTREF(__pyx_t_2);
14998 __Pyx_GIVEREF(__pyx_t_2);
14999 __Pyx_GOTREF(__pyx_v_result->from_object);
15000 __Pyx_DECREF(__pyx_v_result->from_object);
15001 __pyx_v_result->from_object = __pyx_t_2;
15011 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15013 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15022 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15024 __pyx_v_result->__pyx_base.view = __pyx_t_5;
15033 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
15042 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15051 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15060 Py_INCREF(Py_None);
15069 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15081 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15101 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15112 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15121 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15130 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15139 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15141 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15142 __pyx_t_6 = __pyx_t_8;
15143 __pyx_v_suboffset = (__pyx_t_6[0]);
15152 __pyx_t_1 = (__pyx_v_suboffset >= 0);
15164 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15173 goto __pyx_L6_break;
15194 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15196 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15205 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15207 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15208 __pyx_t_6 = __pyx_t_8;
15209 __pyx_v_length = (__pyx_t_6[0]);
15218 __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * __pyx_v_length);
15229 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15238 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15248 PyObject *__pyx_temp;
15250 __pyx_temp = __pyx_r;
15251 __Pyx_INCREF((PyObject *)__pyx_v_result);
15252 __pyx_r = ((PyObject *)__pyx_v_result);
15254 __Pyx_XDECREF(__pyx_temp);
15268 __Pyx_XDECREF(__pyx_t_2);
15269 __Pyx_XDECREF(__pyx_t_3);
15270 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15273 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15276 __Pyx_XGIVEREF(__pyx_r);
15277 __Pyx_RefNannyFinishContext();
15289static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15290 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15291 __Pyx_memviewslice *__pyx_r;
15292 __Pyx_RefNannyDeclarations
15294 PyObject *__pyx_t_2 = NULL;
15295 int __pyx_lineno = 0;
15296 const char *__pyx_filename = NULL;
15297 int __pyx_clineno = 0;
15298 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
15307 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15318 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
15319 __Pyx_INCREF(__pyx_t_2);
15320 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)
15321 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15333 __pyx_r = (&__pyx_v_obj->from_slice);
15354 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15365 __pyx_r = __pyx_v_mslice;
15380 __Pyx_XDECREF(__pyx_t_2);
15381 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15384 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15386 __Pyx_RefNannyFinishContext();
15398static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15400 Py_ssize_t *__pyx_v_shape;
15401 Py_ssize_t *__pyx_v_strides;
15402 Py_ssize_t *__pyx_v_suboffsets;
15403 Py_ssize_t *__pyx_t_1;
15407 Py_ssize_t __pyx_t_5;
15417 __pyx_t_1 = __pyx_v_memview->view.shape;
15419 __pyx_v_shape = __pyx_t_1;
15428 __pyx_t_1 = __pyx_v_memview->view.strides;
15430 __pyx_v_strides = __pyx_t_1;
15439 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15441 __pyx_v_suboffsets = __pyx_t_1;
15450 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
15459 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
15469 __pyx_t_2 = __pyx_v_memview->view.ndim;
15470 __pyx_t_3 = __pyx_t_2;
15472 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15473 __pyx_v_dim = __pyx_t_4;
15482 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15491 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15500 __pyx_t_6 = (__pyx_v_suboffsets != 0);
15504 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15510 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15539static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
15540 __Pyx_memviewslice __pyx_v_memviewslice;
15541 PyObject *__pyx_r = NULL;
15542 __Pyx_RefNannyDeclarations
15543 PyObject *__pyx_t_1 = NULL;
15544 int __pyx_lineno = 0;
15545 const char *__pyx_filename = NULL;
15546 int __pyx_clineno = 0;
15547 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
15556 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15565 __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)
15566 __Pyx_GOTREF(__pyx_t_1);
15568 PyObject *__pyx_temp;
15570 __pyx_temp = __pyx_r;
15571 __pyx_r = __pyx_t_1;
15573 __Pyx_XDECREF(__pyx_temp);
15588 __Pyx_XDECREF(__pyx_t_1);
15589 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15593 __Pyx_XGIVEREF(__pyx_r);
15594 __Pyx_RefNannyFinishContext();
15606static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15607 PyObject *(*__pyx_v_to_object_func)(
char *);
15608 __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func;
15609 PyObject *__pyx_r = NULL;
15610 __Pyx_RefNannyDeclarations
15612 PyObject *(*__pyx_t_2)(
char *);
15613 __pyx_memoryview_to_dtype_func_type __pyx_t_3;
15614 PyObject *__pyx_t_4 = NULL;
15615 int __pyx_lineno = 0;
15616 const char *__pyx_filename = NULL;
15617 int __pyx_clineno = 0;
15618 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
15627 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15638 __pyx_t_2 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15640 __pyx_v_to_object_func = __pyx_t_2;
15649 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15651 __pyx_v_to_dtype_func = __pyx_t_3;
15671 __pyx_v_to_object_func = NULL;
15680 __pyx_v_to_dtype_func = NULL;
15691 __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)
15692 __Pyx_GOTREF(__pyx_t_4);
15694 PyObject *__pyx_temp;
15696 __pyx_temp = __pyx_r;
15697 __pyx_r = __pyx_t_4;
15699 __Pyx_XDECREF(__pyx_temp);
15714 __Pyx_XDECREF(__pyx_t_4);
15715 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15720 __Pyx_XGIVEREF(__pyx_r);
15721 __Pyx_RefNannyFinishContext();
15733static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
15734 Py_ssize_t __pyx_r;
15735 Py_ssize_t __pyx_t_1;
15745 __pyx_t_2 = (__pyx_v_arg < 0);
15749 __pyx_t_1 = (-__pyx_v_arg);
15752 __pyx_t_1 = __pyx_v_arg;
15756 __pyx_r = __pyx_t_1;
15781static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
15783 Py_ssize_t __pyx_v_c_stride;
15784 Py_ssize_t __pyx_v_f_stride;
15798 __pyx_v_c_stride = 0;
15807 __pyx_v_f_stride = 0;
15816 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
15817 __pyx_v_i = __pyx_t_1;
15826 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15838 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15847 goto __pyx_L4_break;
15868 __pyx_t_1 = __pyx_v_ndim;
15869 __pyx_t_3 = __pyx_t_1;
15871 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15872 __pyx_v_i = __pyx_t_4;
15881 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15893 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15902 goto __pyx_L7_break;
15923 __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
15989static 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) {
15990 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
15991 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
15992 Py_ssize_t __pyx_v_dst_extent;
15993 Py_ssize_t __pyx_v_src_stride;
15994 Py_ssize_t __pyx_v_dst_stride;
15997 Py_ssize_t __pyx_t_3;
15998 Py_ssize_t __pyx_t_4;
15999 Py_ssize_t __pyx_t_5;
16010 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16019 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16028 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16037 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16046 __pyx_t_1 = (__pyx_v_ndim == 1);
16058 __pyx_t_2 = (__pyx_v_src_stride > 0);
16064 __pyx_t_1 = __pyx_t_2;
16066 goto __pyx_L5_bool_binop_done;
16068 __pyx_t_2 = (__pyx_v_dst_stride > 0);
16074 __pyx_t_1 = __pyx_t_2;
16076 goto __pyx_L5_bool_binop_done;
16086 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16088 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16091 __pyx_t_1 = __pyx_t_2;
16093 __pyx_L5_bool_binop_done:;
16112 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * ((
size_t)__pyx_v_dst_extent))));
16133 __pyx_t_3 = __pyx_v_dst_extent;
16134 __pyx_t_4 = __pyx_t_3;
16136 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16137 __pyx_v_i = __pyx_t_5;
16146 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16155 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16164 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16189 __pyx_t_3 = __pyx_v_dst_extent;
16190 __pyx_t_4 = __pyx_t_3;
16192 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16193 __pyx_v_i = __pyx_t_5;
16202 _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);
16211 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16220 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16252static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
16261 _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);
16282static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
16283 Py_ssize_t __pyx_v_shape;
16284 size_t __pyx_v_size;
16286 Py_ssize_t *__pyx_t_1;
16287 Py_ssize_t *__pyx_t_2;
16288 Py_ssize_t *__pyx_t_3;
16297 __pyx_v_size = ((size_t)__pyx_v_src->memview->view.itemsize);
16306 __pyx_t_2 = (__pyx_v_src->shape + __pyx_v_ndim);
16308 for (__pyx_t_3 = __pyx_v_src->shape; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16309 __pyx_t_1 = __pyx_t_3;
16310 __pyx_v_shape = (__pyx_t_1[0]);
16319 __pyx_v_size = (__pyx_v_size * ((size_t)__pyx_v_shape));
16332 __pyx_r = __pyx_v_size;
16359static 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) {
16361 Py_ssize_t __pyx_r;
16375 __pyx_t_1 = (__pyx_v_order ==
'F');
16388 __pyx_t_2 = __pyx_v_ndim;
16389 __pyx_t_3 = __pyx_t_2;
16391 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16392 __pyx_v_idx = __pyx_t_4;
16401 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16410 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16432 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16433 __pyx_v_idx = __pyx_t_2;
16442 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16451 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16465 __pyx_r = __pyx_v_stride;
16492static 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) {
16494 void *__pyx_v_result;
16495 size_t __pyx_v_itemsize;
16496 size_t __pyx_v_size;
16500 struct __pyx_memoryview_obj *__pyx_t_3;
16503 int __pyx_lineno = 0;
16504 const char *__pyx_filename = NULL;
16505 int __pyx_clineno = 0;
16506 PyGILState_STATE __pyx_gilstate_save;
16515 __pyx_v_itemsize = ((size_t)__pyx_v_src->memview->view.itemsize);
16524 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16533 __pyx_v_result = malloc(__pyx_v_size);
16542 __pyx_t_1 = (!(__pyx_v_result != 0));
16544 if (unlikely(__pyx_t_1)) {
16554 __pyx_t_2 = __pyx_memoryview_err_no_memory();
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
16573 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
16582 __pyx_t_3 = __pyx_v_src->memview;
16584 __pyx_v_tmpslice->memview = __pyx_t_3;
16594 __pyx_t_2 = __pyx_v_ndim;
16595 __pyx_t_4 = __pyx_t_2;
16597 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16598 __pyx_v_i = __pyx_t_5;
16607 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16616 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16627 (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));
16637 __pyx_t_2 = __pyx_v_ndim;
16638 __pyx_t_4 = __pyx_t_2;
16640 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16641 __pyx_v_i = __pyx_t_5;
16650 __pyx_t_1 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
16662 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16682 __pyx_t_1 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
16694 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16714 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
16727 __pyx_r = __pyx_v_result;
16741 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16742 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
16744 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16761static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
16763 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16775 (void)(PyErr_Format(PyExc_ValueError, __pyx_k_got_differing_extents_in_dimensi, __pyx_v_i, __pyx_v_extent1, __pyx_v_extent2));
16804 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16816static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char const *__pyx_v_msg,
int __pyx_v_dim) {
16818 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16830 (void)(PyErr_Format(__pyx_v_error, __pyx_v_msg, __pyx_v_dim));
16859 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16871static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char const *__pyx_v_msg) {
16873 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16884 (void)(PyErr_SetString(__pyx_v_error, __pyx_v_msg));
16912 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16924static int __pyx_memoryview_err_no_memory(
void) {
16926 int __pyx_lineno = 0;
16927 const char *__pyx_filename = NULL;
16928 int __pyx_clineno = 0;
16929 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16938 PyErr_NoMemory(); __PYX_ERR(1, 1267, __pyx_L1_error)
16950 __Pyx_AddTraceback(
"View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
16953 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16965static int __pyx_memoryview_err_ValueError(
char const *__pyx_v_msg) {
16975 (void)(PyErr_SetString(PyExc_ValueError, __pyx_v_msg));
17012static int __pyx_memoryview_err_IndexError(
char const *__pyx_v_msg, Py_ssize_t __pyx_v_index) {
17022 (void)(PyErr_Format(PyExc_IndexError, __pyx_v_msg, __pyx_v_index));
17059static 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) {
17060 void *__pyx_v_tmpdata;
17061 size_t __pyx_v_itemsize;
17063 char __pyx_v_order;
17064 int __pyx_v_broadcasting;
17065 int __pyx_v_direct_copy;
17066 __Pyx_memviewslice __pyx_v_tmp;
17075 int __pyx_lineno = 0;
17076 const char *__pyx_filename = NULL;
17077 int __pyx_clineno = 0;
17078 PyGILState_STATE __pyx_gilstate_save;
17088 __pyx_v_tmpdata = NULL;
17097 __pyx_v_itemsize = ((size_t)__pyx_v_src.memview->view.itemsize);
17106 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17115 __pyx_v_broadcasting = 0;
17124 __pyx_v_direct_copy = 0;
17133 __pyx_t_1 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17145 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17164 __pyx_t_1 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17176 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17196 __pyx_t_2 = __pyx_v_dst_ndim;
17198 __pyx_t_3 = __pyx_v_src_ndim;
17199 __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
17203 __pyx_t_4 = __pyx_t_2;
17206 __pyx_t_4 = __pyx_t_3;
17209 __pyx_v_ndim = __pyx_t_4;
17220 __pyx_t_4 = __pyx_v_ndim;
17221 __pyx_t_2 = __pyx_t_4;
17223 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17224 __pyx_v_i = __pyx_t_3;
17233 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17245 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17247 if (likely(__pyx_t_1)) {
17257 __pyx_v_broadcasting = 1;
17266 (__pyx_v_src.strides[__pyx_v_i]) = 0;
17286 __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)
17307 __pyx_t_1 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17309 if (unlikely(__pyx_t_1)) {
17319 __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)
17340 __pyx_t_1 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17352 __pyx_t_1 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17364 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17382 __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)
17383 __pyx_v_tmpdata = __pyx_t_6;
17392 __pyx_v_src = __pyx_v_tmp;
17410 __pyx_t_1 = (!__pyx_v_broadcasting);
17422 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim);
17434 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
17453 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim);
17465 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
17484 if (__pyx_v_direct_copy) {
17493 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17502 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17511 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17520 free(__pyx_v_tmpdata);
17560 __pyx_t_1 = (__pyx_v_order ==
'F');
17562 __pyx_t_1 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17574 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1344, __pyx_L1_error)
17584 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1345, __pyx_L1_error)
17603 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17612 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17621 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17630 free(__pyx_v_tmpdata);
17655 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17656 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17658 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17680static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
17682 int __pyx_v_offset;
17694 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17703 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17704 __pyx_v_i = __pyx_t_1;
17713 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
17722 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
17731 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
17742 __pyx_t_1 = __pyx_v_offset;
17743 __pyx_t_2 = __pyx_t_1;
17745 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17746 __pyx_v_i = __pyx_t_3;
17755 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
17764 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
17773 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
17798static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
17807 if (__pyx_v_dtype_is_object) {
17816 __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);
17846static 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) {
17847 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17861 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
17878 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17889static 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) {
17890 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17891 Py_ssize_t __pyx_v_stride;
17892 Py_ssize_t __pyx_t_1;
17893 Py_ssize_t __pyx_t_2;
17894 Py_ssize_t __pyx_t_3;
17905 __pyx_v_stride = (__pyx_v_strides[0]);
17915 __pyx_t_1 = (__pyx_v_shape[0]);
17916 __pyx_t_2 = __pyx_t_1;
17918 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17919 __pyx_v_i = __pyx_t_3;
17928 __pyx_t_4 = (__pyx_v_ndim == 1);
17949 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
17969 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
17991 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18002 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18029static 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) {
18038 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18047 __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);
18056 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18077static 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) {
18078 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18079 Py_ssize_t __pyx_v_stride;
18080 Py_ssize_t __pyx_v_extent;
18082 Py_ssize_t __pyx_t_2;
18083 Py_ssize_t __pyx_t_3;
18084 Py_ssize_t __pyx_t_4;
18094 __pyx_v_stride = (__pyx_v_strides[0]);
18103 __pyx_v_extent = (__pyx_v_shape[0]);
18112 __pyx_t_1 = (__pyx_v_ndim == 1);
18125 __pyx_t_2 = __pyx_v_extent;
18126 __pyx_t_3 = __pyx_t_2;
18128 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18129 __pyx_v_i = __pyx_t_4;
18138 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18147 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18170 __pyx_t_2 = __pyx_v_extent;
18171 __pyx_t_3 = __pyx_t_2;
18173 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18174 __pyx_v_i = __pyx_t_4;
18183 __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);
18191 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18221static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18222#
if CYTHON_VECTORCALL
18223PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18225PyObject *__pyx_args, PyObject *__pyx_kwds
18228static 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};
18229static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18230#
if CYTHON_VECTORCALL
18231PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18233PyObject *__pyx_args, PyObject *__pyx_kwds
18236 PyObject *__pyx_v___pyx_type = 0;
18237 long __pyx_v___pyx_checksum;
18238 PyObject *__pyx_v___pyx_state = 0;
18239 #if !CYTHON_VECTORCALL
18240 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18242 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
18243 PyObject* values[3] = {0,0,0};
18244 int __pyx_lineno = 0;
18245 const char *__pyx_filename = NULL;
18246 int __pyx_clineno = 0;
18247 PyObject *__pyx_r = 0;
18248 __Pyx_RefNannyDeclarations
18249 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
18250 #if !CYTHON_VECTORCALL
18251 #if CYTHON_ASSUME_SAFE_SIZE
18252 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18254 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
18257 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18259 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};
18260 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
18261 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 4, __pyx_L3_error)
18262 if (__pyx_kwds_len > 0) {
18263 switch (__pyx_nargs) {
18265 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18266 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18267 CYTHON_FALLTHROUGH;
18269 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18270 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18271 CYTHON_FALLTHROUGH;
18273 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18274 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18275 CYTHON_FALLTHROUGH;
18277 default:
goto __pyx_L5_argtuple_error;
18279 const Py_ssize_t kwd_pos_args = __pyx_nargs;
18280 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)
18281 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
18282 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
18284 }
else if (unlikely(__pyx_nargs != 3)) {
18285 goto __pyx_L5_argtuple_error;
18287 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18288 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18289 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18290 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18291 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18292 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18294 __pyx_v___pyx_type = values[0];
18295 __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)
18296 __pyx_v___pyx_state = ((PyObject*)values[2]);
18298 goto __pyx_L6_skip;
18299 __pyx_L5_argtuple_error:;
18300 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __pyx_L3_error)
18302 goto __pyx_L4_argument_unpacking_done;
18304 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
18305 Py_XDECREF(values[__pyx_temp]);
18307 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18308 __Pyx_RefNannyFinishContext();
18310 __pyx_L4_argument_unpacking_done:;
18311 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1,
"__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
18312 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18318 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
18319 Py_XDECREF(values[__pyx_temp]);
18321 goto __pyx_L7_cleaned_up;
18323 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
18324 Py_XDECREF(values[__pyx_temp]);
18326 __pyx_L7_cleaned_up:;
18328 __Pyx_RefNannyFinishContext();
18332static 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) {
18333 PyObject *__pyx_v___pyx_result = 0;
18334 PyObject *__pyx_r = NULL;
18335 __Pyx_RefNannyDeclarations
18337 PyObject *__pyx_t_2 = NULL;
18338 PyObject *__pyx_t_3 = NULL;
18341 int __pyx_lineno = 0;
18342 const char *__pyx_filename = NULL;
18343 int __pyx_clineno = 0;
18344 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
18353 __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)
18363 __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
18364 __Pyx_INCREF(__pyx_t_3);
18367 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
18368 __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));
18369 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18370 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
18371 __Pyx_GOTREF(__pyx_t_2);
18373 __pyx_v___pyx_result = __pyx_t_2;
18383 __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
18394 if (unlikely(__pyx_v___pyx_state == Py_None)) {
18395 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
18396 __PYX_ERR(1, 9, __pyx_L1_error)
18398 __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)
18399 __Pyx_GOTREF(__pyx_t_2);
18400 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18419 PyObject *__pyx_temp;
18421 __pyx_temp = __pyx_r;
18422 __Pyx_INCREF(__pyx_v___pyx_result);
18423 __pyx_r = __pyx_v___pyx_result;
18425 __Pyx_XDECREF(__pyx_temp);
18439 __Pyx_XDECREF(__pyx_t_2);
18440 __Pyx_XDECREF(__pyx_t_3);
18441 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18444 __Pyx_XDECREF(__pyx_v___pyx_result);
18445 __Pyx_XGIVEREF(__pyx_r);
18446 __Pyx_RefNannyFinishContext();
18458static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18459 PyObject *__pyx_r = NULL;
18460 __Pyx_RefNannyDeclarations
18461 PyObject *__pyx_t_1 = NULL;
18463 int __pyx_lineno = 0;
18464 const char *__pyx_filename = NULL;
18465 int __pyx_clineno = 0;
18466 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
18474 __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)
18475 __Pyx_GOTREF(__pyx_t_1);
18476 __Pyx_GIVEREF(__pyx_t_1);
18477 __Pyx_GOTREF(__pyx_v___pyx_result->name);
18478 __Pyx_DECREF(__pyx_v___pyx_result->name);
18479 __pyx_v___pyx_result->name = __pyx_t_1;
18487 __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)
18499 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18502 __Pyx_XDECREF(__pyx_t_1);
18503 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18506 __Pyx_XGIVEREF(__pyx_r);
18507 __Pyx_RefNannyFinishContext();
18519static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo
const *__pyx_v_type) {
18520 __Pyx_StructField
const *__pyx_v_field;
18521 struct __pyx_typeinfo_string __pyx_v_fmt;
18522 PyObject *__pyx_v_part = 0;
18523 PyObject *__pyx_v_result = 0;
18524 PyObject *__pyx_v_alignment = NULL;
18525 PyObject *__pyx_v_parts = NULL;
18526 PyObject *__pyx_v_extents = NULL;
18527 Py_ssize_t __pyx_7genexpr__pyx_v_i;
18528 PyObject *__pyx_r = NULL;
18529 __Pyx_RefNannyDeclarations
18531 PyObject *__pyx_t_2 = NULL;
18532 __Pyx_StructField
const *__pyx_t_3;
18533 PyObject *__pyx_t_4 = NULL;
18534 PyObject *__pyx_t_5 = NULL;
18538 Py_ssize_t __pyx_t_9;
18539 PyObject *__pyx_t_10[3];
18540 int __pyx_lineno = 0;
18541 const char *__pyx_filename = NULL;
18542 int __pyx_clineno = 0;
18543 __Pyx_RefNannySetupContext(
"format_from_typeinfo", 0);
18552 __pyx_t_1 = (__pyx_v_type->typegroup ==
'S');
18564 #ifndef CYTHON_WITHOUT_ASSERTIONS
18565 if (unlikely(__pyx_assertions_enabled())) {
18566 __pyx_t_1 = (__pyx_v_type->fields != NULL);
18568 if (unlikely(!__pyx_t_1)) {
18569 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
18570 __PYX_ERR(1, 1475, __pyx_L1_error)
18575 if ((1));
else __PYX_ERR(1, 1475, __pyx_L1_error)
18585 #ifndef CYTHON_WITHOUT_ASSERTIONS
18586 if (unlikely(__pyx_assertions_enabled())) {
18587 __pyx_t_1 = (__pyx_v_type->fields->type != NULL);
18589 if (unlikely(!__pyx_t_1)) {
18590 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
18591 __PYX_ERR(1, 1476, __pyx_L1_error)
18596 if ((1));
else __PYX_ERR(1, 1476, __pyx_L1_error)
18606 __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
18618 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__5);
18619 __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__5;
18639 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__6);
18640 __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__6;
18651 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1483, __pyx_L1_error)
18652 __Pyx_GOTREF(__pyx_t_2);
18653 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_T);
18654 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b_T);
18655 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_kp_b_T) != (0)) __PYX_ERR(1, 1483, __pyx_L1_error);
18656 __pyx_v_parts = ((PyObject*)__pyx_t_2);
18666 __pyx_t_3 = __pyx_v_type->fields;
18668 __pyx_v_field = __pyx_t_3;
18678 __pyx_t_1 = (__pyx_v_field->type != 0);
18681 if (!__pyx_t_1)
break;
18690 __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1487, __pyx_L1_error)
18691 __Pyx_GOTREF(__pyx_t_2);
18692 __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
18702 __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_mstate_global->__pyx_kp_b__7);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1488, __pyx_L1_error)
18703 __Pyx_GOTREF(__pyx_t_2);
18704 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1488, __pyx_L1_error)
18705 __Pyx_GOTREF(__pyx_t_4);
18706 __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1488, __pyx_L1_error)
18707 __Pyx_GOTREF(__pyx_t_5);
18708 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18709 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18710 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_mstate_global->__pyx_kp_b__7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1488, __pyx_L1_error)
18711 __Pyx_GOTREF(__pyx_t_4);
18712 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18713 __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1488, __pyx_L1_error)
18714 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18724 __pyx_v_field = (__pyx_v_field + 1);
18734 __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1491, __pyx_L1_error)
18735 __Pyx_GOTREF(__pyx_t_4);
18736 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_mstate_global->__pyx_kp_b__8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1491, __pyx_L1_error)
18737 __Pyx_GOTREF(__pyx_t_5);
18738 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18739 __pyx_v_result = ((PyObject*)__pyx_t_5);
18760 __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
18769 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_fmt.string);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1494, __pyx_L1_error)
18770 __Pyx_GOTREF(__pyx_t_5);
18771 __pyx_v_result = ((PyObject*)__pyx_t_5);
18781 __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
18794 __pyx_t_5 = PyList_New(0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1496, __pyx_L1_error)
18795 __Pyx_GOTREF(__pyx_t_5);
18797 __pyx_t_7 = __pyx_v_type->ndim;
18798 __pyx_t_8 = __pyx_t_7;
18800 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
18801 __pyx_7genexpr__pyx_v_i = __pyx_t_9;
18802 __pyx_t_4 = __Pyx_PyUnicode_From_size_t((__pyx_v_type->arraysize[__pyx_7genexpr__pyx_v_i]), 0,
' ',
'd');
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1496, __pyx_L1_error)
18803 __Pyx_GOTREF(__pyx_t_4);
18804 __Pyx_GIVEREF(__pyx_t_4);
18805 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_5, __pyx_t_4))) __PYX_ERR(1, 1496, __pyx_L1_error)
18810 __pyx_v_extents = ((PyObject*)__pyx_t_5);
18820 __pyx_t_5 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__10, __pyx_v_extents);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1497, __pyx_L1_error)
18821 __Pyx_GOTREF(__pyx_t_5);
18822 __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u__9;
18823 __pyx_t_10[1] = __pyx_t_5;
18824 __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u__11;
18826 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
18827 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[1]);
18830 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
18831 __pyx_t_7 |= __Pyx_PyUnicode_KIND_04(__pyx_t_10[1]);
18833 __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, __pyx_t_9, __pyx_t_7);
18834 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1497, __pyx_L1_error)
18835 __Pyx_GOTREF(__pyx_t_4);
18836 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18837 __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_4));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1497, __pyx_L1_error)
18838 __Pyx_GOTREF(__pyx_t_5);
18839 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18840 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1497, __pyx_L1_error)
18841 __Pyx_GOTREF(__pyx_t_4);
18842 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18843 __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
18863 PyObject *__pyx_temp;
18865 __pyx_temp = __pyx_r;
18866 __Pyx_INCREF(__pyx_v_result);
18867 __pyx_r = __pyx_v_result;
18869 __Pyx_XDECREF(__pyx_temp);
18883 __Pyx_XDECREF(__pyx_t_2);
18884 __Pyx_XDECREF(__pyx_t_4);
18885 __Pyx_XDECREF(__pyx_t_5);
18886 __Pyx_AddTraceback(
"BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
18891 __Pyx_XDECREF(__pyx_v_part);
18892 __Pyx_XDECREF(__pyx_v_result);
18893 __Pyx_XDECREF(__pyx_v_alignment);
18894 __Pyx_XDECREF(__pyx_v_parts);
18895 __Pyx_XDECREF(__pyx_v_extents);
18897 __Pyx_XGIVEREF(__pyx_r);
18898 __Pyx_RefNannyFinishContext();
18910static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
18911 PyTypeObject *__pyx_r;
18922 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
18947static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
18959 __pyx_r = PyDataType_KIND(__pyx_v_self);
18984static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
18996 __pyx_r = PyDataType_TYPE(__pyx_v_self);
19021static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
19033 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
19058static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
19070 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
19095static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
19107 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
19132static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
19144 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
19169static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
19170 PyObject *__pyx_r = NULL;
19171 __Pyx_RefNannyDeclarations
19172 PyObject *__pyx_t_1;
19173 __Pyx_RefNannySetupContext(
"__get__", 0);
19182 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
19185 PyObject *__pyx_temp;
19187 __pyx_temp = __pyx_r;
19188 __Pyx_INCREF(((PyObject *)__pyx_t_1));
19189 __pyx_r = ((PyObject *)__pyx_t_1);
19191 __Pyx_XDECREF(__pyx_temp);
19206 __Pyx_XGIVEREF(__pyx_r);
19207 __Pyx_RefNannyFinishContext();
19219static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
19220 PyObject *__pyx_r = NULL;
19221 __Pyx_RefNannyDeclarations
19222 PyObject *__pyx_t_1;
19223 __Pyx_RefNannySetupContext(
"__get__", 0);
19232 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
19235 PyObject *__pyx_temp;
19237 __pyx_temp = __pyx_r;
19238 __Pyx_INCREF(((PyObject*)__pyx_t_1));
19239 __pyx_r = ((PyObject*)__pyx_t_1);
19241 __Pyx_XDECREF(__pyx_temp);
19256 __Pyx_XGIVEREF(__pyx_r);
19257 __Pyx_RefNannyFinishContext();
19269static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
19270 PyArray_ArrayDescr *__pyx_r;
19281 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
19306static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
19307 npy_uint64 __pyx_r;
19318 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
19343static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
19355 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
19380static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
19392 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
19417static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
19429 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
19454static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
19466 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
19491static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
19503 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
19528static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
19540 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
19565static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
19577 __pyx_r = PyArray_BASE(__pyx_v_self);
19602static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
19603 PyArray_Descr *__pyx_r = NULL;
19604 __Pyx_RefNannyDeclarations
19605 PyArray_Descr *__pyx_t_1;
19606 __Pyx_RefNannySetupContext(
"__get__", 0);
19615 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
19618 PyArray_Descr *__pyx_temp;
19620 __pyx_temp = __pyx_r;
19621 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
19622 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19624 __Pyx_XDECREF((PyObject *)__pyx_temp);
19639 __Pyx_XGIVEREF((PyObject *)__pyx_r);
19640 __Pyx_RefNannyFinishContext();
19652static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
19664 __pyx_r = PyArray_NDIM(__pyx_v_self);
19689static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
19701 __pyx_r = PyArray_DIMS(__pyx_v_self);
19726static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
19738 __pyx_r = PyArray_STRIDES(__pyx_v_self);
19763static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
19775 __pyx_r = PyArray_SIZE(__pyx_v_self);
19800static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
19812 __pyx_r = PyArray_BYTES(__pyx_v_self);
19837static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19838 PyObject *__pyx_r = NULL;
19839 __Pyx_RefNannyDeclarations
19840 PyObject *__pyx_t_1 = NULL;
19841 int __pyx_lineno = 0;
19842 const char *__pyx_filename = NULL;
19843 int __pyx_clineno = 0;
19844 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
19853 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 795, __pyx_L1_error)
19854 __Pyx_GOTREF(__pyx_t_1);
19856 PyObject *__pyx_temp;
19858 __pyx_temp = __pyx_r;
19859 __pyx_r = __pyx_t_1;
19861 __Pyx_XDECREF(__pyx_temp);
19876 __Pyx_XDECREF(__pyx_t_1);
19877 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19880 __Pyx_XGIVEREF(__pyx_r);
19881 __Pyx_RefNannyFinishContext();
19893static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19894 PyObject *__pyx_r = NULL;
19895 __Pyx_RefNannyDeclarations
19896 PyObject *__pyx_t_1 = NULL;
19897 int __pyx_lineno = 0;
19898 const char *__pyx_filename = NULL;
19899 int __pyx_clineno = 0;
19900 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
19909 __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)
19910 __Pyx_GOTREF(__pyx_t_1);
19912 PyObject *__pyx_temp;
19914 __pyx_temp = __pyx_r;
19915 __pyx_r = __pyx_t_1;
19917 __Pyx_XDECREF(__pyx_temp);
19932 __Pyx_XDECREF(__pyx_t_1);
19933 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19936 __Pyx_XGIVEREF(__pyx_r);
19937 __Pyx_RefNannyFinishContext();
19949static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19950 PyObject *__pyx_r = NULL;
19951 __Pyx_RefNannyDeclarations
19952 PyObject *__pyx_t_1 = NULL;
19953 int __pyx_lineno = 0;
19954 const char *__pyx_filename = NULL;
19955 int __pyx_clineno = 0;
19956 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
19965 __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)
19966 __Pyx_GOTREF(__pyx_t_1);
19968 PyObject *__pyx_temp;
19970 __pyx_temp = __pyx_r;
19971 __pyx_r = __pyx_t_1;
19973 __Pyx_XDECREF(__pyx_temp);
19988 __Pyx_XDECREF(__pyx_t_1);
19989 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19992 __Pyx_XGIVEREF(__pyx_r);
19993 __Pyx_RefNannyFinishContext();
20005static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
20006 PyObject *__pyx_r = NULL;
20007 __Pyx_RefNannyDeclarations
20008 PyObject *__pyx_t_1 = NULL;
20009 int __pyx_lineno = 0;
20010 const char *__pyx_filename = NULL;
20011 int __pyx_clineno = 0;
20012 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
20021 __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)
20022 __Pyx_GOTREF(__pyx_t_1);
20024 PyObject *__pyx_temp;
20026 __pyx_temp = __pyx_r;
20027 __pyx_r = __pyx_t_1;
20029 __Pyx_XDECREF(__pyx_temp);
20044 __Pyx_XDECREF(__pyx_t_1);
20045 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20048 __Pyx_XGIVEREF(__pyx_r);
20049 __Pyx_RefNannyFinishContext();
20061static 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) {
20062 PyObject *__pyx_r = NULL;
20063 __Pyx_RefNannyDeclarations
20064 PyObject *__pyx_t_1 = NULL;
20065 int __pyx_lineno = 0;
20066 const char *__pyx_filename = NULL;
20067 int __pyx_clineno = 0;
20068 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
20077 __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)
20078 __Pyx_GOTREF(__pyx_t_1);
20080 PyObject *__pyx_temp;
20082 __pyx_temp = __pyx_r;
20083 __pyx_r = __pyx_t_1;
20085 __Pyx_XDECREF(__pyx_temp);
20100 __Pyx_XDECREF(__pyx_t_1);
20101 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
20104 __Pyx_XGIVEREF(__pyx_r);
20105 __Pyx_RefNannyFinishContext();
20117static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
20118 PyObject *__pyx_r = NULL;
20119 __Pyx_RefNannyDeclarations
20121 PyObject *__pyx_t_2;
20122 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
20131 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
20143 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
20146 PyObject *__pyx_temp;
20148 __pyx_temp = __pyx_r;
20149 __Pyx_INCREF(((PyObject*)__pyx_t_2));
20150 __pyx_r = ((PyObject*)__pyx_t_2);
20152 __Pyx_XDECREF(__pyx_temp);
20175 PyObject *__pyx_temp;
20177 __pyx_temp = __pyx_r;
20178 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
20179 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
20181 __Pyx_XDECREF(__pyx_temp);
20196 __Pyx_XGIVEREF(__pyx_r);
20197 __Pyx_RefNannyFinishContext();
20209static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
20221 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
20246static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
20258 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
20283static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
20295 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
20320static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
20321 PyUFuncGenericFunction *__pyx_r;
20332 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
20357static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
20369 __pyx_r = ((
void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
20394static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
20406 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
20431static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
20432 char const *__pyx_r;
20443 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
20468static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
20469 char const *__pyx_r;
20480 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
20505static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
20517 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
20542static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
20554 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
20579static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
20591 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
20616static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
20618 int __pyx_lineno = 0;
20619 const char *__pyx_filename = NULL;
20620 int __pyx_clineno = 0;
20629 Py_INCREF(__pyx_v_base);
20638 __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)
20652 __Pyx_AddTraceback(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
20665static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
20666 PyObject *__pyx_v_base;
20667 PyObject *__pyx_r = NULL;
20668 __Pyx_RefNannyDeclarations
20670 __Pyx_RefNannySetupContext(
"get_array_base", 0);
20679 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20688 __pyx_t_1 = (__pyx_v_base == NULL);
20701 PyObject *__pyx_temp;
20703 __pyx_temp = __pyx_r;
20704 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20706 __Pyx_XDECREF(__pyx_temp);
20727 PyObject *__pyx_temp;
20729 __pyx_temp = __pyx_r;
20730 __Pyx_INCREF(((PyObject *)__pyx_v_base));
20731 __pyx_r = ((PyObject *)__pyx_v_base);
20733 __Pyx_XDECREF(__pyx_temp);
20748 __Pyx_XGIVEREF(__pyx_r);
20749 __Pyx_RefNannyFinishContext();
20761static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
20763 __Pyx_RefNannyDeclarations
20764 PyObject *__pyx_t_1 = NULL;
20765 PyObject *__pyx_t_2 = NULL;
20766 PyObject *__pyx_t_3 = NULL;
20768 PyObject *__pyx_t_5 = NULL;
20769 PyObject *__pyx_t_6 = NULL;
20770 PyObject *__pyx_t_7 = NULL;
20771 PyObject *__pyx_t_8 = NULL;
20772 PyObject *__pyx_t_9 = NULL;
20774 int __pyx_lineno = 0;
20775 const char *__pyx_filename = NULL;
20776 int __pyx_clineno = 0;
20777 __Pyx_RefNannySetupContext(
"import_array", 0);
20787 __Pyx_PyThreadState_declare
20788 __Pyx_PyThreadState_assign
20789 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20790 __Pyx_XGOTREF(__pyx_t_1);
20791 __Pyx_XGOTREF(__pyx_t_2);
20792 __Pyx_XGOTREF(__pyx_t_3);
20802 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1079, __pyx_L3_error)
20813 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20814 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20815 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20816 goto __pyx_L8_try_end;
20826 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20828 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20829 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1080, __pyx_L5_except_error)
20830 __Pyx_XGOTREF(__pyx_t_5);
20831 __Pyx_XGOTREF(__pyx_t_6);
20832 __Pyx_XGOTREF(__pyx_t_7);
20844 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
20845 __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));
20846 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20847 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1081, __pyx_L5_except_error)
20848 __Pyx_GOTREF(__pyx_t_8);
20850 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20851 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20852 __PYX_ERR(2, 1081, __pyx_L5_except_error)
20854 goto __pyx_L5_except_error;
20863 __pyx_L5_except_error:;
20864 __Pyx_XGIVEREF(__pyx_t_1);
20865 __Pyx_XGIVEREF(__pyx_t_2);
20866 __Pyx_XGIVEREF(__pyx_t_3);
20867 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20868 goto __pyx_L1_error;
20884 __Pyx_XDECREF(__pyx_t_5);
20885 __Pyx_XDECREF(__pyx_t_6);
20886 __Pyx_XDECREF(__pyx_t_7);
20887 __Pyx_XDECREF(__pyx_t_8);
20888 __Pyx_XDECREF(__pyx_t_9);
20889 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20893 __Pyx_RefNannyFinishContext();
20905static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
20907 __Pyx_RefNannyDeclarations
20908 PyObject *__pyx_t_1 = NULL;
20909 PyObject *__pyx_t_2 = NULL;
20910 PyObject *__pyx_t_3 = NULL;
20912 PyObject *__pyx_t_5 = NULL;
20913 PyObject *__pyx_t_6 = NULL;
20914 PyObject *__pyx_t_7 = NULL;
20915 PyObject *__pyx_t_8 = NULL;
20916 PyObject *__pyx_t_9 = NULL;
20918 int __pyx_lineno = 0;
20919 const char *__pyx_filename = NULL;
20920 int __pyx_clineno = 0;
20921 __Pyx_RefNannySetupContext(
"import_umath", 0);
20931 __Pyx_PyThreadState_declare
20932 __Pyx_PyThreadState_assign
20933 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20934 __Pyx_XGOTREF(__pyx_t_1);
20935 __Pyx_XGOTREF(__pyx_t_2);
20936 __Pyx_XGOTREF(__pyx_t_3);
20946 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1085, __pyx_L3_error)
20957 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20958 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20959 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20960 goto __pyx_L8_try_end;
20970 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20972 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20973 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1086, __pyx_L5_except_error)
20974 __Pyx_XGOTREF(__pyx_t_5);
20975 __Pyx_XGOTREF(__pyx_t_6);
20976 __Pyx_XGOTREF(__pyx_t_7);
20988 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
20989 __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));
20990 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20991 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1087, __pyx_L5_except_error)
20992 __Pyx_GOTREF(__pyx_t_8);
20994 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20995 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20996 __PYX_ERR(2, 1087, __pyx_L5_except_error)
20998 goto __pyx_L5_except_error;
21007 __pyx_L5_except_error:;
21008 __Pyx_XGIVEREF(__pyx_t_1);
21009 __Pyx_XGIVEREF(__pyx_t_2);
21010 __Pyx_XGIVEREF(__pyx_t_3);
21011 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21012 goto __pyx_L1_error;
21028 __Pyx_XDECREF(__pyx_t_5);
21029 __Pyx_XDECREF(__pyx_t_6);
21030 __Pyx_XDECREF(__pyx_t_7);
21031 __Pyx_XDECREF(__pyx_t_8);
21032 __Pyx_XDECREF(__pyx_t_9);
21033 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
21037 __Pyx_RefNannyFinishContext();
21049static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
21051 __Pyx_RefNannyDeclarations
21052 PyObject *__pyx_t_1 = NULL;
21053 PyObject *__pyx_t_2 = NULL;
21054 PyObject *__pyx_t_3 = NULL;
21056 PyObject *__pyx_t_5 = NULL;
21057 PyObject *__pyx_t_6 = NULL;
21058 PyObject *__pyx_t_7 = NULL;
21059 PyObject *__pyx_t_8 = NULL;
21060 PyObject *__pyx_t_9 = NULL;
21062 int __pyx_lineno = 0;
21063 const char *__pyx_filename = NULL;
21064 int __pyx_clineno = 0;
21065 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
21075 __Pyx_PyThreadState_declare
21076 __Pyx_PyThreadState_assign
21077 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21078 __Pyx_XGOTREF(__pyx_t_1);
21079 __Pyx_XGOTREF(__pyx_t_2);
21080 __Pyx_XGOTREF(__pyx_t_3);
21090 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1091, __pyx_L3_error)
21101 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21102 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21103 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21104 goto __pyx_L8_try_end;
21114 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
21116 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21117 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1092, __pyx_L5_except_error)
21118 __Pyx_XGOTREF(__pyx_t_5);
21119 __Pyx_XGOTREF(__pyx_t_6);
21120 __Pyx_XGOTREF(__pyx_t_7);
21132 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
21133 __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));
21134 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21135 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1093, __pyx_L5_except_error)
21136 __Pyx_GOTREF(__pyx_t_8);
21138 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21139 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21140 __PYX_ERR(2, 1093, __pyx_L5_except_error)
21142 goto __pyx_L5_except_error;
21151 __pyx_L5_except_error:;
21152 __Pyx_XGIVEREF(__pyx_t_1);
21153 __Pyx_XGIVEREF(__pyx_t_2);
21154 __Pyx_XGIVEREF(__pyx_t_3);
21155 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21156 goto __pyx_L1_error;
21172 __Pyx_XDECREF(__pyx_t_5);
21173 __Pyx_XDECREF(__pyx_t_6);
21174 __Pyx_XDECREF(__pyx_t_7);
21175 __Pyx_XDECREF(__pyx_t_8);
21176 __Pyx_XDECREF(__pyx_t_9);
21177 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21181 __Pyx_RefNannyFinishContext();
21193static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
21205 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
21231static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
21243 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
21269static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
21270 npy_datetime __pyx_r;
21281 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
21306static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
21307 npy_timedelta __pyx_r;
21318 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
21343static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
21344 NPY_DATETIMEUNIT __pyx_r;
21355 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
21381static int __pyx_pw_9csparsity_14PySparsityInfo_1__cinit__(PyObject *__pyx_v_self,
21382#
if CYTHON_VECTORCALL_TPNEW
21383PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21385PyObject *__pyx_args, PyObject *__pyx_kwds
21388static int __pyx_pw_9csparsity_14PySparsityInfo_1__cinit__(PyObject *__pyx_v_self,
21389#
if CYTHON_VECTORCALL_TPNEW
21390PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21392PyObject *__pyx_args, PyObject *__pyx_kwds
21395 #if !CYTHON_VECTORCALL_TPNEW
21396 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21398 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21400 __Pyx_RefNannyDeclarations
21401 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
21402 #if !CYTHON_VECTORCALL_TPNEW
21403 #if CYTHON_ASSUME_SAFE_SIZE
21404 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21406 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
21409 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
21410 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 0, 0, __pyx_nargs);
return -1; }
21411 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
21412 if (unlikely(__pyx_kwds_len < 0))
return -1;
21413 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__cinit__", __pyx_kwds);
return -1;}
21414 __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo___cinit__(((
struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self));
21417 __Pyx_RefNannyFinishContext();
21421static int __pyx_pf_9csparsity_14PySparsityInfo___cinit__(CYTHON_UNUSED
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self) {
21439static void __pyx_pw_9csparsity_14PySparsityInfo_3__dealloc__(PyObject *__pyx_v_self);
21440static void __pyx_pw_9csparsity_14PySparsityInfo_3__dealloc__(PyObject *__pyx_v_self) {
21441 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21442 __Pyx_RefNannyDeclarations
21443 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
21444 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
21445 __pyx_pf_9csparsity_14PySparsityInfo_2__dealloc__(((
struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self));
21448 __Pyx_RefNannyFinishContext();
21451static void __pyx_pf_9csparsity_14PySparsityInfo_2__dealloc__(CYTHON_UNUSED
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self) {
21466static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_5findNonzeros(PyObject *__pyx_v_self,
21467#
if CYTHON_VECTORCALL
21468PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21470PyObject *__pyx_args, PyObject *__pyx_kwds
21473static PyMethodDef __pyx_mdef_9csparsity_14PySparsityInfo_5findNonzeros = {
"findNonzeros", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_5findNonzeros, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21474static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_5findNonzeros(PyObject *__pyx_v_self,
21475#
if CYTHON_VECTORCALL
21476PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21478PyObject *__pyx_args, PyObject *__pyx_kwds
21481 int __pyx_v_nElements_global;
21482 int __pyx_v_nDOF_test_element;
21483 int __pyx_v_nDOF_trial_element;
21484 PyArrayObject *__pyx_v_nFreeDOF_test = 0;
21485 PyArrayObject *__pyx_v_freeGlobal_test = 0;
21486 PyArrayObject *__pyx_v_nFreeDOF_trial = 0;
21487 PyArrayObject *__pyx_v_freeGlobal_trial = 0;
21488 int __pyx_v_offset_test;
21489 int __pyx_v_stride_test;
21490 int __pyx_v_offset_trial;
21491 int __pyx_v_stride_trial;
21492 int __pyx_v_hasNumericalFlux;
21493 int __pyx_v_hasDiffusionInMixedForm;
21494 int __pyx_v_needNumericalFluxJacobian;
21495 int __pyx_v_nElementBoundaries_element;
21496 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
21497 int __pyx_v_nInteriorElementBoundaries_global;
21498 PyArrayObject *__pyx_v_interiorElementBoundariesArray = 0;
21499 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
21500 PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray = 0;
21501 int __pyx_v_hasFluxBoundaryConditions;
21502 int __pyx_v_nExteriorElementBoundaries_global;
21503 PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
21504 int __pyx_v_hasOutflowBoundary;
21505 int __pyx_v_needOutflowJacobian;
21506 #if !CYTHON_VECTORCALL
21507 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21509 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21510 PyObject* values[25] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
21511 int __pyx_lineno = 0;
21512 const char *__pyx_filename = NULL;
21513 int __pyx_clineno = 0;
21514 PyObject *__pyx_r = 0;
21515 __Pyx_RefNannyDeclarations
21516 __Pyx_RefNannySetupContext(
"findNonzeros (wrapper)", 0);
21517 #if !CYTHON_VECTORCALL
21518 #if CYTHON_ASSUME_SAFE_SIZE
21519 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21521 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
21524 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21526 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nElements_global,&__pyx_mstate_global->__pyx_n_u_nDOF_test_element,&__pyx_mstate_global->__pyx_n_u_nDOF_trial_element,&__pyx_mstate_global->__pyx_n_u_nFreeDOF_test,&__pyx_mstate_global->__pyx_n_u_freeGlobal_test,&__pyx_mstate_global->__pyx_n_u_nFreeDOF_trial,&__pyx_mstate_global->__pyx_n_u_freeGlobal_trial,&__pyx_mstate_global->__pyx_n_u_offset_test,&__pyx_mstate_global->__pyx_n_u_stride_test,&__pyx_mstate_global->__pyx_n_u_offset_trial,&__pyx_mstate_global->__pyx_n_u_stride_trial,&__pyx_mstate_global->__pyx_n_u_hasNumericalFlux,&__pyx_mstate_global->__pyx_n_u_hasDiffusionInMixedForm,&__pyx_mstate_global->__pyx_n_u_needNumericalFluxJacobian,&__pyx_mstate_global->__pyx_n_u_nElementBoundaries_element,&__pyx_mstate_global->__pyx_n_u_elementNeighborsArray,&__pyx_mstate_global->__pyx_n_u_nInteriorElementBoundaries_globa,&__pyx_mstate_global->__pyx_n_u_interiorElementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryElementsArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryLocalElementBound,&__pyx_mstate_global->__pyx_n_u_hasFluxBoundaryConditions,&__pyx_mstate_global->__pyx_n_u_nExteriorElementBoundaries_globa,&__pyx_mstate_global->__pyx_n_u_exteriorElementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_hasOutflowBoundary,&__pyx_mstate_global->__pyx_n_u_needOutflowJacobian,0};
21527 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21528 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 14, __pyx_L3_error)
21529 if (__pyx_kwds_len > 0) {
21530 switch (__pyx_nargs) {
21532 values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
21533 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 14, __pyx_L3_error)
21534 CYTHON_FALLTHROUGH;
21536 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
21537 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 14, __pyx_L3_error)
21538 CYTHON_FALLTHROUGH;
21540 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
21541 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 14, __pyx_L3_error)
21542 CYTHON_FALLTHROUGH;
21544 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
21545 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 14, __pyx_L3_error)
21546 CYTHON_FALLTHROUGH;
21548 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
21549 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 14, __pyx_L3_error)
21550 CYTHON_FALLTHROUGH;
21552 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
21553 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 14, __pyx_L3_error)
21554 CYTHON_FALLTHROUGH;
21556 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
21557 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 14, __pyx_L3_error)
21558 CYTHON_FALLTHROUGH;
21560 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
21561 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 14, __pyx_L3_error)
21562 CYTHON_FALLTHROUGH;
21564 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
21565 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 14, __pyx_L3_error)
21566 CYTHON_FALLTHROUGH;
21568 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
21569 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 14, __pyx_L3_error)
21570 CYTHON_FALLTHROUGH;
21572 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
21573 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 14, __pyx_L3_error)
21574 CYTHON_FALLTHROUGH;
21576 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
21577 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 14, __pyx_L3_error)
21578 CYTHON_FALLTHROUGH;
21580 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
21581 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 14, __pyx_L3_error)
21582 CYTHON_FALLTHROUGH;
21584 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
21585 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 14, __pyx_L3_error)
21586 CYTHON_FALLTHROUGH;
21588 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
21589 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 14, __pyx_L3_error)
21590 CYTHON_FALLTHROUGH;
21592 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
21593 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 14, __pyx_L3_error)
21594 CYTHON_FALLTHROUGH;
21596 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
21597 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 14, __pyx_L3_error)
21598 CYTHON_FALLTHROUGH;
21600 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
21601 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 14, __pyx_L3_error)
21602 CYTHON_FALLTHROUGH;
21604 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
21605 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 14, __pyx_L3_error)
21606 CYTHON_FALLTHROUGH;
21608 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
21609 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 14, __pyx_L3_error)
21610 CYTHON_FALLTHROUGH;
21612 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21613 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 14, __pyx_L3_error)
21614 CYTHON_FALLTHROUGH;
21616 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21617 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 14, __pyx_L3_error)
21618 CYTHON_FALLTHROUGH;
21620 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21621 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 14, __pyx_L3_error)
21622 CYTHON_FALLTHROUGH;
21624 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21625 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 14, __pyx_L3_error)
21626 CYTHON_FALLTHROUGH;
21628 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21629 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 14, __pyx_L3_error)
21630 CYTHON_FALLTHROUGH;
21632 default:
goto __pyx_L5_argtuple_error;
21634 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21635 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"findNonzeros", 0) < (0)) __PYX_ERR(0, 14, __pyx_L3_error)
21636 for (Py_ssize_t i = __pyx_nargs; i < 25; i++) {
21637 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"findNonzeros", 1, 25, 25, i); __PYX_ERR(0, 14, __pyx_L3_error) }
21639 }
else if (unlikely(__pyx_nargs != 25)) {
21640 goto __pyx_L5_argtuple_error;
21642 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21643 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 14, __pyx_L3_error)
21644 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21645 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 14, __pyx_L3_error)
21646 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21647 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 14, __pyx_L3_error)
21648 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21649 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 14, __pyx_L3_error)
21650 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21651 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 14, __pyx_L3_error)
21652 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
21653 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 14, __pyx_L3_error)
21654 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
21655 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 14, __pyx_L3_error)
21656 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
21657 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 14, __pyx_L3_error)
21658 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
21659 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 14, __pyx_L3_error)
21660 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
21661 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 14, __pyx_L3_error)
21662 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
21663 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 14, __pyx_L3_error)
21664 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
21665 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 14, __pyx_L3_error)
21666 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
21667 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 14, __pyx_L3_error)
21668 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
21669 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 14, __pyx_L3_error)
21670 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
21671 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 14, __pyx_L3_error)
21672 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
21673 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 14, __pyx_L3_error)
21674 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
21675 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 14, __pyx_L3_error)
21676 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
21677 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 14, __pyx_L3_error)
21678 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
21679 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 14, __pyx_L3_error)
21680 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
21681 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 14, __pyx_L3_error)
21682 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
21683 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 14, __pyx_L3_error)
21684 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
21685 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 14, __pyx_L3_error)
21686 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
21687 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 14, __pyx_L3_error)
21688 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
21689 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 14, __pyx_L3_error)
21690 values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
21691 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 14, __pyx_L3_error)
21693 __pyx_v_nElements_global = __Pyx_PyLong_As_int(values[0]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 15, __pyx_L3_error)
21694 __pyx_v_nDOF_test_element = __Pyx_PyLong_As_int(values[1]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error)
21695 __pyx_v_nDOF_trial_element = __Pyx_PyLong_As_int(values[2]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error)
21696 __pyx_v_nFreeDOF_test = ((PyArrayObject *)values[3]);
21697 __pyx_v_freeGlobal_test = ((PyArrayObject *)values[4]);
21698 __pyx_v_nFreeDOF_trial = ((PyArrayObject *)values[5]);
21699 __pyx_v_freeGlobal_trial = ((PyArrayObject *)values[6]);
21700 __pyx_v_offset_test = __Pyx_PyLong_As_int(values[7]);
if (unlikely((__pyx_v_offset_test == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L3_error)
21701 __pyx_v_stride_test = __Pyx_PyLong_As_int(values[8]);
if (unlikely((__pyx_v_stride_test == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L3_error)
21702 __pyx_v_offset_trial = __Pyx_PyLong_As_int(values[9]);
if (unlikely((__pyx_v_offset_trial == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 24, __pyx_L3_error)
21703 __pyx_v_stride_trial = __Pyx_PyLong_As_int(values[10]);
if (unlikely((__pyx_v_stride_trial == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L3_error)
21704 __pyx_v_hasNumericalFlux = __Pyx_PyLong_As_int(values[11]);
if (unlikely((__pyx_v_hasNumericalFlux == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error)
21705 __pyx_v_hasDiffusionInMixedForm = __Pyx_PyLong_As_int(values[12]);
if (unlikely((__pyx_v_hasDiffusionInMixedForm == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
21706 __pyx_v_needNumericalFluxJacobian = __Pyx_PyLong_As_int(values[13]);
if (unlikely((__pyx_v_needNumericalFluxJacobian == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
21707 __pyx_v_nElementBoundaries_element = __Pyx_PyLong_As_int(values[14]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
21708 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[15]);
21709 __pyx_v_nInteriorElementBoundaries_global = __Pyx_PyLong_As_int(values[16]);
if (unlikely((__pyx_v_nInteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
21710 __pyx_v_interiorElementBoundariesArray = ((PyArrayObject *)values[17]);
21711 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[18]);
21712 __pyx_v_elementBoundaryLocalElementBoundariesArray = ((PyArrayObject *)values[19]);
21713 __pyx_v_hasFluxBoundaryConditions = __Pyx_PyLong_As_int(values[20]);
if (unlikely((__pyx_v_hasFluxBoundaryConditions == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error)
21714 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyLong_As_int(values[21]);
if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)
21715 __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[22]);
21716 __pyx_v_hasOutflowBoundary = __Pyx_PyLong_As_int(values[23]);
if (unlikely((__pyx_v_hasOutflowBoundary == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L3_error)
21717 __pyx_v_needOutflowJacobian = __Pyx_PyLong_As_int(values[24]);
if (unlikely((__pyx_v_needOutflowJacobian == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error)
21719 goto __pyx_L6_skip;
21720 __pyx_L5_argtuple_error:;
21721 __Pyx_RaiseArgtupleInvalid(
"findNonzeros", 1, 25, 25, __pyx_nargs); __PYX_ERR(0, 14, __pyx_L3_error)
21723 goto __pyx_L4_argument_unpacking_done;
21725 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21726 Py_XDECREF(values[__pyx_temp]);
21728 __Pyx_AddTraceback(
"csparsity.PySparsityInfo.findNonzeros", __pyx_clineno, __pyx_lineno, __pyx_filename);
21729 __Pyx_RefNannyFinishContext();
21731 __pyx_L4_argument_unpacking_done:;
21732 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nFreeDOF_test), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"nFreeDOF_test", 0))) __PYX_ERR(0, 18, __pyx_L1_error)
21733 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freeGlobal_test), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"freeGlobal_test", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
21734 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nFreeDOF_trial), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"nFreeDOF_trial", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
21735 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freeGlobal_trial), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"freeGlobal_trial", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
21736 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 30, __pyx_L1_error)
21737 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interiorElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"interiorElementBoundariesArray", 0))) __PYX_ERR(0, 32, __pyx_L1_error)
21738 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 33, __pyx_L1_error)
21739 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryLocalElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryLocalElementBoundariesArray", 0))) __PYX_ERR(0, 34, __pyx_L1_error)
21740 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundariesArray", 0))) __PYX_ERR(0, 37, __pyx_L1_error)
21741 __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_4findNonzeros(((
struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self), __pyx_v_nElements_global, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_nFreeDOF_test, __pyx_v_freeGlobal_test, __pyx_v_nFreeDOF_trial, __pyx_v_freeGlobal_trial, __pyx_v_offset_test, __pyx_v_stride_test, __pyx_v_offset_trial, __pyx_v_stride_trial, __pyx_v_hasNumericalFlux, __pyx_v_hasDiffusionInMixedForm, __pyx_v_needNumericalFluxJacobian, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_nInteriorElementBoundaries_global, __pyx_v_interiorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementBoundaryLocalElementBoundariesArray, __pyx_v_hasFluxBoundaryConditions, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_hasOutflowBoundary, __pyx_v_needOutflowJacobian);
21747 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21748 Py_XDECREF(values[__pyx_temp]);
21750 goto __pyx_L7_cleaned_up;
21752 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21753 Py_XDECREF(values[__pyx_temp]);
21755 __pyx_L7_cleaned_up:;
21772 __Pyx_RefNannyFinishContext();
21776static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_4findNonzeros(
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self,
int __pyx_v_nElements_global,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_nFreeDOF_test, PyArrayObject *__pyx_v_freeGlobal_test, PyArrayObject *__pyx_v_nFreeDOF_trial, PyArrayObject *__pyx_v_freeGlobal_trial,
int __pyx_v_offset_test,
int __pyx_v_stride_test,
int __pyx_v_offset_trial,
int __pyx_v_stride_trial,
int __pyx_v_hasNumericalFlux,
int __pyx_v_hasDiffusionInMixedForm,
int __pyx_v_needNumericalFluxJacobian,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray,
int __pyx_v_nInteriorElementBoundaries_global, PyArrayObject *__pyx_v_interiorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray,
int __pyx_v_hasFluxBoundaryConditions,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray,
int __pyx_v_hasOutflowBoundary,
int __pyx_v_needOutflowJacobian) {
21777 PyObject *__pyx_r = NULL;
21778 __Pyx_RefNannyDeclarations
21779 __Pyx_RefNannySetupContext(
"findNonzeros", 0);
21788 __pyx_v_self->cpp.findNonzeros(__pyx_v_nElements_global, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nFreeDOF_test)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_freeGlobal_test)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nFreeDOF_trial)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_freeGlobal_trial)), __pyx_v_offset_test, __pyx_v_stride_test, __pyx_v_offset_trial, __pyx_v_stride_trial, __pyx_v_hasNumericalFlux, __pyx_v_hasDiffusionInMixedForm, __pyx_v_needNumericalFluxJacobian, __pyx_v_nElementBoundaries_element, ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementNeighborsArray)), __pyx_v_nInteriorElementBoundaries_global, ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_interiorElementBoundariesArray)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementBoundaryElementsArray)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementBoundaryLocalElementBoundariesArray)), __pyx_v_hasFluxBoundaryConditions, __pyx_v_nExteriorElementBoundaries_global, ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_exteriorElementBoundariesArray)), __pyx_v_hasOutflowBoundary, __pyx_v_needOutflowJacobian);
21799 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21800 __Pyx_XGIVEREF(__pyx_r);
21801 __Pyx_RefNannyFinishContext();
21814static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_7getOffsets_CSR(PyObject *__pyx_v_self,
21815#
if CYTHON_VECTORCALL
21816PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21818PyObject *__pyx_args, PyObject *__pyx_kwds
21821static PyMethodDef __pyx_mdef_9csparsity_14PySparsityInfo_7getOffsets_CSR = {
"getOffsets_CSR", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_7getOffsets_CSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21822static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_7getOffsets_CSR(PyObject *__pyx_v_self,
21823#
if CYTHON_VECTORCALL
21824PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21826PyObject *__pyx_args, PyObject *__pyx_kwds
21829 int __pyx_v_nElements_global;
21830 int __pyx_v_nDOF_test_element;
21831 int __pyx_v_nDOF_trial_element;
21832 PyArrayObject *__pyx_v_nFreeDOF_test = 0;
21833 PyArrayObject *__pyx_v_freeGlobal_test = 0;
21834 PyArrayObject *__pyx_v_nFreeDOF_trial = 0;
21835 PyArrayObject *__pyx_v_freeGlobal_trial = 0;
21836 int __pyx_v_offset_test;
21837 int __pyx_v_stride_test;
21838 int __pyx_v_offset_trial;
21839 int __pyx_v_stride_trial;
21840 int __pyx_v_hasNumericalFlux;
21841 int __pyx_v_hasDiffusionInMixedForm;
21842 int __pyx_v_needNumericalFluxJacobian;
21843 int __pyx_v_nElementBoundaries_element;
21844 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
21845 int __pyx_v_nInteriorElementBoundaries_global;
21846 PyArrayObject *__pyx_v_interiorElementBoundariesArray = 0;
21847 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
21848 PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray = 0;
21849 int __pyx_v_hasFluxBoundaryConditions;
21850 int __pyx_v_nExteriorElementBoundaries_global;
21851 PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
21852 int __pyx_v_hasOutflowBoundary;
21853 int __pyx_v_needOutflowJacobian;
21854 PyArrayObject *__pyx_v_rowptr = 0;
21855 PyArrayObject *__pyx_v_csrRowIndeces = 0;
21856 PyArrayObject *__pyx_v_csrColumnOffsets = 0;
21857 PyArrayObject *__pyx_v_csrColumnOffsets_eNebN = 0;
21858 PyArrayObject *__pyx_v_csrColumnOffsets_eb = 0;
21859 PyArrayObject *__pyx_v_csrColumnOffsets_eb_eNebN = 0;
21860 #if !CYTHON_VECTORCALL
21861 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21863 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21864 PyObject* values[31] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
21865 int __pyx_lineno = 0;
21866 const char *__pyx_filename = NULL;
21867 int __pyx_clineno = 0;
21868 PyObject *__pyx_r = 0;
21869 __Pyx_RefNannyDeclarations
21870 __Pyx_RefNannySetupContext(
"getOffsets_CSR (wrapper)", 0);
21871 #if !CYTHON_VECTORCALL
21872 #if CYTHON_ASSUME_SAFE_SIZE
21873 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21875 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
21878 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21880 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nElements_global,&__pyx_mstate_global->__pyx_n_u_nDOF_test_element,&__pyx_mstate_global->__pyx_n_u_nDOF_trial_element,&__pyx_mstate_global->__pyx_n_u_nFreeDOF_test,&__pyx_mstate_global->__pyx_n_u_freeGlobal_test,&__pyx_mstate_global->__pyx_n_u_nFreeDOF_trial,&__pyx_mstate_global->__pyx_n_u_freeGlobal_trial,&__pyx_mstate_global->__pyx_n_u_offset_test,&__pyx_mstate_global->__pyx_n_u_stride_test,&__pyx_mstate_global->__pyx_n_u_offset_trial,&__pyx_mstate_global->__pyx_n_u_stride_trial,&__pyx_mstate_global->__pyx_n_u_hasNumericalFlux,&__pyx_mstate_global->__pyx_n_u_hasDiffusionInMixedForm,&__pyx_mstate_global->__pyx_n_u_needNumericalFluxJacobian,&__pyx_mstate_global->__pyx_n_u_nElementBoundaries_element,&__pyx_mstate_global->__pyx_n_u_elementNeighborsArray,&__pyx_mstate_global->__pyx_n_u_nInteriorElementBoundaries_globa,&__pyx_mstate_global->__pyx_n_u_interiorElementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryElementsArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryLocalElementBound,&__pyx_mstate_global->__pyx_n_u_hasFluxBoundaryConditions,&__pyx_mstate_global->__pyx_n_u_nExteriorElementBoundaries_globa,&__pyx_mstate_global->__pyx_n_u_exteriorElementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_hasOutflowBoundary,&__pyx_mstate_global->__pyx_n_u_needOutflowJacobian,&__pyx_mstate_global->__pyx_n_u_rowptr,&__pyx_mstate_global->__pyx_n_u_csrRowIndeces,&__pyx_mstate_global->__pyx_n_u_csrColumnOffsets,&__pyx_mstate_global->__pyx_n_u_csrColumnOffsets_eNebN,&__pyx_mstate_global->__pyx_n_u_csrColumnOffsets_eb,&__pyx_mstate_global->__pyx_n_u_csrColumnOffsets_eb_eNebN,0};
21881 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21882 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 65, __pyx_L3_error)
21883 if (__pyx_kwds_len > 0) {
21884 switch (__pyx_nargs) {
21886 values[30] = __Pyx_ArgRef_FASTCALL(__pyx_args, 30);
21887 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[30])) __PYX_ERR(0, 65, __pyx_L3_error)
21888 CYTHON_FALLTHROUGH;
21890 values[29] = __Pyx_ArgRef_FASTCALL(__pyx_args, 29);
21891 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[29])) __PYX_ERR(0, 65, __pyx_L3_error)
21892 CYTHON_FALLTHROUGH;
21894 values[28] = __Pyx_ArgRef_FASTCALL(__pyx_args, 28);
21895 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[28])) __PYX_ERR(0, 65, __pyx_L3_error)
21896 CYTHON_FALLTHROUGH;
21898 values[27] = __Pyx_ArgRef_FASTCALL(__pyx_args, 27);
21899 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[27])) __PYX_ERR(0, 65, __pyx_L3_error)
21900 CYTHON_FALLTHROUGH;
21902 values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
21903 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 65, __pyx_L3_error)
21904 CYTHON_FALLTHROUGH;
21906 values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
21907 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 65, __pyx_L3_error)
21908 CYTHON_FALLTHROUGH;
21910 values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
21911 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 65, __pyx_L3_error)
21912 CYTHON_FALLTHROUGH;
21914 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
21915 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 65, __pyx_L3_error)
21916 CYTHON_FALLTHROUGH;
21918 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
21919 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 65, __pyx_L3_error)
21920 CYTHON_FALLTHROUGH;
21922 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
21923 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 65, __pyx_L3_error)
21924 CYTHON_FALLTHROUGH;
21926 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
21927 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 65, __pyx_L3_error)
21928 CYTHON_FALLTHROUGH;
21930 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
21931 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 65, __pyx_L3_error)
21932 CYTHON_FALLTHROUGH;
21934 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
21935 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 65, __pyx_L3_error)
21936 CYTHON_FALLTHROUGH;
21938 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
21939 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 65, __pyx_L3_error)
21940 CYTHON_FALLTHROUGH;
21942 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
21943 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 65, __pyx_L3_error)
21944 CYTHON_FALLTHROUGH;
21946 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
21947 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 65, __pyx_L3_error)
21948 CYTHON_FALLTHROUGH;
21950 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
21951 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 65, __pyx_L3_error)
21952 CYTHON_FALLTHROUGH;
21954 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
21955 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 65, __pyx_L3_error)
21956 CYTHON_FALLTHROUGH;
21958 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
21959 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 65, __pyx_L3_error)
21960 CYTHON_FALLTHROUGH;
21962 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
21963 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 65, __pyx_L3_error)
21964 CYTHON_FALLTHROUGH;
21966 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
21967 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 65, __pyx_L3_error)
21968 CYTHON_FALLTHROUGH;
21970 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
21971 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 65, __pyx_L3_error)
21972 CYTHON_FALLTHROUGH;
21974 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
21975 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 65, __pyx_L3_error)
21976 CYTHON_FALLTHROUGH;
21978 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
21979 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 65, __pyx_L3_error)
21980 CYTHON_FALLTHROUGH;
21982 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
21983 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 65, __pyx_L3_error)
21984 CYTHON_FALLTHROUGH;
21986 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
21987 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 65, __pyx_L3_error)
21988 CYTHON_FALLTHROUGH;
21990 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21991 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 65, __pyx_L3_error)
21992 CYTHON_FALLTHROUGH;
21994 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21995 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 65, __pyx_L3_error)
21996 CYTHON_FALLTHROUGH;
21998 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21999 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 65, __pyx_L3_error)
22000 CYTHON_FALLTHROUGH;
22002 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22003 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 65, __pyx_L3_error)
22004 CYTHON_FALLTHROUGH;
22006 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22007 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 65, __pyx_L3_error)
22008 CYTHON_FALLTHROUGH;
22010 default:
goto __pyx_L5_argtuple_error;
22012 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22013 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"getOffsets_CSR", 0) < (0)) __PYX_ERR(0, 65, __pyx_L3_error)
22014 for (Py_ssize_t i = __pyx_nargs; i < 31; i++) {
22015 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"getOffsets_CSR", 1, 31, 31, i); __PYX_ERR(0, 65, __pyx_L3_error) }
22017 }
else if (unlikely(__pyx_nargs != 31)) {
22018 goto __pyx_L5_argtuple_error;
22020 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22021 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 65, __pyx_L3_error)
22022 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22023 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 65, __pyx_L3_error)
22024 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22025 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 65, __pyx_L3_error)
22026 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22027 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 65, __pyx_L3_error)
22028 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
22029 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 65, __pyx_L3_error)
22030 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
22031 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 65, __pyx_L3_error)
22032 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
22033 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 65, __pyx_L3_error)
22034 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
22035 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 65, __pyx_L3_error)
22036 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
22037 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 65, __pyx_L3_error)
22038 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
22039 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 65, __pyx_L3_error)
22040 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
22041 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 65, __pyx_L3_error)
22042 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
22043 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 65, __pyx_L3_error)
22044 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
22045 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 65, __pyx_L3_error)
22046 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
22047 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 65, __pyx_L3_error)
22048 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
22049 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 65, __pyx_L3_error)
22050 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
22051 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 65, __pyx_L3_error)
22052 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
22053 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 65, __pyx_L3_error)
22054 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
22055 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 65, __pyx_L3_error)
22056 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
22057 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 65, __pyx_L3_error)
22058 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
22059 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 65, __pyx_L3_error)
22060 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
22061 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 65, __pyx_L3_error)
22062 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
22063 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 65, __pyx_L3_error)
22064 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
22065 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 65, __pyx_L3_error)
22066 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
22067 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 65, __pyx_L3_error)
22068 values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
22069 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 65, __pyx_L3_error)
22070 values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
22071 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 65, __pyx_L3_error)
22072 values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
22073 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 65, __pyx_L3_error)
22074 values[27] = __Pyx_ArgRef_FASTCALL(__pyx_args, 27);
22075 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[27])) __PYX_ERR(0, 65, __pyx_L3_error)
22076 values[28] = __Pyx_ArgRef_FASTCALL(__pyx_args, 28);
22077 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[28])) __PYX_ERR(0, 65, __pyx_L3_error)
22078 values[29] = __Pyx_ArgRef_FASTCALL(__pyx_args, 29);
22079 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[29])) __PYX_ERR(0, 65, __pyx_L3_error)
22080 values[30] = __Pyx_ArgRef_FASTCALL(__pyx_args, 30);
22081 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[30])) __PYX_ERR(0, 65, __pyx_L3_error)
22083 __pyx_v_nElements_global = __Pyx_PyLong_As_int(values[0]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error)
22084 __pyx_v_nDOF_test_element = __Pyx_PyLong_As_int(values[1]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L3_error)
22085 __pyx_v_nDOF_trial_element = __Pyx_PyLong_As_int(values[2]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error)
22086 __pyx_v_nFreeDOF_test = ((PyArrayObject *)values[3]);
22087 __pyx_v_freeGlobal_test = ((PyArrayObject *)values[4]);
22088 __pyx_v_nFreeDOF_trial = ((PyArrayObject *)values[5]);
22089 __pyx_v_freeGlobal_trial = ((PyArrayObject *)values[6]);
22090 __pyx_v_offset_test = __Pyx_PyLong_As_int(values[7]);
if (unlikely((__pyx_v_offset_test == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error)
22091 __pyx_v_stride_test = __Pyx_PyLong_As_int(values[8]);
if (unlikely((__pyx_v_stride_test == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L3_error)
22092 __pyx_v_offset_trial = __Pyx_PyLong_As_int(values[9]);
if (unlikely((__pyx_v_offset_trial == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L3_error)
22093 __pyx_v_stride_trial = __Pyx_PyLong_As_int(values[10]);
if (unlikely((__pyx_v_stride_trial == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error)
22094 __pyx_v_hasNumericalFlux = __Pyx_PyLong_As_int(values[11]);
if (unlikely((__pyx_v_hasNumericalFlux == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error)
22095 __pyx_v_hasDiffusionInMixedForm = __Pyx_PyLong_As_int(values[12]);
if (unlikely((__pyx_v_hasDiffusionInMixedForm == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error)
22096 __pyx_v_needNumericalFluxJacobian = __Pyx_PyLong_As_int(values[13]);
if (unlikely((__pyx_v_needNumericalFluxJacobian == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error)
22097 __pyx_v_nElementBoundaries_element = __Pyx_PyLong_As_int(values[14]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error)
22098 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[15]);
22099 __pyx_v_nInteriorElementBoundaries_global = __Pyx_PyLong_As_int(values[16]);
if (unlikely((__pyx_v_nInteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error)
22100 __pyx_v_interiorElementBoundariesArray = ((PyArrayObject *)values[17]);
22101 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[18]);
22102 __pyx_v_elementBoundaryLocalElementBoundariesArray = ((PyArrayObject *)values[19]);
22103 __pyx_v_hasFluxBoundaryConditions = __Pyx_PyLong_As_int(values[20]);
if (unlikely((__pyx_v_hasFluxBoundaryConditions == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
22104 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyLong_As_int(values[21]);
if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error)
22105 __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[22]);
22106 __pyx_v_hasOutflowBoundary = __Pyx_PyLong_As_int(values[23]);
if (unlikely((__pyx_v_hasOutflowBoundary == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error)
22107 __pyx_v_needOutflowJacobian = __Pyx_PyLong_As_int(values[24]);
if (unlikely((__pyx_v_needOutflowJacobian == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error)
22108 __pyx_v_rowptr = ((PyArrayObject *)values[25]);
22109 __pyx_v_csrRowIndeces = ((PyArrayObject *)values[26]);
22110 __pyx_v_csrColumnOffsets = ((PyArrayObject *)values[27]);
22111 __pyx_v_csrColumnOffsets_eNebN = ((PyArrayObject *)values[28]);
22112 __pyx_v_csrColumnOffsets_eb = ((PyArrayObject *)values[29]);
22113 __pyx_v_csrColumnOffsets_eb_eNebN = ((PyArrayObject *)values[30]);
22115 goto __pyx_L6_skip;
22116 __pyx_L5_argtuple_error:;
22117 __Pyx_RaiseArgtupleInvalid(
"getOffsets_CSR", 1, 31, 31, __pyx_nargs); __PYX_ERR(0, 65, __pyx_L3_error)
22119 goto __pyx_L4_argument_unpacking_done;
22121 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22122 Py_XDECREF(values[__pyx_temp]);
22124 __Pyx_AddTraceback(
"csparsity.PySparsityInfo.getOffsets_CSR", __pyx_clineno, __pyx_lineno, __pyx_filename);
22125 __Pyx_RefNannyFinishContext();
22127 __pyx_L4_argument_unpacking_done:;
22128 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nFreeDOF_test), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"nFreeDOF_test", 0))) __PYX_ERR(0, 69, __pyx_L1_error)
22129 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freeGlobal_test), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"freeGlobal_test", 0))) __PYX_ERR(0, 70, __pyx_L1_error)
22130 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nFreeDOF_trial), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"nFreeDOF_trial", 0))) __PYX_ERR(0, 71, __pyx_L1_error)
22131 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freeGlobal_trial), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"freeGlobal_trial", 0))) __PYX_ERR(0, 72, __pyx_L1_error)
22132 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 81, __pyx_L1_error)
22133 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interiorElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"interiorElementBoundariesArray", 0))) __PYX_ERR(0, 83, __pyx_L1_error)
22134 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 84, __pyx_L1_error)
22135 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryLocalElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryLocalElementBoundariesArray", 0))) __PYX_ERR(0, 85, __pyx_L1_error)
22136 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundariesArray", 0))) __PYX_ERR(0, 88, __pyx_L1_error)
22137 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 91, __pyx_L1_error)
22138 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrRowIndeces), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"csrRowIndeces", 0))) __PYX_ERR(0, 92, __pyx_L1_error)
22139 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrColumnOffsets), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"csrColumnOffsets", 0))) __PYX_ERR(0, 93, __pyx_L1_error)
22140 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrColumnOffsets_eNebN), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"csrColumnOffsets_eNebN", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
22141 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrColumnOffsets_eb), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"csrColumnOffsets_eb", 0))) __PYX_ERR(0, 95, __pyx_L1_error)
22142 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrColumnOffsets_eb_eNebN), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"csrColumnOffsets_eb_eNebN", 0))) __PYX_ERR(0, 96, __pyx_L1_error)
22143 __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_6getOffsets_CSR(((
struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self), __pyx_v_nElements_global, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_nFreeDOF_test, __pyx_v_freeGlobal_test, __pyx_v_nFreeDOF_trial, __pyx_v_freeGlobal_trial, __pyx_v_offset_test, __pyx_v_stride_test, __pyx_v_offset_trial, __pyx_v_stride_trial, __pyx_v_hasNumericalFlux, __pyx_v_hasDiffusionInMixedForm, __pyx_v_needNumericalFluxJacobian, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_nInteriorElementBoundaries_global, __pyx_v_interiorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementBoundaryLocalElementBoundariesArray, __pyx_v_hasFluxBoundaryConditions, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_hasOutflowBoundary, __pyx_v_needOutflowJacobian, __pyx_v_rowptr, __pyx_v_csrRowIndeces, __pyx_v_csrColumnOffsets, __pyx_v_csrColumnOffsets_eNebN, __pyx_v_csrColumnOffsets_eb, __pyx_v_csrColumnOffsets_eb_eNebN);
22149 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22150 Py_XDECREF(values[__pyx_temp]);
22152 goto __pyx_L7_cleaned_up;
22154 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22155 Py_XDECREF(values[__pyx_temp]);
22157 __pyx_L7_cleaned_up:;
22174 __Pyx_RefNannyFinishContext();
22178static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_6getOffsets_CSR(
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self,
int __pyx_v_nElements_global,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_nFreeDOF_test, PyArrayObject *__pyx_v_freeGlobal_test, PyArrayObject *__pyx_v_nFreeDOF_trial, PyArrayObject *__pyx_v_freeGlobal_trial,
int __pyx_v_offset_test,
int __pyx_v_stride_test,
int __pyx_v_offset_trial,
int __pyx_v_stride_trial,
int __pyx_v_hasNumericalFlux,
int __pyx_v_hasDiffusionInMixedForm,
int __pyx_v_needNumericalFluxJacobian,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray,
int __pyx_v_nInteriorElementBoundaries_global, PyArrayObject *__pyx_v_interiorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray,
int __pyx_v_hasFluxBoundaryConditions,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray,
int __pyx_v_hasOutflowBoundary,
int __pyx_v_needOutflowJacobian, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_csrRowIndeces, PyArrayObject *__pyx_v_csrColumnOffsets, PyArrayObject *__pyx_v_csrColumnOffsets_eNebN, PyArrayObject *__pyx_v_csrColumnOffsets_eb, PyArrayObject *__pyx_v_csrColumnOffsets_eb_eNebN) {
22179 PyObject *__pyx_r = NULL;
22180 __Pyx_RefNannyDeclarations
22181 __Pyx_RefNannySetupContext(
"getOffsets_CSR", 0);
22190 __pyx_v_self->cpp.getOffsets_CSR(__pyx_v_nElements_global, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nFreeDOF_test)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_freeGlobal_test)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nFreeDOF_trial)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_freeGlobal_trial)), __pyx_v_offset_test, __pyx_v_stride_test, __pyx_v_offset_trial, __pyx_v_stride_trial, __pyx_v_hasNumericalFlux, __pyx_v_hasDiffusionInMixedForm, __pyx_v_needNumericalFluxJacobian, __pyx_v_nElementBoundaries_element, ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementNeighborsArray)), __pyx_v_nInteriorElementBoundaries_global, ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_interiorElementBoundariesArray)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementBoundaryElementsArray)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementBoundaryLocalElementBoundariesArray)), __pyx_v_hasFluxBoundaryConditions, __pyx_v_nExteriorElementBoundaries_global, ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_exteriorElementBoundariesArray)), __pyx_v_hasOutflowBoundary, __pyx_v_needOutflowJacobian, ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_rowptr)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_csrRowIndeces)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_csrColumnOffsets)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_csrColumnOffsets_eNebN)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_csrColumnOffsets_eb)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_csrColumnOffsets_eb_eNebN)));
22201 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22202 __Pyx_XGIVEREF(__pyx_r);
22203 __Pyx_RefNannyFinishContext();
22216static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_9getCSR(PyObject *__pyx_v_self,
22217#
if CYTHON_VECTORCALL
22218PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22220PyObject *__pyx_args, PyObject *__pyx_kwds
22223static PyMethodDef __pyx_mdef_9csparsity_14PySparsityInfo_9getCSR = {
"getCSR", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_9getCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22224static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_9getCSR(PyObject *__pyx_v_self,
22225#
if CYTHON_VECTORCALL
22226PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22228PyObject *__pyx_args, PyObject *__pyx_kwds
22231 #if !CYTHON_VECTORCALL
22232 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22234 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
22235 PyObject *__pyx_r = 0;
22236 __Pyx_RefNannyDeclarations
22237 __Pyx_RefNannySetupContext(
"getCSR (wrapper)", 0);
22238 #if !CYTHON_VECTORCALL
22239 #if CYTHON_ASSUME_SAFE_SIZE
22240 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22242 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
22245 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22246 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"getCSR", 1, 0, 0, __pyx_nargs);
return NULL; }
22247 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22248 if (unlikely(__pyx_kwds_len < 0))
return NULL;
22249 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"getCSR", __pyx_kwds);
return NULL;}
22250 __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_8getCSR(((
struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self));
22253 __Pyx_RefNannyFinishContext();
22257static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_8getCSR(
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self) {
22258 PyObject *__pyx_r = NULL;
22259 __Pyx_RefNannyDeclarations
22260 PyObject *__pyx_t_1 = NULL;
22261 PyObject *__pyx_t_2 = NULL;
22262 PyObject *__pyx_t_3 = NULL;
22263 PyObject *__pyx_t_4 = NULL;
22265 struct __pyx_array_obj *__pyx_t_6 = NULL;
22266 PyObject *__pyx_t_7 = NULL;
22269 PyObject *__pyx_t_10 = NULL;
22270 PyObject *__pyx_t_11 = NULL;
22271 double *__pyx_t_12;
22272 PyObject *__pyx_t_13 = NULL;
22273 int __pyx_lineno = 0;
22274 const char *__pyx_filename = NULL;
22275 int __pyx_clineno = 0;
22276 __Pyx_RefNannySetupContext(
"getCSR", 0);
22285 __pyx_v_self->cpp.getCSR();
22295 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
22296 __Pyx_GOTREF(__pyx_t_3);
22297 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error)
22298 __Pyx_GOTREF(__pyx_t_4);
22299 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22300 __pyx_t_5 = __pyx_v_self->cpp.rowptr;
22303 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22304 __PYX_ERR(0, 130, __pyx_L1_error)
22306 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error)
22307 __Pyx_GOTREF(__pyx_t_7);
22308 __pyx_t_3 = Py_BuildValue(
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->cpp.nrows));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
22309 __Pyx_GOTREF(__pyx_t_3);
22310 #if CYTHON_COMPILING_IN_LIMITED_API
22311 __pyx_t_8 = PyBytes_AsString(__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 130, __pyx_L1_error)
22313 __pyx_t_8 = PyBytes_AS_STRING(__pyx_t_7);
22315 __pyx_t_6 = __pyx_array_new(__pyx_t_3,
sizeof(
int), __pyx_t_8,
"c", (
char *) __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error)
22316 __Pyx_GOTREF((PyObject *)__pyx_t_6);
22317 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22318 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22321 #if CYTHON_UNPACK_METHODS
22322 if (unlikely(PyMethod_Check(__pyx_t_4))) {
22323 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
22325 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
22326 __Pyx_INCREF(__pyx_t_2);
22327 __Pyx_INCREF(__pyx__function);
22328 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
22333 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_6)};
22334 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22335 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22336 __Pyx_DECREF((PyObject *)__pyx_t_6); __pyx_t_6 = 0;
22337 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22338 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
22339 __Pyx_GOTREF(__pyx_t_1);
22350 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error)
22351 __Pyx_GOTREF(__pyx_t_7);
22352 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error)
22353 __Pyx_GOTREF(__pyx_t_3);
22354 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22355 __pyx_t_5 = __pyx_v_self->cpp.colind;
22358 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22359 __PYX_ERR(0, 131, __pyx_L1_error)
22361 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 131, __pyx_L1_error)
22362 __Pyx_GOTREF(__pyx_t_10);
22363 __pyx_t_7 = Py_BuildValue(
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->cpp.nnz));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error)
22364 __Pyx_GOTREF(__pyx_t_7);
22365 #if CYTHON_COMPILING_IN_LIMITED_API
22366 __pyx_t_8 = PyBytes_AsString(__pyx_t_10);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 131, __pyx_L1_error)
22368 __pyx_t_8 = PyBytes_AS_STRING(__pyx_t_10);
22370 __pyx_t_6 = __pyx_array_new(__pyx_t_7,
sizeof(
int), __pyx_t_8,
"c", (
char *) __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error)
22371 __Pyx_GOTREF((PyObject *)__pyx_t_6);
22372 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22373 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22376 #if CYTHON_UNPACK_METHODS
22377 if (unlikely(PyMethod_Check(__pyx_t_3))) {
22378 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
22380 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
22381 __Pyx_INCREF(__pyx_t_2);
22382 __Pyx_INCREF(__pyx__function);
22383 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
22388 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_6)};
22389 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22390 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22391 __Pyx_DECREF((PyObject *)__pyx_t_6); __pyx_t_6 = 0;
22392 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22393 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
22394 __Pyx_GOTREF(__pyx_t_4);
22403 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_self->cpp.nnz);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error)
22404 __Pyx_GOTREF(__pyx_t_3);
22412 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 133, __pyx_L1_error)
22413 __Pyx_GOTREF(__pyx_t_7);
22414 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_asarray);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 133, __pyx_L1_error)
22415 __Pyx_GOTREF(__pyx_t_11);
22416 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22417 __pyx_t_12 = __pyx_v_self->cpp.nzval;
22420 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22421 __PYX_ERR(0, 133, __pyx_L1_error)
22423 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 133, __pyx_L1_error)
22424 __Pyx_GOTREF(__pyx_t_13);
22425 __pyx_t_7 = Py_BuildValue(
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->cpp.nnz));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 133, __pyx_L1_error)
22426 __Pyx_GOTREF(__pyx_t_7);
22427 #if CYTHON_COMPILING_IN_LIMITED_API
22428 __pyx_t_8 = PyBytes_AsString(__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 133, __pyx_L1_error)
22430 __pyx_t_8 = PyBytes_AS_STRING(__pyx_t_13);
22432 __pyx_t_6 = __pyx_array_new(__pyx_t_7,
sizeof(
double), __pyx_t_8,
"c", (
char *) __pyx_t_12);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error)
22433 __Pyx_GOTREF((PyObject *)__pyx_t_6);
22434 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22435 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22438 #if CYTHON_UNPACK_METHODS
22439 if (unlikely(PyMethod_Check(__pyx_t_11))) {
22440 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
22441 assert(__pyx_t_10);
22442 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
22443 __Pyx_INCREF(__pyx_t_10);
22444 __Pyx_INCREF(__pyx__function);
22445 __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
22450 PyObject *__pyx_callargs[2] = {__pyx_t_10, ((PyObject *)__pyx_t_6)};
22451 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22452 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22453 __Pyx_DECREF((PyObject *)__pyx_t_6); __pyx_t_6 = 0;
22454 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22455 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
22456 __Pyx_GOTREF(__pyx_t_2);
22466 __pyx_t_11 = PyTuple_New(4);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 130, __pyx_L1_error)
22467 __Pyx_GOTREF(__pyx_t_11);
22468 __Pyx_GIVEREF(__pyx_t_1);
22469 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 130, __pyx_L1_error);
22470 __Pyx_GIVEREF(__pyx_t_4);
22471 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 130, __pyx_L1_error);
22472 __Pyx_GIVEREF(__pyx_t_3);
22473 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 130, __pyx_L1_error);
22474 __Pyx_GIVEREF(__pyx_t_2);
22475 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_2) != (0)) __PYX_ERR(0, 130, __pyx_L1_error);
22481 PyObject *__pyx_temp;
22483 __pyx_temp = __pyx_r;
22484 __pyx_r = __pyx_t_11;
22486 __Pyx_XDECREF(__pyx_temp);
22501 __Pyx_XDECREF(__pyx_t_1);
22502 __Pyx_XDECREF(__pyx_t_2);
22503 __Pyx_XDECREF(__pyx_t_3);
22504 __Pyx_XDECREF(__pyx_t_4);
22505 __Pyx_XDECREF((PyObject *)__pyx_t_6);
22506 __Pyx_XDECREF(__pyx_t_7);
22507 __Pyx_XDECREF(__pyx_t_10);
22508 __Pyx_XDECREF(__pyx_t_11);
22509 __Pyx_XDECREF(__pyx_t_13);
22510 __Pyx_AddTraceback(
"csparsity.PySparsityInfo.getCSR", __pyx_clineno, __pyx_lineno, __pyx_filename);
22513 __Pyx_XGIVEREF(__pyx_r);
22514 __Pyx_RefNannyFinishContext();
22525static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_11__reduce_cython__(PyObject *__pyx_v_self,
22526#
if CYTHON_VECTORCALL
22527PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22529PyObject *__pyx_args, PyObject *__pyx_kwds
22532static PyMethodDef __pyx_mdef_9csparsity_14PySparsityInfo_11__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22533static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_11__reduce_cython__(PyObject *__pyx_v_self,
22534#
if CYTHON_VECTORCALL
22535PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22537PyObject *__pyx_args, PyObject *__pyx_kwds
22540 #if !CYTHON_VECTORCALL
22541 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22543 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
22544 PyObject *__pyx_r = 0;
22545 __Pyx_RefNannyDeclarations
22546 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
22547 #if !CYTHON_VECTORCALL
22548 #if CYTHON_ASSUME_SAFE_SIZE
22549 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22551 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
22554 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22555 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
22556 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22557 if (unlikely(__pyx_kwds_len < 0))
return NULL;
22558 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
22559 __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_10__reduce_cython__(((
struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self));
22562 __Pyx_RefNannyFinishContext();
22566static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_10__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self) {
22567 PyObject *__pyx_r = NULL;
22568 __Pyx_RefNannyDeclarations
22569 int __pyx_lineno = 0;
22570 const char *__pyx_filename = NULL;
22571 int __pyx_clineno = 0;
22572 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
22580 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
22581 __PYX_ERR(1, 2, __pyx_L1_error)
22591 __Pyx_AddTraceback(
"csparsity.PySparsityInfo.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22593 __Pyx_XGIVEREF(__pyx_r);
22594 __Pyx_RefNannyFinishContext();
22606static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_13__setstate_cython__(PyObject *__pyx_v_self,
22607#
if CYTHON_VECTORCALL
22608PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22610PyObject *__pyx_args, PyObject *__pyx_kwds
22613static PyMethodDef __pyx_mdef_9csparsity_14PySparsityInfo_13__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22614static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_13__setstate_cython__(PyObject *__pyx_v_self,
22615#
if CYTHON_VECTORCALL
22616PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22618PyObject *__pyx_args, PyObject *__pyx_kwds
22621 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
22622 #if !CYTHON_VECTORCALL
22623 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22625 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
22626 PyObject* values[1] = {0};
22627 int __pyx_lineno = 0;
22628 const char *__pyx_filename = NULL;
22629 int __pyx_clineno = 0;
22630 PyObject *__pyx_r = 0;
22631 __Pyx_RefNannyDeclarations
22632 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
22633 #if !CYTHON_VECTORCALL
22634 #if CYTHON_ASSUME_SAFE_SIZE
22635 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22637 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
22640 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22642 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
22643 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22644 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
22645 if (__pyx_kwds_len > 0) {
22646 switch (__pyx_nargs) {
22648 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22649 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
22650 CYTHON_FALLTHROUGH;
22652 default:
goto __pyx_L5_argtuple_error;
22654 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22655 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)
22656 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
22657 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
22659 }
else if (unlikely(__pyx_nargs != 1)) {
22660 goto __pyx_L5_argtuple_error;
22662 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22663 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
22665 __pyx_v___pyx_state = values[0];
22667 goto __pyx_L6_skip;
22668 __pyx_L5_argtuple_error:;
22669 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
22671 goto __pyx_L4_argument_unpacking_done;
22673 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22674 Py_XDECREF(values[__pyx_temp]);
22676 __Pyx_AddTraceback(
"csparsity.PySparsityInfo.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22677 __Pyx_RefNannyFinishContext();
22679 __pyx_L4_argument_unpacking_done:;
22680 __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_12__setstate_cython__(((
struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self), __pyx_v___pyx_state);
22683 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22684 Py_XDECREF(values[__pyx_temp]);
22686 __Pyx_RefNannyFinishContext();
22690static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_12__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
22691 PyObject *__pyx_r = NULL;
22692 __Pyx_RefNannyDeclarations
22693 int __pyx_lineno = 0;
22694 const char *__pyx_filename = NULL;
22695 int __pyx_clineno = 0;
22696 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
22703 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
22704 __PYX_ERR(1, 4, __pyx_L1_error)
22715 __Pyx_AddTraceback(
"csparsity.PySparsityInfo.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22717 __Pyx_XGIVEREF(__pyx_r);
22718 __Pyx_RefNannyFinishContext();
22723static PyObject *__pyx_tp_new__initialisation_9csparsity_PySparsityInfo(PyObject *o,
22724#
if CYTHON_VECTORCALL_TPNEW
22725 CYTHON_UNUSED PyObject *
const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
22727 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
22730 struct __pyx_obj_9csparsity_PySparsityInfo *p = ((
struct __pyx_obj_9csparsity_PySparsityInfo *)o);
22731 __Pyx_default_placement_construct(&(p->cpp));
22733 int cinit_result = __pyx_pw_9csparsity_14PySparsityInfo_1__cinit__(
22734 #
if CYTHON_VECTORCALL_TPNEW
22737 o, __pyx_mstate_global->__pyx_empty_tuple, NULL);
22739 if (unlikely(cinit_result))
goto bad;
22743 Py_DECREF(o); o = 0;
22747static PyObject *__pyx_tp_new_vectorcall_9csparsity_PySparsityInfo(PyTypeObject *t,
22748#
if CYTHON_VECTORCALL_TPNEW
22749 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
22751 PyObject *a, PyObject *k
22755 o = __Pyx_AllocateExtensionType(t, 0);
22756 if (unlikely(!o))
return 0;
22757 return __pyx_tp_new__initialisation_9csparsity_PySparsityInfo(o,
22758#
if CYTHON_VECTORCALL_TPNEW
22759 args, nargs, kwnames
22766#if CYTHON_VECTORCALL_TPNEW
22767static PyObject *__pyx_tp_new_9csparsity_PySparsityInfo(PyTypeObject *t, PyObject *a, PyObject *k) {
22768 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_9csparsity_PySparsityInfo, t, a, k);
22772#if CYTHON_VECTORCALL_TPNEW
22773static PyObject *__pyx_tp_vectorcall_9csparsity_PySparsityInfo(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
22774 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_9csparsity_PySparsityInfo || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
22775 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
22777 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
22778 PyObject *o = __pyx_tp_new_vectorcall_9csparsity_PySparsityInfo((PyTypeObject*)t, args, nargs, kwnames);
22783static void __pyx_tp_dealloc_9csparsity_PySparsityInfo(PyObject *o) {
22784 struct __pyx_obj_9csparsity_PySparsityInfo *p = (
struct __pyx_obj_9csparsity_PySparsityInfo *)o;
22785 #if CYTHON_USE_TP_FINALIZE
22786 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
22787 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9csparsity_PySparsityInfo) {
22788 if (PyObject_CallFinalizerFromDealloc(o))
return;
22793 PyObject *etype, *eval, *etb;
22794 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
22795 __Pyx_DeallocKeepAliveBegin(o);
22796 __pyx_pw_9csparsity_14PySparsityInfo_3__dealloc__(o);
22797 __Pyx_DeallocKeepAliveEnd(o);
22798 __Pyx_PyErr_RestoreException(etype, eval, etb);
22800 __Pyx_call_destructor(p->cpp);
22801 PyTypeObject *tp = Py_TYPE(o);
22802 #if CYTHON_USE_TYPE_SLOTS
22806 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
22807 if (tp_free) tp_free(o);
22810 #if CYTHON_USE_TYPE_SPECS
22815static PyMethodDef __pyx_methods_9csparsity_PySparsityInfo[] = {
22816 {
"findNonzeros", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_5findNonzeros, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
22817 {
"getOffsets_CSR", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_7getOffsets_CSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
22818 {
"getCSR", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_9getCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
22819 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
22820 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
22823#if CYTHON_USE_TYPE_SPECS
22824static PyType_Slot __pyx_type_9csparsity_PySparsityInfo_slots[] = {
22825 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_9csparsity_PySparsityInfo},
22826 {Py_tp_methods, (
void *)__pyx_methods_9csparsity_PySparsityInfo},
22827 {Py_tp_new, (
void *)__pyx_tp_new_9csparsity_PySparsityInfo},
22828 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
22829 #if CYTHON_VECTORCALL_TPNEW
22830 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_9csparsity_PySparsityInfo},
22835static PyType_Spec __pyx_type_9csparsity_PySparsityInfo_spec = {
22836 "csparsity.PySparsityInfo",
22837 sizeof(
struct __pyx_obj_9csparsity_PySparsityInfo),
22839 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
22840 __pyx_type_9csparsity_PySparsityInfo_slots,
22844static PyTypeObject __pyx_type_9csparsity_PySparsityInfo = {
22845 PyVarObject_HEAD_INIT(0, 0)
22846 "csparsity.""PySparsityInfo",
22847 sizeof(
struct __pyx_obj_9csparsity_PySparsityInfo),
22849 __pyx_tp_dealloc_9csparsity_PySparsityInfo,
22864 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
22872 __pyx_methods_9csparsity_PySparsityInfo,
22879 #
if !CYTHON_USE_TYPE_SPECS
22884 __pyx_tp_new_9csparsity_PySparsityInfo,
22894 #
if CYTHON_USE_TP_FINALIZE
22899 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
22900 #
if CYTHON_VECTORCALL_TPNEW
22901 __pyx_tp_vectorcall_9csparsity_PySparsityInfo,
22906 #
if __PYX_NEED_TP_PRINT_SLOT == 1
22909 #
if PY_VERSION_HEX >= 0x030C0000
22912 #
if PY_VERSION_HEX >= 0x030d00A4
22915 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
22920static struct __pyx_vtabstruct_array __pyx_vtable_array;
22922static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
22923#
if CYTHON_VECTORCALL_TPNEW
22924 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
22926 PyObject *a, PyObject *k
22929 struct __pyx_array_obj *p = ((
struct __pyx_array_obj *)o);
22930 p->__pyx_vtab = __pyx_vtabptr_array;
22931 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
22932 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
22934 int cinit_result = __pyx_array___cinit__(o,
22935#
if CYTHON_VECTORCALL_TPNEW
22936 args, nargs, kwnames
22941 if (unlikely(cinit_result))
goto bad;
22945 Py_DECREF(o); o = 0;
22949static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
22950#
if CYTHON_VECTORCALL_TPNEW
22951 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
22953 PyObject *a, PyObject *k
22957 o = __Pyx_AllocateExtensionType(t, 0);
22958 if (unlikely(!o))
return 0;
22959 return __pyx_tp_new__initialisation_array(o,
22960#
if CYTHON_VECTORCALL_TPNEW
22961 args, nargs, kwnames
22968#if CYTHON_VECTORCALL_TPNEW
22969static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
22970 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_array, t, a, k);
22974#if CYTHON_VECTORCALL_TPNEW
22975static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
22976 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_array_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
22977 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
22979 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
22980 PyObject *o = __pyx_tp_new_vectorcall_array((PyTypeObject*)t, args, nargs, kwnames);
22985static void __pyx_tp_dealloc_array(PyObject *o) {
22986 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
22987 #if CYTHON_USE_TP_FINALIZE
22988 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
22989 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
22990 if (PyObject_CallFinalizerFromDealloc(o))
return;
22995 PyObject *etype, *eval, *etb;
22996 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
22997 __Pyx_DeallocKeepAliveBegin(o);
22998 __pyx_array___dealloc__(o);
22999 __Pyx_DeallocKeepAliveEnd(o);
23000 __Pyx_PyErr_RestoreException(etype, eval, etb);
23003 Py_CLEAR(p->_format);
23004 PyTypeObject *tp = Py_TYPE(o);
23005 #if CYTHON_USE_TYPE_SLOTS
23009 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
23010 if (tp_free) tp_free(o);
23013 #if CYTHON_USE_TYPE_SPECS
23018static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
23020 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return NULL;
23021 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
23022 binaryfunc
f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
23024 binaryfunc
f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
23031static PyObject *__pyx_mp_subscript_array(PyObject *o, PyObject *i) {
23032 return __pyx_array___getitem__(o, i);
23035static int __pyx_sq_ass_item_array(PyObject *o, Py_ssize_t i, PyObject *
v) {
23037 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return -1;
23038 int r = __pyx_array___setitem__(o, x,
v);
23042 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
23047static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
23049 return __pyx_array___setitem__(o, i,
v);
23051 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
23056static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
23057 PyObject *
v = PyObject_GenericGetAttr(o,
n);
23058 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
23060 v = __pyx_array___getattr__(o,
n);
23065static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
23066 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
23069static PyMethodDef __pyx_methods_array[] = {
23070 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
23071 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23072 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23076static struct PyGetSetDef __pyx_getsets_array[] = {
23077 {
"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
23080#if CYTHON_USE_TYPE_SPECS
23081#if !CYTHON_COMPILING_IN_LIMITED_API
23083static PyBufferProcs __pyx_tp_as_buffer_array = {
23084 __pyx_array_getbuffer,
23088static PyType_Slot __pyx_type___pyx_array_slots[] = {
23089 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_array},
23090 {Py_sq_length, (
void *)__pyx_array___len__},
23091 {Py_sq_item, (
void *)__pyx_sq_item_array},
23092 {Py_sq_ass_item, (
void *)__pyx_sq_ass_item_array},
23093 {Py_mp_length, (
void *)__pyx_array___len__},
23094 {Py_mp_subscript, (
void *)__pyx_mp_subscript_array},
23095 {Py_mp_ass_subscript, (
void *)__pyx_mp_ass_subscript_array},
23096 {Py_tp_getattro, (
void *)__pyx_tp_getattro_array},
23097 #if defined(Py_bf_getbuffer)
23098 {Py_bf_getbuffer, (
void *)__pyx_array_getbuffer},
23100 {Py_tp_methods, (
void *)__pyx_methods_array},
23101 {Py_tp_getset, (
void *)__pyx_getsets_array},
23102 {Py_tp_new, (
void *)__pyx_tp_new_array},
23103 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23104 #if CYTHON_VECTORCALL_TPNEW
23105 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_array},
23110static PyType_Spec __pyx_type___pyx_array_spec = {
23112 sizeof(
struct __pyx_array_obj),
23114 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
23115 __pyx_type___pyx_array_slots,
23119static PySequenceMethods __pyx_tp_as_sequence_array = {
23120 __pyx_array___len__,
23123 __pyx_sq_item_array,
23125 __pyx_sq_ass_item_array,
23132static PyMappingMethods __pyx_tp_as_mapping_array = {
23133 __pyx_array___len__,
23134 __pyx_mp_subscript_array,
23135 __pyx_mp_ass_subscript_array,
23138static PyBufferProcs __pyx_tp_as_buffer_array = {
23139 __pyx_array_getbuffer,
23143static PyTypeObject __pyx_type___pyx_array = {
23144 PyVarObject_HEAD_INIT(0, 0)
23145 "csparsity.""array",
23146 sizeof(
struct __pyx_array_obj),
23148 __pyx_tp_dealloc_array,
23155 &__pyx_tp_as_sequence_array,
23156 &__pyx_tp_as_mapping_array,
23160 __pyx_tp_getattro_array,
23162 &__pyx_tp_as_buffer_array,
23163 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
23171 __pyx_methods_array,
23173 __pyx_getsets_array,
23178 #
if !CYTHON_USE_TYPE_SPECS
23183 __pyx_tp_new_array,
23193 #
if CYTHON_USE_TP_FINALIZE
23198 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23199 #
if CYTHON_VECTORCALL_TPNEW
23200 __pyx_tp_vectorcall_array,
23205 #
if __PYX_NEED_TP_PRINT_SLOT == 1
23208 #
if PY_VERSION_HEX >= 0x030C0000
23211 #
if PY_VERSION_HEX >= 0x030d00A4
23214 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
23220static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
23221#
if CYTHON_VECTORCALL_TPNEW
23222 CYTHON_UNUSED PyObject *
const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
23224 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
23227 struct __pyx_MemviewEnum_obj *p = ((
struct __pyx_MemviewEnum_obj *)o);
23228 p->name = Py_None; Py_INCREF(Py_None);
23232static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
23233#
if CYTHON_VECTORCALL_TPNEW
23234 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
23236 PyObject *a, PyObject *k
23240 o = __Pyx_AllocateExtensionType(t, 0);
23241 if (unlikely(!o))
return 0;
23242 return __pyx_tp_new__initialisation_Enum(o,
23243#
if CYTHON_VECTORCALL_TPNEW
23244 args, nargs, kwnames
23251#if CYTHON_VECTORCALL_TPNEW
23252static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k) {
23253 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_Enum, t, a, k);
23257#if CYTHON_VECTORCALL_TPNEW
23258static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
23259 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_MemviewEnum_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
23260 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
23262 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
23263 PyObject *o = __pyx_tp_new_vectorcall_Enum((PyTypeObject*)t, args, nargs, kwnames);
23265 assert(Py_TYPE(o) == (PyTypeObject*)t);
23266 if (unlikely(__pyx_MemviewEnum___init__(o, args, nargs, kwnames) < 0)) {
23274#if CYTHON_VECTORCALL_TPNEW
23275static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds) {
23276 return __Pyx_CallTpinitAsVectorcall(__pyx_MemviewEnum___init__, o, args, kwds);
23280static void __pyx_tp_dealloc_Enum(PyObject *o) {
23281 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
23282 #if CYTHON_USE_TP_FINALIZE
23283 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
23284 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
23285 if (PyObject_CallFinalizerFromDealloc(o))
return;
23289 PyObject_GC_UnTrack(o);
23291 PyTypeObject *tp = Py_TYPE(o);
23292 #if CYTHON_USE_TYPE_SLOTS
23296 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
23297 if (tp_free) tp_free(o);
23300 #if CYTHON_USE_TYPE_SPECS
23305static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
23307 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
23309 e = __Pyx_call_type_traverse(o, 1,
v, a);
23313 e = (*v)(p->name, a);
if (e)
return e;
23318static int __pyx_tp_clear_Enum(PyObject *o) {
23320 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
23321 tmp = ((PyObject*)p->name);
23322 p->name = Py_None; Py_INCREF(Py_None);
23327static PyMethodDef __pyx_methods_Enum[] = {
23328 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23329 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23332#if CYTHON_USE_TYPE_SPECS
23333static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
23334 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_Enum},
23335 {Py_tp_repr, (
void *)__pyx_MemviewEnum___repr__},
23336 {Py_tp_traverse, (
void *)__pyx_tp_traverse_Enum},
23337 {Py_tp_clear, (
void *)__pyx_tp_clear_Enum},
23338 {Py_tp_methods, (
void *)__pyx_methods_Enum},
23339 {Py_tp_init, (
void *)__pyx_tp_init_Enum},
23340 {Py_tp_new, (
void *)__pyx_tp_new_Enum},
23341 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23342 #if CYTHON_VECTORCALL_TPNEW
23343 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_Enum},
23348static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
23350 sizeof(
struct __pyx_MemviewEnum_obj),
23352 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
23353 __pyx_type___pyx_MemviewEnum_slots,
23357static PyTypeObject __pyx_type___pyx_MemviewEnum = {
23358 PyVarObject_HEAD_INIT(0, 0)
23359 "csparsity.""Enum",
23360 sizeof(
struct __pyx_MemviewEnum_obj),
23362 __pyx_tp_dealloc_Enum,
23367 __pyx_MemviewEnum___repr__,
23377 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
23379 __pyx_tp_traverse_Enum,
23380 __pyx_tp_clear_Enum,
23385 __pyx_methods_Enum,
23392 #
if !CYTHON_USE_TYPE_SPECS
23395 __pyx_tp_init_Enum,
23407 #
if CYTHON_USE_TP_FINALIZE
23412 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23413 #
if CYTHON_VECTORCALL_TPNEW
23414 __pyx_tp_vectorcall_Enum,
23419 #
if __PYX_NEED_TP_PRINT_SLOT == 1
23422 #
if PY_VERSION_HEX >= 0x030C0000
23425 #
if PY_VERSION_HEX >= 0x030d00A4
23428 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
23433static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
23435static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
23436#
if CYTHON_VECTORCALL_TPNEW
23437 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
23439 PyObject *a, PyObject *k
23442 struct __pyx_memoryview_obj *p = ((
struct __pyx_memoryview_obj *)o);
23443 p->__pyx_vtab = __pyx_vtabptr_memoryview;
23444 p->obj = Py_None; Py_INCREF(Py_None);
23445 p->_size = Py_None; Py_INCREF(Py_None);
23446 p->view.obj = NULL;
23448 int cinit_result = __pyx_memoryview___cinit__(o,
23449#
if CYTHON_VECTORCALL_TPNEW
23450 args, nargs, kwnames
23455 if (unlikely(cinit_result))
goto bad;
23459 Py_DECREF(o); o = 0;
23463static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
23464#
if CYTHON_VECTORCALL_TPNEW
23465 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
23467 PyObject *a, PyObject *k
23471 o = __Pyx_AllocateExtensionType(t, 0);
23472 if (unlikely(!o))
return 0;
23473 return __pyx_tp_new__initialisation_memoryview(o,
23474#
if CYTHON_VECTORCALL_TPNEW
23475 args, nargs, kwnames
23482#if CYTHON_VECTORCALL_TPNEW
23483static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
23484 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_memoryview, t, a, k);
23488#if CYTHON_VECTORCALL_TPNEW
23489static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
23490 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryview_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
23491 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
23493 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
23494 PyObject *o = __pyx_tp_new_vectorcall_memoryview((PyTypeObject*)t, args, nargs, kwnames);
23499static void __pyx_tp_dealloc_memoryview(PyObject *o) {
23500 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
23501 #if CYTHON_USE_TP_FINALIZE
23502 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
23503 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
23504 if (PyObject_CallFinalizerFromDealloc(o))
return;
23508 PyObject_GC_UnTrack(o);
23510 PyObject *etype, *eval, *etb;
23511 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
23512 __Pyx_DeallocKeepAliveBegin(o);
23513 __pyx_memoryview___dealloc__(o);
23514 __Pyx_DeallocKeepAliveEnd(o);
23515 __Pyx_PyErr_RestoreException(etype, eval, etb);
23518 Py_CLEAR(p->_size);
23519 PyTypeObject *tp = Py_TYPE(o);
23520 #if CYTHON_USE_TYPE_SLOTS
23524 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
23525 if (tp_free) tp_free(o);
23528 #if CYTHON_USE_TYPE_SPECS
23533static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
23535 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
23537 e = __Pyx_call_type_traverse(o, 1,
v, a);
23541 e = (*v)(p->obj, a);
if (e)
return e;
23544 e = (*v)(p->_size, a);
if (e)
return e;
23547 e = (*v)(p->view.obj, a);
if (e)
return e;
23552static int __pyx_tp_clear_memoryview(PyObject *o) {
23554 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
23555 tmp = ((PyObject*)p->obj);
23556 p->obj = Py_None; Py_INCREF(Py_None);
23558 tmp = ((PyObject*)p->_size);
23559 p->_size = Py_None; Py_INCREF(Py_None);
23561 Py_CLEAR(p->view.obj);
23565static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
23567 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return NULL;
23568 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
23569 binaryfunc
f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
23571 binaryfunc
f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
23578static PyObject *__pyx_mp_subscript_memoryview(PyObject *o, PyObject *i) {
23579 return __pyx_memoryview___getitem__(o, i);
23582static int __pyx_sq_ass_item_memoryview(PyObject *o, Py_ssize_t i, PyObject *
v) {
23584 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return -1;
23585 int r = __pyx_memoryview___setitem__(o, x,
v);
23589 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
23594static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
23596 return __pyx_memoryview___setitem__(o, i,
v);
23598 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
23603static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
23604 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
23607static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
23608 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
23611static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
23612 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
23615static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
23616 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
23619static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
23620 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
23623static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
23624 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
23627static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
23628 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
23631static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
23632 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
23635static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
23636 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
23639static PyMethodDef __pyx_methods_memoryview[] = {
23640 {
"is_c_contig", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23641 {
"is_f_contig", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23642 {
"copy", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23643 {
"copy_fortran", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23644 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23645 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23649static struct PyGetSetDef __pyx_getsets_memoryview[] = {
23650 {
"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
23651 {
"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
23652 {
"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
23653 {
"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
23654 {
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
23655 {
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
23656 {
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
23657 {
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
23658 {
"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
23661#if CYTHON_USE_TYPE_SPECS
23662#if !CYTHON_COMPILING_IN_LIMITED_API
23664static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
23665 __pyx_memoryview_getbuffer,
23669static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
23670 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_memoryview},
23671 {Py_tp_repr, (
void *)__pyx_memoryview___repr__},
23672 {Py_sq_length, (
void *)__pyx_memoryview___len__},
23673 {Py_sq_item, (
void *)__pyx_sq_item_memoryview},
23674 {Py_sq_ass_item, (
void *)__pyx_sq_ass_item_memoryview},
23675 {Py_mp_length, (
void *)__pyx_memoryview___len__},
23676 {Py_mp_subscript, (
void *)__pyx_mp_subscript_memoryview},
23677 {Py_mp_ass_subscript, (
void *)__pyx_mp_ass_subscript_memoryview},
23678 {Py_tp_str, (
void *)__pyx_memoryview___str__},
23679 #if defined(Py_bf_getbuffer)
23680 {Py_bf_getbuffer, (
void *)__pyx_memoryview_getbuffer},
23682 {Py_tp_traverse, (
void *)__pyx_tp_traverse_memoryview},
23683 {Py_tp_clear, (
void *)__pyx_tp_clear_memoryview},
23684 {Py_tp_methods, (
void *)__pyx_methods_memoryview},
23685 {Py_tp_getset, (
void *)__pyx_getsets_memoryview},
23686 {Py_tp_new, (
void *)__pyx_tp_new_memoryview},
23687 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23688 #if CYTHON_VECTORCALL_TPNEW
23689 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_memoryview},
23694static PyType_Spec __pyx_type___pyx_memoryview_spec = {
23695 "csparsity.memoryview",
23696 sizeof(
struct __pyx_memoryview_obj),
23698 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
23699 __pyx_type___pyx_memoryview_slots,
23703static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
23704 __pyx_memoryview___len__,
23707 __pyx_sq_item_memoryview,
23709 __pyx_sq_ass_item_memoryview,
23716static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
23717 __pyx_memoryview___len__,
23718 __pyx_mp_subscript_memoryview,
23719 __pyx_mp_ass_subscript_memoryview,
23722static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
23723 __pyx_memoryview_getbuffer,
23727static PyTypeObject __pyx_type___pyx_memoryview = {
23728 PyVarObject_HEAD_INIT(0, 0)
23729 "csparsity.""memoryview",
23730 sizeof(
struct __pyx_memoryview_obj),
23732 __pyx_tp_dealloc_memoryview,
23737 __pyx_memoryview___repr__,
23739 &__pyx_tp_as_sequence_memoryview,
23740 &__pyx_tp_as_mapping_memoryview,
23743 __pyx_memoryview___str__,
23746 &__pyx_tp_as_buffer_memoryview,
23747 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
23749 __pyx_tp_traverse_memoryview,
23750 __pyx_tp_clear_memoryview,
23755 __pyx_methods_memoryview,
23757 __pyx_getsets_memoryview,
23762 #
if !CYTHON_USE_TYPE_SPECS
23767 __pyx_tp_new_memoryview,
23777 #
if CYTHON_USE_TP_FINALIZE
23782 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23783 #
if CYTHON_VECTORCALL_TPNEW
23784 __pyx_tp_vectorcall_memoryview,
23789 #
if __PYX_NEED_TP_PRINT_SLOT == 1
23792 #
if PY_VERSION_HEX >= 0x030C0000
23795 #
if PY_VERSION_HEX >= 0x030d00A4
23798 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
23803static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
23805static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
23806#
if CYTHON_VECTORCALL_TPNEW
23807 CYTHON_UNUSED PyObject *
const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
23809 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
23812 struct __pyx_memoryviewslice_obj *p = ((
struct __pyx_memoryviewslice_obj *)o);
23813 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
23814 __Pyx_default_placement_construct(&(p->from_slice));
23815 p->from_object = Py_None; Py_INCREF(Py_None);
23816 p->from_slice.memview = NULL;
23820static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
23821#
if CYTHON_VECTORCALL_TPNEW
23822 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
23824 PyObject *a, PyObject *k
23828 o = __pyx_tp_new_vectorcall_memoryview(t,
23829#
if CYTHON_VECTORCALL_TPNEW
23830 args, nargs, kwnames
23835 if (unlikely(!o))
return 0;
23836 return __pyx_tp_new__initialisation__memoryviewslice(o,
23837#
if CYTHON_VECTORCALL_TPNEW
23838 args, nargs, kwnames
23845#if CYTHON_VECTORCALL_TPNEW
23846static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
23847 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall__memoryviewslice, t, a, k);
23851#if CYTHON_VECTORCALL_TPNEW
23852static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
23853 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryviewslice_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
23854 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
23856 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
23857 PyObject *o = __pyx_tp_new_vectorcall__memoryviewslice((PyTypeObject*)t, args, nargs, kwnames);
23862static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
23863 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
23864 #if CYTHON_USE_TP_FINALIZE
23865 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
23866 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
23867 if (PyObject_CallFinalizerFromDealloc(o))
return;
23871 PyObject_GC_UnTrack(o);
23873 PyObject *etype, *eval, *etb;
23874 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
23875 __Pyx_DeallocKeepAliveBegin(o);
23876 __pyx_memoryviewslice___dealloc__(o);
23877 __Pyx_DeallocKeepAliveEnd(o);
23878 __Pyx_PyErr_RestoreException(etype, eval, etb);
23880 __Pyx_call_destructor(p->from_slice);
23881 Py_CLEAR(p->from_object);
23882 PyObject_GC_Track(o);
23883 __pyx_tp_dealloc_memoryview(o);
23886static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
23888 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
23889 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
23890 if (p->from_object) {
23891 e = (*v)(p->from_object, a);
if (e)
return e;
23896static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
23898 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
23899 __pyx_tp_clear_memoryview(o);
23900 tmp = ((PyObject*)p->from_object);
23901 p->from_object = Py_None; Py_INCREF(Py_None);
23903 __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
23907static PyMethodDef __pyx_methods__memoryviewslice[] = {
23908 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23909 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23912#if CYTHON_USE_TYPE_SPECS
23913static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
23914 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc__memoryviewslice},
23915 {Py_tp_doc, (
void *)PyDoc_STR(
"Internal class for passing memoryview slices to Python")},
23916 {Py_tp_traverse, (
void *)__pyx_tp_traverse__memoryviewslice},
23917 {Py_tp_clear, (
void *)__pyx_tp_clear__memoryviewslice},
23918 {Py_tp_methods, (
void *)__pyx_methods__memoryviewslice},
23919 {Py_tp_new, (
void *)__pyx_tp_new__memoryviewslice},
23920 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23921 #if CYTHON_VECTORCALL_TPNEW
23922 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall__memoryviewslice},
23927static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
23928 "csparsity._memoryviewslice",
23929 sizeof(
struct __pyx_memoryviewslice_obj),
23931 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
23932 __pyx_type___pyx_memoryviewslice_slots,
23936static PyTypeObject __pyx_type___pyx_memoryviewslice = {
23937 PyVarObject_HEAD_INIT(0, 0)
23938 "csparsity.""_memoryviewslice",
23939 sizeof(
struct __pyx_memoryviewslice_obj),
23941 __pyx_tp_dealloc__memoryviewslice,
23946 #
if CYTHON_COMPILING_IN_PYPY || 0
23947 __pyx_memoryview___repr__,
23956 #
if CYTHON_COMPILING_IN_PYPY || 0
23957 __pyx_memoryview___str__,
23964 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
23965 PyDoc_STR(
"Internal class for passing memoryview slices to Python"),
23966 __pyx_tp_traverse__memoryviewslice,
23967 __pyx_tp_clear__memoryviewslice,
23972 __pyx_methods__memoryviewslice,
23979 #if !CYTHON_USE_TYPE_SPECS
23984 __pyx_tp_new__memoryviewslice,
23994 #if CYTHON_USE_TP_FINALIZE
23999 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
24000 #if CYTHON_VECTORCALL_TPNEW
24001 __pyx_tp_vectorcall__memoryviewslice,
24006 #if __PYX_NEED_TP_PRINT_SLOT == 1
24009 #if PY_VERSION_HEX >= 0x030C0000
24012 #if PY_VERSION_HEX >= 0x030d00A4
24015 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
24021static PyMethodDef __pyx_methods[] = {
24025static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate);
24026static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate);
24027static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void);
24028static CYTHON_SMALL_CODE
int __Pyx_InitAfterSharedUtility(
void);
24029static CYTHON_SMALL_CODE
int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate);
24030static CYTHON_SMALL_CODE
int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate);
24031static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate);
24032static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate);
24033static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_obj_9csparsity_PySparsityInfo(__pyx_mstatetype *__pyx_mstate);
24034static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate);
24035static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate);
24036static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate);
24037static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate);
24038static CYTHON_SMALL_CODE
int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate);
24039static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate);
24040static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate);
24041static CYTHON_SMALL_CODE
int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate);
24044static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
24045 __Pyx_RefNannyDeclarations
24046 CYTHON_UNUSED_VAR(__pyx_mstate);
24047 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Global_init_code", 0);
24049 __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
24050 generic = Py_None; Py_INCREF(Py_None);
24051 strided = Py_None; Py_INCREF(Py_None);
24052 indirect = Py_None; Py_INCREF(Py_None);
24053 contiguous = Py_None; Py_INCREF(Py_None);
24054 indirect_contiguous = Py_None; Py_INCREF(Py_None);
24055 __Pyx_RefNannyFinishContext();
24059static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
24060 __Pyx_RefNannyDeclarations
24061 CYTHON_UNUSED_VAR(__pyx_mstate);
24062 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_export_code", 0);
24064 __Pyx_RefNannyFinishContext();
24068static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
24069 __Pyx_RefNannyDeclarations
24070 CYTHON_UNUSED_VAR(__pyx_mstate);
24071 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_export_code", 0);
24073 __Pyx_RefNannyFinishContext();
24077static int __Pyx_modinit_Exttype___pyx_obj_9csparsity_PySparsityInfo(__pyx_mstatetype *__pyx_mstate) {
24078 __Pyx_RefNannyDeclarations
24079 int __pyx_lineno = 0;
24080 const char *__pyx_filename = NULL;
24081 int __pyx_clineno = 0;
24082 CYTHON_UNUSED_VAR(__pyx_mstate);
24083 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_obj_9csparsity_PySparsityInfo", 0);
24085 #if CYTHON_USE_TYPE_SPECS
24086 __pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9csparsity_PySparsityInfo_spec, NULL);
if (unlikely(!__pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo)) __PYX_ERR(0, 6, __pyx_L1_error)
24088 __pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo = &__pyx_type_9csparsity_PySparsityInfo;
24090 #if !CYTHON_COMPILING_IN_LIMITED_API
24092 #if !CYTHON_USE_TYPE_SPECS
24093 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo) < (0)) __PYX_ERR(0, 6, __pyx_L1_error)
24095 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
24096 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo);
24098 #if !CYTHON_COMPILING_IN_LIMITED_API
24099 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo->tp_dictoffset && __pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo->tp_getattro == PyObject_GenericGetAttr)) {
24100 __pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo->tp_getattro = PyObject_GenericGetAttr;
24103 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PySparsityInfo, (PyObject *) __pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo) < (0)) __PYX_ERR(0, 6, __pyx_L1_error)
24104 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo) < (0)) __PYX_ERR(0, 6, __pyx_L1_error)
24105 __Pyx_RefNannyFinishContext();
24108 __Pyx_RefNannyFinishContext();
24112static int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate) {
24113 __Pyx_RefNannyDeclarations
24114 int __pyx_lineno = 0;
24115 const char *__pyx_filename = NULL;
24116 int __pyx_clineno = 0;
24117 CYTHON_UNUSED_VAR(__pyx_mstate);
24118 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_array_obj", 0);
24120 __pyx_vtabptr_array = &__pyx_vtable_array;
24121 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
24122 #if CYTHON_USE_TYPE_SPECS
24123 __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)
24124 #if !CYTHON_COMPILING_IN_LIMITED_API
24125 __pyx_mstate->__pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
24126 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) {
24127 __pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
24129 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
24131 #elif defined(_MSC_VER)
24132 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
24134 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
24137 __pyx_mstate->__pyx_array_type = &__pyx_type___pyx_array;
24139 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_array_type, 1) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
24140 #if !CYTHON_COMPILING_IN_LIMITED_API
24142 #if !CYTHON_USE_TYPE_SPECS
24143 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
24145 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
24146 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_array_type);
24148 if (__Pyx_SetVtable(__pyx_mstate->__pyx_array_type, __pyx_vtabptr_array) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
24149 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
24150 __Pyx_RefNannyFinishContext();
24153 __Pyx_RefNannyFinishContext();
24157static int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate) {
24158 __Pyx_RefNannyDeclarations
24159 int __pyx_lineno = 0;
24160 const char *__pyx_filename = NULL;
24161 int __pyx_clineno = 0;
24162 CYTHON_UNUSED_VAR(__pyx_mstate);
24163 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_MemviewEnum_obj", 0);
24165 #if CYTHON_USE_TYPE_SPECS
24166 __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)
24168 __pyx_mstate->__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
24170 #if !CYTHON_COMPILING_IN_LIMITED_API
24172 #if !CYTHON_USE_TYPE_SPECS
24173 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
24175 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
24176 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_MemviewEnum_type);
24178 #if !CYTHON_COMPILING_IN_LIMITED_API
24179 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)) {
24180 __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro = PyObject_GenericGetAttr;
24183 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
24184 __Pyx_RefNannyFinishContext();
24187 __Pyx_RefNannyFinishContext();
24191static int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate) {
24192 __Pyx_RefNannyDeclarations
24193 int __pyx_lineno = 0;
24194 const char *__pyx_filename = NULL;
24195 int __pyx_clineno = 0;
24196 CYTHON_UNUSED_VAR(__pyx_mstate);
24197 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_memoryview_obj", 0);
24199 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
24200 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
24201 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
24202 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
24203 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
24204 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
24205 __pyx_vtable_memoryview.setitem_indexed1 = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed1;
24206 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
24207 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
24208 __pyx_vtable_memoryview._get_base = (PyObject *(*)(
struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
24209 #if CYTHON_USE_TYPE_SPECS
24210 __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)
24211 #if !CYTHON_COMPILING_IN_LIMITED_API
24212 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
24213 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) {
24214 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
24216 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
24218 #elif defined(_MSC_VER)
24219 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
24221 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
24224 __pyx_mstate->__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
24226 #if !CYTHON_COMPILING_IN_LIMITED_API
24228 #if !CYTHON_USE_TYPE_SPECS
24229 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
24231 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
24232 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryview_type);
24234 #if !CYTHON_COMPILING_IN_LIMITED_API
24235 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)) {
24236 __pyx_mstate->__pyx_memoryview_type->tp_getattro = PyObject_GenericGetAttr;
24239 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryview_type, __pyx_vtabptr_memoryview) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
24240 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
24241 __Pyx_RefNannyFinishContext();
24244 __Pyx_RefNannyFinishContext();
24248static int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate) {
24249 __Pyx_RefNannyDeclarations
24250 PyObject *__pyx_t_1 = NULL;
24251 int __pyx_lineno = 0;
24252 const char *__pyx_filename = NULL;
24253 int __pyx_clineno = 0;
24254 CYTHON_UNUSED_VAR(__pyx_mstate);
24255 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_memoryviewslice_obj", 0);
24257 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
24258 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
24259 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
24260 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
24261 __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(
struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
24262 #if CYTHON_USE_TYPE_SPECS
24263 __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)
24264 __Pyx_GOTREF(__pyx_t_1);
24265 __pyx_mstate->__pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
24266 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24267 if (unlikely(!__pyx_mstate->__pyx_memoryviewslice_type)) __PYX_ERR(1, 947, __pyx_L1_error)
24269 __pyx_mstate->__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
24271 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_memoryviewslice_type, 1) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
24272 #if !CYTHON_COMPILING_IN_LIMITED_API
24273 __pyx_mstate_global->__pyx_memoryviewslice_type->tp_base = __pyx_mstate_global->__pyx_memoryview_type;
24275 #if !CYTHON_USE_TYPE_SPECS
24276 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
24278 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
24279 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryviewslice_type);
24281 #if !CYTHON_COMPILING_IN_LIMITED_API
24282 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)) {
24283 __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro = PyObject_GenericGetAttr;
24286 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
24287 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
24288 __Pyx_RefNannyFinishContext();
24291 __Pyx_XDECREF(__pyx_t_1);
24292 __Pyx_RefNannyFinishContext();
24296static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
24297 __Pyx_RefNannyDeclarations
24298 PyObject *__pyx_t_1 = NULL;
24299 int __pyx_lineno = 0;
24300 const char *__pyx_filename = NULL;
24301 int __pyx_clineno = 0;
24302 CYTHON_UNUSED_VAR(__pyx_mstate);
24303 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Type_import_code", 0);
24305 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
24306 __Pyx_GOTREF(__pyx_t_1);
24307 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
24308 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24309 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
24310 #elif CYTHON_COMPILING_IN_LIMITED_API
24313 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
24315 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
24316 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24317 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error)
24318 __Pyx_GOTREF(__pyx_t_1);
24319 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"dtype",
24320 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24321 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
24322 #elif CYTHON_COMPILING_IN_LIMITED_API
24323 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
24325 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
24327 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 229, __pyx_L1_error)
24328 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flatiter",
24329 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24330 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
24331 #elif CYTHON_COMPILING_IN_LIMITED_API
24332 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
24334 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
24336 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 286, __pyx_L1_error)
24337 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"broadcast",
24338 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24339 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
24340 #elif CYTHON_COMPILING_IN_LIMITED_API
24341 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
24343 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
24345 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 290, __pyx_L1_error)
24346 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ndarray",
24347 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24348 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
24349 #elif CYTHON_COMPILING_IN_LIMITED_API
24350 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
24352 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
24354 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 329, __pyx_L1_error)
24355 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"generic",
24356 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24357 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24358 #elif CYTHON_COMPILING_IN_LIMITED_API
24359 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24361 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24363 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
24364 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"number",
24365 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24366 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24367 #elif CYTHON_COMPILING_IN_LIMITED_API
24368 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24370 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24372 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
24373 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"integer",
24374 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24375 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24376 #elif CYTHON_COMPILING_IN_LIMITED_API
24377 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24379 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24381 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
24382 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"signedinteger",
24383 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24384 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24385 #elif CYTHON_COMPILING_IN_LIMITED_API
24386 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24388 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24390 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
24391 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"unsignedinteger",
24392 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24393 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24394 #elif CYTHON_COMPILING_IN_LIMITED_API
24395 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24397 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24399 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
24400 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"inexact",
24401 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24402 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24403 #elif CYTHON_COMPILING_IN_LIMITED_API
24404 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24406 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24408 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
24409 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"floating",
24410 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24411 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24412 #elif CYTHON_COMPILING_IN_LIMITED_API
24413 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24415 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24417 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
24418 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"complexfloating",
24419 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24420 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24421 #elif CYTHON_COMPILING_IN_LIMITED_API
24422 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24424 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24426 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
24427 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flexible",
24428 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24429 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24430 #elif CYTHON_COMPILING_IN_LIMITED_API
24431 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24433 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24435 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
24436 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"character",
24437 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24438 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24439 #elif CYTHON_COMPILING_IN_LIMITED_API
24440 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24442 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24444 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
24445 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ufunc",
24446 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24447 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
24448 #elif CYTHON_COMPILING_IN_LIMITED_API
24449 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
24451 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
24453 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 946, __pyx_L1_error)
24454 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24455 __Pyx_RefNannyFinishContext();
24458 __Pyx_XDECREF(__pyx_t_1);
24459 __Pyx_RefNannyFinishContext();
24463static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
24464 __Pyx_RefNannyDeclarations
24465 CYTHON_UNUSED_VAR(__pyx_mstate);
24466 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_import_code", 0);
24468 __Pyx_RefNannyFinishContext();
24472static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
24473 __Pyx_RefNannyDeclarations
24474 CYTHON_UNUSED_VAR(__pyx_mstate);
24475 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_import_code", 0);
24477 __Pyx_RefNannyFinishContext();
24481#if CYTHON_PEP489_MULTI_PHASE_INIT
24482static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
24483static int __pyx_pymod_exec_csparsity(PyObject* module);
24484static PyModuleDef_Slot __pyx_moduledef_slots[] = {
24485 {Py_mod_create, (
void*)__pyx_pymod_create},
24486 {Py_mod_exec, (
void*)__pyx_pymod_exec_csparsity},
24487 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
24488 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
24490 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
24491 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
24499 struct PyModuleDef __pyx_moduledef =
24501 static struct PyModuleDef __pyx_moduledef =
24504 PyModuleDef_HEAD_INIT,
24507 #if CYTHON_USE_MODULE_STATE
24508 sizeof(__pyx_mstatetype),
24510 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1,
24513 #if CYTHON_PEP489_MULTI_PHASE_INIT
24514 __pyx_moduledef_slots,
24518 #if CYTHON_USE_MODULE_STATE
24533#ifndef CYTHON_NO_PYINIT_EXPORT
24534 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
24537 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
24539 #define __Pyx_PyMODINIT_FUNC PyObject *
24543__Pyx_PyMODINIT_FUNC PyInit_csparsity(
void) CYTHON_SMALL_CODE;
24544__Pyx_PyMODINIT_FUNC PyInit_csparsity(
void)
24545#if CYTHON_PEP489_MULTI_PHASE_INIT
24547 return PyModuleDef_Init(&__pyx_moduledef);
24550#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
24551 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
24552static PY_INT64_T __Pyx_GetCurrentInterpreterId(
void) {
24554 PyObject *module = PyImport_ImportModule(
"_interpreters");
24556 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
24560 module = PyImport_ImportModule("_xxsubinterpreters");
24561 if (!module)
goto bad;
24563 PyObject *current = PyObject_CallMethod(module,
"get_current", NULL);
24565 if (!current)
goto bad;
24566 if (PyTuple_Check(current)) {
24567 PyObject *new_current = PySequence_GetItem(current, 0);
24568 Py_DECREF(current);
24569 current = new_current;
24570 if (!new_current)
goto bad;
24572 long long as_c_int = PyLong_AsLongLong(current);
24573 Py_DECREF(current);
24577 PySys_WriteStderr(
"__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
24581#if !CYTHON_USE_MODULE_STATE
24582static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
24583 static PY_INT64_T main_interpreter_id = -1;
24584#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
24585 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
24586#elif CYTHON_COMPILING_IN_GRAAL
24587 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
24588#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
24589 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
24590 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
24591#elif CYTHON_COMPILING_IN_LIMITED_API
24592 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
24594 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
24596 if (unlikely(current_id == -1)) {
24599 if (main_interpreter_id == -1) {
24600 main_interpreter_id = current_id;
24602 }
else if (unlikely(main_interpreter_id != current_id)) {
24605 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
24611static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none)
24613 PyObject *value = PyObject_GetAttrString(spec, from_name);
24615 if (likely(value)) {
24616 if (allow_none || value != Py_None) {
24617 result = PyDict_SetItemString(moddict, to_name, value);
24620 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
24627static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
24628 PyObject *module = NULL, *moddict, *modname;
24629 CYTHON_UNUSED_VAR(def);
24630 #if !CYTHON_USE_MODULE_STATE
24631 if (__Pyx_check_single_interpreter())
24635 return __Pyx_NewRef(__pyx_m);
24636 modname = PyObject_GetAttrString(spec,
"name");
24637 if (unlikely(!modname))
goto bad;
24638 module = PyModule_NewObject(modname);
24639 Py_DECREF(modname);
24640 if (unlikely(!module))
goto bad;
24641 moddict = PyModule_GetDict(module);
24642 if (unlikely(!moddict))
goto bad;
24643 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
24644 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
24645 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
24646 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
24649 Py_XDECREF(module);
24654static CYTHON_SMALL_CODE
int __pyx_pymod_exec_csparsity(PyObject *__pyx_pyinit_module)
24657 int stringtab_initialized = 0;
24658 #if CYTHON_USE_MODULE_STATE
24659 int pystate_addmodule_run = 0;
24661 __pyx_mstatetype *__pyx_mstate = NULL;
24662 PyObject *__pyx_t_1 = NULL;
24663 PyObject *__pyx_t_2 = NULL;
24664 PyObject *__pyx_t_3 = NULL;
24665 PyObject *__pyx_t_4 = NULL;
24666 PyObject *__pyx_t_5 = NULL;
24668 static PyThread_type_lock __pyx_t_7[8];
24670 int __pyx_lineno = 0;
24671 const char *__pyx_filename = NULL;
24672 int __pyx_clineno = 0;
24673 __Pyx_RefNannyDeclarations
24674 #if CYTHON_PEP489_MULTI_PHASE_INIT
24676 if (__pyx_m == __pyx_pyinit_module)
return 0;
24677 PyErr_SetString(PyExc_RuntimeError,
"Module 'csparsity' has already been imported. Re-initialisation is not supported.");
24681 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
24684 #if CYTHON_PEP489_MULTI_PHASE_INIT
24685 __pyx_t_1 = __pyx_pyinit_module;
24686 Py_INCREF(__pyx_t_1);
24688 __pyx_t_1 = PyModule_Create(&__pyx_moduledef);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24690 #if CYTHON_USE_MODULE_STATE
24692 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
24694 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24695 pystate_addmodule_run = 1;
24698 __pyx_m = __pyx_t_1;
24700 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
24701 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
24703 __pyx_mstate = __pyx_mstate_global;
24704 CYTHON_UNUSED_VAR(__pyx_t_1);
24705 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
24706 Py_INCREF(__pyx_mstate->__pyx_d);
24707 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
24708 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef(
"cython_runtime");
if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
24709 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24711 #if CYTHON_REFNANNY
24712 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
24713 if (!__Pyx_RefNanny) {
24714 if (PyErr_ExceptionMatches(PyExc_Exception)) {
24716 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
24718 if (!__Pyx_RefNanny)
24719 Py_FatalError(
"failed to import 'refnanny' module");
24723__Pyx_RefNannySetupContext(
"PyInit_csparsity", 0);
24724 __Pyx_init_runtime_version();
24725 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)
24726 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
24727 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
24728 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
24731 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24732 stringtab_initialized = 1;
24733 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24734 if (__pyx_module_is_main_csparsity) {
24735 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)
24738 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
24739 if (!PyDict_GetItemString(modules,
"csparsity")) {
24740 if (unlikely((PyDict_SetItemString(modules,
"csparsity", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24744 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24746 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24747 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24749 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
24750 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
24751 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
24753 if (unlikely((__Pyx_modinit_Exttype___pyx_obj_9csparsity_PySparsityInfo(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24754 if (unlikely((__Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24755 if (unlikely((__Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24756 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24757 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24758 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24759 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
24760 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
24761 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24772 __Pyx_PyThreadState_declare
24773 __Pyx_PyThreadState_assign
24774 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
24775 __Pyx_XGOTREF(__pyx_t_1);
24776 __Pyx_XGOTREF(__pyx_t_2);
24777 __Pyx_XGOTREF(__pyx_t_3);
24790 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_collections_abc};
24791 __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));
24792 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24793 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
24794 __Pyx_GOTREF(__pyx_t_4);
24796 __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)
24797 __Pyx_GOTREF(__pyx_t_5);
24798 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24799 __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)
24800 __Pyx_GOTREF(__pyx_t_4);
24801 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24802 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
24803 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
24804 __Pyx_GIVEREF(__pyx_t_4);
24815 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24816 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24817 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24818 goto __pyx_L7_try_end;
24820 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24821 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24831 __Pyx_ErrRestore(0,0,0);
24840 __Pyx_INCREF(Py_None);
24841 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
24842 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
24843 __Pyx_GIVEREF(Py_None);
24844 goto __pyx_L3_exception_handled;
24846 __pyx_L3_exception_handled:;
24847 __Pyx_XGIVEREF(__pyx_t_1);
24848 __Pyx_XGIVEREF(__pyx_t_2);
24849 __Pyx_XGIVEREF(__pyx_t_3);
24850 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
24862 __Pyx_PyThreadState_declare
24863 __Pyx_PyThreadState_assign
24864 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
24865 __Pyx_XGOTREF(__pyx_t_3);
24866 __Pyx_XGOTREF(__pyx_t_2);
24867 __Pyx_XGOTREF(__pyx_t_1);
24877 __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)
24878 __Pyx_GOTREF(__pyx_t_4);
24879 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)
24880 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24889 __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)
24890 __Pyx_GOTREF(__pyx_t_4);
24891 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)
24892 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24902 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24903 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24904 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24905 goto __pyx_L15_try_end;
24907 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24908 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24918 __Pyx_ErrRestore(0,0,0);
24919 goto __pyx_L11_exception_handled;
24921 __pyx_L11_exception_handled:;
24922 __Pyx_XGIVEREF(__pyx_t_3);
24923 __Pyx_XGIVEREF(__pyx_t_2);
24924 __Pyx_XGIVEREF(__pyx_t_1);
24925 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
24926 __pyx_L15_try_end:;
24939 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct_or_indirect};
24940 __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));
24941 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24942 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 326, __pyx_L1_error)
24943 __Pyx_GOTREF((PyObject *)__pyx_t_4);
24945 __Pyx_XGOTREF(generic);
24946 __Pyx_DECREF_SET(generic, ((PyObject *)__pyx_t_4));
24947 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
24960 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct};
24961 __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));
24962 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24963 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 327, __pyx_L1_error)
24964 __Pyx_GOTREF((PyObject *)__pyx_t_4);
24966 __Pyx_XGOTREF(strided);
24967 __Pyx_DECREF_SET(strided, ((PyObject *)__pyx_t_4));
24968 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
24981 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_indirect};
24982 __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));
24983 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24984 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 328, __pyx_L1_error)
24985 __Pyx_GOTREF((PyObject *)__pyx_t_4);
24987 __Pyx_XGOTREF(indirect);
24988 __Pyx_DECREF_SET(indirect, ((PyObject *)__pyx_t_4));
24989 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
25002 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_direct};
25003 __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));
25004 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25005 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 331, __pyx_L1_error)
25006 __Pyx_GOTREF((PyObject *)__pyx_t_4);
25008 __Pyx_XGOTREF(contiguous);
25009 __Pyx_DECREF_SET(contiguous, ((PyObject *)__pyx_t_4));
25010 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
25023 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_indirect};
25024 __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));
25025 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25026 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 332, __pyx_L1_error)
25027 __Pyx_GOTREF((PyObject *)__pyx_t_4);
25029 __Pyx_XGOTREF(indirect_contiguous);
25030 __Pyx_DECREF_SET(indirect_contiguous, ((PyObject *)__pyx_t_4));
25031 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
25041 __pyx_memoryview_thread_locks_used = 0;
25050 __pyx_t_7[0] = PyThread_allocate_lock();
25051 __pyx_t_7[1] = PyThread_allocate_lock();
25052 __pyx_t_7[2] = PyThread_allocate_lock();
25053 __pyx_t_7[3] = PyThread_allocate_lock();
25054 __pyx_t_7[4] = PyThread_allocate_lock();
25055 __pyx_t_7[5] = PyThread_allocate_lock();
25056 __pyx_t_7[6] = PyThread_allocate_lock();
25057 __pyx_t_7[7] = PyThread_allocate_lock();
25058 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_7,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
25068 __Pyx_PyThreadState_declare
25069 __Pyx_PyThreadState_assign
25070 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
25071 __Pyx_XGOTREF(__pyx_t_1);
25072 __Pyx_XGOTREF(__pyx_t_2);
25073 __Pyx_XGOTREF(__pyx_t_3);
25083 __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)
25084 __Pyx_GOTREF(__pyx_t_4);
25085 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)
25086 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25095 __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)
25096 __Pyx_GOTREF(__pyx_t_4);
25097 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)
25098 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25108 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25109 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25110 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
25111 goto __pyx_L23_try_end;
25113 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25114 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25124 __Pyx_ErrRestore(0,0,0);
25125 goto __pyx_L19_exception_handled;
25127 __pyx_L19_exception_handled:;
25128 __Pyx_XGIVEREF(__pyx_t_1);
25129 __Pyx_XGIVEREF(__pyx_t_2);
25130 __Pyx_XGIVEREF(__pyx_t_3);
25131 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
25132 __pyx_L23_try_end:;
25143 __Pyx_PyThreadState_declare
25144 __Pyx_PyThreadState_assign
25145 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
25146 __Pyx_XGOTREF(__pyx_t_3);
25147 __Pyx_XGOTREF(__pyx_t_2);
25148 __Pyx_XGOTREF(__pyx_t_1);
25158 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence);
if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 986, __pyx_L26_error)
25169 __pyx_t_5 = __pyx_collections_abc_Sequence;
25170 __Pyx_INCREF(__pyx_t_5);
25173 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_memoryviewslice_type)};
25174 __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));
25175 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25176 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 990, __pyx_L26_error)
25177 __Pyx_GOTREF(__pyx_t_4);
25179 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25188 __pyx_t_5 = __pyx_collections_abc_Sequence;
25189 __Pyx_INCREF(__pyx_t_5);
25192 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_array_type)};
25193 __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));
25194 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25195 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 991, __pyx_L26_error)
25196 __Pyx_GOTREF(__pyx_t_4);
25198 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25217 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
25218 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25219 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25220 goto __pyx_L31_try_end;
25222 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25223 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25233 __Pyx_ErrRestore(0,0,0);
25234 goto __pyx_L27_exception_handled;
25236 __pyx_L27_exception_handled:;
25237 __Pyx_XGIVEREF(__pyx_t_3);
25238 __Pyx_XGIVEREF(__pyx_t_2);
25239 __Pyx_XGIVEREF(__pyx_t_1);
25240 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
25241 __pyx_L31_try_end:;
25251 __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)
25252 __Pyx_GOTREF(__pyx_t_4);
25253 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)
25254 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25262 __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)
25263 __pyx_t_4 = __pyx_t_1;
25264 __Pyx_GOTREF(__pyx_t_4);
25265 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)
25266 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25275 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9csparsity_14PySparsityInfo_5findNonzeros, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PySparsityInfo_findNonzeros, NULL, __pyx_mstate_global->__pyx_n_u_csparsity, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 14, __pyx_L1_error)
25276 __Pyx_GOTREF(__pyx_t_4);
25277 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
25278 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
25280 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9csparsity_PySparsityInfo, __pyx_mstate_global->__pyx_n_u_findNonzeros, __pyx_t_4) < (0)) __PYX_ERR(0, 14, __pyx_L1_error)
25281 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25290 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9csparsity_14PySparsityInfo_7getOffsets_CSR, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PySparsityInfo_getOffsets_CSR, NULL, __pyx_mstate_global->__pyx_n_u_csparsity, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
25291 __Pyx_GOTREF(__pyx_t_4);
25292 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
25293 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
25295 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9csparsity_PySparsityInfo, __pyx_mstate_global->__pyx_n_u_getOffsets_CSR, __pyx_t_4) < (0)) __PYX_ERR(0, 65, __pyx_L1_error)
25296 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25305 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9csparsity_14PySparsityInfo_9getCSR, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PySparsityInfo_getCSR, NULL, __pyx_mstate_global->__pyx_n_u_csparsity, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
25306 __Pyx_GOTREF(__pyx_t_4);
25307 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
25308 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
25310 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9csparsity_PySparsityInfo, __pyx_mstate_global->__pyx_n_u_getCSR, __pyx_t_4) < (0)) __PYX_ERR(0, 128, __pyx_L1_error)
25311 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25318 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9csparsity_14PySparsityInfo_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PySparsityInfo___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_csparsity, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
25319 __Pyx_GOTREF(__pyx_t_4);
25320 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
25321 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
25323 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)
25324 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25332 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9csparsity_14PySparsityInfo_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PySparsityInfo___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_csparsity, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
25333 __Pyx_GOTREF(__pyx_t_4);
25334 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
25335 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
25337 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)
25338 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25345 __pyx_t_4 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
25346 __Pyx_GOTREF(__pyx_t_4);
25347 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)
25348 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25354 __Pyx_XDECREF(__pyx_t_4);
25355 __Pyx_XDECREF(__pyx_t_5);
25357 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
25358 __Pyx_AddTraceback(
"init csparsity", __pyx_clineno, __pyx_lineno, __pyx_filename);
25360 #if !CYTHON_USE_MODULE_STATE
25363 Py_DECREF(__pyx_m);
25364 if (pystate_addmodule_run) {
25365 PyObject *tp, *value, *tb;
25366 __Pyx_PyErr_FetchException(&tp, &value, &tb);
25367 __Pyx_State_RemoveModule(&__pyx_moduledef);
25368 __Pyx_PyErr_RestoreException(tp, value, tb);
25371 }
else if (!PyErr_Occurred()) {
25372 PyErr_SetString(PyExc_ImportError,
"init csparsity");
25375 __Pyx_RefNannyFinishContext();
25376 #if CYTHON_PEP489_MULTI_PHASE_INIT
25377 return (__pyx_m != NULL) ? 0 : -1;
25385static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
25386 int __pyx_lineno = 0;
25387 const char *__pyx_filename = NULL;
25388 int __pyx_clineno = 0;
25389 CYTHON_UNUSED_VAR(__pyx_mstate);
25390 __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_import);
if (!__pyx_builtin___import__) __PYX_ERR(1, 119, __pyx_L1_error)
25391 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 175, __pyx_L1_error)
25392 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 436, __pyx_L1_error)
25393 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 662, __pyx_L1_error)
25396 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
25397 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
25398 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
25399 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
25400 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
25401 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
25408static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
25409 __Pyx_RefNannyDeclarations
25410 int __pyx_lineno = 0;
25411 const char *__pyx_filename = NULL;
25412 int __pyx_clineno = 0;
25413 CYTHON_UNUSED_VAR(__pyx_mstate);
25414 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
25423 __pyx_mstate_global->__pyx_tuple[0] = PyTuple_New(1);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(1, 625, __pyx_L1_error)
25424 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
25425 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
25426 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_1);
25427 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);
25428 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
25437 __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)
25438 __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
25439 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
25448 __pyx_mstate_global->__pyx_tuple[1] = PyTuple_New(1);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 763, __pyx_L1_error)
25449 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
25450 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
25451 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
25452 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);
25453 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
25454 #if CYTHON_IMMORTAL_CONSTANTS
25456 PyObject **table = __pyx_mstate->__pyx_tuple;
25457 for (Py_ssize_t i=0; i<2; ++i) {
25458 #if PY_VERSION_HEX >= 0x030F0000
25459 PyUnstable_SetImmortal(table[i]);
25460 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
25461 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
25462 #if PY_VERSION_HEX < 0x030E0000
25463 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
25465 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
25468 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
25471 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
25472 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
25477 #if CYTHON_IMMORTAL_CONSTANTS
25479 PyObject **table = __pyx_mstate->__pyx_slice;
25480 for (Py_ssize_t i=0; i<1; ++i) {
25481 #if PY_VERSION_HEX >= 0x030F0000
25482 PyUnstable_SetImmortal(table[i]);
25483 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
25484 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
25485 #if PY_VERSION_HEX < 0x030E0000
25486 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
25488 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
25491 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
25494 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
25495 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
25500 __Pyx_RefNannyFinishContext();
25503 __Pyx_RefNannyFinishContext();
25508static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
25509 int __pyx_lineno = 0;
25510 const char *__pyx_filename = NULL;
25511 int __pyx_clineno = 0;
25512 CYTHON_UNUSED_VAR(__pyx_mstate);
25514 const struct {
const unsigned int length: 8; } str_length_index[] = {{6},{8},{1},{15},{1},{1},{1},{2},{15},{23},{25},{32},{20},{22},{1},{1},{37},{45},{22},{179},{8},{15},{7},{6},{2},{9},{50},{39},{34},{21},{30},{37},{5},{8},{14},{32},{34},{27},{21},{29},{8},{15},{20},{12},{9},{17},{8},{8},{12},{10},{8},{10},{8},{7},{14},{11},{10},{19},{14},{12},{10},{17},{13},{12},{12},{19},{8},{13},{3},{15},{7},{18},{4},{1},{18},{5},{9},{16},{22},{19},{25},{13},{15},{28},{42},{21},{6},{9},{5},{30},{12},{5},{6},{7},{15},{16},{6},{14},{23},{25},{16},{18},{2},{5},{30},{5},{8},{4},{7},{4},{17},{18},{26},{16},{33},{13},{14},{33},{4},{4},{25},{19},{2},{5},{3},{11},{12},{4},{3},{8},{6},{4},{10},{5},{4},{5},{4},{4},{11},{12},{6},{6},{6},{6},{1}};
25515 const struct {
const unsigned int length: 8; } bytes_length_index[] = {{0},{1},{1},{2},{1},{1},{9},{83},{129},{177}};
25516 #ifndef CYTHON_COMPRESS_STRINGS
25517 #define CYTHON_COMPRESS_STRINGS 90
25519 #if (CYTHON_COMPRESS_STRINGS) == 1
25520static const char cstring[] =
"x\332\205\025Mo\033U\220\240J\024DE\212*\304\t^$*\267\242]@\n_Q(5\216\203\202\250\323$Uot\365\366\355\254\375\232\267\357\255\337Gb\027\025z\3541\307\034}\314\321\307\034s\344\330\243\177\006?\201\231]\257\343\304m\2116\236y3\363\346{\3461\356\331\327\003f\222\247 \374\275[\267\274\005`\231\345\335\034\264\277}\373N\264\306\326\037@n\354\360\261\204Cf2\266.\214\366\262\033Lp\214\353\224\245\322\322\325\313d\251k\206\363V\246\220\316\t3c\337\312\277H\233I\336\373\271\305\2656\236q\347dW3o\230\005\236\3365Z\rY^:y\200Nn\351\003\256d\312r\223\302\035\006\203\002\357\242\252\206h\220\335Ff\254\267\\7\356\260.\252\252\205]\217\027\200\246\030\037H\307:\306\003\363=\314Mk\350{F3\244\245\240d\002\226{@k\344\037j\265$\244\331\303\366\303\273\253?\254\226\336Z\240L:\346B\"\024:\n\216\222\226\004\251<j\367\303\002\\\304\266264\201i@\2770\212\002\345\346/\370\036h\346\300\023\302\032e\314\334K\243c\274.u\2671M\223<\000\272\275\311\225\203\210\247i\214r \214R\3043\332E<\021\251t<Q\000\232~\273B\272\nK\265\301\2002\036\224gql!\r\002\342\230\245\241\324\250\215\276\213\001\036H\256\220+\244\226>\216u\310\213a\024\013c!\312\361\236\344\326\362!\313\270TU\0242/0\265\363b!\347\276\267 QXt3\270\257\204+\270u\322\017\243b8\010\245[$\304\2252\002\263\314*\375)\367<z\r\267*\030e\274\352\025\0275\367Z[[m\245d\341\244{8\334\233j\337\322\231\271x\212f\021\213\262\272q\274\300\307\344;\314\371\033%2l\312\216\321\317\300\232K\246\242.\370\326\336\356\"q;\313Hk\214\314=\350\007\320\002h\244\242\363\351\"+\003\374\337\300\326\212;0\360\273\220\305\361\264\374X\036,\0055\3109\202Z\245\207\234\010)\335\301\277,hA\260[\007\200\177U\332\t\313\271\324%4iP%O\363\274\202d>\216\261\022\261\350\201\330w!\257NS-\204R\363VX\320\205\024\373\250\241\255k\271\003O%\"\035\375\300U\255\266\356\254\205\214\317\0100\240\003ff\346\212\233s}\241\016q\354\301Q,\322Q\217\231\200S\005\330\347u_\304I\3102\234RWv\017wC-\244\211f\222.\341\016\204P\210\306\230\n\\\004\002\022.\366\205\t\332\317\032R8\3332*\344zZ\263\313""\347\030:\220t\026\251\311kH3\331]\203\233)\005\001.-\023\211\001T[\027\024\320\262\375\005]H\271\035\266\253\243kR\000\227x\277c\214\252}\201&\341\202d\007d\267\227\030;%j\201K\020\260H\345\342\002kq,\007\270\267\244\261\257W3\337\330\231\342]\207\353\022\247x\27243|\035~U&\341\252,\303\374\321\342\262\250Z\377b\257\367\270\333\220Y\026\034n\244-\375@\016 \335D\225H\336TaP\007\3262\270\344\313\245\205\214\016\271+1R\222\300\363v\360\2312\207\265\254L\321G\030H\375\2668h.\\\365\363\014\236\032\251\361}\240\307\201\036\005\275\261\275Y\265\3214i\025\201\"\230Q\026\264^\346\340\364\225\221\353\366\233\362Y\013lb\226j\213\347\007\262\206\t\371\237\2738\022\230\230\234\036\212\013Y\371\215\013\223H\\\r\310\230\246gF*\312\025\214\275e\312*\224vk\224\254\026\330\357\205),t\245\363\324\022\207\205\267\016\024IL\337\204r\271R\346p\370,N \024\250\242\250\026m\251\257FI\037\342Ax\\\t\2507\024\270\257\001\237\324\000n\260\266\375\350\317\047\317_,M\256|\360\362\313\243\235\027\315\311\325\017_n\034\275w\324\237\\]>z\367\350\326\361\312\361w\243\033\243G\047\237\216o\214\037\235^\237,\177<G\374\344\304\217W\307\375\311\362\215\243\215\343\245\232\367\343h\343\344\312\311\346\370\213qz\272\362\242\371\357\352;\357_C\245\327\216w\216\371\344\263\317\313\357\346\350\217\361\n\201x\334$\360d\374\r\202W7\277\035\357\324\"\213\037\362\327NWj\264uV]i\236]/\341\366?\3759\301\222K\047t\340\376R\345\301G\307\375\321\322\204\255\224_c\364\034M#\370{\314\t\374\205\226Y\343U\343{\214g*\262\370!\177\375\264Y\243\355\263\352\n\331\"\270\363jgwN\262d\327\306\016Nv\316mN\255 \374\351\264RAq\021\274\177\266\364\037\021\252\350\330";
25521 PyObject *data = __Pyx_DecompressString(cstring, 1243, 1);
25522 #define __Pyx_DecompressString_LZSS_UNUSED
25523 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
25524 const char*
const bytes = __Pyx_PyBytes_AsString(data);
25525 #if !CYTHON_ASSUME_SAFE_MACROS
25526 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
25528 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90
25529static const char cstring[] =
"\377 at 0x o\377bject>((\377tree fra\377gment)),\377.: <Memo\377ryView o\377f <conti\377guous an\237d dir7\001\007\ri\375n\021\005stride\275d\"\010 or \004\031>\371<(\tA\006>?Can\377not assi\377gn to re\377ad-only \365m\240\002v\242\000Inva\377lid mode\237, exp\327\000|\000\047\373c\047t\001\047fort\177ran\047, gH\000\276%\005shape\222\000 \377axis Not\357e th\231 Cyt\357hon \021\000del\177iberatek\000\336\320\001cter!\001n \177PEP-484\212\"\373re\306!s sub\333cl\246\000es\261!bu\357ilti\260\000ype\377s. If yoOu ne\224 \303\000p\316\000\376%\tthen se\335t\200\000e \047\357\002at\377ion_typi\267ng\047\355$iv\242\000o\377 False.a\367dd_\231 ecol\371l\310@+\000s.abc\377disablee\275n\002\001gcis\004\003d\377no defau\377lt __red\377uce__ du\336M\002non-\262@vi\373al\033\000cinit\377__numpy.\177_core.m5\000\377iarray fwail\300\003imp\330 \276\033\tumath\021\016p\375r\333 us/csp\377arsity.p\347yxu\234\002\317Aall\353oc\343 Z\003dat\303a.\013\020\253C\375a\332cs.\377ASCIIEll\377ipsisPyS^W\004Info\000\013.\351\006\315c\331B__\017\016\372 st\372\350@_\013\024findN\277onzero\\\014.?getCSRc\014\022\000\327OffR\001_\032\000Se\277quence\317\205\001.\364\324\205\007\204\001x\211\000Dict\377_NextRef\263__\370D\234@__\315b_y_\001\005h\000item\r\001yd0\001\027\000func\035\001\340\203\000\273\003+\000\223C3\001mai\275n\003\002odulM\002n\233am\002\003ewT\001\207@_\177checksuT\000\300\n\001?\004\025\001\373`\242`\037\001unopick?\000En \005\363vt\344a\230\001qual\260O\005\322e\341.\354fex\314\001s\207et_\203\005\363&\346\000\367.___test\321\001s\207\204\001\377outineab\375c\256e_buffe\367ras\231\204\002asyn\177cio.cor$\003\377sbaseccl\3722\000_\210 trace\377backcoun\375t\210\204\006csrCol\347umn\255D\000\r_eN\227ebN\004\017b\000\020#\006R\377owIndece\273sd\304\"is_\360\211\003e\353le\351\211\001B\200\000dar\233yE\t\003sA\333\205\001\r\014L\265o\346\000E#\nie\035\nN\177eighbor8\004\377ncodeenu}m\264\210\002error\325`\237erior1\023\315\204\tf\377lagsform\373at\256\211\004freeG\237lobal""\202B\003\tr\347ial\365\204\003\336\204\013has\377Diffusio\377nInMixedyFP\000\024\000Flux\355\005_Condi\337\210\001s-\000\305N\253\001i\320@\036\001=\000Ou\337tflow\231%id=i\305 xint\255\030\224\205\001\375s\000\002izejoi\317nmem\231\213\001\221\213\001nDCOF\301c\364$\013\003\276\001_\n\005\334\324.\n\rs_g\204\"nEyxq\024\031\005Freej\005\341n\004\006\254!\216 \035\034ame\317ndim\245\213\001\211*Ja?cobian\276\213\001\230$z\n\006p\245\212\002objo\355\207\002\370\254\205\002\003\005\242Apackp\377opregist\376\217awptrsel\350\233\210\001\215\213\004\211\215\002s\267 sta\373rt#\000pstop\360\303\216\003\374\205\002\003\005\362Astru\357ctunT\001upd\377atevalue\377sx:OT{^}\377\200\001\330\004\n\210+\220\377Q\200A\330\010\014\210D\377\220\007\220q\330\010\020\220\377\002\220(\230!\2306\240\377\024\240T\250\030\260\024\260\277T\270\021\330\020\022\n\010\026\377\250t\2604\260q\330\020\337\024\220D\230\001\024\0059\240\377D\250\004\250F\260$\260\377d\270!\200A\3604\000\373\t\rR\000\r\230Q\230a\367\330\036\037\000\000\330\036%\240w]\260!\003\001_\260A\n\001\367^\2601\022\000\320%5\260\345Q\033\005\037\000\006,\006\320%:{\270!:\003\320%C\300-\003wA\300\0216\002O\310q\036\010\330\031\002h\001~\000@\001|\003\017\230\277q\240\001\330 !\000\000\330\317 \047\240}x\000\004\000\177\260\365a\n\001~w\000 \047\320\047\2117\315\000\034\004!$\005\000\006\035\000<\373\270A:\003\320\047E\300Q\346E\000\320\047\206\0017\001Q\320QqRV\006\030\004e\005v\250Qj\007\214_\004k\000=\270=\003\324\001z\001@\003\300\001";
25530 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 1653, 2544);
25531 #define __Pyx_DecompressString_UNUSED
25532 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
25533 const char*
const bytes = __Pyx_PyBytes_AsString(data);
25534 #if !CYTHON_ASSUME_SAFE_MACROS
25535 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
25538static 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/csparsity.pyxunable to allocate array data.unable to allocate shape and strides.ASCIIEllipsisPySparsityInfoPySparsityInfo.__reduce_cython__PySparsityInfo.__setstate_cython__PySparsityInfo.findNonzerosPySparsityInfo.getCSRPySparsityInfo.getOffsets_CSRSequenceView.MemoryView__Pyx_PyDict_NextRef__annotate____class____class_getitem____dict____func____getstate____import____main____module____name____new____pyx_checksum__pyx_state__pyx_type__pyx_unpickle_Enum__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex____set_name____setstate____setstate_cython____test___is_coroutineabcallocate_bufferasarrayasyncio.coroutinesbaseccline_in_tracebackcountcsparsitycsrColumnOffsetscsrColumnOffsets_eNebNcsrColumnOffsets_ebcsrColumnOffsets_eb_eNebNcsrRowIndecesdtype_is_objectelementBoundaryElementsArrayelementBoundaryLocalElementBoundariesArrayelementNeighborsArrayencodeenumerateerrorexteriorElementBoundariesArrayfindNonzerosflagsformatfortranfreeGlobal_testfreeGlobal_trialgetCSRgetOffsets_CSRhasDiffusionInMixedFormhasFluxBoundaryConditionshasNumericalFluxhasOutflowBoundaryidindexinteriorElementBoundariesArrayitemsitemsizejoinmemviewmodenDOF_test_elementnDOF_trial_elementnElementBoundaries_elementnElements_globalnExteriorElementBoundaries_globalnFreeDOF_testnFreeDOF_trialnInteriorElementBoundaries_globalnamendimneedNumericalFluxJacobia""nneedOutflowJacobiannpnumpyobjoffset_testoffset_trialpackpopregisterrowptrselfsetdefaultshapesizestartstepstopstride_teststride_trialstructunpackupdatevaluesx:OT{^}\200\001\330\004\n\210+\220Q\200A\330\010\014\210D\220\007\220q\330\010\020\220\002\220(\230!\2306\240\024\240T\250\030\260\024\260T\270\021\330\020\022\220(\230!\2306\240\024\240T\250\026\250t\2604\260q\330\020\024\220D\230\001\330\020\022\220(\230!\2309\240D\250\004\250F\260$\260d\270!\200A\3604\000\t\r\210D\220\r\230Q\230a\330\036\037\330\036\037\330\036%\240]\260!\330\036%\240_\260A\330\036%\240^\2601\330\036%\320%5\260Q\330\036\037\330\036\037\330\036\037\330\036\037\330\036\037\330\036\037\330\036\037\330\036\037\330\036%\320%:\270!\330\036\037\330\036%\320%C\3001\330\036%\320%A\300\021\330\036%\320%O\310q\330\036\037\330\036\037\330\036%\320%C\3001\330\036\037\330\036\037\200A\360@\001\000\t\r\210D\220\017\230q\240\001\330 !\330 !\330 \047\240}\260A\330 \047\240\177\260a\330 \047\240~\260Q\330 \047\320\0477\260q\330 !\330 !\330 !\330 !\330 !\330 !\330 !\330 !\330 \047\320\047<\270A\330 !\330 \047\320\047E\300Q\330 \047\320\047C\3001\330 \047\320\047Q\320QR\330 !\330 !\330 \047\320\047E\300Q\330 !\330 !\330 \047\240v\250Q\330 \047\240}\260A\330 \047\320\0477\260q\330 \047\320\047=\270Q\330 \047\320\047:\270!\330 \047\320\047@\300\001";
25539 PyObject *data = NULL;
25540 #define __Pyx_DecompressString_UNUSED
25541 #define __Pyx_DecompressString_LZSS_UNUSED
25543 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
25544 Py_ssize_t pos = 0;
25545 for (
int i = 0; i < 145; i++) {
25546 Py_ssize_t bytes_length = str_length_index[i].length;
25547 PyObject *
string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
25548 if (likely(
string) && i >= 32) PyUnicode_InternInPlace(&
string);
25549 if (unlikely(!
string)) {
25551 __PYX_ERR(0, 1, __pyx_L1_error)
25553 stringtab[i] = string;
25554 pos += bytes_length;
25556 for (
int i = 145; i < 155; i++) {
25557 Py_ssize_t bytes_length = bytes_length_index[i-145].length;
25558 PyObject *
string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
25559 stringtab[i] = string;
25560 pos += bytes_length;
25561 if (unlikely(!
string)) {
25563 __PYX_ERR(0, 1, __pyx_L1_error)
25567 for (Py_ssize_t i = 0; i < 155; i++) {
25568 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
25569 __PYX_ERR(0, 1, __pyx_L1_error)
25572 #if CYTHON_IMMORTAL_CONSTANTS
25574 PyObject **table = stringtab + 145;
25575 for (Py_ssize_t i=0; i<10; ++i) {
25576 #if PY_VERSION_HEX >= 0x030F0000
25577 PyUnstable_SetImmortal(table[i]);
25578 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
25579 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
25580 #if PY_VERSION_HEX < 0x030E0000
25581 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
25583 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
25586 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
25589 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
25590 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
25597 PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
25598 int8_t
const cint_constants_1[] = {0,-1};
25599 int32_t
const cint_constants_4[] = {136983863L};
25600 for (
int i = 0; i < 3; i++) {
25601 numbertab[i] = PyLong_FromLong((i < 2 ? cint_constants_1[i - 0] : cint_constants_4[i - 2]));
25602 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
25605 #if CYTHON_IMMORTAL_CONSTANTS
25607 PyObject **table = __pyx_mstate->__pyx_number_tab;
25608 for (Py_ssize_t i=0; i<3; ++i) {
25609 #if PY_VERSION_HEX >= 0x030F0000
25610 PyUnstable_SetImmortal(table[i]);
25611 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
25612 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
25613 #if PY_VERSION_HEX < 0x030E0000
25614 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
25616 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
25619 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
25622 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
25623 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
25637 unsigned int argcount : 6;
25638 unsigned int num_posonly_args : 1;
25639 unsigned int num_kwonly_args : 1;
25640 unsigned int nlocals : 6;
25641 unsigned int flags : 10;
25642 unsigned int first_line : 8;
25643} __Pyx_PyCode_New_function_description;
25648static PyObject* __Pyx_PyCode_New(
25649 const __Pyx_PyCode_New_function_description descr,
25650 PyObject *
const *varnames,
25651 PyObject *filename,
25652 PyObject *funcname,
25653 PyObject *line_table,
25654 PyObject *tuple_dedup_map
25658static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
25659 PyObject* tuple_dedup_map = PyDict_New();
25660 if (unlikely(!tuple_dedup_map))
return -1;
25662 const __Pyx_PyCode_New_function_description descr = {26, 0, 0, 26, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 14};
25663 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nElements_global, __pyx_mstate->__pyx_n_u_nDOF_test_element, __pyx_mstate->__pyx_n_u_nDOF_trial_element, __pyx_mstate->__pyx_n_u_nFreeDOF_test, __pyx_mstate->__pyx_n_u_freeGlobal_test, __pyx_mstate->__pyx_n_u_nFreeDOF_trial, __pyx_mstate->__pyx_n_u_freeGlobal_trial, __pyx_mstate->__pyx_n_u_offset_test, __pyx_mstate->__pyx_n_u_stride_test, __pyx_mstate->__pyx_n_u_offset_trial, __pyx_mstate->__pyx_n_u_stride_trial, __pyx_mstate->__pyx_n_u_hasNumericalFlux, __pyx_mstate->__pyx_n_u_hasDiffusionInMixedForm, __pyx_mstate->__pyx_n_u_needNumericalFluxJacobian, __pyx_mstate->__pyx_n_u_nElementBoundaries_element, __pyx_mstate->__pyx_n_u_elementNeighborsArray, __pyx_mstate->__pyx_n_u_nInteriorElementBoundaries_globa, __pyx_mstate->__pyx_n_u_interiorElementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryElementsArray, __pyx_mstate->__pyx_n_u_elementBoundaryLocalElementBound, __pyx_mstate->__pyx_n_u_hasFluxBoundaryConditions, __pyx_mstate->__pyx_n_u_nExteriorElementBoundaries_globa, __pyx_mstate->__pyx_n_u_exteriorElementBoundariesArray, __pyx_mstate->__pyx_n_u_hasOutflowBoundary, __pyx_mstate->__pyx_n_u_needOutflowJacobian};
25664 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csparsity_pyx, __pyx_mstate->__pyx_n_u_findNonzeros, __pyx_mstate->__pyx_kp_b_iso88591_A4_D_Qa__A_1_5Q_C1_A_Oq_C1, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0]))
goto bad;
25667 const __Pyx_PyCode_New_function_description descr = {32, 0, 0, 32, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 65};
25668 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nElements_global, __pyx_mstate->__pyx_n_u_nDOF_test_element, __pyx_mstate->__pyx_n_u_nDOF_trial_element, __pyx_mstate->__pyx_n_u_nFreeDOF_test, __pyx_mstate->__pyx_n_u_freeGlobal_test, __pyx_mstate->__pyx_n_u_nFreeDOF_trial, __pyx_mstate->__pyx_n_u_freeGlobal_trial, __pyx_mstate->__pyx_n_u_offset_test, __pyx_mstate->__pyx_n_u_stride_test, __pyx_mstate->__pyx_n_u_offset_trial, __pyx_mstate->__pyx_n_u_stride_trial, __pyx_mstate->__pyx_n_u_hasNumericalFlux, __pyx_mstate->__pyx_n_u_hasDiffusionInMixedForm, __pyx_mstate->__pyx_n_u_needNumericalFluxJacobian, __pyx_mstate->__pyx_n_u_nElementBoundaries_element, __pyx_mstate->__pyx_n_u_elementNeighborsArray, __pyx_mstate->__pyx_n_u_nInteriorElementBoundaries_globa, __pyx_mstate->__pyx_n_u_interiorElementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryElementsArray, __pyx_mstate->__pyx_n_u_elementBoundaryLocalElementBound, __pyx_mstate->__pyx_n_u_hasFluxBoundaryConditions, __pyx_mstate->__pyx_n_u_nExteriorElementBoundaries_globa, __pyx_mstate->__pyx_n_u_exteriorElementBoundariesArray, __pyx_mstate->__pyx_n_u_hasOutflowBoundary, __pyx_mstate->__pyx_n_u_needOutflowJacobian, __pyx_mstate->__pyx_n_u_rowptr, __pyx_mstate->__pyx_n_u_csrRowIndeces, __pyx_mstate->__pyx_n_u_csrColumnOffsets, __pyx_mstate->__pyx_n_u_csrColumnOffsets_eNebN, __pyx_mstate->__pyx_n_u_csrColumnOffsets_eb, __pyx_mstate->__pyx_n_u_csrColumnOffsets_eb_eNebN};
25669 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csparsity_pyx, __pyx_mstate->__pyx_n_u_getOffsets_CSR, __pyx_mstate->__pyx_kp_b_iso88591_A_D_q_A_a_Q_7q_A_EQ_C1_QQR_EQ_vQ, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1]))
goto bad;
25672 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 128};
25673 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self};
25674 __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csparsity_pyx, __pyx_mstate->__pyx_n_u_getCSR, __pyx_mstate->__pyx_kp_b_iso88591_A_D_q_6_T_T_6_T_t4q_D_9D_F_d, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2]))
goto bad;
25677 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
25678 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self};
25679 __pyx_mstate_global->__pyx_codeobj_tab[3] = __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[3]))
goto bad;
25682 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
25683 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
25684 __pyx_mstate_global->__pyx_codeobj_tab[4] = __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[4]))
goto bad;
25686 Py_DECREF(tuple_dedup_map);
25689 Py_DECREF(tuple_dedup_map);
25694static int __Pyx_InitGlobals(
void) {
25695 int __pyx_lineno = 0;
25696 const char *__pyx_filename = NULL;
25697 int __pyx_clineno = 0;
25699 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0));
else
25701 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25704 #if CYTHON_COMPILING_IN_LIMITED_API
25706 PyObject *builtins = PyEval_GetBuiltins();
25707 if (likely(builtins)) {
25708 PyObject *type_name = PyUnicode_FromStringAndSize(
"frozendict",
sizeof(
"frozendict")-1);
25709 if (likely(type_name)) {
25710 PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
25711 Py_DECREF(type_name);
25712 if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
25714 frozendict_type = (PyObject*) &PyDict_Type;
25715 Py_INCREF(frozendict_type);
25717 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
25723 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25726 if (likely(__Pyx_init_assertions_enabled() == 0));
else
25728 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25737 #ifdef NPY_FEATURE_VERSION
25738 #ifndef NO_IMPORT_ARRAY
25739 if (unlikely(_import_array() == -1)) {
25740 PyErr_SetString(PyExc_ImportError,
"numpy.core.multiarray failed to import "
25741 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
25742 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
25747 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25750 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0));
else
25752 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25755 #if CYTHON_COMPILING_IN_LIMITED_API
25757 PyObject *typesModule=NULL;
25758 typesModule = PyImport_ImportModule(
"types");
25760 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule,
"MethodType");
25761 Py_DECREF(typesModule);
25766 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25774static int __Pyx_InitAfterSharedUtility(
void) {
25775 int __pyx_lineno = 0;
25776 const char *__pyx_filename = NULL;
25777 int __pyx_clineno = 0;
25779 if (likely(__pyx_CyFunction_init(__pyx_m) == 0));
else
25781 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25792#pragma warning( push )
25797#pragma warning( disable : 4127 )
25807static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
25808 PyObject *m = NULL, *p = NULL;
25810 m = PyImport_ImportModule(modname);
25812 p = PyObject_GetAttrString(m,
"RefNannyAPI");
25814 r = PyLong_AsVoidPtr(p);
25818 return (__Pyx_RefNannyAPIStruct *)
r;
25823#if CYTHON_COMPILING_IN_CPYTHON
25824static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
25827 for (i = 0; i < length; i++) {
25828 v = dest[i] = src[i];
25835#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
25836CYTHON_UNUSED
static PyObject *
25837__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n) {
25839 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
25841 PyObject *res = PyTuple_New(
n);
25842 if (unlikely(res == NULL))
return NULL;
25843 #if CYTHON_COMPILING_IN_CPYTHON
25844 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item,
n);
25847 for (i = 0; i <
n; i++) {
25849 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
25860#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
25861#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
25862static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
25863 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
25864 int result = PyUnicode_Equal(s1, s2);
25865 #if !CYTHON_COMPILING_IN_CPYTHON
25866 if (unlikely(result == -1))
return -1;
25868 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
25870 int result = PyUnicode_Compare(s1, s2);
25871 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
25872 if (result == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
25880static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop) {
25881 CYTHON_UNUSED_VAR(pyop);
25882 if (unlikely(op1 == Py_None)) {
25883 if (op2 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
25885 if (unlikely(op2 == Py_None)) {
25886 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
25889 if (likely(op1 != Py_None)) {
25890 if (op1 == op2)
goto __pyx_return_true;
25891 if (likely(op2 != Py_None)) {
25892 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
25894 goto __pyx_richcmp;
25897 if ((0))
goto __pyx_richcmp;
25898 if ((0))
goto __pyx_return_true;
25899 if ((0))
goto __pyx_return_false;
25901 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
25909#if CYTHON_VECTORCALL
25910static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s)
25912 Py_ssize_t i,
n = __Pyx_PyTuple_GET_SIZE(kwnames);
25913 #if !CYTHON_ASSUME_SAFE_SIZE
25914 if (unlikely(
n == -1))
return NULL;
25916 for (i = 0; i <
n; i++)
25918 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
25919 #if !CYTHON_ASSUME_SAFE_MACROS
25920 if (unlikely(!namei))
return NULL;
25922 if (
s == namei)
return kwvalues[i];
25924 for (i = 0; i <
n; i++)
25926 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
25927 #if !CYTHON_ASSUME_SAFE_MACROS
25928 if (unlikely(!namei))
return NULL;
25930 int eq = __Pyx_PyUnicode_Equals(
s, namei);
25931 if (unlikely(eq != 0)) {
25932 if (unlikely(eq < 0))
return NULL;
25933 return kwvalues[i];
25938#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
25939CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues) {
25940 Py_ssize_t i, nkwargs;
25942#if !CYTHON_ASSUME_SAFE_SIZE
25943 nkwargs = PyTuple_Size(kwnames);
25944 if (unlikely(nkwargs < 0))
return NULL;
25946 nkwargs = PyTuple_GET_SIZE(kwnames);
25948 dict = PyDict_New();
25949 if (unlikely(!dict))
25951 for (i=0; i<nkwargs; i++) {
25952#if !CYTHON_ASSUME_SAFE_MACROS
25953 PyObject *key = PyTuple_GetItem(kwnames, i);
25954 if (!key)
goto bad;
25956 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
25958 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
25970#if CYTHON_COMPILING_IN_CPYTHON
25971static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25973 ternaryfunc call = Py_TYPE(func)->tp_call;
25974 if (unlikely(!call))
25975 return PyObject_Call(func, arg, kw);
25976 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
25978 result = (*call)(func, arg, kw);
25979 Py_LeaveRecursiveCall();
25980 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25983 "NULL result without error in PyObject_Call");
25990#if CYTHON_COMPILING_IN_CPYTHON
25991static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
25992 PyObject *self, *result;
25994 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
25995 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
25996 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
25998 result = cfunc(self, arg);
25999 Py_LeaveRecursiveCall();
26000 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
26003 "NULL result without error in PyObject_Call");
26010#if CYTHON_COMPILING_IN_LIMITED_API
26011static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject *
const*args,
size_t nargs, PyObject *kwargs) {
26012 PyObject *argstuple;
26013 PyObject *result = 0;
26015 argstuple = PyTuple_New((Py_ssize_t)nargs);
26016 if (unlikely(!argstuple))
return NULL;
26017 for (i = 0; i < nargs; i++) {
26018 Py_INCREF(args[i]);
26019 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0))
goto bad;
26021 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
26023 Py_DECREF(argstuple);
26027#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
26028 #if CYTHON_COMPILING_IN_CPYTHON
26029static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
26030 PyTypeObject *tp = Py_TYPE(callable);
26031 #if defined(__Pyx_CyFunction_USED)
26032 if (__Pyx_CyFunction_CheckExact(callable)) {
26033 return __Pyx_CyFunction_func_vectorcall(callable);
26036 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
26039 assert(PyCallable_Check(callable));
26040 Py_ssize_t offset = tp->tp_vectorcall_offset;
26041 assert(offset > 0);
26042 vectorcallfunc ptr;
26043 memcpy(&ptr, (
char *) callable + offset,
sizeof(ptr));
26047 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
26050static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwargs) {
26051 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
26052#if CYTHON_COMPILING_IN_CPYTHON
26053 if (nargs == 0 && kwargs == NULL) {
26054 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
26055 return __Pyx_PyObject_CallMethO(func, NULL);
26057 else if (nargs == 1 && kwargs == NULL) {
26058 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
26059 return __Pyx_PyObject_CallMethO(func, args[0]);
26062 if (kwargs == NULL) {
26063 #if CYTHON_VECTORCALL
26064 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
26065 return PyObject_Vectorcall(func, args, nargsf, NULL);
26067 vectorcallfunc
f = __Pyx_PyVectorcall_Function(func);
26069 return f(func, args, nargsf, NULL);
26075 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
26077 #if CYTHON_COMPILING_IN_LIMITED_API
26078 return __Pyx_PyObject_FastCall_fallback(func, args, (
size_t)nargs, kwargs);
26079 #elif CYTHON_COMPILING_IN_PYPY
26080 return PyObject_VectorcallDict(func, args, (
size_t) nargs, kwargs);
26082 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
26087static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
26088 PyObject *args[2] = {NULL, arg};
26089 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
26093static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
26094 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
26102#if CYTHON_COMPILING_IN_CPYTHON
26103static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26105 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
26109 return b == &PyBaseObject_Type;
26111static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26113 if (a == b)
return 1;
26117 n = PyTuple_GET_SIZE(mro);
26118 for (i = 0; i <
n; i++) {
26119 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26124 return __Pyx_InBases(a, b);
26126static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
26128 if (cls == a || cls == b)
return 1;
26132 n = PyTuple_GET_SIZE(mro);
26133 for (i = 0; i <
n; i++) {
26134 PyObject *base = PyTuple_GET_ITEM(mro, i);
26135 if (base == (PyObject *)a || base == (PyObject *)b)
26140 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
26145#if CYTHON_USE_TYPE_SLOTS
26146static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
26147 PyTypeObject* tp = Py_TYPE(obj);
26148 if (likely(tp->tp_getattro))
26149 return tp->tp_getattro(obj, attr_name);
26150 return PyObject_GetAttr(obj, attr_name);
26155#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
26156static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
26158 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
26159 if (unlikely(!selfless_args))
return NULL;
26160 result = PyObject_Call(method, selfless_args, kwargs);
26161 Py_DECREF(selfless_args);
26165static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames) {
26166 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (
size_t) nargs-1 : 0, kwnames);
26169static PyMethodDef __Pyx_UnboundCMethod_Def = {
26170 "CythonUnboundCMethod",
26171 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
26172#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
26173 METH_VARARGS | METH_KEYWORDS,
26175 METH_FASTCALL | METH_KEYWORDS,
26179static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
26180 PyObject *method, *result=NULL;
26181 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
26182 if (unlikely(!method))
26185#if CYTHON_COMPILING_IN_CPYTHON
26186 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
26188 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
26189 target->func = descr->d_method->ml_meth;
26190 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
26193#if CYTHON_COMPILING_IN_PYPY
26195 if (PyCFunction_Check(method))
26200#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
26201 self = PyObject_GetAttrString(method,
"__self__");
26202 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
26206 self = PyCFunction_GET_SELF(method);
26208 self_found = (self && self != Py_None);
26209#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
26213 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
26214 if (unlikely(!unbound_method))
return -1;
26216 result = unbound_method;
26219#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
26220 if (unlikely(target->method)) {
26224 target->method = result;
26229#if CYTHON_COMPILING_IN_CPYTHON
26230static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
26231 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
26232 if (likely(was_initialized == 2 && cfunc->func)) {
26233 if (likely(cfunc->flag == METH_NOARGS))
26234 return __Pyx_CallCFunction(cfunc, self, NULL);
26235 if (likely(cfunc->flag == METH_FASTCALL))
26236 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
26237 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
26238 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
26239 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
26240 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
26241 if (cfunc->flag == METH_VARARGS)
26242 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
26243 return __Pyx__CallUnboundCMethod0(cfunc, self);
26245#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
26246 else if (unlikely(was_initialized == 1)) {
26247 __Pyx_CachedCFunction tmp_cfunc = {
26252 tmp_cfunc.type = cfunc->type;
26253 tmp_cfunc.method_name = cfunc->method_name;
26254 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
26257 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
26258 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
26262static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
26264 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
26265 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
26270static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
26271 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
26275static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
26276 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
26280#if CYTHON_AVOID_BORROWED_REFS
26281static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
26282 PyObject *next = NULL;
26285 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
26286 if (unlikely(!dictview))
goto bad;
26287 *ppos = PyObject_GetIter(dictview);
26288 Py_DECREF(dictview);
26290 *ppos = PyObject_GetIter(p);
26292 if (unlikely(!*ppos))
goto bad;
26294 next = PyIter_Next(*ppos);
26296 if (PyErr_Occurred())
goto bad;
26299 if (pkey && pvalue) {
26300 *pkey = __Pyx_PySequence_ITEM(next, 0);
26301 if (unlikely(*pkey))
goto bad;
26302 *pvalue = __Pyx_PySequence_ITEM(next, 1);
26303 if (unlikely(*pvalue))
goto bad;
26314#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
26315 PyErr_FormatUnraisable(
"Exception ignored in __Pyx_PyDict_NextRef");
26317 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
26319 if (pkey) *pkey = NULL;
26320 if (pvalue) *pvalue = NULL;
26324static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
26325 int result = PyDict_Next(p, ppos, pkey, pvalue);
26326 if (likely(result == 1)) {
26327 if (pkey) Py_INCREF(*pkey);
26328 if (pvalue) Py_INCREF(*pvalue);
26335static void __Pyx_RaiseDoubleKeywordsError(
26336 const char* func_name,
26339 PyErr_Format(PyExc_TypeError,
26340 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
26344#if CYTHON_COMPILING_IN_CPYTHON
26345static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
26346 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
26347 if (likely(was_initialized == 2 && cfunc->func)) {
26348 PyObject *args[2] = {arg1, arg2};
26349 if (cfunc->flag == METH_FASTCALL) {
26350 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
26352 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
26353 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
26355#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
26356 else if (unlikely(was_initialized == 1)) {
26357 __Pyx_CachedCFunction tmp_cfunc = {
26362 tmp_cfunc.type = cfunc->type;
26363 tmp_cfunc.method_name = cfunc->method_name;
26364 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
26367 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
26368 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
26372static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
26373 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
26374#if CYTHON_COMPILING_IN_CPYTHON
26375 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
26376 PyObject *result = NULL;
26377 PyObject *args = PyTuple_New(2);
26378 if (unlikely(!args))
return NULL;
26380 PyTuple_SET_ITEM(args, 0, arg1);
26382 PyTuple_SET_ITEM(args, 1, arg2);
26383 if (cfunc->flag & METH_KEYWORDS)
26384 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
26386 result = __Pyx_CallCFunction(cfunc, self, args);
26392 PyObject *args[4] = {NULL, self, arg1, arg2};
26393 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
26398static int __Pyx_ValidateDuplicatePosArgs(
26400 PyObject **
const argnames[],
26401 PyObject **
const *first_kw_arg,
26402 const char* function_name)
26404 PyObject **
const *name = argnames;
26405 while (name != first_kw_arg) {
26406 PyObject *key = **name;
26407 int found = PyDict_Contains(kwds, key);
26408 if (unlikely(found)) {
26409 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
26418#if CYTHON_USE_UNICODE_INTERNALS
26419static CYTHON_INLINE
int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
26421 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
26422 if (len != PyUnicode_GET_LENGTH(s2))
return 0;
26423 kind = PyUnicode_KIND(s1);
26424 if (kind != PyUnicode_KIND(s2))
return 0;
26425 const void *data1 = PyUnicode_DATA(s1);
26426 const void *data2 = PyUnicode_DATA(s2);
26427 return (memcmp(data1, data2, (
size_t) len * (
size_t) kind) == 0);
26430static int __Pyx_MatchKeywordArg_str(
26432 PyObject **
const argnames[],
26433 PyObject **
const *first_kw_arg,
26434 size_t *index_found,
26435 const char *function_name)
26437 PyObject **
const *name;
26438 #if CYTHON_USE_UNICODE_INTERNALS
26439 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
26440 if (unlikely(key_hash == -1)) {
26441 key_hash = PyObject_Hash(key);
26442 if (unlikely(key_hash == -1))
26446 name = first_kw_arg;
26448 PyObject *name_str = **name;
26449 #if CYTHON_USE_UNICODE_INTERNALS
26450 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
26451 *index_found = (size_t) (name - argnames);
26455 #if CYTHON_ASSUME_SAFE_SIZE
26456 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
26459 int cmp = PyUnicode_Compare(name_str, key);
26460 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
26462 *index_found = (size_t) (name - argnames);
26470 while (name != first_kw_arg) {
26471 PyObject *name_str = **name;
26472 #if CYTHON_USE_UNICODE_INTERNALS
26473 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
26474 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
26475 goto arg_passed_twice;
26478 #if CYTHON_ASSUME_SAFE_SIZE
26479 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
26482 if (unlikely(name_str == key))
goto arg_passed_twice;
26483 int cmp = PyUnicode_Compare(name_str, key);
26484 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
26485 if (cmp == 0)
goto arg_passed_twice;
26492 __Pyx_RaiseDoubleKeywordsError(function_name, key);
26497static int __Pyx_MatchKeywordArg_nostr(
26499 PyObject **
const argnames[],
26500 PyObject **
const *first_kw_arg,
26501 size_t *index_found,
26502 const char *function_name)
26504 PyObject **
const *name;
26505 if (unlikely(!PyUnicode_Check(key)))
goto invalid_keyword_type;
26506 name = first_kw_arg;
26508 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
26510 *index_found = (size_t) (name - argnames);
26513 if (unlikely(cmp == -1))
goto bad;
26517 while (name != first_kw_arg) {
26518 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
26519 if (unlikely(cmp != 0)) {
26520 if (cmp == 1)
goto arg_passed_twice;
26527 __Pyx_RaiseDoubleKeywordsError(function_name, key);
26529invalid_keyword_type:
26530 PyErr_Format(PyExc_TypeError,
26531 "%.200s() keywords must be strings", function_name);
26536static CYTHON_INLINE
int __Pyx_MatchKeywordArg(
26538 PyObject **
const argnames[],
26539 PyObject **
const *first_kw_arg,
26540 size_t *index_found,
26541 const char *function_name)
26543 return likely(PyUnicode_CheckExact(key)) ?
26544 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
26545 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
26547static void __Pyx_RejectUnknownKeyword(
26549 PyObject **
const argnames[],
26550 PyObject **
const *first_kw_arg,
26551 const char *function_name)
26553 #if CYTHON_AVOID_BORROWED_REFS
26554 PyObject *pos = NULL;
26556 Py_ssize_t pos = 0;
26558 PyObject *key = NULL;
26559 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
26560 #if CYTHON_AVOID_BORROWED_REFS
26561 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
26563 (void) __Pyx_PyDict_NextRef;
26564 while (PyDict_Next(kwds, &pos, &key, NULL))
26567 PyObject**
const *name = first_kw_arg;
26568 while (*name && (**name != key)) name++;
26570 size_t index_found = 0;
26571 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
26574 PyErr_Format(PyExc_TypeError,
26575 "%s() got an unexpected keyword argument '%U'",
26576 function_name, key);
26578 #if CYTHON_AVOID_BORROWED_REFS
26584 #if CYTHON_AVOID_BORROWED_REFS
26588 __Pyx_END_CRITICAL_SECTION();
26589 #if CYTHON_AVOID_BORROWED_REFS
26592 assert(PyErr_Occurred());
26594static int __Pyx_ParseKeywordDict(
26596 PyObject **
const argnames[],
26597 PyObject *values[],
26598 Py_ssize_t num_pos_args,
26599 Py_ssize_t num_kwargs,
26600 const char* function_name,
26601 int ignore_unknown_kwargs)
26603 PyObject**
const *name;
26604 PyObject**
const *first_kw_arg = argnames + num_pos_args;
26605 Py_ssize_t extracted = 0;
26606#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
26607 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
26609 name = first_kw_arg;
26610 while (*name && num_kwargs > extracted) {
26611 PyObject * key = **name;
26614 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
26615 found = PyDict_GetItemRef(kwds, key, &value);
26617 value = PyDict_GetItemWithError(kwds, key);
26622 if (unlikely(PyErr_Occurred()))
goto bad;
26626 if (unlikely(found < 0))
goto bad;
26627 values[name-argnames] = value;
26632 if (num_kwargs > extracted) {
26633 if (ignore_unknown_kwargs) {
26634 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
26637 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
26645static int __Pyx_ParseKeywordDictToDict(
26647 PyObject **
const argnames[],
26649 PyObject *values[],
26650 Py_ssize_t num_pos_args,
26651 const char* function_name)
26653 PyObject**
const *name;
26654 PyObject**
const *first_kw_arg = argnames + num_pos_args;
26656#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
26657 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
26659 if (PyDict_Update(kwds2, kwds) < 0)
goto bad;
26660 name = first_kw_arg;
26662 PyObject *key = **name;
26664#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
26665 int found = PyDict_Pop(kwds2, key, &value);
26667 if (unlikely(found < 0))
goto bad;
26668 values[name-argnames] = value;
26670#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
26671 int found = PyDict_GetItemRef(kwds2, key, &value);
26673 if (unlikely(found < 0))
goto bad;
26674 values[name-argnames] = value;
26675 if (unlikely(PyDict_DelItem(kwds2, key) < 0))
goto bad;
26678 #if CYTHON_COMPILING_IN_CPYTHON
26679 value = _PyDict_Pop(kwds2, key, kwds2);
26681 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
26683 if (value == kwds2) {
26686 if (unlikely(!value))
goto bad;
26687 values[name-argnames] = value;
26692 len = PyDict_Size(kwds2);
26694 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
26695 }
else if (unlikely(len == -1)) {
26702static int __Pyx_ParseKeywordsTuple(
26704 PyObject *
const *kwvalues,
26705 PyObject **
const argnames[],
26707 PyObject *values[],
26708 Py_ssize_t num_pos_args,
26709 Py_ssize_t num_kwargs,
26710 const char* function_name,
26711 int ignore_unknown_kwargs)
26713 PyObject *key = NULL;
26714 PyObject**
const * name;
26715 PyObject**
const *first_kw_arg = argnames + num_pos_args;
26716 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
26717#if CYTHON_AVOID_BORROWED_REFS
26718 key = __Pyx_PySequence_ITEM(kwds, pos);
26720 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
26722#if !CYTHON_ASSUME_SAFE_MACROS
26723 if (unlikely(!key))
goto bad;
26725 name = first_kw_arg;
26726 while (*name && (**name != key)) name++;
26728 PyObject *value = kwvalues[pos];
26729 values[name-argnames] = __Pyx_NewRef(value);
26731 size_t index_found = 0;
26732 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
26734 PyObject *value = kwvalues[pos];
26735 values[index_found] = __Pyx_NewRef(value);
26737 if (unlikely(cmp == -1))
goto bad;
26739 PyObject *value = kwvalues[pos];
26740 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
26741 }
else if (!ignore_unknown_kwargs) {
26742 goto invalid_keyword;
26746 #if CYTHON_AVOID_BORROWED_REFS
26753 PyErr_Format(PyExc_TypeError,
26754 "%s() got an unexpected keyword argument '%U'",
26755 function_name, key);
26758 #if CYTHON_AVOID_BORROWED_REFS
26765static int __Pyx_ParseKeywords(
26767 PyObject *
const *kwvalues,
26768 PyObject **
const argnames[],
26770 PyObject *values[],
26771 Py_ssize_t num_pos_args,
26772 Py_ssize_t num_kwargs,
26773 const char* function_name,
26774 int ignore_unknown_kwargs)
26776 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
26777 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
26779 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
26781 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
26785static void __Pyx_RaiseArgtupleInvalid(
26786 const char* func_name,
26788 Py_ssize_t num_min,
26789 Py_ssize_t num_max,
26790 Py_ssize_t num_found)
26792 Py_ssize_t num_expected;
26793 const char *more_or_less;
26794 if (num_found < num_min) {
26795 num_expected = num_min;
26796 more_or_less =
"at least";
26798 num_expected = num_max;
26799 more_or_less =
"at most";
26802 more_or_less =
"exactly";
26804 PyErr_Format(PyExc_TypeError,
26805 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26806 func_name, more_or_less, num_expected,
26807 (num_expected == 1) ?
"" :
"s", num_found);
26811static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
26813 __Pyx_TypeName type_name;
26814 __Pyx_TypeName obj_type_name;
26815 PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
26816 int from_annotation_subclass = 0;
26817 if (unlikely(!type)) {
26818 PyErr_SetString(PyExc_SystemError,
"Missing type object");
26820 }
else if (exact == 2) {
26821 if (__Pyx_TypeCheck(obj, type)) {
26822 from_annotation_subclass = 1;
26823 extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
26826 type_name = __Pyx_PyType_GetFullyQualifiedName(type);
26827 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
26828 if (unlikely(!type_name))
return;
26830 obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
26831 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
26832 if (unlikely(!obj_type_name))
goto obj_type_name_failed;
26834 PyErr_Format(PyExc_TypeError,
26835 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
", got " __Pyx_FMT_TYPENAME
")"
26836#
if __PYX_LIMITED_VERSION_HEX < 0x030C0000
26839 , name, type_name, obj_type_name
26840#
if __PYX_LIMITED_VERSION_HEX < 0x030C0000
26841 , (from_annotation_subclass ?
". " :
""), extra_info
26844#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
26845 if (exact == 2 && from_annotation_subclass) {
26847 PyObject *vargs[2];
26848 vargs[0] = PyErr_GetRaisedException();
26849 vargs[1] = extra_info;
26850 res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
26852 PyErr_SetRaisedException(vargs[0]);
26855 __Pyx_DECREF_TypeName(obj_type_name);
26856#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
26857obj_type_name_failed:
26859 __Pyx_DECREF_TypeName(type_name);
26864static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
const char *name,
int exact) {
26865 if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
26867 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
26869 __Pyx_ArgTypeError(obj, type, name, exact);
26874#if CYTHON_FAST_THREAD_STATE
26875static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26876#if PY_VERSION_HEX >= 0x030C00A6
26877 PyObject *tmp_value;
26878 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
26880 #if CYTHON_COMPILING_IN_CPYTHON
26881 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
26883 PyException_SetTraceback(value, tb);
26885 tmp_value = tstate->current_exception;
26886 tstate->current_exception = value;
26887 Py_XDECREF(tmp_value);
26891 PyObject *tmp_type, *tmp_value, *tmp_tb;
26892 tmp_type = tstate->curexc_type;
26893 tmp_value = tstate->curexc_value;
26894 tmp_tb = tstate->curexc_traceback;
26895 tstate->curexc_type = type;
26896 tstate->curexc_value = value;
26897 tstate->curexc_traceback = tb;
26898 Py_XDECREF(tmp_type);
26899 Py_XDECREF(tmp_value);
26900 Py_XDECREF(tmp_tb);
26903static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26904#if PY_VERSION_HEX >= 0x030C00A6
26905 PyObject* exc_value;
26906 exc_value = tstate->current_exception;
26907 tstate->current_exception = 0;
26908 *value = exc_value;
26912 *type = (PyObject*) Py_TYPE(exc_value);
26914 #if CYTHON_COMPILING_IN_CPYTHON
26915 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
26918 *tb = PyException_GetTraceback(exc_value);
26922 *type = tstate->curexc_type;
26923 *value = tstate->curexc_value;
26924 *tb = tstate->curexc_traceback;
26925 tstate->curexc_type = 0;
26926 tstate->curexc_value = 0;
26927 tstate->curexc_traceback = 0;
26933#if CYTHON_COMPILING_IN_CPYTHON
26934static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26936 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
26938 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26941static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26943 assert(PyExceptionClass_Check(exc_type));
26944 n = PyTuple_GET_SIZE(tuple);
26945 for (i=0; i<
n; i++) {
26946 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
26948 for (i=0; i<
n; i++) {
26949 PyObject *t = PyTuple_GET_ITEM(tuple, i);
26950 if (likely(PyExceptionClass_Check(t))) {
26951 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
26957static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26958 if (likely(err == exc_type))
return 1;
26959 if (likely(PyExceptionClass_Check(err))) {
26960 if (likely(PyExceptionClass_Check(exc_type))) {
26961 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26962 }
else if (likely(PyTuple_Check(exc_type))) {
26963 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26967 return PyErr_GivenExceptionMatches(err, exc_type);
26969static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26970 assert(PyExceptionClass_Check(exc_type1));
26971 assert(PyExceptionClass_Check(exc_type2));
26972 if (likely(err == exc_type1 || err == exc_type2))
return 1;
26973 if (likely(PyExceptionClass_Check(err))) {
26974 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26976 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26981#if CYTHON_FAST_THREAD_STATE
26982static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26984 n = PyTuple_GET_SIZE(tuple);
26985 for (i=0; i<
n; i++) {
26986 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
26988 for (i=0; i<
n; i++) {
26989 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
26993static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
26995 PyObject *exc_type;
26996#if PY_VERSION_HEX >= 0x030C00A6
26997 PyObject *current_exception = tstate->current_exception;
26998 if (unlikely(!current_exception))
return 0;
26999 exc_type = (PyObject*) Py_TYPE(current_exception);
27000 if (exc_type == err)
return 1;
27002 exc_type = tstate->curexc_type;
27003 if (exc_type == err)
return 1;
27004 if (unlikely(!exc_type))
return 0;
27006 #if CYTHON_AVOID_BORROWED_REFS
27007 Py_INCREF(exc_type);
27009 if (unlikely(PyTuple_Check(err))) {
27010 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
27012 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
27014 #if CYTHON_AVOID_BORROWED_REFS
27015 Py_DECREF(exc_type);
27022#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
27023static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
27024 __Pyx_PyThreadState_declare
27025 __Pyx_PyThreadState_assign
27026 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
27027 __Pyx_PyErr_Clear();
27030static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
27032#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
27033 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
27036#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
27037 PyTypeObject* tp = Py_TYPE(obj);
27038 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
27039 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
27042 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
27043 if (unlikely(!result)) {
27044 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
27051static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
27052 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
27053 if (unlikely(!result) && !PyErr_Occurred()) {
27054 PyErr_Format(PyExc_NameError,
27055 "name '%U' is not defined", name);
27061#if !CYTHON_VECTORCALL
27062static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *
const *args,
size_t nargsf) {
27064 switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
27066 return PyObject_CallMethodObjArgs(args[0], name, NULL);
27068 return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
27070 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
27072 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
27074 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
27076 PyObject *attr = PyObject_GetAttr(args[0], name);
27077 if (unlikely(!attr))
27079 result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
27086#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
27087static __Pyx_TypeName
27088__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
27090 PyObject *module = NULL, *name = NULL, *result = NULL;
27091 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
27092 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
27093 __pyx_mstate_global->__pyx_n_u_qualname);
27095 name = PyType_GetQualName(tp);
27097 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name)))
goto bad;
27098 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
27099 __pyx_mstate_global->__pyx_n_u_module);
27100 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module)))
goto bad;
27101 if (PyUnicode_CompareWithASCIIString(module,
"builtins") == 0) {
27106 result = PyUnicode_FromFormat(
"%U.%U", module, name);
27107 if (unlikely(result == NULL))
goto bad;
27110 Py_XDECREF(module);
27118 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
27125static void __Pyx_RaiseErrorWithType1(PyObject* exc_type,
const char* message,
const char *arg, PyTypeObject *type_obj) {
27126 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
27127 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
27128 if (unlikely(!type_name))
return;
27130 PyErr_Format(exc_type, message, arg, type_name);
27131 __Pyx_DECREF_TypeName(type_name);
27135static int __Pyx_RaiseUnexpectedTypeError(
const char *expected, PyObject *obj) {
27136 __Pyx_RaiseTypeErrorWithObjectType1(
27137 "Expected %.42s, got " __Pyx_FMT_TYPENAME,
27143static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
27144 PyObject* owned_instance = NULL;
27145 if (tb == Py_None) {
27147 }
else if (tb && !PyTraceBack_Check(tb)) {
27148 PyErr_SetString(PyExc_TypeError,
27149 "raise: arg 3 must be a traceback or None");
27152 if (value == Py_None)
27154 if (PyExceptionInstance_Check(type)) {
27156 PyErr_SetString(PyExc_TypeError,
27157 "instance exception may not have a separate value");
27161 type = (PyObject*) Py_TYPE(value);
27162 }
else if (PyExceptionClass_Check(type)) {
27163 PyObject *instance_class = NULL;
27164 if (value && PyExceptionInstance_Check(value)) {
27165 instance_class = (PyObject*) Py_TYPE(value);
27166 if (instance_class != type) {
27167 int is_subclass = PyObject_IsSubclass(instance_class, type);
27168 if (!is_subclass) {
27169 instance_class = NULL;
27170 }
else if (unlikely(is_subclass == -1)) {
27173 type = instance_class;
27177 if (!instance_class) {
27180 args = PyTuple_New(0);
27181 else if (PyTuple_Check(value)) {
27185 args = PyTuple_Pack(1, value);
27188 owned_instance = PyObject_Call(type, args, NULL);
27190 if (!owned_instance)
27192 value = owned_instance;
27193 if (!PyExceptionInstance_Check(value)) {
27194 PyErr_Format(PyExc_TypeError,
27195 "calling %R should have returned an instance of "
27196 "BaseException, not %R",
27197 type, Py_TYPE(value));
27202 PyErr_SetString(PyExc_TypeError,
27203 "raise: exception class must be a subclass of BaseException");
27207 PyObject *fixed_cause;
27208 if (cause == Py_None) {
27209 fixed_cause = NULL;
27210 }
else if (PyExceptionClass_Check(cause)) {
27211 fixed_cause = PyObject_CallObject(cause, NULL);
27212 if (fixed_cause == NULL)
27214 }
else if (PyExceptionInstance_Check(cause)) {
27215 fixed_cause = cause;
27216 Py_INCREF(fixed_cause);
27218 PyErr_SetString(PyExc_TypeError,
27219 "exception causes must derive from "
27223 PyException_SetCause(value, fixed_cause);
27225 PyErr_SetObject(type, value);
27227#if PY_VERSION_HEX >= 0x030C00A6
27228 PyException_SetTraceback(value, tb);
27229#elif CYTHON_FAST_THREAD_STATE
27230 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27231 PyObject* tmp_tb = tstate->curexc_traceback;
27232 if (tb != tmp_tb) {
27234 tstate->curexc_traceback = tb;
27235 Py_XDECREF(tmp_tb);
27238 PyObject *tmp_type, *tmp_value, *tmp_tb;
27239 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
27241 PyErr_Restore(tmp_type, tmp_value, tb);
27242 Py_XDECREF(tmp_tb);
27246 Py_XDECREF(owned_instance);
27251static const char DIGIT_PAIRS_10[2*10*10+1] = {
27252 "00010203040506070809"
27253 "10111213141516171819"
27254 "20212223242526272829"
27255 "30313233343536373839"
27256 "40414243444546474849"
27257 "50515253545556575859"
27258 "60616263646566676869"
27259 "70717273747576777879"
27260 "80818283848586878889"
27261 "90919293949596979899"
27263static const char DIGIT_PAIRS_8[2*8*8+1] = {
27273static const char DIGITS_HEX[2*16+1] = {
27279static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength,
const char* chars,
int clength,
27280 int prepend_sign,
char padding_char) {
27282 Py_ssize_t uoffset = ulength - clength;
27283#if CYTHON_USE_UNICODE_INTERNALS
27286 uval = PyUnicode_New(ulength, 127);
27287 if (unlikely(!uval))
return NULL;
27288 udata = PyUnicode_DATA(uval);
27291 if (prepend_sign) {
27292 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0,
'-');
27295 for (; i < uoffset; i++) {
27296 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
27299 for (i=0; i < clength; i++) {
27300 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
27304 PyObject *
sign = NULL, *padding = NULL;
27307 prepend_sign = !!prepend_sign;
27308 if (uoffset > prepend_sign) {
27309 padding = PyUnicode_FromOrdinal(padding_char);
27310 if (likely(padding) && uoffset > prepend_sign + 1) {
27311 PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
27312 Py_DECREF(padding);
27315 if (unlikely(!padding))
goto done_or_error;
27317 if (prepend_sign) {
27318 sign = PyUnicode_FromOrdinal(
'-');
27319 if (unlikely(!
sign))
goto done_or_error;
27322 uval = PyUnicode_DecodeASCII(chars, clength, NULL);
27323 if (likely(uval) && padding) {
27324 PyObject *tmp = PyUnicode_Concat(padding, uval);
27328 if (likely(uval) &&
sign) {
27329 PyObject *tmp = PyUnicode_Concat(
sign, uval);
27334 Py_XDECREF(padding);
27342static CYTHON_INLINE
int __Pyx_CheckUnicodeValue(
int value) {
27343 return value <= 1114111;
27345static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(
int value, Py_ssize_t ulength,
char padding_char) {
27346 Py_ssize_t padding_length = ulength - 1;
27347 if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
27349 if (value <= 255) {
27350 memset(chars, padding_char, (
size_t) padding_length);
27351 chars[ulength-1] = (char) value;
27352 return PyUnicode_DecodeLatin1(chars, ulength, NULL);
27354 char *cpos = chars +
sizeof(chars);
27355 if (value < 0x800) {
27356 *--cpos = (char) (0x80 | (value & 0x3f));
27358 *--cpos = (char) (0xc0 | (value & 0x1f));
27359 }
else if (value < 0x10000) {
27360 *--cpos = (char) (0x80 | (value & 0x3f));
27362 *--cpos = (char) (0x80 | (value & 0x3f));
27364 *--cpos = (char) (0xe0 | (value & 0x0f));
27366 *--cpos = (char) (0x80 | (value & 0x3f));
27368 *--cpos = (char) (0x80 | (value & 0x3f));
27370 *--cpos = (char) (0x80 | (value & 0x3f));
27372 *--cpos = (char) (0xf0 | (value & 0x07));
27374 cpos -= padding_length;
27375 memset(cpos, padding_char, (
size_t) padding_length);
27376 return PyUnicode_DecodeUTF8(cpos, chars +
sizeof(chars) - cpos, NULL);
27378 if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
27379 const char chars[1] = {(char) value};
27380 return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
27383 PyObject *uchar, *padding_uchar, *padding, *result;
27384 padding_uchar = PyUnicode_FromOrdinal(padding_char);
27385 if (unlikely(!padding_uchar))
return NULL;
27386 padding = PySequence_Repeat(padding_uchar, padding_length);
27387 Py_DECREF(padding_uchar);
27388 if (unlikely(!padding))
return NULL;
27389 uchar = PyUnicode_FromOrdinal(value);
27390 if (unlikely(!uchar)) {
27391 Py_DECREF(padding);
27394 result = PyUnicode_Concat(padding, uchar);
27395 Py_DECREF(padding);
27402static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(
int value, Py_ssize_t width,
char padding_char) {
27403#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27404#pragma GCC diagnostic push
27405#pragma GCC diagnostic ignored "-Wconversion"
27407 const int neg_one = (int) -1, const_zero = (
int) 0;
27408#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27409#pragma GCC diagnostic pop
27411 const int is_unsigned = neg_one > const_zero;
27412 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
27413 !(
sizeof(value) <= 2 || value & ~ (
int) 0x01fffff || __Pyx_CheckUnicodeValue((
int) value)))) {
27414 PyErr_SetString(PyExc_OverflowError,
"%c arg not in range(0x110000)");
27418 return PyUnicode_FromOrdinal((
int) value);
27420 return __Pyx_PyUnicode_FromOrdinal_Padded((
int) value, width, padding_char);
27422static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(
int value, Py_ssize_t width,
char padding_char,
char format_char) {
27423 char digits[
sizeof(int)*3+2];
27424 char *dpos, *end = digits +
sizeof(int)*3+2;
27425 const char *hex_digits = DIGITS_HEX;
27426 Py_ssize_t length, ulength;
27427 int prepend_sign, last_one_off;
27429#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27430#pragma GCC diagnostic push
27431#pragma GCC diagnostic ignored "-Wconversion"
27433 const int neg_one = (int) -1, const_zero = (
int) 0;
27434#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27435#pragma GCC diagnostic pop
27437 const int is_unsigned = neg_one > const_zero;
27438 if (format_char ==
'X') {
27447 switch (format_char) {
27449 digit_pos = abs((
int)(remaining % (8*8)));
27450 remaining = (int) (remaining / (8*8));
27452 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
27453 last_one_off = (digit_pos < 8);
27456 digit_pos = abs((
int)(remaining % (10*10)));
27457 remaining = (int) (remaining / (10*10));
27459 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
27460 last_one_off = (digit_pos < 10);
27463 *(--dpos) = hex_digits[abs((
int)(remaining % 16))];
27464 remaining = (int) (remaining / 16);
27470 }
while (unlikely(remaining != 0));
27471 assert(!last_one_off || *dpos ==
'0');
27472 dpos += last_one_off;
27473 length = end - dpos;
27476 if (!is_unsigned && value <= neg_one) {
27477 if (padding_char ==
' ' || width <= length + 1) {
27485 if (width > ulength) {
27488 if (ulength == 1) {
27489 return PyUnicode_FromOrdinal(*dpos);
27491 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (
int) length, prepend_sign, padding_char);
27495static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width,
char padding_char) {
27496#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27497#pragma GCC diagnostic push
27498#pragma GCC diagnostic ignored "-Wconversion"
27500 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
27501#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27502#pragma GCC diagnostic pop
27504 const int is_unsigned = neg_one > const_zero;
27505 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
27506 !(
sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((
int) value)))) {
27507 PyErr_SetString(PyExc_OverflowError,
"%c arg not in range(0x110000)");
27511 return PyUnicode_FromOrdinal((
int) value);
27513 return __Pyx_PyUnicode_FromOrdinal_Padded((
int) value, width, padding_char);
27515static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width,
char padding_char,
char format_char) {
27516 char digits[
sizeof(Py_ssize_t)*3+2];
27517 char *dpos, *end = digits +
sizeof(Py_ssize_t)*3+2;
27518 const char *hex_digits = DIGITS_HEX;
27519 Py_ssize_t length, ulength;
27520 int prepend_sign, last_one_off;
27521 Py_ssize_t remaining;
27522#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27523#pragma GCC diagnostic push
27524#pragma GCC diagnostic ignored "-Wconversion"
27526 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
27527#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27528#pragma GCC diagnostic pop
27530 const int is_unsigned = neg_one > const_zero;
27531 if (format_char ==
'X') {
27540 switch (format_char) {
27542 digit_pos = abs((
int)(remaining % (8*8)));
27543 remaining = (Py_ssize_t) (remaining / (8*8));
27545 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
27546 last_one_off = (digit_pos < 8);
27549 digit_pos = abs((
int)(remaining % (10*10)));
27550 remaining = (Py_ssize_t) (remaining / (10*10));
27552 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
27553 last_one_off = (digit_pos < 10);
27556 *(--dpos) = hex_digits[abs((
int)(remaining % 16))];
27557 remaining = (Py_ssize_t) (remaining / 16);
27563 }
while (unlikely(remaining != 0));
27564 assert(!last_one_off || *dpos ==
'0');
27565 dpos += last_one_off;
27566 length = end - dpos;
27569 if (!is_unsigned && value <= neg_one) {
27570 if (padding_char ==
' ' || width <= length + 1) {
27578 if (width > ulength) {
27581 if (ulength == 1) {
27582 return PyUnicode_FromOrdinal(*dpos);
27584 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (
int) length, prepend_sign, padding_char);
27588static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
int kind) {
27589#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH && CYTHON_USE_UNICODE_INTERNALS
27590 PyObject *result_uval;
27591 int result_ukind, kind_shift;
27592 Py_ssize_t i, char_pos;
27593 void *result_udata;
27594 static const Py_UCS4 max_char[5] = {0x7fU, 0xffU, 0xffffU, 0xffffU, 0x10ffffU};
27595 assert (kind >= 0);
27596 if (kind > PyUnicode_4BYTE_KIND) kind = PyUnicode_4BYTE_KIND;
27597 result_uval = PyUnicode_New(result_ulength, max_char[kind]);
27598 if (unlikely(!result_uval))
return NULL;
27599 kind_shift = kind >> 1;
27600 result_ukind = 1 << kind_shift;
27601 result_udata = PyUnicode_DATA(result_uval);
27602 assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
27603 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
27606 for (i=0; i < value_count; i++) {
27608 Py_ssize_t ulength;
27610 PyObject *uval = values[i];
27611 if (__Pyx_PyUnicode_READY(uval) == (-1))
27613 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
27614 #if !CYTHON_ASSUME_SAFE_SIZE
27615 if (unlikely(ulength < 0))
goto bad;
27617 if (unlikely(!ulength))
27619 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
27621 ukind = __Pyx_PyUnicode_KIND(uval);
27622 udata = __Pyx_PyUnicode_DATA(uval);
27623 if (ukind == result_ukind) {
27624 memcpy((
char *)result_udata + (char_pos << kind_shift), udata, (
size_t) (ulength << kind_shift));
27626 #if PY_VERSION_HEX >= 0x030d0000
27627 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0))
goto bad;
27628 #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
27629 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
27632 for (j=0; j < ulength; j++) {
27633 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
27634 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
27638 char_pos += ulength;
27640 return result_uval;
27642 PyErr_SetString(PyExc_OverflowError,
"join() result is too long for a Python string");
27644 Py_DECREF(result_uval);
27648 PyObject *result = NULL;
27649 PyObject *value_tuple = PyTuple_New(value_count);
27650 if (unlikely(!value_tuple))
return NULL;
27651 CYTHON_UNUSED_VAR(kind);
27652 CYTHON_UNUSED_VAR(result_ulength);
27653 for (i=0; i<value_count; i++) {
27654 Py_INCREF(values[i]);
27655 if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0))
goto bad;
27657 result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
27659 Py_DECREF(value_tuple);
27665#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL)
27666static CYTHON_INLINE
int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2,
int equals) {
27670 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0))
goto bad;
27671 length = __Pyx_PyUnicode_GET_LENGTH(s1);
27672 #if !CYTHON_ASSUME_SAFE_SIZE
27673 if (unlikely(length < 0))
goto bad;
27675 if (length != 1)
goto return_ne;
27676 kind = PyUnicode_KIND(s1);
27678 if (likely(kind == PyUnicode_1BYTE_KIND)) {
27679 ch1 = PyUnicode_1BYTE_DATA(s1)[0];
27680 }
else if (kind == PyUnicode_2BYTE_KIND) {
27681 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
27683 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
27685 }
else if (ch2 < 65536) {
27686 if (kind == PyUnicode_2BYTE_KIND) {
27687 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
27688 }
else if (kind == PyUnicode_4BYTE_KIND) {
27689 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
27694 if (kind == PyUnicode_4BYTE_KIND){
27695 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
27706 return (equals == Py_EQ);
27708 return (equals == Py_NE);
27715#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
27716#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
27717static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
27718 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
27719 int result = PyUnicode_Equal(s1, s2);
27720 #if !CYTHON_COMPILING_IN_CPYTHON
27721 if (unlikely(result == -1))
return -1;
27723 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
27725 int result = PyUnicode_Compare(s1, s2);
27726 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
27727 if (result == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
27735static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2,
int pyop) {
27736 CYTHON_UNUSED_VAR(pyop);
27737 if (unlikely(op2 == Py_None)) {
27738 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_richcmp;
27740 if (PyFloat_CheckExact(op1)) {
27741 goto __pyx_richcmp;
27743 if (PyLong_CheckExact(op1)) {
27744 if (op1 == op2)
goto __pyx_return_true;
27745 goto __pyx_richcmp;
27748 if (likely(PyUnicode_CheckExact(op1))) {
27749 if (op1 == op2)
goto __pyx_return_true;
27750 if (likely(op2 != Py_None)) {
27751 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
27753 goto __pyx_richcmp;
27756 if ((0))
goto __pyx_richcmp;
27757 if ((0))
goto __pyx_return_true;
27758 if ((0))
goto __pyx_return_false;
27760 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
27768#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
27769#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
27770#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
27771static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyBytesPyBytesEq(PyObject* s1, PyObject* s2) {
27772 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
27773 const char *ps1, *ps2;
27774 Py_ssize_t length = PyBytes_GET_SIZE(s1);
27775 if (length != PyBytes_GET_SIZE(s2))
goto __pyx_return_false;
27776 ps1 = PyBytes_AS_STRING(s1);
27777 ps2 = PyBytes_AS_STRING(s2);
27780 Py_ssize_t length, length2;
27781 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length) == -1))
return NULL;
27782 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1))
return NULL;
27783 if (length != length2)
goto __pyx_return_false;
27785 if (ps1[0] != ps2[0])
goto __pyx_return_false;
27786 if (length == 1)
goto __pyx_return_true;
27789#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
27790 Py_hash_t hash1 = ((PyBytesObject*)s1)->ob_shash;
27791 Py_hash_t hash2 = ((PyBytesObject*)s2)->ob_shash;
27792 if (hash1 != hash2 && hash1 != -1 && hash2 != -1)
goto __pyx_return_false;
27794 cmp = memcmp(ps1, ps2, (
size_t)length);
27795 if (cmp == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
27804#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
27805#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
27806#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
27807static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyByteArrayPyBytesEq(PyObject* s1, PyObject* s2) {
27808 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
27809 const char *ps1, *ps2;
27810 Py_ssize_t length = PyByteArray_GET_SIZE(s1);
27811 if (length != PyBytes_GET_SIZE(s2))
goto __pyx_return_false;
27812 ps1 = PyByteArray_AS_STRING(s1);
27813 ps2 = PyBytes_AS_STRING(s2);
27816 Py_ssize_t length, length2;
27817 ps1 = __Pyx_PyByteArray_AsString(s1);
if (unlikely(!ps1))
return NULL;
27818 length = __Pyx_PyByteArray_GET_SIZE(s1);
if (unlikely(length == -1))
return NULL;
27819 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1))
return NULL;
27820 if (length != length2)
goto __pyx_return_false;
27822 if (length == 0)
goto __pyx_return_true;
27823 if (ps1[0] != ps2[0])
goto __pyx_return_false;
27824 if (length == 1)
goto __pyx_return_true;
27827 cmp = memcmp(ps1, ps2, (
size_t)length);
27828 if (cmp == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
27837static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2,
int pyop) {
27838 CYTHON_UNUSED_VAR(pyop);
27839 if (unlikely(op2 == Py_None)) {
27840 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_richcmp;
27842 if (PyFloat_CheckExact(op1)) {
27843 goto __pyx_richcmp;
27845 if (PyLong_CheckExact(op1)) {
27846 if (op1 == op2)
goto __pyx_return_true;
27847 goto __pyx_richcmp;
27849 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
27850 if (likely(PyBytes_CheckExact(op1))) {
27851 if (op1 == op2)
goto __pyx_return_true;
27852 if (likely(op2 != Py_None)) {
27853 return __Pyx_PyObject_ComparePyBytesPyBytesEq(op1, op2);
27855 goto __pyx_richcmp;
27858 if ((0))
goto __pyx_richcmp;
27859 if ((0))
goto __pyx_return_true;
27860 if ((0))
goto __pyx_return_false;
27862 return PyObject_RichCompare(op1, op2, Py_EQ);
27870static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
27871#if CYTHON_USE_TYPE_SLOTS
27872 if (likely(PyUnicode_Check(
n)))
27873 return __Pyx_PyObject_GetAttrStr(o,
n);
27875 return PyObject_GetAttr(o,
n);
27879#if CYTHON_COMPILING_IN_LIMITED_API
27880static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
27881 return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
27886#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
27887static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
27889 if (likely(sm->sq_length)) {
27890 Py_ssize_t l = sm->sq_length(o);
27891 if (likely(l >= 0)) {
27894 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
27904static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
27906 if (unlikely(!j))
return NULL;
27907 r = PyObject_GetItem(o, j);
27911static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
27912 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
27914static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
27915 int wraparound,
int boundscheck,
int unsafe_shared) {
27916 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
27917#if CYTHON_AVOID_BORROWED_REFS
27918 CYTHON_UNUSED_VAR(boundscheck);
27919 Py_ssize_t wrapped_i = i;
27920 if (wraparound & unlikely(i < 0)) {
27921 Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
27922 #if !CYTHON_ASSUME_SAFE_SIZE
27923 if (unlikely(size < 0))
return NULL;
27927 return __Pyx_PyList_GetItemRef(o, wrapped_i);
27928#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
27929 Py_ssize_t wrapped_i = i;
27930 Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
27931 if (wraparound & unlikely(i < 0)) {
27934 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
27935 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
27937 return __Pyx_GetItemInt_Generic_size(o, i);
27941 return PySequence_GetItem(o, i);
27944static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
27945 int wraparound,
int boundscheck,
int unsafe_shared) {
27946 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
27947#if CYTHON_AVOID_BORROWED_REFS
27948 CYTHON_UNUSED_VAR(boundscheck);
27949 Py_ssize_t wrapped_i = i;
27950 if (wraparound & unlikely(i < 0)) {
27951 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
27952 #if !CYTHON_ASSUME_SAFE_SIZE
27953 if (unlikely(size < 0))
return NULL;
27957 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
27958 return PySequence_ITEM(o, wrapped_i);
27960 if (unlikely(wrapped_i < 0)) {
27961 PyErr_SetString(PyExc_IndexError,
"tuple index out of range");
27964 return PySequence_GetItem(o, wrapped_i);
27966#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
27967 Py_ssize_t wrapped_i = i;
27968 Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
27969 if (wraparound & unlikely(i < 0)) {
27972 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
27973 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
27975 return __Pyx_GetItemInt_Generic_size(o, i);
27979 return PySequence_GetItem(o, i);
27982#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
27983static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
27984 PyObject *
r, *key = PyLong_FromSsize_t(i);
27985 if (unlikely(!key))
return NULL;
27986 r = getitem(o, key);
27991static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
27992 int wraparound,
int boundscheck,
int unsafe_shared) {
27993 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
27994#if CYTHON_ASSUME_SAFE_SIZE
27995 if (PyList_CheckExact(o)) {
27996 return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
27998 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27999 if (PyTuple_CheckExact(o)) {
28000 return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
28004 if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
28005 return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
28008#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
28009 if (PyDict_CheckExact(o)) {
28010 return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
28011 #if defined(PyFrozenDict_CheckExact)
28012 }
else if (PyFrozenDict_CheckExact(o)) {
28013 return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
28017 PyTypeObject *obj_type = Py_TYPE(o);
28018 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
28019 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
28020 PyMappingMethods *mm = obj_type->tp_as_mapping;
28021 if (mm && mm->mp_subscript)
28022 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
28024 PySequenceMethods *sm = obj_type->tp_as_sequence;
28025 if (likely(sm && sm->sq_item)) {
28026 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
28028 return sm->sq_item(o, i);
28030 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
28031 PyMappingMethods *mm = obj_type->tp_as_mapping;
28032 if (likely(mm && mm->mp_subscript))
28033 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
28037 if (!PyMapping_Check(o)) {
28038 return PySequence_GetItem(o, i);
28043 return __Pyx_GetItemInt_Generic_size(o, i);
28047static void __Pyx_RaiseErrorWithType(PyObject* exc_type,
const char* message, PyTypeObject *type_obj) {
28048 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
28049 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
28050 if (unlikely(!type_name))
return;
28052 PyErr_Format(exc_type, message, type_name);
28053 __Pyx_DECREF_TypeName(type_name);
28057#if CYTHON_USE_TYPE_SLOTS
28058static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
28059 PyObject *runerr = NULL;
28060 Py_ssize_t key_value;
28061 key_value = __Pyx_PyIndex_AsSsize_t(index);
28062 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
28063 return __Pyx_GetItemInt_Fast(obj, key_value, 1, 1, 1);
28065 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
28067 __Pyx_RaiseErrorWithObjectType(
28069 "cannot fit '" __Pyx_FMT_TYPENAME
"' into an index-sized integer",
28074static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
28075 if (likely(PyType_Check(obj))) {
28076 if ((PyTypeObject*)obj == &PyType_Type) {
28077 return Py_GenericAlias(obj, key);
28079 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
28081 if (PyErr_Occurred()) {
28085 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
28090 __Pyx_RaiseTypeErrorWithObjectType(
28091 "'" __Pyx_FMT_TYPENAME
"' object is not subscriptable", obj);
28094static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
28095 PyTypeObject *tp = Py_TYPE(obj);
28096 PyMappingMethods *mm = tp->tp_as_mapping;
28097 PySequenceMethods *sm = tp->tp_as_sequence;
28098 if (likely(mm && mm->mp_subscript)) {
28099 return mm->mp_subscript(obj, key);
28101 if (likely(sm && sm->sq_item)) {
28102 return __Pyx_PyObject_GetIndex(obj, key);
28104 return __Pyx_PyObject_GetItem_Slow(obj, key);
28109static void __Pyx_RejectKeywords(
const char* function_name, PyObject *kwds) {
28110 PyObject *key = NULL;
28111 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds))) {
28112 key = __Pyx_PySequence_ITEM(kwds, 0);
28114#if CYTHON_AVOID_BORROWED_REFS
28115 PyObject *pos = NULL;
28117 Py_ssize_t pos = 0;
28119#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
28120 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return;
28122 __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
28123#if CYTHON_AVOID_BORROWED_REFS
28128 PyErr_Format(PyExc_TypeError,
28129 "%s() got an unexpected keyword argument '%U'",
28130 function_name, key);
28136static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b,
int b_is_constant) {
28137 Py_ssize_t
q = a / b;
28138 Py_ssize_t
r = a -
q*b;
28139 Py_ssize_t adapt_python = (b_is_constant ?
28140 ((
r != 0) & ((
r < 0) ^ (b < 0))) :
28141 ((
r != 0) & ((
r ^ b) < 0))
28143 return q - adapt_python;
28147#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
28148static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
28149 __Pyx_PyThreadState_declare
28150 __Pyx_PyThreadState_assign
28151 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28153 __Pyx_PyErr_Clear();
28158static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
28160#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
28161 int res = PyObject_GetOptionalAttr(o,
n, &
r);
28162 return (res != 0) ?
r : __Pyx_NewRef(d);
28164 #if CYTHON_USE_TYPE_SLOTS
28165 if (likely(PyUnicode_Check(
n))) {
28166 r = __Pyx_PyObject_GetAttrStrNoError(o,
n);
28167 if (unlikely(!
r) && likely(!PyErr_Occurred())) {
28168 r = __Pyx_NewRef(d);
28173 r = PyObject_GetAttr(o,
n);
28174 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
28179#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
28180static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
28181 PyObject *dict = Py_TYPE(obj)->tp_dict;
28182 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
28184static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
28185 PyObject **dictptr = NULL;
28186 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
28188#if CYTHON_COMPILING_IN_CPYTHON
28189 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
28191 dictptr = _PyObject_GetDictPtr(obj);
28194 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
28196static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
28197 PyObject *dict = Py_TYPE(obj)->tp_dict;
28198 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
28200 return obj_dict_version == __Pyx_get_object_dict_version(obj);
28205#if CYTHON_USE_DICT_VERSIONS
28206static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
28208static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
28212#if CYTHON_COMPILING_IN_LIMITED_API
28213 if (unlikely(!__pyx_m)) {
28214 if (!PyErr_Occurred())
28215 PyErr_SetNone(PyExc_NameError);
28218 result = PyObject_GetAttr(__pyx_m, name);
28219 if (likely(result)) {
28222 if (!__Pyx_IgnoreException(PyExc_Exception)) {
28225#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
28226 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
28227 if (!__Pyx_IgnoreException(PyExc_Exception)) {
28231 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
28232 if (likely(result)) {
28236 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
28237 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
28238 if (likely(result)) {
28239 return __Pyx_NewRef(result);
28241 PyObject *exc = PyErr_Occurred();
28242 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
28246 return __Pyx_GetBuiltinName(name);
28250static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
28251 PyErr_Format(PyExc_ValueError,
28252 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
28256static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
28257 PyErr_Format(PyExc_ValueError,
28258 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
28259 index, (index == 1) ?
"" :
"s");
28263static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
28264 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
28268#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
28269static _PyErr_StackItem *
28270__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
28272 _PyErr_StackItem *exc_info = tstate->exc_info;
28273 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
28274 exc_info->previous_item != NULL)
28276 exc_info = exc_info->previous_item;
28283#if CYTHON_FAST_THREAD_STATE
28284static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28285 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
28286 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
28287 PyObject *exc_value = exc_info->exc_value;
28288 if (exc_value == NULL || exc_value == Py_None) {
28293 *value = exc_value;
28295 *type = (PyObject*) Py_TYPE(exc_value);
28297 *tb = PyException_GetTraceback(exc_value);
28299 #elif CYTHON_USE_EXC_INFO_STACK
28300 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
28301 *type = exc_info->exc_type;
28302 *value = exc_info->exc_value;
28303 *tb = exc_info->exc_traceback;
28305 Py_XINCREF(*value);
28308 *type = tstate->exc_type;
28309 *value = tstate->exc_value;
28310 *tb = tstate->exc_traceback;
28312 Py_XINCREF(*value);
28316static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
28317 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
28318 _PyErr_StackItem *exc_info = tstate->exc_info;
28319 PyObject *tmp_value = exc_info->exc_value;
28320 exc_info->exc_value = value;
28321 Py_XDECREF(tmp_value);
28325 PyObject *tmp_type, *tmp_value, *tmp_tb;
28326 #if CYTHON_USE_EXC_INFO_STACK
28327 _PyErr_StackItem *exc_info = tstate->exc_info;
28328 tmp_type = exc_info->exc_type;
28329 tmp_value = exc_info->exc_value;
28330 tmp_tb = exc_info->exc_traceback;
28331 exc_info->exc_type = type;
28332 exc_info->exc_value = value;
28333 exc_info->exc_traceback = tb;
28335 tmp_type = tstate->exc_type;
28336 tmp_value = tstate->exc_value;
28337 tmp_tb = tstate->exc_traceback;
28338 tstate->exc_type = type;
28339 tstate->exc_value = value;
28340 tstate->exc_traceback = tb;
28342 Py_XDECREF(tmp_type);
28343 Py_XDECREF(tmp_value);
28344 Py_XDECREF(tmp_tb);
28350static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type,
const char *message,
const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
28351 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
28352 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
28353 if (unlikely(!type_name1))
return;
28355 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
28356 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
28357 if (unlikely(!type_name2))
goto type2_failed;
28359 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
28360 __Pyx_DECREF_TypeName(type_name2);
28361#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
28364 __Pyx_DECREF_TypeName(type_name1);
28368static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
28369 if (unlikely(!type)) {
28370 PyErr_SetString(PyExc_SystemError,
"Missing type object");
28373 if (likely(__Pyx_TypeCheck(obj, type)))
28375 __Pyx_RaiseTypeErrorWithTypes(
28376 "Cannot convert " __Pyx_FMT_TYPENAME
" to " __Pyx_FMT_TYPENAME,
28377 Py_TYPE(obj), type);
28382#if CYTHON_FAST_THREAD_STATE
28383static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
28385static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
28388 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
28389#if CYTHON_FAST_THREAD_STATE
28390 PyObject *tmp_type, *tmp_value, *tmp_tb;
28391 #if PY_VERSION_HEX >= 0x030C0000
28392 local_value = tstate->current_exception;
28393 tstate->current_exception = 0;
28395 local_type = tstate->curexc_type;
28396 local_value = tstate->curexc_value;
28397 local_tb = tstate->curexc_traceback;
28398 tstate->curexc_type = 0;
28399 tstate->curexc_value = 0;
28400 tstate->curexc_traceback = 0;
28402#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
28403 local_value = PyErr_GetRaisedException();
28405 PyErr_Fetch(&local_type, &local_value, &local_tb);
28407#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
28408 if (likely(local_value)) {
28409 local_type = (PyObject*) Py_TYPE(local_value);
28410 Py_INCREF(local_type);
28411 local_tb = PyException_GetTraceback(local_value);
28414 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
28415#if CYTHON_FAST_THREAD_STATE
28416 if (unlikely(tstate->curexc_type))
28418 if (unlikely(PyErr_Occurred()))
28422 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
28426 Py_XINCREF(local_tb);
28427 Py_XINCREF(local_type);
28428 Py_XINCREF(local_value);
28429 *type = local_type;
28430 *value = local_value;
28432#if CYTHON_FAST_THREAD_STATE
28433 #if CYTHON_USE_EXC_INFO_STACK
28435 _PyErr_StackItem *exc_info = tstate->exc_info;
28436 #if PY_VERSION_HEX >= 0x030B00a4
28437 tmp_value = exc_info->exc_value;
28438 exc_info->exc_value = local_value;
28441 Py_XDECREF(local_type);
28442 Py_XDECREF(local_tb);
28444 tmp_type = exc_info->exc_type;
28445 tmp_value = exc_info->exc_value;
28446 tmp_tb = exc_info->exc_traceback;
28447 exc_info->exc_type = local_type;
28448 exc_info->exc_value = local_value;
28449 exc_info->exc_traceback = local_tb;
28453 tmp_type = tstate->exc_type;
28454 tmp_value = tstate->exc_value;
28455 tmp_tb = tstate->exc_traceback;
28456 tstate->exc_type = local_type;
28457 tstate->exc_value = local_value;
28458 tstate->exc_traceback = local_tb;
28460 Py_XDECREF(tmp_type);
28461 Py_XDECREF(tmp_value);
28462 Py_XDECREF(tmp_tb);
28463#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
28464 PyErr_SetHandledException(local_value);
28465 Py_XDECREF(local_value);
28466 Py_XDECREF(local_type);
28467 Py_XDECREF(local_tb);
28469 PyErr_SetExcInfo(local_type, local_value, local_tb);
28472#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
28477 Py_XDECREF(local_type);
28478 Py_XDECREF(local_value);
28479 Py_XDECREF(local_tb);
28485#if CYTHON_FAST_THREAD_STATE
28486static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28487 PyObject *tmp_type, *tmp_value, *tmp_tb;
28488 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
28489 _PyErr_StackItem *exc_info = tstate->exc_info;
28490 tmp_value = exc_info->exc_value;
28491 exc_info->exc_value = *value;
28492 if (tmp_value == NULL || tmp_value == Py_None) {
28493 Py_XDECREF(tmp_value);
28498 tmp_type = (PyObject*) Py_TYPE(tmp_value);
28499 Py_INCREF(tmp_type);
28500 #if CYTHON_COMPILING_IN_CPYTHON
28501 tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
28502 Py_XINCREF(tmp_tb);
28504 tmp_tb = PyException_GetTraceback(tmp_value);
28507 #elif CYTHON_USE_EXC_INFO_STACK
28508 _PyErr_StackItem *exc_info = tstate->exc_info;
28509 tmp_type = exc_info->exc_type;
28510 tmp_value = exc_info->exc_value;
28511 tmp_tb = exc_info->exc_traceback;
28512 exc_info->exc_type = *type;
28513 exc_info->exc_value = *value;
28514 exc_info->exc_traceback = *tb;
28516 tmp_type = tstate->exc_type;
28517 tmp_value = tstate->exc_value;
28518 tmp_tb = tstate->exc_traceback;
28519 tstate->exc_type = *type;
28520 tstate->exc_value = *value;
28521 tstate->exc_traceback = *tb;
28524 *value = tmp_value;
28528static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
28529 PyObject *tmp_type, *tmp_value, *tmp_tb;
28530 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
28531 PyErr_SetExcInfo(*type, *value, *tb);
28533 *value = tmp_value;
28539#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
28540static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
28542 if (unlikely(!PyUnicode_Check(
n))) {
28543 PyErr_SetString(PyExc_TypeError,
28544 "hasattr(): attribute name must be string");
28547 r = __Pyx_PyObject_GetAttrStrNoError(o,
n);
28549 return (unlikely(PyErr_Occurred())) ? -1 : 0;
28558CYTHON_UNUSED
static PyObject *
28559__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n) {
28560 PyObject *res = PyList_New(
n);
28561 if (unlikely(res == NULL))
return NULL;
28562 #if CYTHON_COMPILING_IN_CPYTHON
28563 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item,
n);
28566 for (i = 0; i <
n; i++) {
28568 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
28578static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
28579 PyObject *imported_module = PyImport_GetModule(qualname);
28580 if (unlikely(!imported_module)) {
28582 if (PyErr_Occurred()) {
28587 *
module = imported_module;
28590static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
28591 PyObject *imported_module;
28592 PyObject *top_level_package_name;
28594 int status, module_found;
28595 Py_ssize_t dot_index;
28596 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
28597 if (unlikely(!module_found || module_found == -1)) {
28599 return module_found;
28601 if (imported_names) {
28602 for (i = 0; i < len_imported_names; i++) {
28603 PyObject *imported_name = imported_names[i];
28604#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
28605 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
28607 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
28608 if (unlikely(has_imported_attribute == -1))
goto error;
28610 if (!has_imported_attribute) {
28614 *
module = imported_module;
28617 dot_index = PyUnicode_FindChar(qualname,
'.', 0, PY_SSIZE_T_MAX, 1);
28618 if (dot_index == -1) {
28619 *
module = imported_module;
28622 if (unlikely(dot_index == -2))
goto error;
28623 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
28624 if (unlikely(!top_level_package_name))
goto error;
28625 Py_DECREF(imported_module);
28626 status = __Pyx__Import_GetModule(top_level_package_name, module);
28627 Py_DECREF(top_level_package_name);
28630 Py_DECREF(imported_module);
28634 Py_DECREF(imported_module);
28638static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level) {
28639 PyObject *module = 0;
28640 PyObject *empty_dict = 0;
28641 PyObject *from_list = 0;
28646 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
28647 if (likely(module_found == 1)) {
28649 }
else if (unlikely(module_found == -1)) {
28652 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
28653 empty_dict = PyFrozenDict_New(NULL);
28655 empty_dict = PyDict_New();
28657 if (unlikely(!empty_dict))
28659 if (imported_names) {
28660 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
28661 if (unlikely(!from_list))
28665 const char* package_sep = strchr(__Pyx_MODULE_NAME,
'.');
28666 if (package_sep != (0)) {
28667 module = PyImport_ImportModuleLevelObject(
28668 name, moddict, empty_dict, from_list, 1);
28669 if (unlikely(!module)) {
28670 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
28678 module = PyImport_ImportModuleLevelObject(
28679 name, moddict, empty_dict, from_list, level);
28682 Py_XDECREF(from_list);
28683 Py_XDECREF(empty_dict);
28688static PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level) {
28689 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
28693#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
28694static CYTHON_INLINE
void __Pyx__ListComp_AppendAndDecref(PyObject* list, Py_ssize_t len, PyObject* x) {
28695 PyList_SET_ITEM(list, len, x);
28696 Py_SET_SIZE(list, len + 1);
28701#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
28702static CYTHON_INLINE
int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
28703 PyListObject*
L = (PyListObject*) list;
28704 Py_ssize_t len = Py_SIZE(list);
28705 if (likely(
L->allocated > len)) {
28706 __Pyx__ListComp_AppendAndDecref(list, len, x);
28709 int result = PyList_Append(list, x);
28714static CYTHON_INLINE
int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
28715 int result = PyList_Append(list, x);
28722#if CYTHON_USE_TYPE_SLOTS
28723static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
28724 PyObject *result, *pymul = PyLong_FromSsize_t(mul);
28725 if (unlikely(!pymul))
28727 result = PyNumber_Multiply(seq, pymul);
28731static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
28732 PyTypeObject *type = Py_TYPE(seq);
28733 if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
28734 return type->tp_as_sequence->sq_repeat(seq, mul);
28736 return __Pyx_PySequence_Multiply_Generic(seq, mul);
28742#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
28743#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
28744#ifndef __Pyx_DEFINED_BinopTypeError
28745#define __Pyx_DEFINED_BinopTypeError
28746static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2,
const char* op,
int inplace) {
28747 char opname[4] = {op[0], op[1], 0, 0};
28749 opname[op[1] ? 2 : 1] =
'=';
28751 __Pyx_RaiseErrorWithObjectTypes1(
28753 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME
"' and '" __Pyx_FMT_TYPENAME
"'",
28758#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
28759#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
28760static PyObject* __Pyx_PyNumber_Multiply_xfloat_int(PyObject *op1, PyObject *op2,
int inplace) {
28761 if (likely(op2 != Py_None)) {
28763 #if CYTHON_USE_PYLONG_INTERNALS
28764 if (__Pyx_PyLong_IsCompact(op2)) {
28765 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
28766 int_op2 = (double) compact_op2;
28770 int_op2 = PyLong_AsDouble(op2);
28771 if (unlikely((int_op2 == -1.) && PyErr_Occurred()))
return NULL;
28773 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
28774 #if !CYTHON_ASSUME_SAFE_MACROS
28775 if (unlikely((float_op1 == -1.) && PyErr_Occurred()))
return NULL;
28777 if (float_op1 == 0.)
return __Pyx_NewRef(op1);
28778 return PyFloat_FromDouble(float_op1 * int_op2);
28780 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
28782 PyTypeObject *type_op2 = Py_TYPE(op2);
28783 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
28784 if (likely(slot_func)) {
28785 PyObject *result = slot_func(op1, op2);
28786 if (likely(result != Py_NotImplemented)) {
28791 __Pyx_BinopTypeError(op1, op2,
"*", inplace);
28795 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
28799#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_int
28800#define __Pyx_DEFINED_PyNumber_Multiply_xint_int
28801static PyObject* __Pyx_PyNumber_Multiply_xint_int(PyObject *op1, PyObject *op2,
int inplace) {
28802 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
28804 PyTypeObject *type_op2 = Py_TYPE(op2);
28805 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
28806 if (likely(slot_func)) {
28807 PyObject *result = slot_func(op1, op2);
28808 if (likely(result != Py_NotImplemented)) {
28813 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
28814 if (likely(repeat_func)) {
28816 #if CYTHON_USE_PYLONG_INTERNALS
28817 if (__Pyx_PyLong_IsCompact(op1)) {
28818 count = __Pyx_PyLong_CompactValue(op1);
28822 count = PyLong_AsSsize_t(op1);
28823 if (unlikely((count == -1) && PyErr_Occurred()))
return NULL;
28825 return repeat_func(op2, count);
28827 __Pyx_BinopTypeError(op1, op2,
"*", inplace);
28831 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
28835static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2,
int inplace) {
28836 if (PyFloat_CheckExact(op1)) {
28837 return __Pyx_PyNumber_Multiply_xfloat_int(op1, op2, inplace);
28839 if (likely(PyLong_CheckExact(op1))) {
28840 if (likely(op2 != Py_None)) {
28841 #if CYTHON_USE_PYLONG_INTERNALS
28842 if (__Pyx_PyLong_IsCompact(op1)) {
28843 long long int_op1 = (
long long) __Pyx_PyLong_CompactValue(op1);
28844 if (int_op1 == 0)
return __Pyx_NewRef(op1);
28845 if (__Pyx_PyLong_IsCompact(op2)) {
28846 long long int_op2 = (
long long) __Pyx_PyLong_CompactValue(op2);
28847 if (int_op2 == 0)
return __Pyx_NewRef(op2);
28848 return PyLong_FromLongLong(int_op1 * int_op2);
28851 else if (__Pyx_PyLong_IsZero(op2))
return __Pyx_NewRef(op2);
28853 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_multiply, binaryfunc);
28854 if (likely(slot_func)) {
28855 return slot_func(op1, op2);
28858 return __Pyx_PyNumber_Multiply_xint_int(op1, op2, inplace);
28860 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
28865static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject*
s, PyObject*
f) {
28866 if (unlikely(!
s))
return NULL;
28867 if (likely(PyUnicode_CheckExact(
s)))
return s;
28868 return __Pyx_PyObject_FormatAndDecref(
s,
f);
28870static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject*
s, PyObject*
f) {
28872 if (unlikely(!
s))
return NULL;
28873 result = PyObject_Format(
s,
f);
28879#if CYTHON_USE_UNICODE_WRITER
28880static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
28882 _PyUnicodeWriter writer;
28883 if (likely(PyFloat_CheckExact(obj))) {
28884 _PyUnicodeWriter_Init(&writer);
28885 ret = _PyFloat_FormatAdvancedWriter(
28888 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
28889 }
else if (likely(PyLong_CheckExact(obj))) {
28890 _PyUnicodeWriter_Init(&writer);
28891 ret = _PyLong_FormatAdvancedWriter(
28894 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
28896 return PyObject_Format(obj, format_spec);
28898 if (unlikely(ret == -1)) {
28899 _PyUnicodeWriter_Dealloc(&writer);
28902 return _PyUnicodeWriter_Finish(&writer);
28907static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v) {
28909 if (unlikely(!j))
return -1;
28910 r = PyObject_SetItem(o, j,
v);
28914#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
28915static CYTHON_INLINE
int __Pyx_SetItemInt_Fast_mapping(PyObject *o, objobjargproc setitem, Py_ssize_t i, PyObject *value) {
28916 PyObject *key = PyLong_FromSsize_t(i);
28917 if (unlikely(!key))
return -1;
28918 int r = setitem(o, key, value);
28923static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *
v,
28924 int wraparound,
int boundscheck,
int unsafe_shared) {
28925 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
28926#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
28927 if (PyList_CheckExact(o)) {
28928 Py_ssize_t
n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
28929 if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
28931 return PyList_SetItem(o,
n,
v);
28932 }
else if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o)))) {
28935 old = PyList_GET_ITEM(o,
n);
28936 PyList_SET_ITEM(o,
n,
v);
28942#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
28943 if (PyDict_CheckExact(o)) {
28944 return __Pyx_SetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_ass_subscript, i,
v);
28947 PyTypeObject *obj_type = Py_TYPE(o);
28948 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
28949 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
28950 PyMappingMethods *mm = obj_type->tp_as_mapping;
28951 if (mm && mm->mp_ass_subscript)
28952 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i,
v);
28954 PySequenceMethods *sm = obj_type->tp_as_sequence;
28955 if (likely(sm && sm->sq_ass_item)) {
28956 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
28958 return sm->sq_ass_item(o, i,
v);
28960 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
28961 PyMappingMethods *mm = obj_type->tp_as_mapping;
28962 if (likely(mm && mm->mp_ass_subscript))
28963 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i,
v);
28967 if (!PyMapping_Check(o)) {
28968 return PySequence_SetItem(o, i,
v);
28973 return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i),
v);
28977static void __Pyx_RaiseUnboundLocalError(
const char *varname) {
28978 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
28982static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b,
int b_is_constant) {
28985 long adapt_python = (b_is_constant ?
28986 ((
r != 0) & ((
r < 0) ^ (b < 0))) :
28987 ((
r != 0) & ((
r ^ b) < 0))
28989 return q - adapt_python;
28993#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
28994static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
28995 PyListObject*
L = (PyListObject*) list;
28996 Py_ssize_t len = Py_SIZE(list);
28997 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
28999 __Pyx__ListComp_AppendAndDecref(list, len, x);
29002 return PyList_Append(list, x);
29007static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
29008#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
29009 PyObject *args[2] = {obj, arg};
29010 return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
29011#elif CYTHON_COMPILING_IN_LIMITED_API
29012 return PyObject_CallMethodObjArgs(obj, method_name, arg, NULL);
29014 return PyObject_CallMethodOneArg(obj, method_name, arg);
29019static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
29020 (void) __Pyx_PyObject_CallMethod1;
29021#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030e0000 || defined(PyBytes_Join)
29022 return PyBytes_Join(sep, values);
29023#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyBytes_Join)
29024 return _PyBytes_Join(sep, values);
29026 return __Pyx_PyObject_CallMethod1(sep, __pyx_mstate_global->__pyx_n_u_join, values);
29031static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_size_t(
size_t value, Py_ssize_t width,
char padding_char) {
29032#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29033#pragma GCC diagnostic push
29034#pragma GCC diagnostic ignored "-Wconversion"
29036 const size_t neg_one = (size_t) -1, const_zero = (
size_t) 0;
29037#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29038#pragma GCC diagnostic pop
29040 const int is_unsigned = neg_one > const_zero;
29041 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
29042 !(
sizeof(value) <= 2 || value & ~ (
size_t) 0x01fffff || __Pyx_CheckUnicodeValue((
int) value)))) {
29043 PyErr_SetString(PyExc_OverflowError,
"%c arg not in range(0x110000)");
29047 return PyUnicode_FromOrdinal((
int) value);
29049 return __Pyx_PyUnicode_FromOrdinal_Padded((
int) value, width, padding_char);
29051static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_size_t(
size_t value, Py_ssize_t width,
char padding_char,
char format_char) {
29052 char digits[
sizeof(size_t)*3+2];
29053 char *dpos, *end = digits +
sizeof(size_t)*3+2;
29054 const char *hex_digits = DIGITS_HEX;
29055 Py_ssize_t length, ulength;
29056 int prepend_sign, last_one_off;
29058#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29059#pragma GCC diagnostic push
29060#pragma GCC diagnostic ignored "-Wconversion"
29062 const size_t neg_one = (size_t) -1, const_zero = (
size_t) 0;
29063#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29064#pragma GCC diagnostic pop
29066 const int is_unsigned = neg_one > const_zero;
29067 if (format_char ==
'X') {
29076 switch (format_char) {
29078 digit_pos = abs((
int)(remaining % (8*8)));
29079 remaining = (size_t) (remaining / (8*8));
29081 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
29082 last_one_off = (digit_pos < 8);
29085 digit_pos = abs((
int)(remaining % (10*10)));
29086 remaining = (size_t) (remaining / (10*10));
29088 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
29089 last_one_off = (digit_pos < 10);
29092 *(--dpos) = hex_digits[abs((
int)(remaining % 16))];
29093 remaining = (size_t) (remaining / 16);
29099 }
while (unlikely(remaining != 0));
29100 assert(!last_one_off || *dpos ==
'0');
29101 dpos += last_one_off;
29102 length = end - dpos;
29105 if (!is_unsigned && value <= neg_one) {
29106 if (padding_char ==
' ' || width <= length + 1) {
29114 if (width > ulength) {
29117 if (ulength == 1) {
29118 return PyUnicode_FromOrdinal(*dpos);
29120 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (
int) length, prepend_sign, padding_char);
29124static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t,
int is_final) {
29125 if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
29126 allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
29127 return alloc_func(t, 0);
29129 newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
29130 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
29132 PyObject *new_str = PyUnicode_FromString(
"__new__");
29133 if (likely(new_str)) {
29134 PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
29135 Py_DECREF(new_str);
29141 return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
29146static CYTHON_INLINE
int __Pyx_CallSlotAsVectorcallUnpackDict(Py_ssize_t args_size, PyObject *keys_dict, PyObject **args, PyObject *kwnames) {
29147 Py_ssize_t pos = 0, i = 0;
29148 PyObject *key, *value;
29149 while (PyDict_Next(keys_dict, &pos, &key, &value)) {
29151 args[args_size+i] = value;
29153 if (unlikely(__Pyx_PyTuple_SET_ITEM(kwnames, i, key) == -1)) {
29162#if CYTHON_VECTORCALL_TPNEW
29163static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc
f, PyTypeObject* o, PyObject *a, PyObject *k) {
29164 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
29165#if !CYTHON_ASSUME_SAFE_SIZE
29166 if (unlikely(k_size < 0))
return NULL;
29168 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
29169#if !CYTHON_ASSUME_SAFE_SIZE
29170 if (unlikely(a_size < 0))
return NULL;
29172#if CYTHON_ASSUME_SAFE_MACROS
29174 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
29177 if (k_size == 0 && a_size == 0) {
29178 return f(o, NULL, 0, NULL);
29181 PyObject *stack_args[5];
29182 PyObject **args = stack_args;
29183 Py_ssize_t maxnargs = PY_SSIZE_T_MAX /
sizeof(PyObject*) - 1;
29184 if (a_size > maxnargs - k_size) {
29188 Py_ssize_t total_size = a_size + k_size;
29189 if (total_size > 5) {
29190 args = (PyObject**)PyMem_Malloc(((
size_t)total_size)*
sizeof(PyObject*));
29191 if (unlikely(!args)) {
29196 PyObject * result = NULL;
29197 PyObject *kwnames = NULL;
29198 int unpack_dict_result;
29200 for (; i < a_size; ++i) {
29201 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
29202#if !CYTHON_ASSUME_SAFE_MACROS
29203 if (unlikely(!args[i]))
goto cleanup;
29206#if !CYTHON_ASSUME_SAFE_MACROS
29210 kwnames = PyTuple_New(k_size);
29211 if (unlikely(!kwnames))
goto cleanup;
29212 __Pyx_BEGIN_CRITICAL_SECTION(k);
29213 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
29214 __Pyx_END_CRITICAL_SECTION();
29215 if (unlikely(unpack_dict_result == -1))
goto cleanup;
29217 result =
f(o, args, a_size, kwnames);
29219 Py_XDECREF(kwnames);
29220 for (i=a_size; i<total_size; ++i) {
29221 Py_XDECREF(args[i]);
29223 if (args != stack_args) {
29231#if CYTHON_VECTORCALL_TPNEW
29232static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
29233 newfunc tp_new = __Pyx_PyType_GetSlot(t, tp_new, newfunc);
29234 if (unlikely(!tp_new)) {
29235 __Pyx_RaiseErrorWithType(PyExc_TypeError,
"cannot create " __Pyx_FMT_TYPENAME
" instances", t);
29238 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
29239 PyObject *result = NULL, *args_tuple = NULL, *kwds_dict = NULL;
29240 Py_ssize_t kw_size = kwnames ? __Pyx_PyTuple_GET_SIZE(kwnames) : 0;
29241#if !CYTHON_ASSUME_SAFE_SIZE
29242 if (unlikely(kw_size == -1)) {
29247 kwds_dict = __Pyx_PyDict_NewPresized(kw_size);
29248 if (unlikely(!kwds_dict)) {
29251 for (Py_ssize_t i=0; i<kw_size; ++i) {
29252 PyObject *
v = args[nargs + i];
29253 PyObject *k = __Pyx_PyTuple_GET_ITEM(kwnames, i);
29254#if !CYTHON_ASSUME_SAFE_MACROS
29255 if (unlikely(!k)) {
29259 if (unlikely(PyDict_SetItem(kwds_dict, k,
v) < 0)) {
29265 args_tuple = __Pyx_PyTuple_FromArray(args, nargs);
29266 if (unlikely(!args_tuple)) {
29270 args_tuple = __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
29272 result = tp_new(t, args_tuple, kwds_dict);
29273 if (unlikely(!result)) {
29276 if (PyObject_TypeCheck(result, t)) {
29277 initproc tp_init = __Pyx_PyObject_GetSlot(result, tp_init, initproc);
29278 if (tp_init && unlikely(tp_init(result, args_tuple, kwds_dict) < 0)) {
29283 Py_XDECREF(args_tuple);
29284 Py_XDECREF(kwds_dict);
29290#if CYTHON_VECTORCALL_TPNEW
29291static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc
f, PyObject* o, PyObject *a, PyObject *k) {
29292 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
29293#if !CYTHON_ASSUME_SAFE_SIZE
29294 if (unlikely(k_size < 0))
return -1;
29296 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
29297#if !CYTHON_ASSUME_SAFE_SIZE
29298 if (unlikely(a_size < 0))
return -1;
29300#if CYTHON_ASSUME_SAFE_MACROS
29302 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
29305 if (k_size == 0 && a_size == 0) {
29306 return f(o, NULL, 0, NULL);
29309 PyObject *stack_args[5];
29310 PyObject **args = stack_args;
29311 Py_ssize_t maxnargs = PY_SSIZE_T_MAX /
sizeof(PyObject*) - 1;
29312 if (a_size > maxnargs - k_size) {
29316 Py_ssize_t total_size = a_size + k_size;
29317 if (total_size > 5) {
29318 args = (PyObject**)PyMem_Malloc(((
size_t)total_size)*
sizeof(PyObject*));
29319 if (unlikely(!args)) {
29325 PyObject *kwnames = NULL;
29326 int unpack_dict_result;
29328 for (; i < a_size; ++i) {
29329 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
29330#if !CYTHON_ASSUME_SAFE_MACROS
29331 if (unlikely(!args[i]))
goto cleanup;
29334#if !CYTHON_ASSUME_SAFE_MACROS
29338 kwnames = PyTuple_New(k_size);
29339 if (unlikely(!kwnames))
goto cleanup;
29340 __Pyx_BEGIN_CRITICAL_SECTION(k);
29341 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
29342 __Pyx_END_CRITICAL_SECTION();
29343 if (unlikely(unpack_dict_result == -1))
goto cleanup;
29345 result =
f(o, args, a_size, kwnames);
29347 Py_XDECREF(kwnames);
29348 for (i=a_size; i<total_size; ++i) {
29349 Py_XDECREF(args[i]);
29351 if (args != stack_args) {
29359#if !CYTHON_USE_TYPE_SPECS
29361static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg) {
29362 if (!always_call) {
29363 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
29364 unsigned long flags = PyType_GetFlags(base);
29365 if (flags & Py_TPFLAGS_HEAPTYPE) {
29369 Py_VISIT((PyObject*)Py_TYPE(o));
29375static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
29376#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
29377 return PyObject_VectorcallMethod(method_name, &obj, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
29378#elif CYTHON_COMPILING_IN_LIMITED_API
29379 return PyObject_CallMethodObjArgs(obj, method_name, NULL);
29381 return PyObject_CallMethodNoArgs(obj, method_name);
29386#if !CYTHON_USE_TYPE_SLOTS
29387CYTHON_UNUSED
static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp,
int require_cython_valid_result) {
29388 PyObject *tp_dictoffset_o;
29389 Py_ssize_t tp_dictoffset;
29390 tp_dictoffset_o = PyObject_GetAttrString(tp,
"__dictoffset__");
29391 if (unlikely(!tp_dictoffset_o))
return -1;
29392 tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
29393 Py_DECREF(tp_dictoffset_o);
29394 if (unlikely(require_cython_valid_result && tp_dictoffset == 0)) {
29397 "'type' doesn't have a dictoffset");
29399 }
else if (unlikely(require_cython_valid_result && tp_dictoffset < 0)) {
29402 "'type' has an unexpected negative dictoffset. "
29403 "Please report this as Cython bug");
29406 return tp_dictoffset;
29411#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
29412static int __Pyx_validate_bases_tuple(
const char *type_name,
int has_dictoffset, PyObject *bases) {
29414#if CYTHON_ASSUME_SAFE_SIZE
29415 n = PyTuple_GET_SIZE(bases);
29417 n = PyTuple_Size(bases);
29418 if (unlikely(
n < 0))
return -1;
29420 if (!has_dictoffset) {
29422#if CYTHON_AVOID_BORROWED_REFS
29423 b = PySequence_GetItem(bases, 0);
29425#elif CYTHON_ASSUME_SAFE_MACROS
29426 b = PyTuple_GET_ITEM(bases, 0);
29428 b = PyTuple_GetItem(bases, 0);
29431#if CYTHON_USE_TYPE_SLOTS
29432 has_dictoffset = ((PyTypeObject*)b)->tp_dictoffset != 0;
29434 Py_ssize_t dictoffset = __Pyx_GetTypeDictOffset(b, 0);
29435 has_dictoffset = dictoffset != 0;
29437#if CYTHON_AVOID_BORROWED_REFS
29440#if !CYTHON_USE_TYPE_SLOTS
29441 if (dictoffset == -1 && PyErr_Occurred())
return -1;
29444 for (i = 1; i <
n; i++)
29447#if CYTHON_AVOID_BORROWED_REFS
29448 PyObject *b0 = PySequence_GetItem(bases, i);
29449 if (!b0)
return -1;
29450#elif CYTHON_ASSUME_SAFE_MACROS
29451 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
29453 PyObject *b0 = PyTuple_GetItem(bases, i);
29454 if (!b0)
return -1;
29456 b = (PyTypeObject*) b0;
29457 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
29459 __Pyx_RaiseErrorWithType(
29460 PyExc_TypeError,
"base class '" __Pyx_FMT_TYPENAME
"' is not a heap type", b);
29461#if CYTHON_AVOID_BORROWED_REFS
29466 if (!has_dictoffset)
29468 Py_ssize_t b_dictoffset = 0;
29469#if CYTHON_USE_TYPE_SLOTS
29470 b_dictoffset = b->tp_dictoffset;
29472 b_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)b, 0);
29473 if (b_dictoffset == -1 && PyErr_Occurred())
goto dictoffset_return;
29475 if (b_dictoffset) {
29476 __Pyx_RaiseErrorWithType1(
29478 "extension type '%.200s' has no __dict__ slot, "
29479 "but base type '" __Pyx_FMT_TYPENAME
"' has: "
29480 "either add 'cdef dict __dict__' to the extension type "
29481 "or add '__slots__ = [...]' to the base type",
29483#if !CYTHON_USE_TYPE_SLOTS
29486#if CYTHON_AVOID_BORROWED_REFS
29492#if CYTHON_AVOID_BORROWED_REFS
29501CYTHON_UNUSED
static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
29503 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
29507 t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
29511static int __Pyx_PyType_Ready(PyTypeObject *t) {
29512#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON
29513 (void)__Pyx_PyObject_CallMethod0;
29514#if CYTHON_USE_TYPE_SPECS
29515 (void)__Pyx_validate_bases_tuple;
29517 return PyType_Ready(t);
29520 if (!__Pyx_PyType_HasMultipleInheritance(t)) {
29521 return PyType_Ready(t);
29523 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
29524 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset != 0, bases) == -1))
29527 int gc_was_enabled;
29528 #if PY_VERSION_HEX >= 0x030A00b1
29529 gc_was_enabled = PyGC_Disable();
29530 (void)__Pyx_PyObject_CallMethod0;
29532 PyObject *ret, *py_status;
29533 PyObject *gc = NULL;
29534 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
29535 !CYTHON_COMPILING_IN_GRAAL
29536 gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
29538 if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
29539 if (unlikely(!gc))
return -1;
29540 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
29541 if (unlikely(!py_status)) {
29545 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
29546 Py_DECREF(py_status);
29547 if (gc_was_enabled > 0) {
29548 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
29549 if (unlikely(!ret)) {
29554 }
else if (unlikely(gc_was_enabled == -1)) {
29559 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
29560#if PY_VERSION_HEX >= 0x030A0000
29561 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
29563 r = PyType_Ready(t);
29564 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
29565 #if PY_VERSION_HEX >= 0x030A00b1
29566 if (gc_was_enabled)
29569 if (gc_was_enabled) {
29570 PyObject *tp, *
v, *tb;
29571 PyErr_Fetch(&tp, &
v, &tb);
29572 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
29573 if (likely(ret ||
r == -1)) {
29575 PyErr_Restore(tp,
v, tb);
29591#if CYTHON_COMPILING_IN_LIMITED_API
29592static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp) {
29593 static Py_ssize_t tp_dictoffset = 0;
29594 if (unlikely(tp_dictoffset == 0)) {
29595 tp_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)(&PyType_Type), 1);
29596 if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
29601 return *(PyObject**)((
char*)tp + tp_dictoffset);
29606static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
29609#if CYTHON_COMPILING_IN_LIMITED_API
29610 tp_dict = __Pyx_GetTypeTypeDict(tp);
29611 if (unlikely(!tp_dict))
return -1;
29613 tp_dict = tp->tp_dict;
29615 result = PyDict_DelItem(tp_dict, k);
29616 if (likely(!result)) PyType_Modified(tp);
29621static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *
v) {
29624#if CYTHON_COMPILING_IN_LIMITED_API
29625 tp_dict = __Pyx_GetTypeTypeDict(tp);
29626 if (unlikely(!tp_dict))
return -1;
29628 tp_dict = tp->tp_dict;
29630 result = PyDict_SetItem(tp_dict, k,
v);
29631 if (likely(!result)) {
29632 PyType_Modified(tp);
29633 if (unlikely(PyObject_HasAttr(
v, __pyx_mstate_global->__pyx_n_u_set_name))) {
29634 PyObject *setNameResult = PyObject_CallMethodObjArgs(
v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL);
29635 if (!setNameResult)
return -1;
29636 Py_DECREF(setNameResult);
29643static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
29645 PyObject *name_attr;
29646 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_2);
29647 if (likely(name_attr)) {
29648 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
29652 if (unlikely(ret < 0) && __Pyx_IgnoreException(PyExc_Exception)) {
29655 Py_XDECREF(name_attr);
29658static PyObject *__Pyx_setup_reduce_get_reduce_attribute(PyObject *type_obj, PyObject *name,
int allow_not_present) {
29659#if CYTHON_USE_PYTYPE_LOOKUP
29660 CYTHON_UNUSED_VAR(allow_not_present);
29661 return _PyType_Lookup((PyTypeObject*)type_obj, name);
29663 if (allow_not_present) {
29664 return __Pyx_PyObject_GetAttrStrNoError(type_obj, name);
29666 return __Pyx_PyObject_GetAttrStr(type_obj, name);
29670static int __Pyx_setup_reduce(PyObject* type_obj) {
29672 PyObject *object_reduce = NULL;
29673 PyObject *object_getstate = NULL;
29674 PyObject *object_reduce_ex = NULL;
29675 PyObject *reduce = NULL;
29676 PyObject *reduce_ex = NULL;
29677 PyObject *reduce_cython = NULL;
29678 PyObject *setstate = NULL;
29679 PyObject *setstate_cython = NULL;
29680 PyObject *getstate = NULL;
29681 getstate = __Pyx_setup_reduce_get_reduce_attribute(type_obj, __pyx_mstate_global->__pyx_n_u_getstate, 1);
29682 if (!getstate && PyErr_Occurred()) {
29686 object_getstate = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate, 1);
29687 if (!object_getstate && PyErr_Occurred()) {
29690 if (object_getstate != getstate) {
29694 object_reduce_ex = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex, 0);
29695 if (unlikely(!object_reduce_ex))
goto __PYX_BAD;
29696 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
29697 if (reduce_ex == object_reduce_ex) {
29698 object_reduce = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce, 0);
29699 if (!object_reduce)
goto __PYX_BAD;
29700 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
29701 int try_to_replace_reduce = (reduce == object_reduce);
29702 if (!try_to_replace_reduce) {
29703 try_to_replace_reduce = __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython);
29704 if (unlikely(try_to_replace_reduce < 0)) {
29708 if (try_to_replace_reduce) {
29709 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
29710 if (likely(reduce_cython)) {
29711 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
29712 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
29713 }
else if (reduce == object_reduce || PyErr_Occurred()) {
29716 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
29717 int try_to_replace_setstate;
29719 PyObject *exc = PyErr_Occurred();
29720 if (exc && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
29723 try_to_replace_setstate = 1;
29725 try_to_replace_setstate = __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython);
29726 if (unlikely(try_to_replace_setstate < 0)) {
29730 if (try_to_replace_setstate) {
29731 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
29732 if (likely(setstate_cython)) {
29733 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
29734 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
29735 }
else if (!setstate || PyErr_Occurred()) {
29739 PyType_Modified((PyTypeObject*)type_obj);
29744 if (!PyErr_Occurred()) {
29745 __Pyx_RaiseErrorWithType(
29746 PyExc_RuntimeError,
29747 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME,
29748 (PyTypeObject*)type_obj);
29752#if !CYTHON_USE_PYTYPE_LOOKUP
29753 Py_XDECREF(object_reduce);
29754 Py_XDECREF(object_reduce_ex);
29755 Py_XDECREF(object_getstate);
29756 Py_XDECREF(getstate);
29758 Py_XDECREF(reduce);
29759 Py_XDECREF(reduce_ex);
29760 Py_XDECREF(reduce_cython);
29761 Py_XDECREF(setstate);
29762 Py_XDECREF(setstate_cython);
29767#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_PYPY && CYTHON_USE_TYPE_SPECS)
29768int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp,
int is_sequence) {
29770 PyObject *collections_abc = PyImport_ImportModule(
"collections.abc");
29771 if (unlikely(!collections_abc))
return -1;
29772 abc = PyObject_GetAttrString(collections_abc, is_sequence ?
"Sequence":
"Mapping");
29773 Py_DECREF(collections_abc);
29774 if (unlikely(!abc))
return -1;
29775 PyObject *register_result = PyObject_CallMethod(abc,
"register",
"O", (PyObject*)tp);
29777 if (unlikely(!register_result))
return -1;
29778 Py_DECREF(register_result);
29781#elif CYTHON_COMPILING_IN_PYPY
29782int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp,
int is_sequence) {
29783 CYTHON_UNUSED_VAR(tp);
29784 CYTHON_UNUSED_VAR(is_sequence);
29785 return PyErr_WarnEx(
29786 PyExc_RuntimeWarning,
29787 "cython.collection_type only works on PyPy with the C flag CYTHON_USE_TYPE_SPECS=1",
29794static int __Pyx_GetVtable(PyTypeObject *type,
void** table) {
29797#if CYTHON_COMPILING_IN_LIMITED_API
29798 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
29800 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
29804 ptr = PyCapsule_GetPointer(ob, 0);
29805 if (!ptr && !PyErr_Occurred())
29806 PyErr_SetString(PyExc_RuntimeError,
"invalid vtable found for imported type");
29811 if (PyErr_ExceptionMatches(CYTHON_COMPILING_IN_LIMITED_API ? PyExc_AttributeError : PyExc_KeyError)) {
29819static int __Pyx_MergeVtables(PyTypeObject *type) {
29822 void** base_vtables;
29823 void* unknown = (
void*)-1;
29824 PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
29825 int base_depth = 0;
29827 PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
29830 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
29833 base_vtables = (
void**) PyMem_Malloc(
sizeof(
void*) * (
size_t)(base_depth + 1));
29834 if (unlikely(!base_vtables)) {
29838 base_vtables[0] = unknown;
29839#if CYTHON_COMPILING_IN_LIMITED_API
29840 size = PyTuple_Size(bases);
29841 if (size < 0)
goto other_failure;
29843 size = PyTuple_GET_SIZE(bases);
29845 for (i = 1; i < size; i++) {
29848#if CYTHON_AVOID_BORROWED_REFS
29849 basei = PySequence_GetItem(bases, i);
29850 if (unlikely(!basei))
goto other_failure;
29851#elif !CYTHON_ASSUME_SAFE_MACROS
29852 basei = PyTuple_GetItem(bases, i);
29853 if (unlikely(!basei))
goto other_failure;
29855 basei = PyTuple_GET_ITEM(bases, i);
29857 int get_vtable_result = __Pyx_GetVtable((PyTypeObject*)basei, &base_vtable);
29858#if CYTHON_AVOID_BORROWED_REFS
29861 if (get_vtable_result != 1) {
29862 if (get_vtable_result == -1) {
29863 goto other_failure;
29867 assert(base_vtable != NULL);
29869 PyTypeObject* base = __Pyx_PyType_TryGetSlot(type, tp_base, PyTypeObject*);
29870#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
29871 if (!base)
goto bad;
29873 for (j = 0; j < base_depth; j++) {
29874 if (base_vtables[j] == unknown) {
29875 switch (__Pyx_GetVtable(base, &base_vtables[j])) {
29877 assert(base_vtables[j] == NULL);
29883 goto other_failure;
29885 base_vtables[j + 1] = unknown;
29887 if (base_vtables[j] == base_vtable) {
29890 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
29891#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
29892 if (!base)
goto bad;
29897 PyMem_Free(base_vtables);
29901 PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
29902 PyTypeObject* basei;
29903#if CYTHON_AVOID_BORROWED_REFS
29904 basei = (PyTypeObject*)PySequence_GetItem(bases, i);
29905 if (unlikely(!basei))
goto other_failure;
29906#elif !CYTHON_ASSUME_SAFE_MACROS
29907 basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
29908 if (unlikely(!basei))
goto other_failure;
29910 basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
29912 __Pyx_RaiseTypeErrorWithTypes(
29913 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME
"' and '" __Pyx_FMT_TYPENAME
"'", tp_base, basei);
29914#if CYTHON_AVOID_BORROWED_REFS
29919 PyMem_Free(base_vtables);
29924static int __Pyx_SetVtable(PyTypeObject *type,
void *vtable) {
29925 PyObject *ob = PyCapsule_New(vtable, 0, 0);
29928#if CYTHON_COMPILING_IN_LIMITED_API
29929 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
29931 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
29935 return __Pyx_MergeVtables(type);
29942#ifndef __PYX_HAVE_RT_ImportType_3_3_0
29943#define __PYX_HAVE_RT_ImportType_3_3_0
29944static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module,
const char *module_name,
const char *class_name,
29945 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
29947 PyObject *result = 0;
29948 Py_ssize_t basicsize;
29949 Py_ssize_t itemsize;
29950#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
29951 PyObject *py_basicsize;
29952 PyObject *py_itemsize;
29954 result = PyObject_GetAttrString(module, class_name);
29957 if (!PyType_Check(result)) {
29958 PyErr_Format(PyExc_TypeError,
29959 "%.200s.%.200s is not a type object",
29960 module_name, class_name);
29963#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
29964 basicsize = ((PyTypeObject *)result)->tp_basicsize;
29965 itemsize = ((PyTypeObject *)result)->tp_itemsize;
29968 return (PyTypeObject *)result;
29970 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
29973 basicsize = PyLong_AsSsize_t(py_basicsize);
29974 Py_DECREF(py_basicsize);
29976 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
29978 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
29981 itemsize = PyLong_AsSsize_t(py_itemsize);
29982 Py_DECREF(py_itemsize);
29984 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
29988 if (size % alignment) {
29989 alignment = size % alignment;
29991 if (itemsize < (Py_ssize_t)alignment)
29992 itemsize = (Py_ssize_t)alignment;
29994 if ((
size_t)(basicsize + itemsize) < size) {
29995 PyErr_Format(PyExc_ValueError,
29996 "%.200s.%.200s size changed, may indicate binary incompatibility. "
29997 "Expected %zd from C header, got %zd from PyObject",
29998 module_name, class_name, size, basicsize+itemsize);
30001 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
30002 ((
size_t)basicsize > size || (
size_t)(basicsize + itemsize) < size)) {
30003 PyErr_Format(PyExc_ValueError,
30004 "%.200s.%.200s size changed, may indicate binary incompatibility. "
30005 "Expected %zd from C header, got %zd-%zd from PyObject",
30006 module_name, class_name, size, basicsize, basicsize+itemsize);
30009 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (
size_t)basicsize > size) {
30010 if (PyErr_WarnFormat(NULL, 0,
30011 "%.200s.%.200s size changed, may indicate binary incompatibility. "
30012 "Expected %zd from C header, got %zd from PyObject",
30013 module_name, class_name, size, basicsize) < 0) {
30017 return (PyTypeObject *)result;
30019 Py_XDECREF(result);
30025static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
30027#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
30028 PyDict_SetDefaultRef(d, key, default_value, &value);
30029#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
30030 PyObject *args[] = {d, key, default_value};
30031 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
30032#elif CYTHON_COMPILING_IN_LIMITED_API
30033 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
30035 value = PyDict_SetDefault(d, key, default_value);
30036 if (unlikely(!value))
return NULL;
30043#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
30044 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
30045 PyObject *module_dict = PyImport_GetModuleDict();
30047 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
30050 if (m != NULL && PyModule_Check(m)) {
30054 m = PyModule_NewObject(name);
30057 if (PyDict_CheckExact(module_dict)) {
30059 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
30063 if (PyObject_SetItem(module_dict, name, m) != 0) {
30070 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
30071 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
30072 return PyImport_AddModuleRef(name);
30074 PyObject *py_name = PyUnicode_FromString(name);
30075 if (!py_name)
return NULL;
30076 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
30077 Py_DECREF(py_name);
30080#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
30081 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
30082 PyObject *module = PyImport_AddModule(name);
30083 Py_XINCREF(module);
30089static PyObject *__Pyx_FetchSharedCythonABIModule(
void) {
30090 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
30094static int __Pyx_VerifyCachedType(PyObject *cached_type,
30096 Py_ssize_t expected_basicsize) {
30097 Py_ssize_t basicsize;
30098 if (!PyType_Check(cached_type)) {
30099 PyErr_Format(PyExc_TypeError,
30100 "Shared Cython type %.200s is not a type object", name);
30103 if (expected_basicsize == 0) {
30106#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
30107 if (expected_basicsize < 0) {
30108 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
30112 #if CYTHON_COMPILING_IN_LIMITED_API
30113 PyObject *py_basicsize;
30114 py_basicsize = PyObject_GetAttrString(cached_type,
"__basicsize__");
30115 if (unlikely(!py_basicsize))
return -1;
30116 basicsize = PyLong_AsSsize_t(py_basicsize);
30117 Py_DECREF(py_basicsize);
30118 py_basicsize = NULL;
30119 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred())
return -1;
30121 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
30124 if ((expected_basicsize >= 0) ?
30125 (basicsize != expected_basicsize) :
30126 (basicsize < -expected_basicsize)) {
30127 PyErr_Format(PyExc_TypeError,
30128 "Shared Cython type %.200s has the wrong size, try recompiling",
30136#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
30137static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
30138 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
30139 if (result && metaclass) {
30140 PyObject *old_tp = (PyObject*)Py_TYPE(result);
30141 Py_INCREF((PyObject*)metaclass);
30142 Py_SET_TYPE(result, metaclass);
30144 PyType_Modified((PyTypeObject*)result);
30149#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
30151static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
30152 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
30153 int get_item_ref_result;
30154 const char* object_name = strrchr(spec->name,
'.');
30155 object_name = object_name ? object_name+1 : spec->name;
30156 py_object_name = PyUnicode_FromString(object_name);
30157 if (!py_object_name)
return NULL;
30158 abi_module = __Pyx_FetchSharedCythonABIModule();
30159 if (!abi_module)
goto done;
30160 abi_module_dict = PyModule_GetDict(abi_module);
30161 if (!abi_module_dict)
goto done;
30162 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
30163 if (get_item_ref_result == 1) {
30164 if (__Pyx_VerifyCachedType(
30167 spec->basicsize) < 0) {
30171 }
else if (unlikely(get_item_ref_result == -1)) {
30174 cached_type = __Pyx_PyType_FromMetaclass(
30176 CYTHON_USE_MODULE_STATE ? module : abi_module,
30178 if (unlikely(!cached_type))
goto bad;
30179 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
30180 if (unlikely(new_cached_type != cached_type)) {
30181 if (unlikely(!new_cached_type))
goto bad;
30182 Py_DECREF(cached_type);
30183 cached_type = new_cached_type;
30184 if (__Pyx_VerifyCachedType(
30187 spec->basicsize) < 0) {
30192 Py_DECREF(new_cached_type);
30195 Py_XDECREF(abi_module);
30196 Py_DECREF(py_object_name);
30197 assert(cached_type == NULL || PyType_Check(cached_type));
30198 return (PyTypeObject *) cached_type;
30200 Py_XDECREF(cached_type);
30201 cached_type = NULL;
30206static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED
void* context) {
30207 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
30209#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
30210static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
30211 PyErr_SetString(PyExc_TypeError,
"Cannot instantiate Cython internal types");
30214static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
30215 PyErr_SetString(PyExc_TypeError,
"Cython internal types are immutable");
30219static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
30220 {
"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
30223static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
30224 {Py_tp_getset, (
void *)__pyx_CommonTypesMetaclass_getset},
30225 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
30226 {Py_tp_call, (
void*)__pyx_CommonTypesMetaclass_call},
30227 {Py_tp_new, (
void*)__pyx_CommonTypesMetaclass_call},
30228 {Py_tp_setattro, (
void*)__pyx_CommonTypesMetaclass_setattr},
30232static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
30233 __PYX_TYPE_MODULE_PREFIX
"_common_types_metatype",
30236 Py_TPFLAGS_IMMUTABLETYPE |
30237 Py_TPFLAGS_DISALLOW_INSTANTIATION |
30238 Py_TPFLAGS_DEFAULT,
30239 __pyx_CommonTypesMetaclass_slots
30241static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
30242 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
30243 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
30244 if (unlikely(!bases)) {
30247 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
30249 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
30256#if CYTHON_COMPILING_IN_LIMITED_API
30257static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func,
void (*cfunc)(
void)) {
30258 if (__Pyx_CyFunction_Check(func)) {
30259 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
30260 }
else if (PyCFunction_Check(func)) {
30261 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
30265static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
30266 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
30268 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
30269 if (unlikely(!newFunc)) {
30273 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
30274 Py_DECREF(newFunc);
30277 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
30280static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
30281 if (PyMethod_Check(func)) {
30282 func = PyMethod_GET_FUNCTION(func);
30284 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
30287static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj) {
30288#if CYTHON_COMPILING_IN_LIMITED_API
30289 __Pyx_Py_XDECREF_SET(
30290 __Pyx__CyFunction_GetClassObj(
f),
30291 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
30293 __Pyx_Py_XDECREF_SET(
30294 ((PyCMethodObject *) (
f))->mm_class,
30295 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
30298static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
30299 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
30300 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL);
30301 if (unlikely(!m->defaults))
30303 return m->defaults;
30305static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
30306 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
30307 m->defaults_tuple = tuple;
30310static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
30311 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
30312 m->defaults_kwdict = dict;
30315static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
30316 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
30317 m->func_annotations = dict;
30322#if CYTHON_COMPILING_IN_LIMITED_API
30323static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
30325 CYTHON_UNUSED_VAR(typ);
30327 return __Pyx_NewRef(func);
30328 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
30330 PyObject *args[] = {func, self};
30331 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
30334 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
30339static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
30340 CYTHON_UNUSED_VAR(typ);
30342 return __Pyx_NewRef(func);
30343 return PyMethod_New(func, self);
30348#if CYTHON_VECTORCALL
30349static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
30351 PyObject *res = NULL;
30353 PyObject **newargs;
30354 PyObject **kwvalues;
30356 #if CYTHON_AVOID_BORROWED_REFS
30362 PyObject *key, *value;
30363 unsigned long keys_are_strings;
30364 #if !CYTHON_ASSUME_SAFE_SIZE
30365 Py_ssize_t nkw = PyDict_Size(kw);
30366 if (unlikely(nkw == -1))
return NULL;
30368 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
30370 newargs = (PyObject **)PyMem_Malloc((nargs + (
size_t)nkw) *
sizeof(args[0]));
30371 if (unlikely(newargs == NULL)) {
30375 for (j = 0; j < nargs; j++) newargs[j] = args[j];
30376 kwnames = PyTuple_New(nkw);
30377 if (unlikely(kwnames == NULL)) {
30378 PyMem_Free(newargs);
30381 kwvalues = newargs + nargs;
30384 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
30385 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
30386 keys_are_strings &=
30387 #if CYTHON_COMPILING_IN_LIMITED_API
30388 PyType_GetFlags(Py_TYPE(key));
30390 Py_TYPE(key)->tp_flags;
30392 #if !CYTHON_ASSUME_SAFE_MACROS
30393 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0))
goto cleanup;
30395 PyTuple_SET_ITEM(kwnames, i, key);
30397 kwvalues[i] = value;
30400 if (unlikely(!keys_are_strings)) {
30401 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
30404 res = vc(func, newargs, nargs, kwnames);
30406 #if CYTHON_AVOID_BORROWED_REFS
30409 Py_DECREF(kwnames);
30410 for (i = 0; i < nkw; i++)
30411 Py_DECREF(kwvalues[i]);
30412 PyMem_Free(newargs);
30415static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
30417 Py_ssize_t kw_size =
30418 likely(kw == NULL) ?
30420#if !CYTHON_ASSUME_SAFE_SIZE
30423 PyDict_GET_SIZE(kw);
30425 if (kw_size == 0) {
30426 return vc(func, args, nargs, NULL);
30428#if !CYTHON_ASSUME_SAFE_SIZE
30429 else if (unlikely(kw_size == -1)) {
30433 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
30439__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
30441 if (unlikely(op->func_doc == NULL)) {
30442#if CYTHON_COMPILING_IN_LIMITED_API
30443 const char *doc = op->func_methoddef->ml_doc;
30445 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
30448 op->func_doc = PyUnicode_FromString(doc);
30449 if (unlikely(op->func_doc == NULL))
30452 Py_INCREF(Py_None);
30456 Py_INCREF(op->func_doc);
30457 return op->func_doc;
30460__Pyx_CyFunction_get_doc(PyObject *op_in,
void *closure) {
30462 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30463 CYTHON_UNUSED_VAR(closure);
30464 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30465 result = __Pyx_CyFunction_get_doc_locked(op);
30466 __Pyx_END_CRITICAL_SECTION();
30470__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value,
void *context)
30472 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30473 CYTHON_UNUSED_VAR(context);
30474 if (value == NULL) {
30478 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30479 __Pyx_Py_XDECREF_SET(op->func_doc, value);
30480 __Pyx_END_CRITICAL_SECTION();
30484__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
30486 if (unlikely(op->func_name == NULL)) {
30487#if CYTHON_COMPILING_IN_LIMITED_API
30488 const char *name = op->func_methoddef->ml_name;
30490 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
30492 op->func_name = PyUnicode_InternFromString(name);
30493 if (unlikely(op->func_name == NULL))
30496 Py_INCREF(op->func_name);
30497 return op->func_name;
30500__Pyx_CyFunction_get_name(PyObject *op,
void *context)
30502 PyObject *result = NULL;
30503 CYTHON_UNUSED_VAR(context);
30504 __Pyx_BEGIN_CRITICAL_SECTION(op);
30505 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
30506 __Pyx_END_CRITICAL_SECTION();
30510__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value,
void *context)
30512 CYTHON_UNUSED_VAR(context);
30513 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
30514 PyErr_SetString(PyExc_TypeError,
30515 "__name__ must be set to a string object");
30518 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30520 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30521 __Pyx_Py_XDECREF_SET(op->func_name, value);
30522 __Pyx_END_CRITICAL_SECTION();
30526__Pyx_CyFunction_get_qualname(PyObject *op_in,
void *context)
30528 CYTHON_UNUSED_VAR(context);
30529 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30531 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30532 Py_INCREF(op->func_qualname);
30533 result = op->func_qualname;
30534 __Pyx_END_CRITICAL_SECTION();
30538__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value,
void *context)
30540 CYTHON_UNUSED_VAR(context);
30541 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
30542 PyErr_SetString(PyExc_TypeError,
30543 "__qualname__ must be set to a string object");
30546 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30548 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30549 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
30550 __Pyx_END_CRITICAL_SECTION();
30553#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
30555__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op,
void *context)
30557 CYTHON_UNUSED_VAR(context);
30558 if (unlikely(op->func_dict == NULL)) {
30559 op->func_dict = PyDict_New();
30560 if (unlikely(op->func_dict == NULL))
30563 Py_INCREF(op->func_dict);
30564 return op->func_dict;
30568__Pyx_CyFunction_get_globals(PyObject *op_in,
void *context)
30570 CYTHON_UNUSED_VAR(context);
30571 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30572 Py_INCREF(op->func_globals);
30573 return op->func_globals;
30576__Pyx_CyFunction_get_closure(PyObject *op,
void *context)
30578 CYTHON_UNUSED_VAR(op);
30579 CYTHON_UNUSED_VAR(context);
30580 Py_INCREF(Py_None);
30584__Pyx_CyFunction_get_code(PyObject *op_in,
void *context)
30586 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30587 PyObject* result = (op->func_code) ? op->func_code : Py_None;
30588 CYTHON_UNUSED_VAR(context);
30593__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
30595 PyObject *res = op->defaults_getter(op_obj);
30596 if (unlikely(!res))
30598 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30599 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
30600 Py_INCREF(op->defaults_tuple);
30601 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
30602 Py_INCREF(op->defaults_kwdict);
30604 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
30605 if (unlikely(!op->defaults_tuple)) result = -1;
30607 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
30608 if (unlikely(!op->defaults_kwdict)) result = -1;
30615__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value,
void *context) {
30616 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30617 CYTHON_UNUSED_VAR(context);
30620 }
else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
30621 PyErr_SetString(PyExc_TypeError,
30622 "__defaults__ must be set to a tuple object");
30625 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__defaults__ will not "
30626 "currently affect the values used in function calls", 1);
30628 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30629 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
30630 __Pyx_END_CRITICAL_SECTION();
30634__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
30635 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30636 PyObject* result = op->defaults_tuple;
30637 if (unlikely(!result)) {
30638 if (op->defaults_getter) {
30639 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
30640 result = op->defaults_tuple;
30649__Pyx_CyFunction_get_defaults(PyObject *op,
void *context) {
30650 PyObject* result = NULL;
30651 CYTHON_UNUSED_VAR(context);
30652 __Pyx_BEGIN_CRITICAL_SECTION(op);
30653 result = __Pyx_CyFunction_get_defaults_locked(op);
30654 __Pyx_END_CRITICAL_SECTION();
30658__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value,
void *context) {
30659 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30660 CYTHON_UNUSED_VAR(context);
30663 }
else if (unlikely(value != Py_None && !PyDict_Check(value))) {
30664 PyErr_SetString(PyExc_TypeError,
30665 "__kwdefaults__ must be set to a dict object");
30668 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__kwdefaults__ will not "
30669 "currently affect the values used in function calls", 1);
30671 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30672 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
30673 __Pyx_END_CRITICAL_SECTION();
30677__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
30678 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30679 PyObject* result = op->defaults_kwdict;
30680 if (unlikely(!result)) {
30681 if (op->defaults_getter) {
30682 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
30683 result = op->defaults_kwdict;
30692__Pyx_CyFunction_get_kwdefaults(PyObject *op,
void *context) {
30694 CYTHON_UNUSED_VAR(context);
30695 __Pyx_BEGIN_CRITICAL_SECTION(op);
30696 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
30697 __Pyx_END_CRITICAL_SECTION();
30700static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
30702__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value,
void *context) {
30703 CYTHON_UNUSED_VAR(context);
30704 if (!value || value == Py_None) {
30706 }
else if (unlikely(!PyDict_Check(value))) {
30707 PyErr_SetString(PyExc_TypeError,
30708 "__annotations__ must be set to a dict object");
30711 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30713 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30714 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
30715 __Pyx_END_CRITICAL_SECTION();
30716 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0))
return -1;
30720__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
30723#if CYTHON_COMPILING_IN_PYPY
30724 *dict = PyObject_GenericGetDict(op_in, NULL);
30725#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
30726 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
30728 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
30729 *dict = likely(dictptr) ? *dictptr : NULL;
30731 return *dict ? 1 : 0;
30734__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
30738 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
30739 if (!dict_found)
return 0;
30740 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
30743__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
30746 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
30747 if (!dict_found)
return 0;
30749 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
30751#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
30752 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
30754 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
30756 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
30763__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
30766#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
30767 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
30769 dict = PyObject_GenericGetDict(op_in, NULL);
30771 if (unlikely(!dict))
return -1;
30772 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
30777__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
30778 PyObject* result = op->func_annotations;
30779 if (unlikely(!result)) {
30780 result = PyDict_New();
30781 if (unlikely(!result))
return NULL;
30782 op->func_annotations = result;
30788__Pyx_CyFunction_get_annotations(PyObject *op_in,
void *context) {
30789 PyObject *annotate = NULL;
30790 PyObject *result = NULL;
30791 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30792 CYTHON_UNUSED_VAR(context);
30793 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30794 result = __Pyx_XNewRef(op->func_annotations);
30795 __Pyx_END_CRITICAL_SECTION();
30796 if (result)
return result;
30797 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
30798 if (!annotate || annotate == Py_None) {
30799 Py_XDECREF(annotate);
30800 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30801 result = __Pyx_CyFunction_get_annotations_locked(op);
30802 __Pyx_END_CRITICAL_SECTION();
30805 PyObject *format = PyLong_FromLong(1L);
30806 if (likely(format)) {
30807 if (!Py_EnterRecursiveCall(
" cyfunction __annotations__.__get__")) {
30808 result = __Pyx_PyObject_CallOneArg(annotate, format);
30809 Py_LeaveRecursiveCall();
30813 Py_DECREF(annotate);
30814 if (unlikely(!result))
return NULL;
30815 if (unlikely(!PyDict_Check(result))) {
30816 PyErr_SetString(PyExc_TypeError,
"__annotate__ must return a dict");
30820 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30821 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
30822 __Pyx_END_CRITICAL_SECTION();
30825static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
30826 CYTHON_UNUSED_VAR(arg);
30827 if (unlikely(!self)) {
30828 PyErr_SetString(PyExc_SystemError,
"cython __annotate__ called without 'self' argument");
30832 if (Py_EnterRecursiveCall(
" in cyfunction annotate")) {
30835 result = __Pyx_CyFunction_get_annotations(self, NULL);
30836 Py_LeaveRecursiveCall();
30840__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context);
30842__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value,
void *context) {
30843 CYTHON_UNUSED_VAR(context);
30844 if (value == NULL) {
30845 PyErr_SetString(PyExc_TypeError,
"__annotate__ cannot be deleted");
30848 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
30849 PyErr_SetString(PyExc_TypeError,
"__annotate__ must be callable or None");
30852 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
30853#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
30854 PyCFunction cfunction = PyCFunction_GetFunction(value);
30855 if (unlikely(!cfunction))
return -1;
30856 PyObject *value_self = PyCFunction_GetSelf(value);
30857 if (unlikely(!value_self && PyErr_Occurred()))
return -1;
30859 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
30860 PyObject *value_self = PyCFunction_GET_SELF(value);
30862 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
30863 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
30866 if (value != Py_None) {
30867 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30868 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30869 Py_CLEAR(op->func_annotations);
30870 __Pyx_END_CRITICAL_SECTION();
30872 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
30874#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
30876__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
30877 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
30878 if (is_coroutine) {
30879 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
30880 fromlist = PyList_New(1);
30881 if (unlikely(!fromlist))
return NULL;
30883#if CYTHON_ASSUME_SAFE_MACROS
30884 PyList_SET_ITEM(fromlist, 0, marker);
30886 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
30887 Py_DECREF(fromlist);
30891 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
30892 Py_DECREF(fromlist);
30893 if (unlikely(!module)) {
30894 goto ignore_or_error;
30896 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
30898 if (likely(is_coroutine_value)) {
30899 return is_coroutine_value;
30902 if (!__Pyx_IgnoreException(PyExc_Exception)) {
30906 return __Pyx_PyBool_FromLong(is_coroutine);
30909__Pyx_CyFunction_get_is_coroutine(PyObject *op_in,
void *context) {
30910 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30912 CYTHON_UNUSED_VAR(context);
30913 if (op->func_is_coroutine) {
30914 return __Pyx_NewRef(op->func_is_coroutine);
30916 result = __Pyx_CyFunction_get_is_coroutine_value(op);
30917 if (unlikely(!result))
30919 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30920 if (op->func_is_coroutine) {
30922 result = __Pyx_NewRef(op->func_is_coroutine);
30924 op->func_is_coroutine = __Pyx_NewRef(result);
30926 __Pyx_END_CRITICAL_SECTION();
30930static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func,
const char* message, Py_ssize_t size) {
30931#if CYTHON_COMPILING_IN_LIMITED_API
30932 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
30933 if (!py_name)
return;
30934 PyErr_Format(PyExc_TypeError,
30935 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
30936 py_name, message, size);
30937 Py_DECREF(py_name);
30939 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
30940 PyErr_Format(PyExc_TypeError,
30941 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
30942 name, message, size);
30945static void __Pyx_CyFunction_raise_type_error(PyObject *func,
const char* message) {
30946#if CYTHON_COMPILING_IN_LIMITED_API
30947 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
30948 if (!py_name)
return;
30949 PyErr_Format(PyExc_TypeError,
30952 Py_DECREF(py_name);
30954 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
30955 PyErr_Format(PyExc_TypeError,
30960#if CYTHON_COMPILING_IN_LIMITED_API
30962__Pyx_CyFunction_get_module(PyObject *op_in,
void *context) {
30963 CYTHON_UNUSED_VAR(context);
30964 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30965 Py_INCREF(op->func_module);
30966 return op->func_module;
30969__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value,
void *context) {
30970 CYTHON_UNUSED_VAR(context);
30971 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30972 if (value == NULL) {
30976 PyObject *old = op->func_module;
30977 op->func_module = value;
30982static PyGetSetDef __pyx_CyFunction_getsets[] = {
30983 {
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
30984 {
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
30985 {
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
30986 {
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
30987 {
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
30988#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
30989 {
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
30990 {
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
30992 {
"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
30993 {
"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
30995 {
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
30996 {
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
30997 {
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
30998 {
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
30999 {
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
31000 {
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
31001 {
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
31002 {
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
31003 {
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
31004 {
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
31005 {
"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
31006#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
31007 {
"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
31009#if CYTHON_COMPILING_IN_LIMITED_API
31010 {
"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
31014static PyMemberDef __pyx_CyFunction_members[] = {
31015#if !CYTHON_COMPILING_IN_LIMITED_API
31016 {
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
31018#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
31019 {
"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
31020 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
31022#if CYTHON_VECTORCALL
31023#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
31024 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
31025 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
31027 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
31029#if CYTHON_COMPILING_IN_LIMITED_API
31030 {
"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
31031 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
31033 {
"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
31039__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
31041 PyObject *result = NULL;
31042 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
31043 CYTHON_UNUSED_VAR(args);
31044 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
31045 Py_INCREF(m->func_qualname);
31046 result = m->func_qualname;
31047 __Pyx_END_CRITICAL_SECTION();
31050static PyMethodDef __pyx_CyFunction_methods[] = {
31051 {
"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
31052 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
31053 "on Cython functions."},
31054 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
31058__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context) {
31059 PyObject *annotate = NULL;
31060 CYTHON_UNUSED_VAR(context);
31061 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
31062 if (annotate)
return annotate;
31063 PyObject *method = PyCFunction_New(
31064 &__pyx_CyFunction_methods[0],
31068#if CYTHON_COMPILING_IN_LIMITED_API
31069#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
31071#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
31073static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
31074 PyMethodDef *ml,
int flags, PyObject* qualname,
31075 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
31076 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
31077#if !CYTHON_COMPILING_IN_LIMITED_API
31078 PyCFunctionObject *cf = (PyCFunctionObject*) op;
31080 if (unlikely(op == NULL))
31082#if CYTHON_COMPILING_IN_LIMITED_API
31083 op->func_methoddef = ml;
31085 op->func_module =
module;
31088 __Pyx_CyFunction_weakreflist(op) = NULL;
31089#if !CYTHON_COMPILING_IN_LIMITED_API
31091 cf->m_self = (PyObject *) op;
31093 Py_XINCREF(closure);
31094 op->func_closure = closure;
31095#if !CYTHON_COMPILING_IN_LIMITED_API
31096 Py_XINCREF(module);
31097 cf->m_module =
module;
31099#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
31100 op->func_dict = NULL;
31102 op->func_name = NULL;
31103 Py_INCREF(qualname);
31104 op->func_qualname = qualname;
31105 op->func_doc = NULL;
31106#if CYTHON_COMPILING_IN_LIMITED_API
31107 op->func_classobj = NULL;
31109 ((PyCMethodObject*)op)->mm_class = NULL;
31111 op->func_globals = globals;
31112 Py_INCREF(op->func_globals);
31114 op->func_code = code;
31115 op->defaults = NULL;
31116 op->defaults_tuple = NULL;
31117 op->defaults_kwdict = NULL;
31118 op->defaults_getter = NULL;
31119 op->func_annotations = NULL;
31120#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
31121 op->func_is_coroutine = NULL;
31123#if CYTHON_VECTORCALL
31124 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
31126 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
31129 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
31131 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
31132 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
31134 case METH_FASTCALL | METH_KEYWORDS:
31135 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
31137 case METH_VARARGS | METH_KEYWORDS:
31138 __Pyx_CyFunction_func_vectorcall(op) = NULL;
31141 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
31148static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
31150 Py_CLEAR(m->func_closure);
31151#if CYTHON_COMPILING_IN_LIMITED_API
31152 Py_CLEAR(m->func_module);
31154 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
31156#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
31157 Py_CLEAR(m->func_dict);
31158#elif PY_VERSION_HEX < 0x030d0000
31159 _PyObject_ClearManagedDict((PyObject*)m);
31161 PyObject_ClearManagedDict((PyObject*)m);
31163 Py_CLEAR(m->func_name);
31164 Py_CLEAR(m->func_qualname);
31165 Py_CLEAR(m->func_doc);
31166 Py_CLEAR(m->func_globals);
31167 Py_CLEAR(m->func_code);
31168#if CYTHON_COMPILING_IN_LIMITED_API
31169 Py_CLEAR(m->func_classobj);
31172 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
31173 ((PyCMethodObject *) (m))->mm_class = NULL;
31177 Py_CLEAR(m->defaults_tuple);
31178 Py_CLEAR(m->defaults_kwdict);
31179 Py_CLEAR(m->func_annotations);
31180#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
31181 Py_CLEAR(m->func_is_coroutine);
31183 Py_CLEAR(m->defaults);
31187__Pyx_CyFunction_clear(PyObject *m)
31189 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
31191static void __Pyx__CyFunction_dealloc(PyObject *m)
31193 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
31194 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
31195 PyObject_ClearWeakRefs(m);
31196 __Pyx__CyFunction_clear(cyfunc);
31197 __Pyx_PyHeapTypeObject_GC_Del(m);
31199static void __Pyx_CyFunction_dealloc(PyObject *m)
31201 PyObject_GC_UnTrack(m);
31202 __Pyx__CyFunction_dealloc(m);
31204static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit,
void *arg)
31206 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
31208 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
31211 Py_VISIT(m->func_closure);
31212#if CYTHON_COMPILING_IN_LIMITED_API
31213 Py_VISIT(m->func_module);
31215 Py_VISIT(((PyCFunctionObject*)m)->m_module);
31217#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
31218 Py_VISIT(m->func_dict);
31222#if PY_VERSION_HEX < 0x030d0000
31223 _PyObject_VisitManagedDict
31225 PyObject_VisitManagedDict
31227 ((PyObject*)m, visit, arg);
31228 if (e != 0)
return e;
31231 __Pyx_VISIT_CONST(m->func_name);
31232 __Pyx_VISIT_CONST(m->func_qualname);
31233 Py_VISIT(m->func_doc);
31234 Py_VISIT(m->func_globals);
31235 __Pyx_VISIT_CONST(m->func_code);
31236 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
31237 Py_VISIT(m->defaults_tuple);
31238 Py_VISIT(m->defaults_kwdict);
31239 Py_VISIT(m->func_annotations);
31240#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
31241 Py_VISIT(m->func_is_coroutine);
31243 Py_VISIT(m->defaults);
31247__Pyx_CyFunction_repr(PyObject *op_in)
31249 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
31251 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
31252 repr = PyUnicode_FromFormat(
"<cyfunction %U at %p>",
31253 op->func_qualname, (
void *)op);
31254 __Pyx_END_CRITICAL_SECTION();
31257static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
31258#if CYTHON_COMPILING_IN_LIMITED_API
31259 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
31260 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
31261 int flags = cyfunc->func_methoddef->ml_flags;
31263 PyCFunctionObject*
f = (PyCFunctionObject*)func;
31264 PyCFunction meth =
f->m_ml->ml_meth;
31265 int flags =
f->m_ml->ml_flags;
31268 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
31270 if (likely(kw == NULL || PyDict_Size(kw) == 0))
31271 return (*meth)(self, arg);
31273 case METH_VARARGS | METH_KEYWORDS:
31274 return (*(PyCFunctionWithKeywords)(
void(*)(
void))meth)(self, arg, kw);
31276 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
31277#if CYTHON_ASSUME_SAFE_SIZE
31278 size = PyTuple_GET_SIZE(arg);
31280 size = PyTuple_Size(arg);
31281 if (unlikely(size < 0))
return NULL;
31283 if (likely(size == 0))
31284 return (*meth)(self, NULL);
31285 __Pyx_CyFunction_raise_argument_count_error(
31287 "takes no arguments", size);
31292 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
31293#if CYTHON_ASSUME_SAFE_SIZE
31294 size = PyTuple_GET_SIZE(arg);
31296 size = PyTuple_Size(arg);
31297 if (unlikely(size < 0))
return NULL;
31299 if (likely(size == 1)) {
31300 PyObject *result, *arg0;
31301 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31302 arg0 = PyTuple_GET_ITEM(arg, 0);
31304 arg0 = __Pyx_PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
31306 result = (*meth)(self, arg0);
31307 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
31312 __Pyx_CyFunction_raise_argument_count_error(
31314 "takes exactly one argument", size);
31319 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
31322 __Pyx_CyFunction_raise_type_error(
31323 func,
"takes no keyword arguments");
31326static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
31328 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
31331static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
31333 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
31334#if CYTHON_VECTORCALL
31335 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
31337#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
31338 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (
size_t)PyTuple_GET_SIZE(args), kw);
31340 (void) &__Pyx_PyVectorcall_FastCallDict;
31341 return PyVectorcall_Call(func, args, kw);
31345 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
31347 PyObject *new_args;
31349#if CYTHON_ASSUME_SAFE_SIZE
31350 argc = PyTuple_GET_SIZE(args);
31352 argc = PyTuple_Size(args);
31353 if (unlikely(argc < 0))
return NULL;
31355 new_args = PyTuple_GetSlice(args, 1, argc);
31356 if (unlikely(!new_args))
31358 self = PyTuple_GetItem(args, 0);
31359 if (unlikely(!self)) {
31360 Py_DECREF(new_args);
31361 PyErr_Format(PyExc_TypeError,
31362 "unbound method %.200S() needs an argument",
31363 cyfunc->func_qualname);
31366 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
31367 Py_DECREF(new_args);
31369 result = __Pyx_CyFunction_Call(func, args, kw);
31373#if CYTHON_VECTORCALL
31374static CYTHON_INLINE
int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
31377 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
31378 if (unlikely(nargs < 1)) {
31379 __Pyx_CyFunction_raise_type_error(
31380 func,
"needs an argument");
31385 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
31386 __Pyx_CyFunction_raise_type_error(
31387 func,
"takes no keyword arguments");
31392static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
31394 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
31395 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
31397#if CYTHON_COMPILING_IN_LIMITED_API
31398 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
31399 if (unlikely(!meth))
return NULL;
31401 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
31403 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
31415 if (unlikely(nargs != 0)) {
31416 __Pyx_CyFunction_raise_argument_count_error(
31417 func,
"takes no arguments", nargs);
31420 return meth(self, NULL);
31422static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
31424 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
31425 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
31427#if CYTHON_COMPILING_IN_LIMITED_API
31428 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
31429 if (unlikely(!meth))
return NULL;
31431 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
31433 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
31445 if (unlikely(nargs != 1)) {
31446 __Pyx_CyFunction_raise_argument_count_error(
31447 func,
"takes exactly one argument", nargs);
31450 return meth(self, args[0]);
31452static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
31454 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
31455 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
31457#if CYTHON_COMPILING_IN_LIMITED_API
31458 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
31459 if (unlikely(!meth))
return NULL;
31461 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
31463 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
31475 return ((__Pyx_PyCFunctionFastWithKeywords)(
void(*)(
void))meth)(self, args, nargs, kwnames);
31477static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
31479 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
31480 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
31481 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
31483#if CYTHON_COMPILING_IN_LIMITED_API
31484 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
31485 if (unlikely(!meth))
return NULL;
31487 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
31489 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
31501 #if PY_VERSION_HEX < 0x030e00A6
31502 size_t nargs_value = (size_t) nargs;
31504 Py_ssize_t nargs_value = nargs;
31506 return ((__Pyx_PyCMethod)(
void(*)(
void))meth)(self, cls, args, nargs_value, kwnames);
31509static PyType_Slot __pyx_CyFunctionType_slots[] = {
31510 {Py_tp_dealloc, (
void *)__Pyx_CyFunction_dealloc},
31511 {Py_tp_repr, (
void *)__Pyx_CyFunction_repr},
31512 {Py_tp_call, (
void *)__Pyx_CyFunction_CallAsMethod},
31513 {Py_tp_traverse, (
void *)__Pyx_CyFunction_traverse},
31514 {Py_tp_clear, (
void *)__Pyx_CyFunction_clear},
31515 {Py_tp_methods, (
void *)__pyx_CyFunction_methods},
31516 {Py_tp_members, (
void *)__pyx_CyFunction_members},
31517 {Py_tp_getset, (
void *)__pyx_CyFunction_getsets},
31518 {Py_tp_descr_get, (
void *)__Pyx_PyMethod_New},
31521static PyType_Spec __pyx_CyFunctionType_spec = {
31522 __PYX_TYPE_MODULE_PREFIX
"cython_function_or_method",
31523 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
31525#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
31526 Py_TPFLAGS_METHOD_DESCRIPTOR |
31528#if CYTHON_VECTORCALL
31529#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
31530 Py_TPFLAGS_HAVE_VECTORCALL |
31531#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
31532 _Py_TPFLAGS_HAVE_VECTORCALL |
31535#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
31536 Py_TPFLAGS_MANAGED_DICT |
31538 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
31539 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
31540 __pyx_CyFunctionType_slots
31542static int __pyx_CyFunction_init(PyObject *module) {
31543 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
31544 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
31545 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
31546 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
31553static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
31554 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
31555 (void)&__Pyx_Get_CyFunction_Type;
31556 PyObject *op = __Pyx_CyFunction_Init(
31557 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
31558 ml, flags, qualname, closure, module, globals, code
31561 PyObject_GC_Track(op);
31565static PyTypeObject *__Pyx_Get_CyFunction_Type(
void) {
31566 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
31567 Py_INCREF((PyObject*)tp);
31572#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
31573#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
31574#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
31575#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
31576#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
31578PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
31579 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
31580 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
31583static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
31584 PyObject *use_cline = NULL;
31585 PyObject *ptype, *pvalue, *ptraceback;
31586 PyObject *cython_runtime_dict;
31587 CYTHON_MAYBE_UNUSED_VAR(tstate);
31588 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
31591 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
31592 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
31593 if (likely(cython_runtime_dict)) {
31594 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
31595 use_cline, cython_runtime_dict,
31596 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
31598 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
31601 Py_XDECREF(use_cline);
31602 Py_XDECREF(cython_runtime_dict);
31603 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
31609static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
31610 int start = 0, mid = 0, end = count - 1;
31611 if (end >= 0 && code_line > entries[end].code_line) {
31614 while (start < end) {
31615 mid = start + (end - start) / 2;
31616 if (code_line < entries[mid].code_line) {
31618 }
else if (code_line > entries[mid].code_line) {
31624 if (code_line <= entries[mid].code_line) {
31630static __Pyx_CachedCodeObjectType *__pyx__find_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line) {
31631 __Pyx_CachedCodeObjectType* code_object;
31633 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
31636 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
31637 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
31640 code_object = code_cache->entries[pos].code_object;
31641 Py_INCREF(code_object);
31642 return code_object;
31644static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line) {
31645#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
31646 (void)__pyx__find_code_object;
31649 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
31650#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
31651 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
31652 if (old_count < 0) {
31653 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
31657 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
31658#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
31659 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
31664static void __pyx__insert_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line, __Pyx_CachedCodeObjectType* code_object)
31667 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
31668 if (unlikely(!code_line)) {
31671 if (unlikely(!entries)) {
31672 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
31673 if (likely(entries)) {
31674 code_cache->entries = entries;
31675 code_cache->max_count = 64;
31676 code_cache->count = 1;
31677 entries[0].code_line = code_line;
31678 entries[0].code_object = code_object;
31679 Py_INCREF(code_object);
31683 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
31684 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
31685 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
31686 entries[pos].code_object = code_object;
31687 Py_INCREF(code_object);
31691 if (code_cache->count == code_cache->max_count) {
31692 int new_max = code_cache->max_count + 64;
31693 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
31694 code_cache->entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
31695 if (unlikely(!entries)) {
31698 code_cache->entries = entries;
31699 code_cache->max_count = new_max;
31701 for (i=code_cache->count; i>pos; i--) {
31702 entries[i] = entries[i-1];
31704 entries[pos].code_line = code_line;
31705 entries[pos].code_object = code_object;
31706 code_cache->count++;
31707 Py_INCREF(code_object);
31709static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object) {
31710#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
31711 (void)__pyx__insert_code_object;
31714 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
31715#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
31716 __pyx_nonatomic_int_type expected = 0;
31717 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
31721 __pyx__insert_code_object(code_cache, code_line, code_object);
31722#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
31723 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
31729#include "compile.h"
31730#include "frameobject.h"
31731#include "traceback.h"
31732#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
31733 #ifndef Py_BUILD_CORE
31734 #define Py_BUILD_CORE 1
31736 #include "internal/pycore_frame.h"
31738#if CYTHON_COMPILING_IN_LIMITED_API
31739static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
31740 PyObject *firstlineno, PyObject *name) {
31741 PyObject *replace = NULL;
31742 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_firstlineno", firstlineno)))
return NULL;
31743 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_name", name)))
return NULL;
31744 replace = PyObject_GetAttrString(code,
"replace");
31745 if (likely(replace)) {
31746 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
31747 Py_DECREF(replace);
31752static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
31753 int py_line,
const char *filename) {
31754 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
31755 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
31756 PyObject *exc_type, *exc_value, *exc_traceback;
31759 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
31761 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
31762 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
31763 if (!code_object) {
31764 code_object = Py_CompileString(
"_getframe()", filename, Py_eval_input);
31765 if (unlikely(!code_object))
goto bad;
31766 py_py_line = PyLong_FromLong(py_line);
31767 if (unlikely(!py_py_line))
goto bad;
31769 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
31771 py_funcname = PyUnicode_FromString(funcname);
31773 if (unlikely(!py_funcname))
goto bad;
31774 dict = PyDict_New();
31775 if (unlikely(!dict))
goto bad;
31777 PyObject *old_code_object = code_object;
31778 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
31779 Py_DECREF(old_code_object);
31781 if (unlikely(!code_object))
goto bad;
31782 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
31784 dict = PyDict_New();
31786 getframe = PySys_GetObject(
"_getframe");
31787 if (unlikely(!getframe))
goto bad;
31788 if (unlikely(PyDict_SetItemString(dict,
"_getframe", getframe)))
goto bad;
31789 frame = PyEval_EvalCode(code_object, dict, dict);
31790 if (unlikely(!frame) || frame == Py_None)
goto bad;
31793 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
31794 Py_XDECREF(code_object);
31795 Py_XDECREF(py_py_line);
31796 Py_XDECREF(py_funcname);
31798 Py_XDECREF(replace);
31801 (
struct _frame*)frame);
31806static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
31807 const char *funcname,
int c_line,
31808 int py_line,
const char *filename) {
31809 PyCodeObject *py_code = NULL;
31810 PyObject *py_funcname = NULL;
31812 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
31813 if (!py_funcname)
goto bad;
31814 funcname = PyUnicode_AsUTF8(py_funcname);
31815 if (!funcname)
goto bad;
31817 py_code = PyCode_NewEmpty(filename, funcname, py_line);
31818 Py_XDECREF(py_funcname);
31821 Py_XDECREF(py_funcname);
31824static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
31825 int py_line,
const char *filename) {
31826 PyCodeObject *py_code = 0;
31827 PyFrameObject *py_frame = 0;
31828 PyThreadState *tstate = __Pyx_PyThreadState_Current;
31829 PyObject *ptype, *pvalue, *ptraceback;
31831 c_line = __Pyx_CLineForTraceback(tstate, c_line);
31833 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
31835 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
31836 py_code = __Pyx_CreateCodeObjectForTraceback(
31837 funcname, c_line, py_line, filename);
31842 Py_XDECREF(pvalue);
31843 Py_XDECREF(ptraceback);
31846 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
31847 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
31849 py_frame = PyFrame_New(
31852 __pyx_mstate_global->__pyx_d,
31855 if (!py_frame)
goto bad;
31856 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
31857 PyTraceBack_Here(py_frame);
31859 Py_XDECREF(py_code);
31860 Py_XDECREF(py_frame);
31865#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
31866 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
31867#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
31868 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
31869#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
31871 func_type value = func_value;\
31872 if (sizeof(target_type) < sizeof(func_type)) {\
31873 if (unlikely(value != (func_type) (target_type) value)) {\
31874 func_type zero = 0;\
31875 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
31876 return (target_type) -1;\
31877 if (is_unsigned && unlikely(value < zero))\
31878 goto raise_neg_overflow;\
31880 goto raise_overflow;\
31883 return (target_type) value;\
31887static CYTHON_INLINE PyObject *__pyx_memview_get_int(
const char *itemp) {
31888 return (PyObject *) __Pyx_PyLong_From_int(*(
int const *) itemp);
31890static CYTHON_INLINE
int __pyx_memview_set_int(
char *itemp, PyObject *obj) {
31891 int value = __Pyx_PyLong_As_int(obj);
31892 if (unlikely((value == (
int)-1) && PyErr_Occurred()))
31894 *(
int *) itemp = value;
31899static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp) {
31900 return (PyObject *) PyFloat_FromDouble(*(
double const *) itemp);
31902static CYTHON_INLINE
int __pyx_memview_set_double(
char *itemp, PyObject *obj) {
31903 double value = __Pyx_PyFloat_AsDouble(obj);
31904 if (unlikely((value == (
double)-1) && PyErr_Occurred()))
31906 *(
double *) itemp = value;
31911#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
31913 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
31914 return ::std::complex< float >(x, y);
31917 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
31918 return x + y*(__pyx_t_float_complex)_Complex_I;
31922 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
31923 __pyx_t_float_complex
z;
31931#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
31933 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31934 return (a.real == b.real) && (a.imag == b.imag);
31936 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31937 __pyx_t_float_complex
z;
31938 z.real = a.real + b.real;
31939 z.imag = a.imag + b.imag;
31942 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31943 __pyx_t_float_complex
z;
31944 z.real = a.real - b.real;
31945 z.imag = a.imag - b.imag;
31948 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31949 __pyx_t_float_complex
z;
31950 z.real = a.real * b.real - a.imag * b.imag;
31951 z.imag = a.real * b.imag + a.imag * b.real;
31955 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31957 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
31958 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
31959 if (b.real == 0 && b.imag == 0) {
31960 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
31962 float r = b.imag / b.real;
31963 float s = (float)(1.0) / (b.real + b.imag *
r);
31964 return __pyx_t_float_complex_from_parts(
31965 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
31968 float r = b.real / b.imag;
31969 float s = (float)(1.0) / (b.imag + b.real *
r);
31970 return __pyx_t_float_complex_from_parts(
31971 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
31975 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31977 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
31979 float denom = b.real * b.real + b.imag * b.imag;
31980 return __pyx_t_float_complex_from_parts(
31981 (a.real * b.real + a.imag * b.imag) / denom,
31982 (a.imag * b.real - a.real * b.imag) / denom);
31986 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
31987 __pyx_t_float_complex
z;
31992 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
31993 return (a.real == 0) && (a.imag == 0);
31995 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
31996 __pyx_t_float_complex
z;
32002 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
32003 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
32004 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
32006 return hypotf(
z.real,
z.imag);
32009 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
32010 __pyx_t_float_complex
z;
32011 float r, lnr, theta, z_r, z_theta;
32012 if (b.imag == 0 && b.real == (
int)b.real) {
32014 float denom = a.real * a.real + a.imag * a.imag;
32015 a.real = a.real / denom;
32016 a.imag = -a.imag / denom;
32019 switch ((
int)b.real) {
32027 return __Pyx_c_prod_float(a, a);
32029 z = __Pyx_c_prod_float(a, a);
32030 return __Pyx_c_prod_float(
z, a);
32032 z = __Pyx_c_prod_float(a, a);
32033 return __Pyx_c_prod_float(
z,
z);
32039 }
else if ((b.imag == 0) && (a.real >= 0)) {
32040 z.real = powf(a.real, b.real);
32043 }
else if (a.real > 0) {
32048 theta = atan2f(0.0, -1.0);
32051 r = __Pyx_c_abs_float(a);
32052 theta = atan2f(a.imag, a.real);
32055 z_r = expf(lnr * b.real - theta * b.imag);
32056 z_theta = theta * b.real + lnr * b.imag;
32057 z.real = z_r * cosf(z_theta);
32058 z.imag = z_r * sinf(z_theta);
32065#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
32067 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
32068 return ::std::complex< double >(x, y);
32071 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
32072 return x + y*(__pyx_t_double_complex)_Complex_I;
32076 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
32077 __pyx_t_double_complex
z;
32085#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
32087 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32088 return (a.real == b.real) && (a.imag == b.imag);
32090 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32091 __pyx_t_double_complex
z;
32092 z.real = a.real + b.real;
32093 z.imag = a.imag + b.imag;
32096 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32097 __pyx_t_double_complex
z;
32098 z.real = a.real - b.real;
32099 z.imag = a.imag - b.imag;
32102 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32103 __pyx_t_double_complex
z;
32104 z.real = a.real * b.real - a.imag * b.imag;
32105 z.imag = a.real * b.imag + a.imag * b.real;
32109 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32111 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
32112 }
else if (fabs(b.real) >= fabs(b.imag)) {
32113 if (b.real == 0 && b.imag == 0) {
32114 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
32116 double r = b.imag / b.real;
32117 double s = (double)(1.0) / (b.real + b.imag *
r);
32118 return __pyx_t_double_complex_from_parts(
32119 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
32122 double r = b.real / b.imag;
32123 double s = (double)(1.0) / (b.imag + b.real *
r);
32124 return __pyx_t_double_complex_from_parts(
32125 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
32129 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32131 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
32133 double denom = b.real * b.real + b.imag * b.imag;
32134 return __pyx_t_double_complex_from_parts(
32135 (a.real * b.real + a.imag * b.imag) / denom,
32136 (a.imag * b.real - a.real * b.imag) / denom);
32140 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
32141 __pyx_t_double_complex
z;
32146 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
32147 return (a.real == 0) && (a.imag == 0);
32149 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
32150 __pyx_t_double_complex
z;
32156 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
32157 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
32158 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
32160 return hypot(
z.real,
z.imag);
32163 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32164 __pyx_t_double_complex
z;
32165 double r, lnr, theta, z_r, z_theta;
32166 if (b.imag == 0 && b.real == (
int)b.real) {
32168 double denom = a.real * a.real + a.imag * a.imag;
32169 a.real = a.real / denom;
32170 a.imag = -a.imag / denom;
32173 switch ((
int)b.real) {
32181 return __Pyx_c_prod_double(a, a);
32183 z = __Pyx_c_prod_double(a, a);
32184 return __Pyx_c_prod_double(
z, a);
32186 z = __Pyx_c_prod_double(a, a);
32187 return __Pyx_c_prod_double(
z,
z);
32193 }
else if ((b.imag == 0) && (a.real >= 0)) {
32194 z.real = pow(a.real, b.real);
32197 }
else if (a.real > 0) {
32202 theta = atan2(0.0, -1.0);
32205 r = __Pyx_c_abs_double(a);
32206 theta = atan2(a.imag, a.real);
32209 z_r = exp(lnr * b.real - theta * b.imag);
32210 z_theta = theta * b.real + lnr * b.imag;
32211 z.real = z_r * cos(z_theta);
32212 z.imag = z_r * sin(z_theta);
32219#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
32221 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
32222 return ::std::complex< long double >(x, y);
32225 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
32226 return x + y*(__pyx_t_long_double_complex)_Complex_I;
32230 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
32231 __pyx_t_long_double_complex
z;
32239#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
32241 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32242 return (a.real == b.real) && (a.imag == b.imag);
32244 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) {
32245 __pyx_t_long_double_complex
z;
32246 z.real = a.real + b.real;
32247 z.imag = a.imag + b.imag;
32250 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) {
32251 __pyx_t_long_double_complex
z;
32252 z.real = a.real - b.real;
32253 z.imag = a.imag - b.imag;
32256 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) {
32257 __pyx_t_long_double_complex
z;
32258 z.real = a.real * b.real - a.imag * b.imag;
32259 z.imag = a.real * b.imag + a.imag * b.real;
32263 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) {
32265 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
32266 }
else if (fabsl(b.real) >= fabsl(b.imag)) {
32267 if (b.real == 0 && b.imag == 0) {
32268 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
32270 long double r = b.imag / b.real;
32271 long double s = (
long double)(1.0) / (b.real + b.imag *
r);
32272 return __pyx_t_long_double_complex_from_parts(
32273 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
32276 long double r = b.real / b.imag;
32277 long double s = (
long double)(1.0) / (b.imag + b.real *
r);
32278 return __pyx_t_long_double_complex_from_parts(
32279 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
32283 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) {
32285 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
32287 long double denom = b.real * b.real + b.imag * b.imag;
32288 return __pyx_t_long_double_complex_from_parts(
32289 (a.real * b.real + a.imag * b.imag) / denom,
32290 (a.imag * b.real - a.real * b.imag) / denom);
32294 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
32295 __pyx_t_long_double_complex
z;
32300 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
32301 return (a.real == 0) && (a.imag == 0);
32303 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
32304 __pyx_t_long_double_complex
z;
32310 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex
z) {
32311 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
32312 return sqrtl(
z.real*
z.real +
z.imag*
z.imag);
32314 return hypotl(
z.real,
z.imag);
32317 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) {
32318 __pyx_t_long_double_complex
z;
32319 long double r, lnr, theta, z_r, z_theta;
32320 if (b.imag == 0 && b.real == (
int)b.real) {
32322 long double denom = a.real * a.real + a.imag * a.imag;
32323 a.real = a.real / denom;
32324 a.imag = -a.imag / denom;
32327 switch ((
int)b.real) {
32335 return __Pyx_c_prod_long__double(a, a);
32337 z = __Pyx_c_prod_long__double(a, a);
32338 return __Pyx_c_prod_long__double(
z, a);
32340 z = __Pyx_c_prod_long__double(a, a);
32341 return __Pyx_c_prod_long__double(
z,
z);
32347 }
else if ((b.imag == 0) && (a.real >= 0)) {
32348 z.real = powl(a.real, b.real);
32351 }
else if (a.real > 0) {
32356 theta = atan2l(0.0, -1.0);
32359 r = __Pyx_c_abs_long__double(a);
32360 theta = atan2l(a.imag, a.real);
32363 z_r = expl(lnr * b.real - theta * b.imag);
32364 z_theta = theta * b.real + lnr * b.imag;
32365 z.real = z_r * cosl(z_theta);
32366 z.imag = z_r * sinl(z_theta);
32374#ifndef _Py_NO_RETURN
32375#define _Py_NO_RETURN
32378static void __pyx_fatalerror(
const char *fmt, ...) {
32381#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
32382 va_start(vargs, fmt);
32386 vsnprintf(msg, 200, fmt, vargs);
32388 Py_FatalError(msg);
32390static CYTHON_INLINE
int
32391__pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
32392 PyThread_type_lock lock)
32395 PyThread_acquire_lock(lock, 1);
32396 result = (*acquisition_count)++;
32397 PyThread_release_lock(lock);
32400static CYTHON_INLINE
int
32401__pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
32402 PyThread_type_lock lock)
32405 PyThread_acquire_lock(lock, 1);
32406 result = (*acquisition_count)--;
32407 PyThread_release_lock(lock);
32410static CYTHON_INLINE
void
32411__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
32413 __pyx_nonatomic_int_type old_acquisition_count;
32414 struct __pyx_memoryview_obj *memview = memslice->memview;
32415 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
32418 old_acquisition_count = __pyx_add_acquisition_count(memview);
32419 if (unlikely(old_acquisition_count <= 0)) {
32420 if (likely(old_acquisition_count == 0)) {
32422 Py_INCREF((PyObject *) memview);
32424 PyGILState_STATE _gilstate = PyGILState_Ensure();
32425 Py_INCREF((PyObject *) memview);
32426 PyGILState_Release(_gilstate);
32429 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
32430 old_acquisition_count+1, lineno);
32434static CYTHON_INLINE
void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
32435 int have_gil,
int lineno) {
32436 __pyx_nonatomic_int_type old_acquisition_count;
32437 struct __pyx_memoryview_obj *memview = memslice->memview;
32438 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
32439 memslice->memview = NULL;
32442 old_acquisition_count = __pyx_sub_acquisition_count(memview);
32443 memslice->data = NULL;
32444 if (likely(old_acquisition_count > 1)) {
32445 memslice->memview = NULL;
32446 }
else if (likely(old_acquisition_count == 1)) {
32448 Py_CLEAR(memslice->memview);
32450 PyGILState_STATE _gilstate = PyGILState_Ensure();
32451 Py_CLEAR(memslice->memview);
32452 PyGILState_Release(_gilstate);
32455 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
32456 old_acquisition_count-1, lineno);
32462__pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
32464 int i, index, step, start;
32465 Py_ssize_t itemsize = mvs.memview->view.itemsize;
32466 if (order ==
'F') {
32473 for (i = 0; i < ndim; i++) {
32474 index = start + step * i;
32475 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
32477 itemsize *= mvs.shape[index];
32484__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
32485 void **out_start,
void **out_end,
32486 int ndim,
size_t itemsize)
32490 start = end = slice->data;
32491 for (i = 0; i < ndim; i++) {
32492 Py_ssize_t stride = slice->strides[i];
32493 Py_ssize_t extent = slice->shape[i];
32495 *out_start = *out_end = start;
32499 end += stride * (extent - 1);
32501 start += stride * (extent - 1);
32504 *out_start = start;
32505 *out_end = end + itemsize;
32508__pyx_slices_overlap(__Pyx_memviewslice *slice1,
32509 __Pyx_memviewslice *slice2,
32510 int ndim,
size_t itemsize)
32512 void *start1, *end1, *start2, *end2;
32513 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
32514 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
32515 return (start1 < end2) && (start2 < end1);
32520__Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
32522 __Pyx_memviewslice *memviewslice,
32523 int memview_is_new_reference)
32525 __Pyx_RefNannyDeclarations
32527 Py_buffer *buf = &memview->view;
32528 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
32529 if (unlikely(memviewslice->memview || memviewslice->data)) {
32530 PyErr_SetString(PyExc_ValueError,
32531 "memviewslice is already initialized!");
32534 if (buf->strides) {
32535 for (i = 0; i < ndim; i++) {
32536 memviewslice->strides[i] = buf->strides[i];
32539 Py_ssize_t stride = buf->itemsize;
32540 for (i = ndim - 1; i >= 0; i--) {
32541 memviewslice->strides[i] = stride;
32542 stride *= buf->shape[i];
32545 for (i = 0; i < ndim; i++) {
32546 memviewslice->shape[i] = buf->shape[i];
32547 if (buf->suboffsets) {
32548 memviewslice->suboffsets[i] = buf->suboffsets[i];
32550 memviewslice->suboffsets[i] = -1;
32553 memviewslice->memview = memview;
32554 memviewslice->data = (
char *)buf->buf;
32555 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
32556 Py_INCREF((PyObject*)memview);
32561 memviewslice->memview = 0;
32562 memviewslice->data = 0;
32565 __Pyx_RefNannyFinishContext();
32570static void __pyx_memoryview_slice_memviewslice_err_dim(PyObject *error,
const char* msg,
int dim) {
32571 PyGILState_STATE gilstate = PyGILState_Ensure();
32572 PyErr_Format(error, msg, dim);
32573 PyGILState_Release(gilstate);
32575static CYTHON_INLINE
int __pyx_memoryview_slice_memviewslice(
32576 __Pyx_memviewslice *dst,
32577 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
32578 int dim,
int new_ndim,
int *suboffset_dim,
32579 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
32580 int have_start,
int have_stop,
int have_step,
32586 if (unlikely(!(0 <= start && start < shape))) {
32587 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_IndexError,
"Index out of bounds (axis %d)", dim);
32593 negative_step = step < 0;
32594 if (unlikely(step == 0)) {
32595 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_ValueError,
"Step may not be zero (axis %d)", dim);
32608 }
else if (start >= shape) {
32609 start = negative_step ? (shape - 1) : shape;
32612 start = negative_step ? (shape - 1) : 0;
32620 }
else if (stop > shape) {
32624 stop = negative_step ? -1 : shape;
32626 Py_ssize_t new_shape = (stop - start) / step;
32627 if ((stop - start) - step * new_shape) {
32630 if (new_shape < 0) {
32633 dst->strides[new_ndim] = stride * step;
32634 dst->shape[new_ndim] = new_shape;
32635 dst->suboffsets[new_ndim] = suboffset;
32637 if (suboffset_dim[0] < 0) {
32638 dst->data += start * stride;
32640 dst->suboffsets[suboffset_dim[0]] += start * stride;
32642 if (suboffset >= 0) {
32644 if (likely(new_ndim == 0)) {
32645 dst->data = ((
char **)(dst->data))[0] + suboffset;
32647 __pyx_memoryview_slice_memviewslice_err_dim(
32649 "All dimensions preceding dimension %d must be indexed and not sliced",
32654 suboffset_dim[0] = new_ndim;
32661static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
32662static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(
void) {
32663 const char* type_name =
"int";
32664 PyErr_Format(PyExc_OverflowError,
32665 "can't convert negative value to %.200s", type_name);
32668static int __Pyx_raise_overflow___Pyx_PyLong_As_int(
void) {
32669 const char* type_name =
"int";
32670 PyErr_Format(PyExc_OverflowError,
32671 "value too large to convert to %.200s", type_name);
32674static CYTHON_INLINE
int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
32675 const int is_unsigned = 1;
32676#if CYTHON_USE_PYLONG_INTERNALS
32678 const digit* digits = __Pyx_PyLong_Digits(x);
32679 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
32680 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
32681 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
32682 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32683 }
else if ((8 *
sizeof(
int) >= 2 * PyLong_SHIFT)) {
32684 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32687 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
32688 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
32689 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32690 }
else if ((8 *
sizeof(
int) >= 3 * PyLong_SHIFT)) {
32691 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32694 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
32695 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
32696 __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])))
32697 }
else if ((8 *
sizeof(
int) >= 4 * PyLong_SHIFT)) {
32698 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32703#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
32704 if (unlikely(Py_SIZE(x) < 0)) {
32705 goto raise_neg_overflow;
32709 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32710 if (unlikely(result < 0))
32712 if (unlikely(result == 1))
32713 goto raise_neg_overflow;
32716 if ((
sizeof(
int) <=
sizeof(
unsigned long))) {
32717 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
32718 }
else if ((
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG))) {
32719 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32721 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
32723 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
32725 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
32727static CYTHON_INLINE
int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
32728 const int is_unsigned = 0;
32729#if CYTHON_USE_PYLONG_INTERNALS
32730 if (__Pyx_PyLong_IsNeg(x)) {
32731 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
32732 const digit* digits = __Pyx_PyLong_Digits(x);
32733 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
32734 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
32735 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
32736 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
32737 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
32738 return (
int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32741 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
32742 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
32743 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
32744 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
32745 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
32746 return (
int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32749 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
32750 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
32751 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]));
32752 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
32753 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
32754 return (
int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32759 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
32760 const digit* digits = __Pyx_PyLong_Digits(x);
32761 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
32762 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
32763 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32764 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
32765 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32768 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
32769 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
32770 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32771 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
32772 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32775 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
32776 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
32777 __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])))
32778 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
32779 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32785 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
32786 if ((
sizeof(
int) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
32787 __PYX_VERIFY_RETURN_INT_EXC(
int,
int, PyLong_AsInt(x))
32790 if ((
sizeof(
int) <=
sizeof(
long))) {
32791 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
32792 }
else if ((
sizeof(
int) <=
sizeof(PY_LONG_LONG))) {
32793 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
32795 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
32797 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
32799 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
32801static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
32802#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32803#pragma GCC diagnostic push
32804#pragma GCC diagnostic ignored "-Wconversion"
32806 const int neg_one = (int) -1, const_zero = (
int) 0;
32807#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32808#pragma GCC diagnostic pop
32810 const int is_unsigned = neg_one > const_zero;
32813#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
32814 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
32815 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
32816 if (unlikely(bytes_copied == -1)) {
32817 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
32818 goto raise_overflow;
32822#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
32823 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
32824 unsigned char *bytes = (
unsigned char *)&val;
32825 ret = _PyLong_AsByteArray((PyLongObject *)x,
32826 bytes,
sizeof(val),
32827 is_little, !is_unsigned);
32828 if ((0))
goto raise_overflow;
32831 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
32832 int bits, remaining_bits, is_negative = 0;
32833 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
32834 if (likely(PyLong_CheckExact(x))) {
32835 v = __Pyx_NewRef(x);
32837 v = PyNumber_Long(x);
32838 if (unlikely(!
v))
return (
int) -1;
32839 assert(PyLong_CheckExact(
v));
32842 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
32843 if (unlikely(result < 0)) {
32847 is_negative = result == 1;
32849 if (is_unsigned && unlikely(is_negative)) {
32851 PyErr_SetString(PyExc_OverflowError,
32852 "can't convert negative value to int");
32854 }
else if (is_negative) {
32855 stepval = PyNumber_Invert(
v);
32857 if (unlikely(!stepval))
32864 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
32865 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
32866 for (bits = 0; bits < (int)
sizeof(int) * 8 - chunk_size; bits += chunk_size) {
32867 PyObject *tmp, *digit;
32869 digit = PyNumber_And(stepval, mask);
32870 if (unlikely(!digit))
goto done;
32871 idigit = PyLong_AsLong(digit);
32873 if (unlikely(idigit < 0))
goto done;
32874 val |= ((int) idigit) << bits;
32875 tmp = PyNumber_Rshift(stepval, shift);
32876 if (unlikely(!tmp))
goto done;
32877 Py_DECREF(stepval); stepval = tmp;
32879 Py_DECREF(shift); shift = NULL;
32880 Py_DECREF(mask); mask = NULL;
32882 long idigit = PyLong_AsLong(stepval);
32883 if (unlikely(idigit < 0))
goto done;
32884 remaining_bits = ((int)
sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
32885 if (unlikely(idigit >= (1L << remaining_bits)))
32886 goto raise_overflow;
32887 val |= ((int) idigit) << bits;
32889 if (!is_unsigned) {
32890 if (unlikely(val & (((
int) 1) << (
sizeof(
int) * 8 - 1))))
32891 goto raise_overflow;
32899 Py_XDECREF(stepval);
32905 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
32907static CYTHON_INLINE
int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
32908#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32909#pragma GCC diagnostic push
32910#pragma GCC diagnostic ignored "-Wconversion"
32912 const int neg_one = (int) -1, const_zero = (
int) 0;
32913#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32914#pragma GCC diagnostic pop
32916 const int is_unsigned = neg_one > const_zero;
32918 #if CYTHON_USE_PYLONG_INTERNALS
32919 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
32920 goto raise_neg_overflow;
32921 }
else if (__Pyx_PyLong_IsCompact(x)) {
32922 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
32926 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
32929 #if CYTHON_USE_PYLONG_INTERNALS
32930 if (__Pyx_PyLong_IsCompact(x)) {
32931 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
32935 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
32938#if CYTHON_USE_PYLONG_INTERNALS
32940 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
32942 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
32945static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
32947 PyObject *tmp = __Pyx_PyNumber_Long(x);
32948 if (!tmp)
return (
int) -1;
32949 val = __Pyx_PyLong_As_int(tmp);
32953static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *x) {
32954 if (likely(PyLong_Check(x))) {
32955 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
32957 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
32962#if CYTHON_VECTORCALL
32963CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
32964 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
32965#if !CYTHON_ASSUME_SAFE_MACROS
32966 if (unlikely(!key))
return -1;
32968 if (unlikely(!PyUnicode_Check(key))) {
32969 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
32975CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n) {
32976 PyObject *out = PyDict_New();
32977 if (unlikely(!out))
return NULL;
32978 for (Py_ssize_t i=0; i<
n; ++i) {
32979 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
32986CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
32987 PyObject *key = kwnames[i];
32988 if (unlikely(!PyUnicode_Check(key))) {
32989 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
32997#if !CYTHON_VECTORCALL
32998static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
33000 PyObject *obj = PyObject_GetAttr(args[0], name);
33001 if (unlikely(!obj))
33003 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
33010static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(
int value) {
33011#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33012#pragma GCC diagnostic push
33013#pragma GCC diagnostic ignored "-Wconversion"
33015 const int neg_one = (int) -1, const_zero = (
int) 0;
33016#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33017#pragma GCC diagnostic pop
33019 const int is_unsigned = neg_one > const_zero;
33021 if (
sizeof(
int) <
sizeof(
long)) {
33022 return PyLong_FromLong((
long) value);
33023 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
33024 return PyLong_FromUnsignedLong((
unsigned long) value);
33025#if !CYTHON_COMPILING_IN_PYPY
33026 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
33027 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
33031 if (
sizeof(
int) <=
sizeof(
long)) {
33032 return PyLong_FromLong((
long) value);
33033 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
33034 return PyLong_FromLongLong((PY_LONG_LONG) value);
33038 unsigned char *bytes = (
unsigned char *)&value;
33039#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
33041 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
33043 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
33045#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
33046 int one = 1;
int little = (int)*(
unsigned char *)&one;
33047 return _PyLong_FromByteArray(bytes,
sizeof(
int),
33048 little, !is_unsigned);
33050 int one = 1;
int little = (int)*(
unsigned char *)&one;
33051 PyObject *result = NULL, *kwds = NULL;
33052 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
33053 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
int));
33054 if (!py_bytes)
goto limited_bad;
33055 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
33056 if (!from_bytes_str)
goto limited_bad;
33057 order_str = PyUnicode_FromString(little ?
"little" :
"big");
33058 if (!order_str)
goto limited_bad;
33060 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
33061 if (!is_unsigned) {
33062 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
33063 if (!signed_str)
goto limited_bad;
33064#if CYTHON_VECTORCALL
33065 kwds = PyTuple_Pack(1, signed_str);
33068 PyObject *keys[] = {signed_str};
33069 PyObject *values[] = {Py_True};
33070 kwds = __Pyx_MakeKwargDict(keys, values, 1);
33073 Py_DECREF(signed_str);
33074 if (unlikely(!kwds))
goto limited_bad;
33076 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
33080 Py_XDECREF(order_str);
33081 Py_XDECREF(py_bytes);
33082 Py_XDECREF(from_bytes_str);
33089static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(
const __Pyx_TypeInfo *type) {
33090 struct __pyx_typeinfo_string result = { {0} };
33091 char *buf = (
char *) result.string;
33092 size_t size = type->size;
33093 switch (type->typegroup) {
33100 *buf = (type->is_unsigned) ?
'B' :
'b';
33101 else if (size == 2)
33102 *buf = (type->is_unsigned) ?
'H' :
'h';
33103 else if (size == 4)
33104 *buf = (type->is_unsigned) ?
'I' :
'i';
33105 else if (size == 8)
33106 *buf = (type->is_unsigned) ?
'Q' :
'q';
33113 __Pyx_TypeInfo complex_type = *type;
33114 complex_type.typegroup =
'R';
33115 complex_type.size /= 2;
33117 *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
33123 else if (size == 8)
33133static __Pyx_memviewslice
33134__pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
33135 const char *mode,
int ndim,
33136 Py_ssize_t sizeof_dtype,
int contig_flag,
33137 int dtype_is_object)
33139 __Pyx_RefNannyDeclarations
33141 __Pyx_memviewslice new_mvs = __Pyx_MEMSLICE_INIT;
33142 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
33143 Py_buffer *buf = &from_memview->view;
33144 PyObject *shape_tuple = NULL;
33145 struct __pyx_array_obj *array_obj = NULL;
33146 struct __pyx_memoryview_obj *memview_obj = NULL;
33147 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
33148 for (i = 0; i < ndim; i++) {
33149 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
33150 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
33151 "indirect dimensions (axis %d)", i);
33155 shape_tuple = PyTuple_New(ndim);
33156 if (unlikely(!shape_tuple)) {
33159 __Pyx_GOTREF(shape_tuple);
33160 for(i = 0; i < ndim; i++) {
33161 PyObject *temp_int = PyLong_FromSsize_t(from_mvs->shape[i]);
33162 if(unlikely(!temp_int)) {
33165#if CYTHON_ASSUME_SAFE_MACROS
33166 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
33168 if (PyTuple_SetItem(shape_tuple, i, temp_int) < 0) {
33174 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, mode, NULL);
33175 if (unlikely(!array_obj)) {
33178 __Pyx_GOTREF(array_obj);
33179 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
33180 (PyObject *) array_obj, contig_flag,
33182 from_mvs->memview->typeinfo);
33183 if (unlikely(!memview_obj))
33185 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
33187 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
33188 dtype_is_object) < 0))
33192 __Pyx_XDECREF((PyObject *) new_mvs.memview);
33193 new_mvs.memview = NULL;
33194 new_mvs.data = NULL;
33196 __Pyx_XDECREF(shape_tuple);
33197 __Pyx_XDECREF((PyObject *) array_obj);
33198 __Pyx_RefNannyFinishContext();
33203static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
33204 PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
33205 if (unlikely(!state_dict)) {
33208 int non_empty = PyObject_IsTrue(state_dict);
33209 if (non_empty == 0) {
33210 Py_DECREF(state_dict);
33212 }
else if (unlikely(non_empty == -1)) {
33216 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33217 dict = PyObject_GetAttrString(obj,
"__dict__");
33219 dict = PyObject_GenericGetDict(obj, NULL);
33221 if (unlikely(!dict)) {
33222 Py_DECREF(state_dict);
33226 if (likely(PyDict_CheckExact(dict))) {
33227 result = PyDict_Update(dict, state_dict);
33229 PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
33230 if (likely(obj_result)) {
33231 Py_DECREF(obj_result);
33237 Py_DECREF(state_dict);
33241static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
33242 Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
33243 #if !CYTHON_ASSUME_SAFE_SIZE
33244 if (unlikely(state_size == -1))
return -1;
33246 if (state_size <= index) {
33249 return __Pyx__UpdateUnpickledDict(obj, state, index);
33253static void __Pyx_RaiseUnpickleChecksumError(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members) {
33254 PyObject *pickle_module = PyImport_ImportModule(
"pickle");
33255 if (unlikely(!pickle_module))
return;
33256 PyObject *pickle_error = PyObject_GetAttrString(pickle_module,
"PickleError");
33257 Py_DECREF(pickle_module);
33258 if (unlikely(!pickle_error))
return;
33259 if (checksum2 == checksum1) {
33260 PyErr_Format(pickle_error,
"Incompatible checksums (0x%x vs (0x%x) = (%s))",
33261 checksum, checksum1, members);
33262 }
else if (checksum3 == checksum2) {
33263 PyErr_Format(pickle_error,
"Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
33264 checksum, checksum1, checksum2, members);
33266 PyErr_Format(pickle_error,
"Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
33267 checksum, checksum1, checksum2, checksum3, members);
33269 Py_DECREF(pickle_error);
33273static int __Pyx_CheckUnpickleChecksum(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members) {
33275 found |= checksum1 == checksum;
33276 found |= checksum2 == checksum;
33277 found |= checksum3 == checksum;
33280 __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
33285static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
33286static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(
void) {
33287 const char* type_name =
"long";
33288 PyErr_Format(PyExc_OverflowError,
33289 "can't convert negative value to %.200s", type_name);
33292static long __Pyx_raise_overflow___Pyx_PyLong_As_long(
void) {
33293 const char* type_name =
"long";
33294 PyErr_Format(PyExc_OverflowError,
33295 "value too large to convert to %.200s", type_name);
33298static CYTHON_INLINE
long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
33299 const int is_unsigned = 1;
33300#if CYTHON_USE_PYLONG_INTERNALS
33302 const digit* digits = __Pyx_PyLong_Digits(x);
33303 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33304 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
33305 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
33306 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33307 }
else if ((8 *
sizeof(
long) >= 2 * PyLong_SHIFT)) {
33308 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33311 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
33312 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
33313 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33314 }
else if ((8 *
sizeof(
long) >= 3 * PyLong_SHIFT)) {
33315 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33318 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
33319 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
33320 __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])))
33321 }
else if ((8 *
sizeof(
long) >= 4 * PyLong_SHIFT)) {
33322 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33327#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33328 if (unlikely(Py_SIZE(x) < 0)) {
33329 goto raise_neg_overflow;
33333 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33334 if (unlikely(result < 0))
33336 if (unlikely(result == 1))
33337 goto raise_neg_overflow;
33340 if ((
sizeof(
long) <=
sizeof(
unsigned long))) {
33341 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
33342 }
else if ((
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG))) {
33343 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33345 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
33347 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
33349 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
33351static CYTHON_INLINE
long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
33352 const int is_unsigned = 0;
33353#if CYTHON_USE_PYLONG_INTERNALS
33354 if (__Pyx_PyLong_IsNeg(x)) {
33355 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33356 const digit* digits = __Pyx_PyLong_Digits(x);
33357 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
33358 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
33359 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
33360 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
33361 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
33362 return (
long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33365 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
33366 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
33367 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
33368 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
33369 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
33370 return (
long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33373 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
33374 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
33375 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]));
33376 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
33377 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
33378 return (
long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33383 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33384 const digit* digits = __Pyx_PyLong_Digits(x);
33385 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
33386 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
33387 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33388 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
33389 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33392 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
33393 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
33394 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33395 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
33396 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33399 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
33400 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
33401 __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])))
33402 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
33403 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33409 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
33410 if ((
sizeof(
long) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
33411 __PYX_VERIFY_RETURN_INT_EXC(
long,
int, PyLong_AsInt(x))
33414 if ((
sizeof(
long) <=
sizeof(
long))) {
33415 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
33416 }
else if ((
sizeof(
long) <=
sizeof(PY_LONG_LONG))) {
33417 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
33419 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
33421 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
33423 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
33425static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
33426#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33427#pragma GCC diagnostic push
33428#pragma GCC diagnostic ignored "-Wconversion"
33430 const long neg_one = (long) -1, const_zero = (
long) 0;
33431#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33432#pragma GCC diagnostic pop
33434 const int is_unsigned = neg_one > const_zero;
33437#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
33438 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
33439 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
33440 if (unlikely(bytes_copied == -1)) {
33441 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
33442 goto raise_overflow;
33446#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
33447 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
33448 unsigned char *bytes = (
unsigned char *)&val;
33449 ret = _PyLong_AsByteArray((PyLongObject *)x,
33450 bytes,
sizeof(val),
33451 is_little, !is_unsigned);
33452 if ((0))
goto raise_overflow;
33455 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
33456 int bits, remaining_bits, is_negative = 0;
33457 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
33458 if (likely(PyLong_CheckExact(x))) {
33459 v = __Pyx_NewRef(x);
33461 v = PyNumber_Long(x);
33462 if (unlikely(!
v))
return (
long) -1;
33463 assert(PyLong_CheckExact(
v));
33466 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
33467 if (unlikely(result < 0)) {
33471 is_negative = result == 1;
33473 if (is_unsigned && unlikely(is_negative)) {
33475 PyErr_SetString(PyExc_OverflowError,
33476 "can't convert negative value to long");
33478 }
else if (is_negative) {
33479 stepval = PyNumber_Invert(
v);
33481 if (unlikely(!stepval))
33488 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
33489 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
33490 for (bits = 0; bits < (int)
sizeof(long) * 8 - chunk_size; bits += chunk_size) {
33491 PyObject *tmp, *digit;
33493 digit = PyNumber_And(stepval, mask);
33494 if (unlikely(!digit))
goto done;
33495 idigit = PyLong_AsLong(digit);
33497 if (unlikely(idigit < 0))
goto done;
33498 val |= ((long) idigit) << bits;
33499 tmp = PyNumber_Rshift(stepval, shift);
33500 if (unlikely(!tmp))
goto done;
33501 Py_DECREF(stepval); stepval = tmp;
33503 Py_DECREF(shift); shift = NULL;
33504 Py_DECREF(mask); mask = NULL;
33506 long idigit = PyLong_AsLong(stepval);
33507 if (unlikely(idigit < 0))
goto done;
33508 remaining_bits = ((int)
sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
33509 if (unlikely(idigit >= (1L << remaining_bits)))
33510 goto raise_overflow;
33511 val |= ((long) idigit) << bits;
33513 if (!is_unsigned) {
33514 if (unlikely(val & (((
long) 1) << (
sizeof(
long) * 8 - 1))))
33515 goto raise_overflow;
33523 Py_XDECREF(stepval);
33529 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
33531static CYTHON_INLINE
long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
33532#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33533#pragma GCC diagnostic push
33534#pragma GCC diagnostic ignored "-Wconversion"
33536 const long neg_one = (long) -1, const_zero = (
long) 0;
33537#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33538#pragma GCC diagnostic pop
33540 const int is_unsigned = neg_one > const_zero;
33542 #if CYTHON_USE_PYLONG_INTERNALS
33543 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
33544 goto raise_neg_overflow;
33545 }
else if (__Pyx_PyLong_IsCompact(x)) {
33546 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
33550 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
33553 #if CYTHON_USE_PYLONG_INTERNALS
33554 if (__Pyx_PyLong_IsCompact(x)) {
33555 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
33559 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
33562#if CYTHON_USE_PYLONG_INTERNALS
33564 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
33566 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
33569static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
33571 PyObject *tmp = __Pyx_PyNumber_Long(x);
33572 if (!tmp)
return (
long) -1;
33573 val = __Pyx_PyLong_As_long(tmp);
33577static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *x) {
33578 if (likely(PyLong_Check(x))) {
33579 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
33581 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
33586static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value) {
33587#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33588#pragma GCC diagnostic push
33589#pragma GCC diagnostic ignored "-Wconversion"
33591 const long neg_one = (long) -1, const_zero = (
long) 0;
33592#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33593#pragma GCC diagnostic pop
33595 const int is_unsigned = neg_one > const_zero;
33597 if (
sizeof(
long) <
sizeof(
long)) {
33598 return PyLong_FromLong((
long) value);
33599 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
33600 return PyLong_FromUnsignedLong((
unsigned long) value);
33601#if !CYTHON_COMPILING_IN_PYPY
33602 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
33603 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
33607 if (
sizeof(
long) <=
sizeof(
long)) {
33608 return PyLong_FromLong((
long) value);
33609 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
33610 return PyLong_FromLongLong((PY_LONG_LONG) value);
33614 unsigned char *bytes = (
unsigned char *)&value;
33615#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
33617 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
33619 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
33621#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
33622 int one = 1;
int little = (int)*(
unsigned char *)&one;
33623 return _PyLong_FromByteArray(bytes,
sizeof(
long),
33624 little, !is_unsigned);
33626 int one = 1;
int little = (int)*(
unsigned char *)&one;
33627 PyObject *result = NULL, *kwds = NULL;
33628 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
33629 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
long));
33630 if (!py_bytes)
goto limited_bad;
33631 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
33632 if (!from_bytes_str)
goto limited_bad;
33633 order_str = PyUnicode_FromString(little ?
"little" :
"big");
33634 if (!order_str)
goto limited_bad;
33636 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
33637 if (!is_unsigned) {
33638 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
33639 if (!signed_str)
goto limited_bad;
33640#if CYTHON_VECTORCALL
33641 kwds = PyTuple_Pack(1, signed_str);
33644 PyObject *keys[] = {signed_str};
33645 PyObject *values[] = {Py_True};
33646 kwds = __Pyx_MakeKwargDict(keys, values, 1);
33649 Py_DECREF(signed_str);
33650 if (unlikely(!kwds))
goto limited_bad;
33652 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
33656 Py_XDECREF(order_str);
33657 Py_XDECREF(py_bytes);
33658 Py_XDECREF(from_bytes_str);
33665static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x);
33666static char __Pyx_raise_neg_overflow___Pyx_PyLong_As_char(
void) {
33667 const char* type_name =
"char";
33668 PyErr_Format(PyExc_OverflowError,
33669 "can't convert negative value to %.200s", type_name);
33672static char __Pyx_raise_overflow___Pyx_PyLong_As_char(
void) {
33673 const char* type_name =
"char";
33674 PyErr_Format(PyExc_OverflowError,
33675 "value too large to convert to %.200s", type_name);
33678static CYTHON_INLINE
char __Pyx_PyULong___Pyx_PyLong_As_char(PyObject *x) {
33679 const int is_unsigned = 1;
33680#if CYTHON_USE_PYLONG_INTERNALS
33682 const digit* digits = __Pyx_PyLong_Digits(x);
33683 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33684 if (size == 2 && (8 *
sizeof(
char) > 1 * PyLong_SHIFT)) {
33685 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
33686 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33687 }
else if ((8 *
sizeof(
char) >= 2 * PyLong_SHIFT)) {
33688 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33691 if (size == 3 && (8 *
sizeof(
char) > 2 * PyLong_SHIFT)) {
33692 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
33693 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33694 }
else if ((8 *
sizeof(
char) >= 3 * PyLong_SHIFT)) {
33695 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33698 if (size == 4 && (8 *
sizeof(
char) > 3 * PyLong_SHIFT)) {
33699 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
33700 __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])))
33701 }
else if ((8 *
sizeof(
char) >= 4 * PyLong_SHIFT)) {
33702 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33707#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33708 if (unlikely(Py_SIZE(x) < 0)) {
33709 goto raise_neg_overflow;
33713 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33714 if (unlikely(result < 0))
33716 if (unlikely(result == 1))
33717 goto raise_neg_overflow;
33720 if ((
sizeof(
char) <=
sizeof(
unsigned long))) {
33721 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
33722 }
else if ((
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG))) {
33723 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33725 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
33727 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
33729 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
33731static CYTHON_INLINE
char __Pyx_PySLong___Pyx_PyLong_As_char(PyObject *x) {
33732 const int is_unsigned = 0;
33733#if CYTHON_USE_PYLONG_INTERNALS
33734 if (__Pyx_PyLong_IsNeg(x)) {
33735 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33736 const digit* digits = __Pyx_PyLong_Digits(x);
33737 if (size == 2 && (8 *
sizeof(
char) > 1 * PyLong_SHIFT)) {
33738 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
33739 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
33740 __PYX_VERIFY_RETURN_INT(
char,
long, ival)
33741 }
else if ((8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT)) {
33742 return (
char) (((char) -1) * (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33745 if (size == 3 && (8 *
sizeof(
char) > 2 * PyLong_SHIFT)) {
33746 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
33747 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
33748 __PYX_VERIFY_RETURN_INT(
char,
long, ival)
33749 }
else if ((8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT)) {
33750 return (
char) (((char) -1) * (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33753 if (size == 4 && (8 *
sizeof(
char) > 3 * PyLong_SHIFT)) {
33754 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
33755 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]));
33756 __PYX_VERIFY_RETURN_INT(
char,
long, ival)
33757 }
else if ((8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT)) {
33758 return (
char) (((char) -1) * (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33763 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33764 const digit* digits = __Pyx_PyLong_Digits(x);
33765 if (size == 2 && (8 *
sizeof(
char) > 1 * PyLong_SHIFT)) {
33766 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
33767 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33768 }
else if ((8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT)) {
33769 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33772 if (size == 3 && (8 *
sizeof(
char) > 2 * PyLong_SHIFT)) {
33773 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
33774 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33775 }
else if ((8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT)) {
33776 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33779 if (size == 4 && (8 *
sizeof(
char) > 3 * PyLong_SHIFT)) {
33780 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
33781 __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])))
33782 }
else if ((8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT)) {
33783 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33789 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
33790 if ((
sizeof(
char) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
33791 __PYX_VERIFY_RETURN_INT_EXC(
char,
int, PyLong_AsInt(x))
33794 if ((
sizeof(
char) <=
sizeof(
long))) {
33795 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
33796 }
else if ((
sizeof(
char) <=
sizeof(PY_LONG_LONG))) {
33797 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
33799 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
33801 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
33803 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
33805static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x) {
33806#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33807#pragma GCC diagnostic push
33808#pragma GCC diagnostic ignored "-Wconversion"
33810 const char neg_one = (char) -1, const_zero = (
char) 0;
33811#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33812#pragma GCC diagnostic pop
33814 const int is_unsigned = neg_one > const_zero;
33817#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
33818 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
33819 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
33820 if (unlikely(bytes_copied == -1)) {
33821 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
33822 goto raise_overflow;
33826#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
33827 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
33828 unsigned char *bytes = (
unsigned char *)&val;
33829 ret = _PyLong_AsByteArray((PyLongObject *)x,
33830 bytes,
sizeof(val),
33831 is_little, !is_unsigned);
33832 if ((0))
goto raise_overflow;
33835 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
33836 int bits, remaining_bits, is_negative = 0;
33837 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
33838 if (likely(PyLong_CheckExact(x))) {
33839 v = __Pyx_NewRef(x);
33841 v = PyNumber_Long(x);
33842 if (unlikely(!
v))
return (
char) -1;
33843 assert(PyLong_CheckExact(
v));
33846 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
33847 if (unlikely(result < 0)) {
33851 is_negative = result == 1;
33853 if (is_unsigned && unlikely(is_negative)) {
33855 PyErr_SetString(PyExc_OverflowError,
33856 "can't convert negative value to char");
33858 }
else if (is_negative) {
33859 stepval = PyNumber_Invert(
v);
33861 if (unlikely(!stepval))
33868 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
33869 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
33870 for (bits = 0; bits < (int)
sizeof(char) * 8 - chunk_size; bits += chunk_size) {
33871 PyObject *tmp, *digit;
33873 digit = PyNumber_And(stepval, mask);
33874 if (unlikely(!digit))
goto done;
33875 idigit = PyLong_AsLong(digit);
33877 if (unlikely(idigit < 0))
goto done;
33878 val |= ((char) idigit) << bits;
33879 tmp = PyNumber_Rshift(stepval, shift);
33880 if (unlikely(!tmp))
goto done;
33881 Py_DECREF(stepval); stepval = tmp;
33883 Py_DECREF(shift); shift = NULL;
33884 Py_DECREF(mask); mask = NULL;
33886 long idigit = PyLong_AsLong(stepval);
33887 if (unlikely(idigit < 0))
goto done;
33888 remaining_bits = ((int)
sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
33889 if (unlikely(idigit >= (1L << remaining_bits)))
33890 goto raise_overflow;
33891 val |= ((char) idigit) << bits;
33893 if (!is_unsigned) {
33894 if (unlikely(val & (((
char) 1) << (
sizeof(
char) * 8 - 1))))
33895 goto raise_overflow;
33903 Py_XDECREF(stepval);
33909 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
33911static CYTHON_INLINE
char __Pyx_PyLong___Pyx_PyLong_As_char(PyObject *x) {
33912#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33913#pragma GCC diagnostic push
33914#pragma GCC diagnostic ignored "-Wconversion"
33916 const char neg_one = (char) -1, const_zero = (
char) 0;
33917#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33918#pragma GCC diagnostic pop
33920 const int is_unsigned = neg_one > const_zero;
33922 #if CYTHON_USE_PYLONG_INTERNALS
33923 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
33924 goto raise_neg_overflow;
33925 }
else if (__Pyx_PyLong_IsCompact(x)) {
33926 __PYX_VERIFY_RETURN_INT(
char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
33930 return __Pyx_PyULong___Pyx_PyLong_As_char(x);
33933 #if CYTHON_USE_PYLONG_INTERNALS
33934 if (__Pyx_PyLong_IsCompact(x)) {
33935 __PYX_VERIFY_RETURN_INT(
char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
33939 return __Pyx_PySLong___Pyx_PyLong_As_char(x);
33942#if CYTHON_USE_PYLONG_INTERNALS
33944 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
33946 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
33949static char __Pyx_NonPyLong___Pyx_PyLong_As_char(PyObject *x) {
33951 PyObject *tmp = __Pyx_PyNumber_Long(x);
33952 if (!tmp)
return (
char) -1;
33953 val = __Pyx_PyLong_As_char(tmp);
33957static CYTHON_INLINE
char __Pyx_PyLong_As_char(PyObject *x) {
33958 if (likely(PyLong_Check(x))) {
33959 return __Pyx_PyLong___Pyx_PyLong_As_char(x);
33961 return __Pyx_NonPyLong___Pyx_PyLong_As_char(x);
33966#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
33967void __Pyx_init_runtime_version(
void) {
33968 if (__Pyx_cached_runtime_version == 0) {
33969 const char* rt_version = Py_GetVersion();
33970 unsigned long version = 0;
33971 unsigned long factor = 0x01000000UL;
33972 unsigned int digit = 0;
33975 while (
'0' <= rt_version[i] && rt_version[i] <=
'9') {
33976 digit = digit * 10 + (
unsigned int) (rt_version[i] -
'0');
33979 version += factor * digit;
33980 if (rt_version[i] !=
'.')
33986 __Pyx_cached_runtime_version = version;
33990static unsigned long __Pyx_get_runtime_version(
void) {
33991#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
33992 return Py_Version & ~0xFFUL;
33994 return __Pyx_cached_runtime_version;
33999static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer) {
34000 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
34001 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
34003 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
34007 PyOS_snprintf(message,
sizeof(message),
34008 "compile time Python version %d.%d "
34009 "of module '%.100s' "
34011 "runtime version %d.%d",
34012 (
int) (ct_version >> 24), (
int) ((ct_version >> 16) & 0xFF),
34014 (allow_newer) ?
"was newer than" :
"does not match",
34015 (
int) (rt_version >> 24), (
int) ((rt_version >> 16) & 0xFF)
34017 return PyErr_WarnEx(NULL, message, 1);
34022#if CYTHON_COMPILING_IN_LIMITED_API
34023 static PyObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
34024 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
34025 PyObject *fv, PyObject *cell, PyObject* fn,
34026 PyObject *name,
int fline, PyObject *lnos) {
34027 PyObject *exception_table = NULL;
34028 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
34029 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
34030 PyObject *version_info;
34031 PyObject *py_minor_version = NULL;
34033 long minor_version = 0;
34034 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
34035 minor_version = 11;
34037 if (!(version_info = PySys_GetObject(
"version_info")))
goto end;
34038 if (!(py_minor_version = PySequence_GetItem(version_info, 1)))
goto end;
34039 minor_version = PyLong_AsLong(py_minor_version);
34040 Py_DECREF(py_minor_version);
34041 if (minor_version == -1 && PyErr_Occurred())
goto end;
34043 if (!(types_module = PyImport_ImportModule(
"types")))
goto end;
34044 if (!(code_type = PyObject_GetAttrString(types_module,
"CodeType")))
goto end;
34045 if (minor_version <= 10) {
34046 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOiOOO", a,p, k, l,
s,
f, code,
34047 c,
n,
v, fn, name, fline, lnos, fv, cell);
34049 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0)))
goto end;
34050 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOOiOOOO", a,p, k, l,
s,
f, code,
34051 c,
n,
v, fn, name, name, fline, lnos, exception_table, fv, cell);
34054 Py_XDECREF(code_type);
34055 Py_XDECREF(exception_table);
34056 Py_XDECREF(types_module);
34058 PyObject *exc_type, *exc_value, *exc_tb;
34059 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
34060 if (PyErr_WarnFormat(
34061 PyExc_RuntimeWarning, 1,
34062 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
34063 exc_value ? exc_value : exc_type) == 0) {
34067 Py_DECREF(exc_type);
34068 Py_XDECREF(exc_value);
34069 Py_XDECREF(exc_tb);
34073#elif PY_VERSION_HEX >= 0x030B0000
34074 static PyCodeObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
34075 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
34076 PyObject *fv, PyObject *cell, PyObject* fn,
34077 PyObject *name,
int fline, PyObject *lnos) {
34078 PyCodeObject *result;
34080 #if PY_VERSION_HEX >= 0x030C0000
34081 PyUnstable_Code_NewWithPosOnlyArgs
34083 PyCode_NewWithPosOnlyArgs
34085 (a, p, k, l,
s,
f, code,
c,
n,
v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
34086 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
34087 if (likely(result))
34088 result->_co_firsttraceable = 0;
34092#elif !CYTHON_COMPILING_IN_PYPY
34093 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
34094 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
34096 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
34097 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
34099static PyObject* __Pyx_PyCode_New(
34100 const __Pyx_PyCode_New_function_description descr,
34101 PyObject *
const *varnames,
34102 PyObject *filename,
34103 PyObject *funcname,
34104 PyObject *line_table,
34105 PyObject *tuple_dedup_map
34107 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
34108 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
34109 PyObject *varnames_tuple = PyTuple_New(var_count);
34110 if (unlikely(!varnames_tuple))
return NULL;
34111 for (Py_ssize_t i=0; i < var_count; i++) {
34112 Py_INCREF(varnames[i]);
34113 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0))
goto done;
34115 #if CYTHON_COMPILING_IN_LIMITED_API
34116 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
34117 if (!varnames_tuple_dedup) {
34118 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0))
goto done;
34119 varnames_tuple_dedup = varnames_tuple;
34122 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
34123 if (unlikely(!varnames_tuple_dedup))
goto done;
34125 #if CYTHON_AVOID_BORROWED_REFS
34126 Py_INCREF(varnames_tuple_dedup);
34128 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
34129 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
34130 #if !CYTHON_ASSUME_SAFE_SIZE
34131 if (unlikely(line_table_length == -1))
goto done;
34133 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
34134 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
34135 if (unlikely(!code_bytes))
goto done;
34136 char* c_code_bytes = PyBytes_AsString(code_bytes);
34137 if (unlikely(!c_code_bytes))
goto done;
34138 memset(c_code_bytes, 0, (
size_t) code_len);
34140 code_obj = (PyObject*) __Pyx__PyCode_New(
34141 (
int) descr.argcount,
34142 (
int) descr.num_posonly_args,
34143 (
int) descr.num_kwonly_args,
34144 (
int) descr.nlocals,
34147 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
34148 __pyx_mstate_global->__pyx_empty_tuple,
34149 __pyx_mstate_global->__pyx_empty_tuple,
34150 varnames_tuple_dedup,
34151 __pyx_mstate_global->__pyx_empty_tuple,
34152 __pyx_mstate_global->__pyx_empty_tuple,
34155 (
int) descr.first_line,
34156 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
34159 Py_XDECREF(code_bytes);
34160 #if CYTHON_AVOID_BORROWED_REFS
34161 Py_XDECREF(varnames_tuple_dedup);
34163 Py_DECREF(varnames_tuple);
34169static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo) {
34170#ifdef __Pyx_DecompressString_UNUSED
34171 CYTHON_UNUSED_VAR(
s);
34172 CYTHON_UNUSED_VAR(length);
34173 CYTHON_UNUSED_VAR(algo);
34176 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
34177 const char* module_name = algo == 3 ?
"compression.zstd" : algo == 2 ?
"bz2" :
"zlib";
34178 PyObject *methodname = PyUnicode_FromString(
"decompress");
34179 if (unlikely(!methodname))
return NULL;
34180 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
34182 PyObject *fromlist = Py_BuildValue(
"[O]", methodname);
34183 if (unlikely(!fromlist))
goto bad;
34184 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
34185 Py_DECREF(fromlist);
34188 module = PyImport_ImportModule(module_name);
34189 if (unlikely(!module))
goto import_failed;
34190 decompress = PyObject_GetAttr(module, methodname);
34191 if (unlikely(!decompress))
goto import_failed;
34194 char *memview_bytes =
const_cast<char*
>(
s);
34196 #if defined(__clang__)
34197 #pragma clang diagnostic push
34198 #pragma clang diagnostic ignored "-Wcast-qual"
34199 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
34200 #pragma GCC diagnostic push
34201 #pragma GCC diagnostic ignored "-Wcast-qual"
34203 char *memview_bytes = (
char*)
s;
34204 #if defined(__clang__)
34205 #pragma clang diagnostic pop
34206 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
34207 #pragma GCC diagnostic pop
34210 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
34211 int memview_flags = 0x100;
34213 int memview_flags = PyBUF_READ;
34215 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
34217 if (unlikely(!compressed_bytes)) {
34218 Py_DECREF(decompress);
34221 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
34222 Py_DECREF(compressed_bytes);
34223 Py_DECREF(decompress);
34225 Py_DECREF(methodname);
34226 return decompressed;
34228 PyErr_Format(PyExc_ImportError,
34229 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
34230 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
34231 module_name, algo);
34233 Py_XDECREF(module);
34234 Py_DECREF(methodname);
34240#ifndef __Pyx_DecompressString_LZSS_UNUSED
34242static CYTHON_SMALL_CODE
size_t __pyx_lzss_decompress(
const uint8_t* src, uint8_t* dst,
size_t dst_len) {
34243 size_t pos = 0, out_pos = 0;
34245 uint32_t flags = src[pos++] | 0xFF00;
34246 while (flags & 0x100) {
34248 dst[out_pos++] = src[pos++];
34250 uint32_t lo = src[pos++], hi = src[pos++];
34251 uint32_t end_offset_of_last_occurrence, match_length;
34252 if (!(lo & 0x80)) {
34253 end_offset_of_last_occurrence = lo;
34255 }
else if (!(hi & 0x80)) {
34256 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
34257 match_length = hi & 0x1F;
34259 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
34260 match_length = src[pos++];
34263 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
34264 memcpy(dst + out_pos, dst + ref_pos, match_length);
34265 out_pos += match_length;
34267 if (out_pos >= dst_len)
return pos;
34273static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(
const char *
s,
size_t compressed_length,
size_t uncompressed_length) {
34274#ifdef __Pyx_DecompressString_LZSS_UNUSED
34275 CYTHON_UNUSED_VAR(
s);
34276 CYTHON_UNUSED_VAR(compressed_length);
34277 CYTHON_UNUSED_VAR(uncompressed_length);
34281 unsigned char *result_data;
34283 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
34284 if (unlikely(!result))
return NULL;
34285 result_data = __Pyx_PyBytes_AsWritableUString(result);
34286 if (unlikely(!result_data))
goto bad;
34287 src_length = __pyx_lzss_decompress((
const uint8_t*)
s, result_data, uncompressed_length);
34288 if (unlikely(src_length != compressed_length))
goto decompression_failed;
34290decompression_failed:
34291 PyErr_SetString(PyExc_RuntimeError,
"LZSS string data decompression failed");
34299static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s) {
34300 size_t len = strlen(
s);
34301 if (unlikely(len > (
size_t) PY_SSIZE_T_MAX)) {
34302 PyErr_SetString(PyExc_OverflowError,
"byte string is too long");
34305 return (Py_ssize_t) len;
34307static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
34308 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
34309 if (unlikely(len < 0))
return NULL;
34310 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
34312static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char* c_str) {
34313 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
34314 if (unlikely(len < 0))
return NULL;
34315 return PyByteArray_FromStringAndSize(c_str, len);
34317static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
34319 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
34321#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
34322static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
34323 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
34324#if CYTHON_COMPILING_IN_LIMITED_API
34326 const char* result;
34327 Py_ssize_t unicode_length;
34328 CYTHON_MAYBE_UNUSED_VAR(unicode_length);
34329 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
34330 if (unlikely(PyArg_Parse(o,
"s#", &result, length) < 0))
return NULL;
34332 result = PyUnicode_AsUTF8AndSize(o, length);
34334 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
34335 unicode_length = PyUnicode_GetLength(o);
34336 if (unlikely(unicode_length < 0))
return NULL;
34337 if (unlikely(unicode_length != *length)) {
34338 PyUnicode_AsASCIIString(o);
34345#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
34346 if (likely(PyUnicode_IS_ASCII(o))) {
34347 *length = PyUnicode_GET_LENGTH(o);
34348 return PyUnicode_AsUTF8(o);
34350 PyUnicode_AsASCIIString(o);
34354 return PyUnicode_AsUTF8AndSize(o, length);
34359static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
34360#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
34361 if (PyUnicode_Check(o)) {
34362 return __Pyx_PyUnicode_AsStringAndSize(o, length);
34365 if (PyByteArray_Check(o)) {
34366#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
34367 *length = PyByteArray_GET_SIZE(o);
34368 return PyByteArray_AS_STRING(o);
34370 *length = PyByteArray_Size(o);
34371 if (*length == -1)
return NULL;
34372 return PyByteArray_AsString(o);
34377 int r = PyBytes_AsStringAndSize(o, &result, length);
34378 if (unlikely(
r < 0)) {
34385static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
34386 int is_true = x == Py_True;
34387 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
34388 else return PyObject_IsTrue(x);
34390static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
34392 if (unlikely(!x))
return -1;
34393 retval = __Pyx_PyObject_IsTrue(x);
34397static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
34398 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
34399 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
34400 if (unlikely(!result_type_name))
goto bad;
34402 if (PyLong_Check(result)) {
34403 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
34404 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
"). "
34405 "The ability to return an instance of a strict subclass of int is deprecated, "
34406 "and may be removed in a future version of Python.",
34407 result_type_name)) {
34408 __Pyx_DECREF_TypeName(result_type_name);
34411 __Pyx_DECREF_TypeName(result_type_name);
34414 PyErr_Format(PyExc_TypeError,
34415 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
")",
34417 __Pyx_DECREF_TypeName(result_type_name);
34422static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
34423#if CYTHON_USE_TYPE_SLOTS
34424 PyNumberMethods *m;
34426 PyObject *res = NULL;
34427 if (likely(PyLong_Check(x)))
34428 return __Pyx_NewRef(x);
34429#if CYTHON_USE_TYPE_SLOTS
34430 m = Py_TYPE(x)->tp_as_number;
34431 if (likely(m && m->nb_int)) {
34432 res = m->nb_int(x);
34435 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
34436 res = PyNumber_Long(x);
34440 if (unlikely(!PyLong_CheckExact(res))) {
34441 return __Pyx_PyNumber_LongWrongResultType(res);
34444 else if (!PyErr_Occurred()) {
34445 PyErr_SetString(PyExc_TypeError,
34446 "an integer is required");
34450static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
34451 #if CYTHON_USE_PYLONG_INTERNALS
34453 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
34454 const int is_neg = __Pyx_PyLong_IsNeg(b);
34455 const digit* digits = __Pyx_PyLong_Digits(b);
34456 if (size == 0)
return 0;
34457 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
34459 ival = (Py_ssize_t) (((
size_t)digits[0]));
34462 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
34464 ival = (Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
34467 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
34469 ival = (Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
34472 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
34474 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]));
34477 return PyLong_AsSsize_t(b);
34478 return is_neg ? -ival : ival;
34480 return PyLong_AsSsize_t(b);
34483static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
34484 if (likely(PyLong_Check(b))) {
34485 return __Pyx_PyLong_AsSsize_t(b);
34488 PyObject *x = PyNumber_Index(b);
34489 if (unlikely(!x))
return -1;
34490 ival = __Pyx_PyLong_AsSsize_t(x);
34495static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
34496 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
34497 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
34501 x = PyNumber_Index(o);
34503 ival = PyLong_AsLong(x);
34508static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b) {
34509 CYTHON_UNUSED_VAR(b);
34510 return __Pyx_NewRef(Py_None);
34512static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
34513 return __Pyx_NewRef(b ? Py_True: Py_False);
34515static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t ival) {
34516 return PyLong_FromSize_t(ival);
34521#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
34522#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34523#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
34524 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
34526 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
34529#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
34530#error "Module state with PEP489 requires atomics. Currently that's one of\
34531 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
34533#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34534#define __Pyx_ModuleStateLookup_Lock()
34535#define __Pyx_ModuleStateLookup_Unlock()
34536#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
34537static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
34538#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
34539#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
34540#elif defined(__cplusplus) && __cplusplus >= 201103L
34542static std::mutex __Pyx_ModuleStateLookup_mutex;
34543#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
34544#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
34545#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
34546#include <threads.h>
34547static mtx_t __Pyx_ModuleStateLookup_mutex;
34548static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
34549static void __Pyx_ModuleStateLookup_initialize_mutex(
void) {
34550 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
34552#define __Pyx_ModuleStateLookup_Lock()\
34553 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
34554 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
34555#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
34556#elif defined(HAVE_PTHREAD_H)
34557#include <pthread.h>
34558static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
34559#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
34560#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
34561#elif defined(_WIN32)
34562#include <Windows.h>
34563static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
34564#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
34565#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
34567#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
34568 Requires C standard >= C11, or C++ standard >= C++11,\
34569 or pthreads, or the Windows 32 API, or Python >= 3.13."
34574} __Pyx_InterpreterIdAndModule;
34576 char interpreter_id_as_index;
34578 Py_ssize_t allocated;
34579 __Pyx_InterpreterIdAndModule table[1];
34580} __Pyx_ModuleStateLookupData;
34581#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
34582#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34583static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
34585#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34586static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
34588static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
34590static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
34591 __Pyx_InterpreterIdAndModule* table,
34593 int64_t interpreterId) {
34594 __Pyx_InterpreterIdAndModule* begin = table;
34595 __Pyx_InterpreterIdAndModule* end = begin + count;
34596 if (begin->id == interpreterId) {
34599 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
34600 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
34601 if (halfway->id == interpreterId) {
34604 if (halfway->id < interpreterId) {
34610 for (; begin < end; ++begin) {
34611 if (begin->id >= interpreterId)
return begin;
34615static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED
void* dummy) {
34616 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
34617 if (interpreter_id == -1)
return NULL;
34618#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34619 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
34621 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
34622 if (likely(data)) {
34623 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
34624 if (likely(data == new_data)) {
34625 goto read_finished;
34628 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
34629 __Pyx_ModuleStateLookup_Lock();
34630 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
34631 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
34632 __Pyx_ModuleStateLookup_Unlock();
34636 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
34638 __Pyx_InterpreterIdAndModule* found = NULL;
34639 if (unlikely(!data))
goto end;
34640 if (data->interpreter_id_as_index) {
34641 if (interpreter_id < data->count) {
34642 found = data->table+interpreter_id;
34645 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
34646 data->table, data->count, interpreter_id);
34650 PyObject *result=NULL;
34651 if (found && found->id == interpreter_id) {
34652 result = found->module;
34654#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34655 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
34660#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34661static void __Pyx_ModuleStateLookup_wait_until_no_readers(
void) {
34662 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
34665#define __Pyx_ModuleStateLookup_wait_until_no_readers()
34667static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
34668 Py_ssize_t to_allocate = (*old_data)->allocated;
34669 while (to_allocate <= interpreter_id) {
34670 if (to_allocate == 0) to_allocate = 1;
34671 else to_allocate *= 2;
34673 __Pyx_ModuleStateLookupData *new_data = *old_data;
34674 if (to_allocate != (*old_data)->allocated) {
34675 new_data = (__Pyx_ModuleStateLookupData *)realloc(
34677 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
34682 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
34683 new_data->table[i].id = i;
34684 new_data->table[i].module = NULL;
34686 new_data->allocated = to_allocate;
34688 new_data->table[interpreter_id].module =
module;
34689 if (new_data->count < interpreter_id+1) {
34690 new_data->count = interpreter_id+1;
34692 *old_data = new_data;
34695static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
34696 __Pyx_InterpreterIdAndModule *read = data->table;
34697 __Pyx_InterpreterIdAndModule *write = data->table;
34698 __Pyx_InterpreterIdAndModule *end = read + data->count;
34699 for (; read<end; ++read) {
34700 if (read->module) {
34701 write->id = read->id;
34702 write->module = read->module;
34706 data->count = write - data->table;
34707 for (; write<end; ++write) {
34709 write->module = NULL;
34711 data->interpreter_id_as_index = 0;
34713static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED
void* dummy) {
34714 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
34715 if (interpreter_id == -1)
return -1;
34717 __Pyx_ModuleStateLookup_Lock();
34718#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34719 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
34720 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
34722 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
34724 __Pyx_ModuleStateLookupData *new_data = old_data;
34726 new_data = (__Pyx_ModuleStateLookupData *)calloc(1,
sizeof(__Pyx_ModuleStateLookupData));
34732 new_data->allocated = 1;
34733 new_data->interpreter_id_as_index = 1;
34735 __Pyx_ModuleStateLookup_wait_until_no_readers();
34736 if (new_data->interpreter_id_as_index) {
34737 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
34738 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
34741 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
34744 Py_ssize_t insert_at = 0;
34746 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
34747 new_data->table, new_data->count, interpreter_id);
34748 assert(lower_bound);
34749 insert_at = lower_bound - new_data->table;
34750 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
34751 lower_bound->module =
module;
34755 if (new_data->count+1 >= new_data->allocated) {
34756 Py_ssize_t to_allocate = (new_data->count+1)*2;
34758 (__Pyx_ModuleStateLookupData*)realloc(
34760 sizeof(__Pyx_ModuleStateLookupData) +
34761 (to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
34764 new_data = old_data;
34768 new_data->allocated = to_allocate;
34771 int64_t last_id = interpreter_id;
34772 PyObject *last_module =
module;
34773 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
34774 int64_t current_id = new_data->table[i].id;
34775 new_data->table[i].id = last_id;
34776 last_id = current_id;
34777 PyObject *current_module = new_data->table[i].module;
34778 new_data->table[i].module = last_module;
34779 last_module = current_module;
34783#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34784 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
34786 __Pyx_ModuleStateLookup_data = new_data;
34788 __Pyx_ModuleStateLookup_Unlock();
34791static int __Pyx_State_RemoveModule(CYTHON_UNUSED
void* dummy) {
34792 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
34793 if (interpreter_id == -1)
return -1;
34794 __Pyx_ModuleStateLookup_Lock();
34795#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34796 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
34797 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
34799 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
34801 if (data->interpreter_id_as_index) {
34802 if (interpreter_id < data->count) {
34803 data->table[interpreter_id].module = NULL;
34808 __Pyx_ModuleStateLookup_wait_until_no_readers();
34809 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
34810 data->table, data->count, interpreter_id);
34811 if (!lower_bound)
goto done;
34812 if (lower_bound->id != interpreter_id)
goto done;
34813 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
34814 for (;lower_bound<end-1; ++lower_bound) {
34815 lower_bound->id = (lower_bound+1)->
id;
34816 lower_bound->module = (lower_bound+1)->module;
34820 if (data->count == 0) {
34825#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34826 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
34828 __Pyx_ModuleStateLookup_data = data;
34830 __Pyx_ModuleStateLookup_Unlock();
34837#pragma warning( pop )