proteus 1.9.0
C/C++/Fortran libraries
Loading...
Searching...
No Matches
superluWrappers.c
Go to the documentation of this file.
1/* Generated by Cython 3.3.0 */
2
3/* BEGIN: Cython Metadata
4{
5 "distutils": {
6 "define_macros": [
7 [
8 "PROTEUS_SUPERLU_H",
9 "\"slu_ddefs.h\""
10 ],
11 [
12 "PROTEUS_BLAS_H",
13 "\"proteus_blas.h\""
14 ]
15 ],
16 "depends": [
17 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayobject.h",
18 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayscalars.h",
19 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarrayobject.h",
20 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarraytypes.h",
21 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ufuncobject.h",
22 "proteus/proteus_superlu.h"
23 ],
24 "extra_compile_args": [
25 "-Wall",
26 "-DF77_POST_UNDERSCORE",
27 "-DUSE_BLAS",
28 "-DCMRVEC_BOUNDS_CHECK",
29 "-DMV_VECTOR_BOUNDS_CHECK",
30 "-DPETSC_INCLUDE_AS_C",
31 "-DPETSC_SKIP_COMPLEX"
32 ],
33 "extra_link_args": [
34 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
35 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
36 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
37 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
38 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
39 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
40 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
41 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib"
42 ],
43 "include_dirs": [
44 "proteus",
45 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include",
46 "/work/cekees/miniforge3/envs/proteus-jupyterhub/include"
47 ],
48 "language": "c",
49 "libraries": [
50 "m",
51 "superlu",
52 "lapack",
53 "blas",
54 "metis"
55 ],
56 "library_dirs": [
57 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib"
58 ],
59 "name": "superluWrappers",
60 "sources": [
61 "proteus/superluWrappers.pyx"
62 ]
63 },
64 "module_name": "superluWrappers"
65}
66END: Cython Metadata */
67
68#ifndef PY_SSIZE_T_CLEAN
69#define PY_SSIZE_T_CLEAN
70#endif /* PY_SSIZE_T_CLEAN */
71/* InitLimitedAPI */
72#if defined(Py_LIMITED_API)
73 #if !defined(CYTHON_LIMITED_API)
74 #define CYTHON_LIMITED_API 1
75 #endif
76#elif defined(CYTHON_LIMITED_API)
77 #ifdef _MSC_VER
78 #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
79 #else
80 #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
81 #endif
82#endif
83
84#include "Python.h"
85#ifndef Py_PYTHON_H
86 #error Python headers needed to compile C extensions, please install development version of Python.
87#elif PY_VERSION_HEX < 0x03090000
88 #error Cython requires Python 3.9+.
89#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
90 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
91#else
92#define __PYX_ABI_VERSION "3_3_0"
93#define CYTHON_HEX_VERSION 0x030300F0
94#define CYTHON_FUTURE_DIVISION 1
95/* CModulePreamble */
96#include <stddef.h>
97#ifndef offsetof
98 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
99#endif
100#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
101 #ifndef __stdcall
102 #define __stdcall
103 #endif
104 #ifndef __cdecl
105 #define __cdecl
106 #endif
107 #ifndef __fastcall
108 #define __fastcall
109 #endif
110#endif
111#ifdef __has_builtin
112 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
113#else
114 #define __Pyx_has_cbuiltin(name) (0)
115#endif
116#ifndef DL_IMPORT
117 #define DL_IMPORT(t) t
118#endif
119#ifndef DL_EXPORT
120 #define DL_EXPORT(t) t
121#endif
122#define __PYX_COMMA ,
123#ifndef PY_LONG_LONG
124 #define PY_LONG_LONG LONG_LONG
125#endif
126#ifndef Py_HUGE_VAL
127 #define Py_HUGE_VAL HUGE_VAL
128#endif
129#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
130#if defined(CYTHON_LIMITED_API)
131 #ifdef Py_LIMITED_API
132 #undef __PYX_LIMITED_VERSION_HEX
133 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
134 #if Py_LIMITED_API < 0x03090000
135 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
136 #endif
137 #endif
138 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
139 #ifdef _MSC_VER
140 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
141 code for PyPy and GraalPy and is unlikely to work.")
142 #else
143 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
144 code for PyPy and GraalPy and is unlikely to work."
145 #endif
146 #endif
147 #define CYTHON_COMPILING_IN_PYPY 0
148 #define CYTHON_COMPILING_IN_CPYTHON 0
149 #define CYTHON_COMPILING_IN_LIMITED_API 1
150 #define CYTHON_COMPILING_IN_GRAAL 0
151 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
152 #undef CYTHON_USE_TYPE_SLOTS
153 #define CYTHON_USE_TYPE_SLOTS 0
154 #undef CYTHON_USE_TYPE_SPECS
155 #define CYTHON_USE_TYPE_SPECS 1
156 #undef CYTHON_USE_PYTYPE_LOOKUP
157 #define CYTHON_USE_PYTYPE_LOOKUP 0
158 #undef CYTHON_USE_PYLIST_INTERNALS
159 #define CYTHON_USE_PYLIST_INTERNALS 0
160 #undef CYTHON_USE_UNICODE_INTERNALS
161 #define CYTHON_USE_UNICODE_INTERNALS 0
162 #ifndef CYTHON_USE_UNICODE_WRITER
163 #define CYTHON_USE_UNICODE_WRITER 0
164 #endif
165 #undef CYTHON_USE_PYLONG_INTERNALS
166 #define CYTHON_USE_PYLONG_INTERNALS 0
167 #ifndef CYTHON_AVOID_BORROWED_REFS
168 #define CYTHON_AVOID_BORROWED_REFS 0
169 #endif
170 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
171 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
172 #endif
173 #undef CYTHON_ASSUME_SAFE_MACROS
174 #define CYTHON_ASSUME_SAFE_MACROS 0
175 #undef CYTHON_ASSUME_SAFE_SIZE
176 #define CYTHON_ASSUME_SAFE_SIZE 0
177 #undef CYTHON_UNPACK_METHODS
178 #define CYTHON_UNPACK_METHODS 0
179 #undef CYTHON_FAST_THREAD_STATE
180 #define CYTHON_FAST_THREAD_STATE 0
181 #undef CYTHON_FAST_GIL
182 #define CYTHON_FAST_GIL 0
183 #undef CYTHON_VECTORCALL
184 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
185 #ifndef CYTHON_VECTORCALL_TPNEW
186 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
187 #endif
188 #ifndef CYTHON_PEP487_INIT_SUBCLASS
189 #define CYTHON_PEP487_INIT_SUBCLASS 1
190 #endif
191 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
192 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
193 #endif
194 #ifndef CYTHON_USE_MODULE_STATE
195 #define CYTHON_USE_MODULE_STATE 0
196 #endif
197 #undef CYTHON_USE_SYS_MONITORING
198 #define CYTHON_USE_SYS_MONITORING 0
199 #ifndef CYTHON_USE_TP_FINALIZE
200 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
201 #endif
202 #ifndef CYTHON_USE_AM_SEND
203 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
204 #endif
205 #undef CYTHON_USE_DICT_VERSIONS
206 #define CYTHON_USE_DICT_VERSIONS 0
207 #undef CYTHON_USE_EXC_INFO_STACK
208 #define CYTHON_USE_EXC_INFO_STACK 0
209 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
210 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
211 #endif
212 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
213 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
214 #endif
215 #ifndef CYTHON_USE_FREELISTS
216 #define CYTHON_USE_FREELISTS 1
217 #endif
218 #undef CYTHON_IMMORTAL_CONSTANTS
219 #define CYTHON_IMMORTAL_CONSTANTS 0
220 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
221 #undef CYTHON_OPAQUE_OBJECTS
222 #define CYTHON_OPAQUE_OBJECTS 0
223 #elif !defined(CYTHON_OPAQUE_OBJECTS)
224 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
225 #endif
226#elif defined(GRAALVM_PYTHON)
227 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
228 The existence of this section does not imply that anything works or is even tested */
229 #define CYTHON_COMPILING_IN_PYPY 0
230 #define CYTHON_COMPILING_IN_CPYTHON 0
231 #define CYTHON_COMPILING_IN_LIMITED_API 0
232 #define CYTHON_COMPILING_IN_GRAAL 1
233 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
234 #ifndef CYTHON_USE_TYPE_SLOTS
235 #define CYTHON_USE_TYPE_SLOTS 0
236 #endif
237 #undef CYTHON_USE_TYPE_SPECS
238 #define CYTHON_USE_TYPE_SPECS 0
239 #undef CYTHON_USE_PYTYPE_LOOKUP
240 #define CYTHON_USE_PYTYPE_LOOKUP 0
241 #undef CYTHON_USE_PYLIST_INTERNALS
242 #define CYTHON_USE_PYLIST_INTERNALS 0
243 #undef CYTHON_USE_UNICODE_INTERNALS
244 #define CYTHON_USE_UNICODE_INTERNALS 0
245 #undef CYTHON_USE_UNICODE_WRITER
246 #define CYTHON_USE_UNICODE_WRITER 0
247 #undef CYTHON_USE_PYLONG_INTERNALS
248 #define CYTHON_USE_PYLONG_INTERNALS 0
249 #undef CYTHON_AVOID_BORROWED_REFS
250 #define CYTHON_AVOID_BORROWED_REFS 1
251 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
252 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
253 #undef CYTHON_ASSUME_SAFE_MACROS
254 #define CYTHON_ASSUME_SAFE_MACROS 0
255 #undef CYTHON_ASSUME_SAFE_SIZE
256 #define CYTHON_ASSUME_SAFE_SIZE 0
257 #undef CYTHON_UNPACK_METHODS
258 #define CYTHON_UNPACK_METHODS 0
259 #undef CYTHON_FAST_THREAD_STATE
260 #define CYTHON_FAST_THREAD_STATE 0
261 #undef CYTHON_FAST_GIL
262 #define CYTHON_FAST_GIL 0
263 #ifndef CYTHON_VECTORCALL
264 #define CYTHON_VECTORCALL 1
265 #endif
266 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
267 #undef CYTHON_VECTORCALL_TPNEW
268 #define CYTHON_VECTORCALL_TPNEW 0
269 #elif !defined(CYTHON_VECTORCALL_TPNEW)
270 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
271 #endif
272 #ifndef CYTHON_PEP487_INIT_SUBCLASS
273 #define CYTHON_PEP487_INIT_SUBCLASS 1
274 #endif
275 #undef CYTHON_PEP489_MULTI_PHASE_INIT
276 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
277 #undef CYTHON_USE_MODULE_STATE
278 #define CYTHON_USE_MODULE_STATE 0
279 #undef CYTHON_USE_SYS_MONITORING
280 #define CYTHON_USE_SYS_MONITORING 0
281 #undef CYTHON_USE_TP_FINALIZE
282 #define CYTHON_USE_TP_FINALIZE 0
283 #undef CYTHON_USE_AM_SEND
284 #define CYTHON_USE_AM_SEND 0
285 #undef CYTHON_USE_DICT_VERSIONS
286 #define CYTHON_USE_DICT_VERSIONS 0
287 #undef CYTHON_USE_EXC_INFO_STACK
288 #define CYTHON_USE_EXC_INFO_STACK 1
289 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
290 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
291 #endif
292 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
293 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
294 #endif
295 #undef CYTHON_USE_FREELISTS
296 #define CYTHON_USE_FREELISTS 0
297 #undef CYTHON_IMMORTAL_CONSTANTS
298 #define CYTHON_IMMORTAL_CONSTANTS 0
299 #undef CYTHON_OPAQUE_OBJECTS
300 #define CYTHON_OPAQUE_OBJECTS 0
301#elif defined(PYPY_VERSION)
302 #define CYTHON_COMPILING_IN_PYPY 1
303 #define CYTHON_COMPILING_IN_CPYTHON 0
304 #define CYTHON_COMPILING_IN_LIMITED_API 0
305 #define CYTHON_COMPILING_IN_GRAAL 0
306 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
307 #undef CYTHON_USE_TYPE_SLOTS
308 #define CYTHON_USE_TYPE_SLOTS 1
309 #ifndef CYTHON_USE_TYPE_SPECS
310 #define CYTHON_USE_TYPE_SPECS 0
311 #endif
312 #undef CYTHON_USE_PYTYPE_LOOKUP
313 #define CYTHON_USE_PYTYPE_LOOKUP 0
314 #undef CYTHON_USE_PYLIST_INTERNALS
315 #define CYTHON_USE_PYLIST_INTERNALS 0
316 #undef CYTHON_USE_UNICODE_INTERNALS
317 #define CYTHON_USE_UNICODE_INTERNALS 0
318 #undef CYTHON_USE_UNICODE_WRITER
319 #define CYTHON_USE_UNICODE_WRITER 0
320 #undef CYTHON_USE_PYLONG_INTERNALS
321 #define CYTHON_USE_PYLONG_INTERNALS 0
322 #undef CYTHON_AVOID_BORROWED_REFS
323 #define CYTHON_AVOID_BORROWED_REFS 1
324 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
325 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
326 #undef CYTHON_ASSUME_SAFE_MACROS
327 #define CYTHON_ASSUME_SAFE_MACROS 0
328 #ifndef CYTHON_ASSUME_SAFE_SIZE
329 #define CYTHON_ASSUME_SAFE_SIZE 1
330 #endif
331 #undef CYTHON_UNPACK_METHODS
332 #define CYTHON_UNPACK_METHODS 0
333 #undef CYTHON_FAST_THREAD_STATE
334 #define CYTHON_FAST_THREAD_STATE 0
335 #undef CYTHON_FAST_GIL
336 #define CYTHON_FAST_GIL 0
337 #ifndef CYTHON_VECTORCALL
338 #define CYTHON_VECTORCALL 1
339 #endif
340 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
341 #undef CYTHON_VECTORCALL_TPNEW
342 #define CYTHON_VECTORCALL_TPNEW 0
343 #elif !defined(CYTHON_VECTORCALL_TPNEW)
344 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
345 #endif
346 #ifndef CYTHON_PEP487_INIT_SUBCLASS
347 #define CYTHON_PEP487_INIT_SUBCLASS 1
348 #endif
349 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
350 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
351 #endif
352 #undef CYTHON_USE_MODULE_STATE
353 #define CYTHON_USE_MODULE_STATE 0
354 #undef CYTHON_USE_SYS_MONITORING
355 #define CYTHON_USE_SYS_MONITORING 0
356 #ifndef CYTHON_USE_TP_FINALIZE
357 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
358 #endif
359 #undef CYTHON_USE_AM_SEND
360 #define CYTHON_USE_AM_SEND 0
361 #undef CYTHON_USE_DICT_VERSIONS
362 #define CYTHON_USE_DICT_VERSIONS 0
363 #undef CYTHON_USE_EXC_INFO_STACK
364 #define CYTHON_USE_EXC_INFO_STACK 0
365 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
366 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
367 #endif
368 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
369 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
370 #endif
371 #undef CYTHON_USE_FREELISTS
372 #define CYTHON_USE_FREELISTS 0
373 #undef CYTHON_IMMORTAL_CONSTANTS
374 #define CYTHON_IMMORTAL_CONSTANTS 0
375 #undef CYTHON_OPAQUE_OBJECTS
376 #define CYTHON_OPAQUE_OBJECTS 0
377#else
378 #define CYTHON_COMPILING_IN_PYPY 0
379 #define CYTHON_COMPILING_IN_CPYTHON 1
380 #define CYTHON_COMPILING_IN_LIMITED_API 0
381 #define CYTHON_COMPILING_IN_GRAAL 0
382 #ifdef Py_GIL_DISABLED
383 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
384 #else
385 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
386 #endif
387 #if PY_VERSION_HEX < 0x030A0000
388 #undef CYTHON_USE_TYPE_SLOTS
389 #define CYTHON_USE_TYPE_SLOTS 1
390 #elif !defined(CYTHON_USE_TYPE_SLOTS)
391 #define CYTHON_USE_TYPE_SLOTS 1
392 #endif
393 #ifndef CYTHON_USE_TYPE_SPECS
394 #define CYTHON_USE_TYPE_SPECS 0
395 #endif
396 #ifndef CYTHON_USE_PYTYPE_LOOKUP
397 #define CYTHON_USE_PYTYPE_LOOKUP 1
398 #endif
399 #ifndef CYTHON_USE_PYLONG_INTERNALS
400 #define CYTHON_USE_PYLONG_INTERNALS 1
401 #endif
402 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
403 #undef CYTHON_USE_PYLIST_INTERNALS
404 #define CYTHON_USE_PYLIST_INTERNALS 0
405 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
406 #define CYTHON_USE_PYLIST_INTERNALS 1
407 #endif
408 #ifndef CYTHON_USE_UNICODE_INTERNALS
409 #define CYTHON_USE_UNICODE_INTERNALS 1
410 #endif
411 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
412 #undef CYTHON_USE_UNICODE_WRITER
413 #define CYTHON_USE_UNICODE_WRITER 0
414 #elif !defined(CYTHON_USE_UNICODE_WRITER)
415 #define CYTHON_USE_UNICODE_WRITER 1
416 #endif
417 #ifndef CYTHON_AVOID_BORROWED_REFS
418 #define CYTHON_AVOID_BORROWED_REFS 0
419 #endif
420 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
421 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
422 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
423 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
424 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
425 #endif
426 #ifndef CYTHON_ASSUME_SAFE_MACROS
427 #define CYTHON_ASSUME_SAFE_MACROS 1
428 #endif
429 #ifndef CYTHON_ASSUME_SAFE_SIZE
430 #define CYTHON_ASSUME_SAFE_SIZE 1
431 #endif
432 #ifndef CYTHON_UNPACK_METHODS
433 #define CYTHON_UNPACK_METHODS 1
434 #endif
435 #ifndef CYTHON_FAST_THREAD_STATE
436 #define CYTHON_FAST_THREAD_STATE 1
437 #endif
438 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
439 #undef CYTHON_FAST_GIL
440 #define CYTHON_FAST_GIL 0
441 #elif !defined(CYTHON_FAST_GIL)
442 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
443 #endif
444 #ifndef CYTHON_VECTORCALL
445 #define CYTHON_VECTORCALL 1
446 #endif
447 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
448 #undef CYTHON_VECTORCALL_TPNEW
449 #define CYTHON_VECTORCALL_TPNEW 0
450 #elif !defined(CYTHON_VECTORCALL_TPNEW)
451 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
452 #endif
453 #ifndef CYTHON_PEP487_INIT_SUBCLASS
454 #define CYTHON_PEP487_INIT_SUBCLASS 1
455 #endif
456 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
457 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
458 #endif
459 #ifndef CYTHON_USE_MODULE_STATE
460 #define CYTHON_USE_MODULE_STATE 0
461 #endif
462 #ifndef CYTHON_USE_SYS_MONITORING
463 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
464 #endif
465 #ifndef CYTHON_USE_TP_FINALIZE
466 #define CYTHON_USE_TP_FINALIZE 1
467 #endif
468 #ifndef CYTHON_USE_AM_SEND
469 #define CYTHON_USE_AM_SEND 1
470 #endif
471 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
472 #undef CYTHON_USE_DICT_VERSIONS
473 #define CYTHON_USE_DICT_VERSIONS 0
474 #elif !defined(CYTHON_USE_DICT_VERSIONS)
475 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
476 #endif
477 #ifndef CYTHON_USE_EXC_INFO_STACK
478 #define CYTHON_USE_EXC_INFO_STACK 1
479 #endif
480 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
481 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
482 #endif
483 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
484 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
485 #endif
486 #ifndef CYTHON_USE_FREELISTS
487 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
488 #endif
489 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
490 #undef CYTHON_IMMORTAL_CONSTANTS
491 #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work
492 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
493 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
494 #endif
495 #ifndef CYTHON_OPAQUE_OBJECTS
496 #define CYTHON_OPAQUE_OBJECTS 0
497 #endif
498#endif
499#if CYTHON_USE_PYLONG_INTERNALS
500 #undef SHIFT
501 #undef BASE
502 #undef MASK
503 #ifdef SIZEOF_VOID_P
504 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
505 #endif
506#endif
507#ifndef __has_attribute
508 #define __has_attribute(x) 0
509#endif
510#ifndef __has_cpp_attribute
511 #define __has_cpp_attribute(x) 0
512#endif
513#ifndef CYTHON_RESTRICT
514 #if defined(__GNUC__)
515 #define CYTHON_RESTRICT __restrict__
516 #elif defined(_MSC_VER) && _MSC_VER >= 1400
517 #define CYTHON_RESTRICT __restrict
518 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
519 #define CYTHON_RESTRICT restrict
520 #else
521 #define CYTHON_RESTRICT
522 #endif
523#endif
524#ifndef CYTHON_UNUSED
525 #if defined(__cplusplus)
526 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
527 * but leads to warnings with -pedantic, since it is a C++17 feature */
528 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
529 #if __has_cpp_attribute(maybe_unused)
530 #define CYTHON_UNUSED [[maybe_unused]]
531 #endif
532 #endif
533 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
534 #define CYTHON_UNUSED [[maybe_unused]]
535 #endif
536#endif
537#ifndef CYTHON_UNUSED
538# if defined(__GNUC__)
539# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
540# define CYTHON_UNUSED __attribute__ ((__unused__))
541# else
542# define CYTHON_UNUSED
543# endif
544# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
545# define CYTHON_UNUSED __attribute__ ((__unused__))
546# else
547# define CYTHON_UNUSED
548# endif
549#endif
550#ifndef CYTHON_UNUSED_VAR
551# if defined(__cplusplus)
552 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
553# else
554# define CYTHON_UNUSED_VAR(x) (void)(x)
555# endif
556#endif
557#ifndef CYTHON_MAYBE_UNUSED_VAR
558 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
559#endif
560#ifndef CYTHON_NCP_UNUSED
561# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
562# define CYTHON_NCP_UNUSED
563# else
564# define CYTHON_NCP_UNUSED CYTHON_UNUSED
565# endif
566#endif
567#ifndef CYTHON_USE_CPP_STD_MOVE
568 #if defined(__cplusplus) && (\
569 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
570 #define CYTHON_USE_CPP_STD_MOVE 1
571 #else
572 #define CYTHON_USE_CPP_STD_MOVE 0
573 #endif
574#endif
575#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
576#include <stdint.h>
577typedef uintptr_t __pyx_uintptr_t;
578#ifndef CYTHON_FALLTHROUGH
579 #if defined(__cplusplus)
580 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
581 * but leads to warnings with -pedantic, since it is a C++17 feature */
582 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
583 #if __has_cpp_attribute(fallthrough)
584 #define CYTHON_FALLTHROUGH [[fallthrough]]
585 #endif
586 #endif
587 #ifndef CYTHON_FALLTHROUGH
588 #if __has_cpp_attribute(clang::fallthrough)
589 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
590 #elif __has_cpp_attribute(gnu::fallthrough)
591 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
592 #endif
593 #endif
594 #endif
595 #ifndef CYTHON_FALLTHROUGH
596 #if __has_attribute(fallthrough)
597 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
598 #else
599 #define CYTHON_FALLTHROUGH
600 #endif
601 #endif
602 #if defined(__clang__) && defined(__apple_build_version__)
603 #if __apple_build_version__ < 7000000
604 #undef CYTHON_FALLTHROUGH
605 #define CYTHON_FALLTHROUGH
606 #endif
607 #endif
608#endif
609#ifdef Py_UNREACHABLE
610 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
611#elif __Pyx_has_cbuiltin(__builtin_unreachable)
612 #define __Pyx_UNREACHABLE() __builtin_unreachable()
613#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
614 #define __Pyx_UNREACHABLE() __builtin_unreachable()
615#elif defined(_MSC_VER)
616 #define __Pyx_UNREACHABLE() __assume(0)
617#else
618 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
619#endif
620#ifndef Py_UNREACHABLE
621 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
622#endif
623#ifdef __cplusplus
624 template <typename T>
625 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
626 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
627#else
628 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
629#endif
630#if CYTHON_COMPILING_IN_PYPY == 1
631 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
632#else
633 #define __PYX_NEED_TP_PRINT_SLOT 0
634#endif
635#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
636#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
637#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
638#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
639#else
640#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
641#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
642#endif
643
644/* CInitCode */
645#ifndef CYTHON_INLINE
646 #if defined(__clang__)
647 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
648 #elif defined(__GNUC__)
649 #define CYTHON_INLINE __inline__
650 #elif defined(_MSC_VER)
651 #define CYTHON_INLINE __inline
652 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
653 #define CYTHON_INLINE inline
654 #else
655 #define CYTHON_INLINE
656 #endif
657#endif
658
659/* PythonCompatibility */
660#define __PYX_BUILD_PY_SSIZE_T "n"
661#define CYTHON_FORMAT_SSIZE_T "z"
662#define __Pyx_BUILTIN_MODULE_NAME "builtins"
663#define __Pyx_DefaultClassType PyType_Type
664#if CYTHON_COMPILING_IN_LIMITED_API
665 #ifndef CO_OPTIMIZED
666 static int CO_OPTIMIZED;
667 #endif
668 #ifndef CO_NEWLOCALS
669 static int CO_NEWLOCALS;
670 #endif
671 #ifndef CO_VARARGS
672 static int CO_VARARGS;
673 #endif
674 #ifndef CO_VARKEYWORDS
675 static int CO_VARKEYWORDS;
676 #endif
677 #ifndef CO_ASYNC_GENERATOR
678 static int CO_ASYNC_GENERATOR;
679 #endif
680 #ifndef CO_GENERATOR
681 static int CO_GENERATOR;
682 #endif
683 #ifndef CO_COROUTINE
684 static int CO_COROUTINE;
685 #endif
686#else
687 #ifndef CO_COROUTINE
688 #define CO_COROUTINE 0x80
689 #endif
690 #ifndef CO_ASYNC_GENERATOR
691 #define CO_ASYNC_GENERATOR 0x200
692 #endif
693#endif
694static int __Pyx_init_co_variables(void);
695#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
696 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
697#else
698 #define __Pyx_Py_Is(x, y) ((x) == (y))
699#endif
700#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
701 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
702#else
703 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
704#endif
705#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
706 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
707#else
708 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
709#endif
710#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
711 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
712#else
713 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
714#endif
715#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
716#if CYTHON_COMPILING_IN_PYPY
717 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
718#else
719 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
720#endif
721#if CYTHON_COMPILING_IN_LIMITED_API
722static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
723static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
724#else
725#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
726#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
727#endif
728static int __Pyx_init_tpflags_variables(void);
729#ifndef Py_TPFLAGS_HAVE_FINALIZE
730 #define Py_TPFLAGS_HAVE_FINALIZE 0
731#endif
732#ifndef Py_TPFLAGS_SEQUENCE
733 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
734#endif
735#ifndef Py_TPFLAGS_MAPPING
736 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
737#endif
738#ifndef Py_TPFLAGS_IMMUTABLETYPE
739 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
740#endif
741#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
742 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
743#endif
744#ifndef METH_STACKLESS
745 #define METH_STACKLESS 0
746#endif
747#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
748 #ifndef METH_FASTCALL
749 #define METH_FASTCALL 0x80
750 #endif
751 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
752 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
753 Py_ssize_t nargs, PyObject *kwnames);
754#else
755 #if PY_VERSION_HEX >= 0x030d00A4
756 # define __Pyx_PyCFunctionFast PyCFunctionFast
757 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
758 #else
759 # define __Pyx_PyCFunctionFast _PyCFunctionFast
760 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
761 #endif
762#endif
763#if CYTHON_VECTORCALL
764 #define __Pyx_METH_FASTCALL METH_FASTCALL
765 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
766 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
767#else
768 #define __Pyx_METH_FASTCALL METH_VARARGS
769 #define __Pyx_PyCFunction_FastCall PyCFunction
770 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
771#endif
772#if CYTHON_VECTORCALL
773 #define __pyx_vectorcallfunc vectorcallfunc
774 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
775 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
776#else
777 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
778 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
779#endif
780#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
781#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
782#if CYTHON_COMPILING_IN_CPYTHON
783#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
784#elif !CYTHON_COMPILING_IN_LIMITED_API
785#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
786#endif
787#if CYTHON_COMPILING_IN_CPYTHON
788#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
789static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
790 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
791}
792#endif
793static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
794#if CYTHON_COMPILING_IN_LIMITED_API
795 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
796#else
797 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
798#endif
799}
800#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
801#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
802 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
803#else
804 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
805#endif
806#if CYTHON_COMPILING_IN_PYPY
807 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
808#else
809 #define __Pyx_PyCMethod PyCMethod
810#endif
811#ifndef METH_METHOD
812 #define METH_METHOD 0x200
813#endif
814#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
815 #define PyObject_Malloc(s) PyMem_Malloc(s)
816 #define PyObject_Free(p) PyMem_Free(p)
817 #define PyObject_Realloc(p) PyMem_Realloc(p)
818#endif
819#if CYTHON_COMPILING_IN_LIMITED_API
820 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
821#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
822 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
823 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
824#elif CYTHON_COMPILING_IN_GRAAL
825 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
826 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
827#else
828 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
829 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
830#endif
831#if CYTHON_COMPILING_IN_LIMITED_API
832 #define __Pyx_PyThreadState_Current PyThreadState_Get()
833#elif !CYTHON_FAST_THREAD_STATE
834 #define __Pyx_PyThreadState_Current PyThreadState_GET()
835#elif PY_VERSION_HEX >= 0x030d00A1
836 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
837#else
838 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
839#endif
840#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
841 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
842 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
843 #define CYTHON_OPAQUE_SHARED_TYPES 1
844#else
845 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
846 #define __PYX_SHARED_RELATIVE_OFFSET 0
847 #define CYTHON_OPAQUE_SHARED_TYPES 0
848#endif
849#if CYTHON_USE_MODULE_STATE
850static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
851{
852 void *result;
853 result = PyModule_GetState(op);
854 if (!result)
855 Py_FatalError("Couldn't find the module state");
856 return result;
857}
858#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
859#else
860#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
861#endif
862#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
863#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
864#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
865#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
866#if CYTHON_USE_TYPE_SLOTS
867 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
868 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
869 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
870 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
871#else
872 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
873 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
874 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
875 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
876 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
877 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
878 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
879#endif
880#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
881#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
882#else
883#define __Pyx_PyDict_NewPresized(n) PyDict_New()
884#endif
885#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
886#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
887#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
888#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
889static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
890 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
891 if (res == NULL && PyErr_Occurred()) {
892 PyErr_WriteUnraisable(NULL);
893 }
894 return res;
895}
896#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
897#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
898#define __Pyx_PyDict_GetItemStr PyDict_GetItem
899#else
900static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
901#if CYTHON_COMPILING_IN_PYPY
902 return PyDict_GetItem(dict, name);
903#else
904 PyDictEntry *ep;
905 PyDictObject *mp = (PyDictObject*) dict;
906 long hash = ((PyStringObject *) name)->ob_shash;
907 assert(hash != -1);
908 ep = (mp->ma_lookup)(mp, name, hash);
909 if (ep == NULL) {
910 return NULL;
911 }
912 return ep->me_value;
913#endif
914}
915#define __Pyx_PyDict_GetItemStr PyDict_GetItem
916#endif
917#if CYTHON_USE_TYPE_SLOTS
918 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
919 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
920#else
921 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
922 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
923#endif
924#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
925#if CYTHON_USE_TYPE_SPECS
926#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
927 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
928 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
929 PyObject_GC_Del(obj);\
930 Py_DECREF(type);\
931}
932#else
933#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
934#endif
935#if CYTHON_COMPILING_IN_LIMITED_API
936 #define __Pyx_PyUnicode_READY(op) (0)
937 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
938 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
939 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
940 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
941 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
942 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
943 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
944#else
945 #if PY_VERSION_HEX >= 0x030C0000
946 #define __Pyx_PyUnicode_READY(op) (0)
947 #else
948 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
949 0 : _PyUnicode_Ready((PyObject *)(op)))
950 #endif
951 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
952 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
953 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
954 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
955 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
956 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
957 #if PY_VERSION_HEX >= 0x030C0000
958 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
959 #else
960 #if CYTHON_COMPILING_IN_CPYTHON
961 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
962 #else
963 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
964 #endif
965 #endif
966 static CYTHON_INLINE int __Pyx_PyUnicode_KIND_04(PyObject *o) {
967 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
968 }
969#endif
970#if CYTHON_COMPILING_IN_PYPY
971 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
972 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
973#else
974 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
975 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
976 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
977#endif
978#if CYTHON_COMPILING_IN_PYPY
979 #if !defined(PyUnicode_DecodeUnicodeEscape)
980 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
981 #endif
982 #if !defined(PyUnicode_Contains)
983 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
984 #endif
985 #if !defined(PyByteArray_Check)
986 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
987 #endif
988 #if !defined(PyObject_Format)
989 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
990 #endif
991#endif
992#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
993#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
994 #define __Pyx_PySequence_ListKeepNew(obj)\
995 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
996#elif CYTHON_COMPILING_IN_CPYTHON
997 #define __Pyx_PySequence_ListKeepNew(obj)\
998 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
999#else
1000 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1001#endif
1002#ifndef PySet_CheckExact
1003 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
1004#endif
1005enum __Pyx_ReferenceSharing {
1006 __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
1007 __Pyx_ReferenceSharing_OwnStrongReference,
1008 __Pyx_ReferenceSharing_FunctionArgument,
1009 __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
1010};
1011#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
1012#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
1013 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
1014 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
1015 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
1016#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
1017#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
1018#else
1019#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1020#endif
1021#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1022 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1023#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1024 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1025 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1026 #else
1027 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1028 #endif
1029#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1030 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1031#else
1032 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1033 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1034#endif
1035#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1036 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1037 __Pyx_PyList_GetItemRef(o, i))
1038#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1039 #if CYTHON_ASSUME_SAFE_MACROS
1040 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1041 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1042 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1043 #else
1044 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1045 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1046 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1047 #endif
1048#elif CYTHON_ASSUME_SAFE_MACROS
1049 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1050 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1051#else
1052 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1053 __Pyx_XNewRef(PyList_GetItem(o, i)))
1054#endif
1055#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1056#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1057#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1058static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1059 *result = PyObject_GetItem(dict, key);
1060 if (*result == NULL) {
1061 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1062 PyErr_Clear();
1063 return 0;
1064 }
1065 return -1;
1066 }
1067 return 1;
1068}
1069#else
1070static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1071 *result = PyDict_GetItemWithError(dict, key);
1072 if (*result == NULL) {
1073 return PyErr_Occurred() ? -1 : 0;
1074 }
1075 Py_INCREF(*result);
1076 return 1;
1077}
1078#endif
1079#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1080 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1081#else
1082 #define __Pyx_VISIT_CONST(obj)
1083#endif
1084#if CYTHON_ASSUME_SAFE_MACROS
1085 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1086 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1087 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1088 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1089 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1090 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1091#else
1092 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1093 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1094 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1095 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1096 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1097 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1098#endif
1099#if CYTHON_ASSUME_SAFE_SIZE
1100 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1101 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1102 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1103 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1104 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1105 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1106 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1107#else
1108 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1109 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1110 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1111 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1112 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1113 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1114 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1115#endif
1116#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1117 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1118#endif
1119#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1120#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1121#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1122 #define __Pyx_PySendResult PySendResult
1123#else
1124 typedef enum {
1125 PYGEN_RETURN = 0,
1126 PYGEN_ERROR = -1,
1127 PYGEN_NEXT = 1,
1128 } __Pyx_PySendResult;
1129#endif
1130#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1131 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1132#else
1133 #define __Pyx_pyiter_sendfunc sendfunc
1134#endif
1135#if !CYTHON_USE_AM_SEND
1136#define __PYX_HAS_PY_AM_SEND 0
1137#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1138#define __PYX_HAS_PY_AM_SEND 1
1139#else
1140#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
1141#endif
1142#if __PYX_HAS_PY_AM_SEND < 2
1143 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1144#else
1145 typedef struct {
1146 unaryfunc am_await;
1147 unaryfunc am_aiter;
1148 unaryfunc am_anext;
1149 __Pyx_pyiter_sendfunc am_send;
1150 } __Pyx_PyAsyncMethodsStruct;
1151 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1152#endif
1153#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1154 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1155#else
1156 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1157#endif
1158#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1159#ifdef __cplusplus
1160extern "C"
1161#endif
1162PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
1163#endif
1164#if CYTHON_COMPILING_IN_LIMITED_API
1165static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
1166 int value;
1167 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1168 if (!py_value) return 0;
1169 value = (int) PyLong_AsLong(py_value);
1170 Py_DECREF(py_value);
1171 *write_to = value;
1172 return value != -1 || !PyErr_Occurred();
1173}
1174static int __Pyx_init_co_variables(void) {
1175 PyObject *inspect;
1176 int result;
1177 inspect = PyImport_ImportModule("inspect");
1178 result =
1179#if !defined(CO_OPTIMIZED)
1180 __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
1181#endif
1182#if !defined(CO_NEWLOCALS)
1183 __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
1184#endif
1185#if !defined(CO_VARARGS)
1186 __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
1187#endif
1188#if !defined(CO_VARKEYWORDS)
1189 __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1190#endif
1191#if !defined(CO_ASYNC_GENERATOR)
1192 __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1193#endif
1194#if !defined(CO_GENERATOR)
1195 __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
1196#endif
1197#if !defined(CO_COROUTINE)
1198 __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
1199#endif
1200 1;
1201 Py_DECREF(inspect);
1202 return result ? 0 : -1;
1203}
1204static int __Pyx_init_tpflags_bitcount(unsigned long flag) {
1205 int count = 0;
1206 while (flag) {
1207 count += (int) (flag & 1);
1208 flag >>= 1;
1209 }
1210 return count;
1211}
1212static int __Pyx_init_tpflags_variables(void) {
1213 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1214 return 0;
1215 }
1216 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
1217 if (!collections_abc) return -1;
1218 int result = 0;
1219 PyObject *sequence = NULL, *mapping = NULL;
1220#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1221 if (PyObject_GetOptionalAttrString(collections_abc, "Sequence", &sequence) != 1) goto fail;
1222 if (PyObject_GetOptionalAttrString(collections_abc, "Mapping", &mapping) != 1) goto fail;
1223#else
1224 sequence = PyObject_GetAttrString(collections_abc, "Sequence");
1225 if (!sequence) goto fail_attr_lookup;
1226 mapping = PyObject_GetAttrString(collections_abc, "Mapping");
1227 if (!mapping) goto fail_attr_lookup;
1228#endif
1229 if (!PyType_Check(sequence) || !PyType_Check(mapping)) goto fail;
1230 {
1231 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1232 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1233 unsigned long mutual_flags = sequence_flags & mapping_flags;
1234 sequence_flags = sequence_flags ^ mutual_flags;
1235 mapping_flags = mapping_flags ^ mutual_flags;
1236 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1237 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1238 }
1239 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1240 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1241 }
1242 }
1243 cleanup:
1244 Py_XDECREF(mapping);
1245 Py_XDECREF(sequence);
1246 Py_DECREF(collections_abc);
1247 return result;
1248#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1249 fail_attr_lookup:
1250 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1251 PyErr_Clear();
1252 }
1253#endif
1254 fail:
1255 result = PyErr_Occurred() ? -1 : 0;
1256 goto cleanup;
1257}
1258#else
1259static int __Pyx_init_co_variables(void) {
1260 return 0; // It's a limited API-only feature
1261}
1262static int __Pyx_init_tpflags_variables(void) {
1263 return 0; // It's a limited API-only feature
1264}
1265#endif
1266
1267/* MathInitCode */
1268#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1269 #ifndef _USE_MATH_DEFINES
1270 #define _USE_MATH_DEFINES
1271 #endif
1272#endif
1273#include <math.h>
1274#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1275#define __Pyx_truncl trunc
1276#else
1277#define __Pyx_truncl truncl
1278#endif
1279
1280#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1281#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1282#endif
1283#ifndef CYTHON_CLINE_IN_TRACEBACK
1284#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1285#endif
1286#if CYTHON_CLINE_IN_TRACEBACK
1287#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
1288#else
1289#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
1290#endif
1291#define __PYX_ERR(f_index, lineno, Ln_error) \
1292 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1293
1294#ifdef CYTHON_EXTERN_C
1295 #undef __PYX_EXTERN_C
1296 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1297#elif defined(__PYX_EXTERN_C)
1298 #ifdef _MSC_VER
1299 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1300 #else
1301 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1302 #endif
1303#else
1304 #ifdef __cplusplus
1305 #define __PYX_EXTERN_C extern "C"
1306 #else
1307 #define __PYX_EXTERN_C extern
1308 #endif
1309#endif
1310
1311#define __PYX_HAVE__superluWrappers
1312#define __PYX_HAVE_API__superluWrappers
1313/* Early includes */
1314#include <string.h>
1315#include <stdio.h>
1316
1317 /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1318
1319#include "numpy/arrayobject.h"
1320#include "numpy/ndarrayobject.h"
1321#include "numpy/ndarraytypes.h"
1322#include "numpy/arrayscalars.h"
1323#include "numpy/ufuncobject.h"
1324#include "proteus_superlu.h"
1325#include <stdlib.h>
1326#include "pythread.h"
1327
1328 typedef int (*__pyx_memoryview_to_dtype_func_type)(char*, PyObject*);
1329
1330#ifdef _OPENMP
1331#include <omp.h>
1332#endif /* _OPENMP */
1333
1334#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1335#define CYTHON_WITHOUT_ASSERTIONS
1336#endif
1337
1338#ifdef CYTHON_FREETHREADING_COMPATIBLE
1339#if CYTHON_FREETHREADING_COMPATIBLE
1340#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1341#else
1342#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1343#endif
1344#else
1345#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1346#endif
1347#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1348#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1349#define __PYX_DEFAULT_STRING_ENCODING ""
1350#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1351#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1352#define __Pyx_uchar_cast(c) ((unsigned char)c)
1353#define __Pyx_long_cast(x) ((long)x)
1354#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1355 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1356 (sizeof(type) > sizeof(Py_ssize_t) &&\
1357 likely(v < (type)PY_SSIZE_T_MAX ||\
1358 v == (type)PY_SSIZE_T_MAX) &&\
1359 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1360 v == (type)PY_SSIZE_T_MIN))) ||\
1361 (sizeof(type) == sizeof(Py_ssize_t) &&\
1362 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1363 v == (type)PY_SSIZE_T_MAX))) )
1364static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1365 return (size_t) i < (size_t) limit;
1366}
1367#if defined (__cplusplus) && __cplusplus >= 201103L
1368 #include <cstdlib>
1369 #define __Pyx_sst_abs(value) std::abs(value)
1370#elif SIZEOF_INT >= SIZEOF_SIZE_T
1371 #define __Pyx_sst_abs(value) abs(value)
1372#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1373 #define __Pyx_sst_abs(value) labs(value)
1374#elif defined (_MSC_VER)
1375 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1376#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1377 #define __Pyx_sst_abs(value) llabs(value)
1378#elif defined (__GNUC__)
1379 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1380#else
1381 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1382#endif
1383static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1384static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1385static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1386static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1387#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1388#define __Pyx_PyBytes_FromString PyBytes_FromString
1389#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1390static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1391#if CYTHON_ASSUME_SAFE_MACROS
1392 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1393 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1394 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1395 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1396 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1397 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1398 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1399#else
1400 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1401 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1402 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1403 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1404 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1405 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1406 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1407#endif
1408#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1409#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1410#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1411#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1412#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1413#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1414#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1415#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1416#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1417#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1418#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1419static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1420#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1421 return Py_NewRef(obj);
1422#else
1423 Py_INCREF(obj);
1424 return obj;
1425#endif
1426}
1427static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1428#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1429 return Py_XNewRef(obj);
1430#else
1431 Py_XINCREF(obj);
1432 return obj;
1433#endif
1434}
1435static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
1436static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1437static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1438static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1439static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1440#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1441#define __Pyx_PySequence_Tuple(obj)\
1442 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1443static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1444static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
1445static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1446#if CYTHON_ASSUME_SAFE_MACROS
1447#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1448#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1449#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1450#else
1451#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1452#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1453#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1454#endif
1455#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1456#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1457#if CYTHON_USE_PYLONG_INTERNALS
1458 #if PY_VERSION_HEX >= 0x030C00A7
1459 #ifndef _PyLong_SIGN_MASK
1460 #define _PyLong_SIGN_MASK 3
1461 #endif
1462 #ifndef _PyLong_NON_SIZE_BITS
1463 #define _PyLong_NON_SIZE_BITS 3
1464 #endif
1465 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1466 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1467 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1468 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1469 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1470 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1471 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1472 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1473 #define __Pyx_PyLong_SignedDigitCount(x)\
1474 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1475 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1476 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1477 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1478 #else
1479 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1480 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1481 #endif
1482 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1483 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1484 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1485 if (tag_a == tag_b) return 0;
1486 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1487 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1488 if (sign_a > sign_b) return -1;
1489 if (sign_a < sign_b) return 1;
1490 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1491 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1492 return (1 - sign_a) * (size_a - size_b);
1493 }
1494 typedef Py_ssize_t __Pyx_compact_pylong;
1495 typedef size_t __Pyx_compact_upylong;
1496 #else
1497 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1498 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1499 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1500 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1501 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1502 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1503 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1504 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1505 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1506 #define __Pyx_PyLong_CompactValue(x)\
1507 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1508 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1509 typedef sdigit __Pyx_compact_pylong;
1510 typedef digit __Pyx_compact_upylong;
1511 #endif
1512 #if PY_VERSION_HEX >= 0x030C00A5
1513 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1514 #else
1515 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1516 #endif
1517 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1518#else
1519 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1520#endif
1521#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1522 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1523#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1524 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1525#else
1526 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1527#endif
1528
1529
1530/* Test for GCC > 2.95 */
1531#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1532 #define likely(x) __builtin_expect(!!(x), 1)
1533 #define unlikely(x) __builtin_expect(!!(x), 0)
1534#else /* !__GNUC__ or GCC < 2.95 */
1535 #define likely(x) (x)
1536 #define unlikely(x) (x)
1537#endif /* __GNUC__ */
1538/* PretendToInitialize */
1539#ifdef __cplusplus
1540#if __cplusplus > 201103L
1541#include <type_traits>
1542#endif
1543template <typename T>
1544static void __Pyx_pretend_to_initialize(T* ptr) {
1545#if __cplusplus > 201103L
1546 if ((std::is_trivially_default_constructible<T>::value))
1547#endif
1548 *ptr = T();
1549 (void)ptr;
1550}
1551#else
1552static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1553#endif
1554
1555
1556#if !CYTHON_USE_MODULE_STATE
1557static PyObject *__pyx_m = NULL;
1558#endif
1559static const char * const __pyx_cfilenm = __FILE__;
1560
1561/* Header.proto */
1562#if !defined(CYTHON_CCOMPLEX)
1563 #if defined(__cplusplus)
1564 #define CYTHON_CCOMPLEX 1
1565 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1566 #define CYTHON_CCOMPLEX 1
1567 #else
1568 #define CYTHON_CCOMPLEX 0
1569 #endif
1570#endif
1571#if CYTHON_CCOMPLEX
1572 #ifdef __cplusplus
1573 #include <complex>
1574 #else
1575 #include <complex.h>
1576 #endif
1577#endif
1578#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1579 #undef _Complex_I
1580 #define _Complex_I 1.0fj
1581#endif
1582
1583/* #### Code section: filename_table ### */
1584
1585static const char* const __pyx_f[] = {
1586 "proteus/superluWrappers.pyx",
1587 "View.MemoryView",
1588 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1589 "cpython/type.pxd",
1590};
1591/* #### Code section: utility_code_proto_before_types ### */
1592/* Atomics.proto (used by UnpackUnboundCMethod) */
1593#include <pythread.h>
1594#ifndef CYTHON_ATOMICS
1595 #define CYTHON_ATOMICS 1
1596#endif
1597#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1598#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1599#define __pyx_atomic_int_type int
1600#define __pyx_nonatomic_int_type int
1601#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1602 (__STDC_VERSION__ >= 201112L) &&\
1603 !defined(__STDC_NO_ATOMICS__))
1604 #include <stdatomic.h>
1605#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1606 (__cplusplus >= 201103L) ||\
1607 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1608 #include <atomic>
1609#endif
1610#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1611 (__STDC_VERSION__ >= 201112L) &&\
1612 !defined(__STDC_NO_ATOMICS__) &&\
1613 ATOMIC_INT_LOCK_FREE == 2)
1614 #undef __pyx_atomic_int_type
1615 #define __pyx_atomic_int_type atomic_int
1616 #define __pyx_atomic_ptr_type atomic_uintptr_t
1617 #define __pyx_nonatomic_ptr_type uintptr_t
1618 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1619 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1620 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1621 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1622 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1623 #define __pyx_atomic_load(value) atomic_load(value)
1624 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1625 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1626 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1627 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1628 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1629 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1630 #pragma message ("Using standard C atomics")
1631 #elif defined(__PYX_DEBUG_ATOMICS)
1632 #warning "Using standard C atomics"
1633 #endif
1634#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1635 (__cplusplus >= 201103L) ||\
1636\
1637 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1638 ATOMIC_INT_LOCK_FREE == 2)
1639 #undef __pyx_atomic_int_type
1640 #define __pyx_atomic_int_type std::atomic_int
1641 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1642 #define __pyx_nonatomic_ptr_type uintptr_t
1643 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1644 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1645 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1646 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1647 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1648 #define __pyx_atomic_load(value) std::atomic_load(value)
1649 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1650 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1651 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1652 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1653 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1654 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1655 #pragma message ("Using standard C++ atomics")
1656 #elif defined(__PYX_DEBUG_ATOMICS)
1657 #warning "Using standard C++ atomics"
1658 #endif
1659#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1660 (__GNUC_MINOR__ > 1 ||\
1661 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1662 #define __pyx_atomic_ptr_type void*
1663 #define __pyx_nonatomic_ptr_type void*
1664 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1665 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1666 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1667 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1668 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1669 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1670 int result = old == *expected;
1671 *expected = old;
1672 return result;
1673 }
1674 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1675 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1676 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1677 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1678 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1679 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1680 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1681 int result = old == *expected;
1682 *expected = old;
1683 return result;
1684 }
1685 #ifdef __PYX_DEBUG_ATOMICS
1686 #warning "Using GNU atomics"
1687 #endif
1688#elif CYTHON_ATOMICS && defined(_MSC_VER)
1689 #include <intrin.h>
1690 #undef __pyx_atomic_int_type
1691 #define __pyx_atomic_int_type long
1692 #define __pyx_atomic_ptr_type void*
1693 #undef __pyx_nonatomic_int_type
1694 #define __pyx_nonatomic_int_type long
1695 #define __pyx_nonatomic_ptr_type void*
1696 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1697 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1698 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1699 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1700 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1701 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1702 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1703 int result = old == *expected;
1704 *expected = old;
1705 return result;
1706 }
1707 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1708 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1709 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1710 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1711 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1712 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1713 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1714 int result = old == *expected;
1715 *expected = old;
1716 return result;
1717 }
1718 #ifdef __PYX_DEBUG_ATOMICS
1719 #pragma message ("Using MSVC atomics")
1720 #endif
1721#else
1722 #undef CYTHON_ATOMICS
1723 #define CYTHON_ATOMICS 0
1724 #ifdef __PYX_DEBUG_ATOMICS
1725 #warning "Not using atomics"
1726 #endif
1727#endif
1728
1729/* CriticalSectionsDefinition.proto (used by CriticalSections) */
1730#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1731#define __Pyx_PyCriticalSection void*
1732#define __Pyx_PyCriticalSection2 void*
1733#define __Pyx_PyCriticalSection_End(cs)
1734#define __Pyx_PyCriticalSection2_End(cs)
1735#else
1736#define __Pyx_PyCriticalSection PyCriticalSection
1737#define __Pyx_PyCriticalSection2 PyCriticalSection2
1738#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1739#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1740#endif
1741
1742/* CriticalSections.proto (used by ParseKeywordsImpl) */
1743#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1744#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1745#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1746#else
1747#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1748#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1749#endif
1750#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1751#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1752#define __Pyx_END_CRITICAL_SECTION() }
1753#else
1754#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1755#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1756#endif
1757
1758/* ForceInitThreads.proto */
1759#ifndef __PYX_FORCE_INIT_THREADS
1760 #define __PYX_FORCE_INIT_THREADS 0
1761#endif
1762
1763/* NoFastGil.proto */
1764#define __Pyx_PyGILState_Ensure PyGILState_Ensure
1765#define __Pyx_PyGILState_Release PyGILState_Release
1766#define __Pyx_FastGIL_Remember()
1767#define __Pyx_FastGIL_Forget()
1768#define __Pyx_FastGilFuncInit()
1769
1770/* IncludeStructmemberH.proto (used by CythonFunctionShared) */
1771#include <structmember.h>
1772
1773/* BufferFormatStructs.proto */
1774struct __Pyx_StructField_;
1775#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1776typedef struct {
1777 const char* name;
1778 const struct __Pyx_StructField_* fields;
1779 size_t size;
1780 size_t arraysize[8];
1781 int ndim;
1782 char typegroup;
1783 char is_unsigned;
1784 int flags;
1785} __Pyx_TypeInfo;
1786typedef struct __Pyx_StructField_ {
1787 const __Pyx_TypeInfo* type;
1788 const char* name;
1789 size_t offset;
1790} __Pyx_StructField;
1791typedef struct {
1792 const __Pyx_StructField* field;
1793 size_t parent_offset;
1794} __Pyx_BufFmt_StackElem;
1795typedef struct {
1796 __Pyx_StructField root;
1797 __Pyx_BufFmt_StackElem* head;
1798 size_t fmt_offset;
1799 size_t new_count, enc_count;
1800 size_t struct_alignment;
1801 int is_complex;
1802 char enc_type;
1803 char new_packmode;
1804 char enc_packmode;
1805 char is_valid_array;
1806} __Pyx_BufFmt_Context;
1807
1808/* MemviewSliceStruct.proto */
1809struct __pyx_memoryview_obj;
1810typedef struct {
1811 struct __pyx_memoryview_obj *memview;
1812 char *data;
1813 Py_ssize_t shape[8];
1814 Py_ssize_t strides[8];
1815 Py_ssize_t suboffsets[8];
1816} __Pyx_memviewslice;
1817#define __Pyx_MemoryView_Len(m) (m.shape[0])
1818#define __Pyx_MEMVIEW_DIRECT 1
1819#define __Pyx_MEMVIEW_PTR 2
1820#define __Pyx_MEMVIEW_FULL 4
1821#define __Pyx_MEMVIEW_CONTIG 8
1822#define __Pyx_MEMVIEW_STRIDED 16
1823#define __Pyx_MEMVIEW_FOLLOW 32
1824#define __Pyx_IS_C_CONTIG 1
1825#define __Pyx_IS_F_CONTIG 2
1826#define __Pyx_MEMSLICE_INIT { 0, 0, { 0 }, { 0 }, { 0 } }
1827#if CYTHON_ATOMICS
1828 #define __pyx_add_acquisition_count(memview)\
1829 __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
1830 #define __pyx_sub_acquisition_count(memview)\
1831 __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
1832#else
1833 #define __pyx_add_acquisition_count(memview)\
1834 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1835 #define __pyx_sub_acquisition_count(memview)\
1836 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1837#endif
1838
1839/* #### Code section: numeric_typedefs ### */
1840
1841/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":761
1842 * # in Cython to enable them only on the right systems.
1843 *
1844 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1845 * ctypedef npy_int16 int16_t
1846 * ctypedef npy_int32 int32_t
1847*/
1848typedef npy_int8 __pyx_t_5numpy_int8_t;
1849
1850/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":762
1851 *
1852 * ctypedef npy_int8 int8_t
1853 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1854 * ctypedef npy_int32 int32_t
1855 * ctypedef npy_int64 int64_t
1856*/
1857typedef npy_int16 __pyx_t_5numpy_int16_t;
1858
1859/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":763
1860 * ctypedef npy_int8 int8_t
1861 * ctypedef npy_int16 int16_t
1862 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1863 * ctypedef npy_int64 int64_t
1864 *
1865*/
1866typedef npy_int32 __pyx_t_5numpy_int32_t;
1867
1868/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":764
1869 * ctypedef npy_int16 int16_t
1870 * ctypedef npy_int32 int32_t
1871 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1872 *
1873 * ctypedef npy_uint8 uint8_t
1874*/
1875typedef npy_int64 __pyx_t_5numpy_int64_t;
1876
1877/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":766
1878 * ctypedef npy_int64 int64_t
1879 *
1880 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1881 * ctypedef npy_uint16 uint16_t
1882 * ctypedef npy_uint32 uint32_t
1883*/
1884typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1885
1886/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":767
1887 *
1888 * ctypedef npy_uint8 uint8_t
1889 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1890 * ctypedef npy_uint32 uint32_t
1891 * ctypedef npy_uint64 uint64_t
1892*/
1893typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1894
1895/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":768
1896 * ctypedef npy_uint8 uint8_t
1897 * ctypedef npy_uint16 uint16_t
1898 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1899 * ctypedef npy_uint64 uint64_t
1900 *
1901*/
1902typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1903
1904/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":769
1905 * ctypedef npy_uint16 uint16_t
1906 * ctypedef npy_uint32 uint32_t
1907 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1908 *
1909 * ctypedef npy_float32 float32_t
1910*/
1911typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1912
1913/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":771
1914 * ctypedef npy_uint64 uint64_t
1915 *
1916 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1917 * ctypedef npy_float64 float64_t
1918 * #ctypedef npy_float80 float80_t
1919*/
1920typedef npy_float32 __pyx_t_5numpy_float32_t;
1921
1922/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":772
1923 *
1924 * ctypedef npy_float32 float32_t
1925 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1926 * #ctypedef npy_float80 float80_t
1927 * #ctypedef npy_float128 float128_t
1928*/
1929typedef npy_float64 __pyx_t_5numpy_float64_t;
1930
1931/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":779
1932 * ctypedef double complex complex128_t
1933 *
1934 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1935 * ctypedef npy_ulonglong ulonglong_t
1936 *
1937*/
1938typedef npy_longlong __pyx_t_5numpy_longlong_t;
1939
1940/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":780
1941 *
1942 * ctypedef npy_longlong longlong_t
1943 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1944 *
1945 * ctypedef npy_intp intp_t
1946*/
1947typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1948
1949/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":782
1950 * ctypedef npy_ulonglong ulonglong_t
1951 *
1952 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1953 * ctypedef npy_uintp uintp_t
1954 *
1955*/
1956typedef npy_intp __pyx_t_5numpy_intp_t;
1957
1958/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":783
1959 *
1960 * ctypedef npy_intp intp_t
1961 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1962 *
1963 * ctypedef npy_double float_t
1964*/
1965typedef npy_uintp __pyx_t_5numpy_uintp_t;
1966
1967/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":785
1968 * ctypedef npy_uintp uintp_t
1969 *
1970 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1971 * ctypedef npy_double double_t
1972 * ctypedef npy_longdouble longdouble_t
1973*/
1974typedef npy_double __pyx_t_5numpy_float_t;
1975
1976/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":786
1977 *
1978 * ctypedef npy_double float_t
1979 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1980 * ctypedef npy_longdouble longdouble_t
1981 *
1982*/
1983typedef npy_double __pyx_t_5numpy_double_t;
1984
1985/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":787
1986 * ctypedef npy_double float_t
1987 * ctypedef npy_double double_t
1988 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1989 *
1990 * ctypedef float complex cfloat_t
1991*/
1992typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1993/* #### Code section: complex_type_declarations ### */
1994/* Declarations.proto */
1995#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1996 #ifdef __cplusplus
1997 typedef ::std::complex< float > __pyx_t_float_complex;
1998 #else
1999 typedef float _Complex __pyx_t_float_complex;
2000 #endif
2001#else
2002 typedef struct { float real, imag; } __pyx_t_float_complex;
2003#endif
2004static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
2005
2006/* Declarations.proto */
2007#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2008 #ifdef __cplusplus
2009 typedef ::std::complex< double > __pyx_t_double_complex;
2010 #else
2011 typedef double _Complex __pyx_t_double_complex;
2012 #endif
2013#else
2014 typedef struct { double real, imag; } __pyx_t_double_complex;
2015#endif
2016static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
2017
2018/* Declarations.proto */
2019#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2020 #ifdef __cplusplus
2021 typedef ::std::complex< long double > __pyx_t_long_double_complex;
2022 #else
2023 typedef long double _Complex __pyx_t_long_double_complex;
2024 #endif
2025#else
2026 typedef struct { long double real, imag; } __pyx_t_long_double_complex;
2027#endif
2028static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
2029
2030/* #### Code section: type_declarations ### */
2031
2032/*--- Type declarations ---*/
2033struct __pyx_obj_15superluWrappers_cSparseMatrix;
2034struct __pyx_obj_15superluWrappers_SparseFactor;
2035struct __pyx_array_obj;
2036struct __pyx_MemviewEnum_obj;
2037struct __pyx_memoryview_obj;
2038struct __pyx_memoryviewslice_obj;
2039struct __pyx_t_15superluWrappers__NRformat;
2040struct __pyx_t_15superluWrappers__NCformat;
2041struct __pyx_t_15superluWrappers__DNformat;
2042struct __pyx_t_15superluWrappers__NCPformat;
2043
2044/* "superluWrappers.pxd":62
2045 * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
2046 *
2047 * cdef struct _NRformat: # <<<<<<<<<<<<<<
2048 * np.int32_t nnz
2049 * np.float64_t * nzval
2050*/
2051struct __pyx_t_15superluWrappers__NRformat {
2052 __pyx_t_5numpy_int32_t nnz;
2053 __pyx_t_5numpy_float64_t *nzval;
2054 __pyx_t_5numpy_int32_t *colind;
2055 __pyx_t_5numpy_int32_t *rowptr;
2056};
2057
2058/* "superluWrappers.pyx":131
2059 * yp[i] = tmp
2060 *
2061 * cdef struct _NCformat: # <<<<<<<<<<<<<<
2062 * np.int32_t nnz
2063 * np.float64_t * nzval
2064*/
2065struct __pyx_t_15superluWrappers__NCformat {
2066 __pyx_t_5numpy_int32_t nnz;
2067 __pyx_t_5numpy_float64_t *nzval;
2068 __pyx_t_5numpy_int32_t *rowind;
2069 __pyx_t_5numpy_int32_t *colptr;
2070};
2071
2072/* "superluWrappers.pyx":137
2073 * np.int32_t * colptr
2074 *
2075 * cdef struct _DNformat: # <<<<<<<<<<<<<<
2076 * np.int32_t lda
2077 * void *nzval
2078*/
2079struct __pyx_t_15superluWrappers__DNformat {
2080 __pyx_t_5numpy_int32_t lda;
2081 void *nzval;
2082};
2083
2084/* "superluWrappers.pyx":141
2085 * void *nzval
2086 *
2087 * cdef struct _NCPformat: # <<<<<<<<<<<<<<
2088 * np.int32_t nnz
2089 * void * nzval
2090*/
2091struct __pyx_t_15superluWrappers__NCPformat {
2092 __pyx_t_5numpy_int32_t nnz;
2093 void *nzval;
2094 __pyx_t_5numpy_int32_t *rowind;
2095 __pyx_t_5numpy_int32_t *colbeg;
2096 __pyx_t_5numpy_int32_t *colend;
2097};
2098
2099/* "superluWrappers.pxd":68
2100 * np.int32_t * rowptr
2101 *
2102 * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
2103 * cdef np.int32_t dim[2]
2104 * cdef _NRformat A
2105*/
2106struct __pyx_obj_15superluWrappers_cSparseMatrix {
2107 PyObject_HEAD
2108 __pyx_t_5numpy_int32_t dim[2];
2109 struct __pyx_t_15superluWrappers__NRformat A;
2110};
2111
2112
2113/* "superluWrappers.pyx":148
2114 * np.int32_t * colend
2115 *
2116 * cdef class SparseFactor(object): # <<<<<<<<<<<<<<
2117 *
2118 * cdef _superlu_options_t options
2119*/
2120struct __pyx_obj_15superluWrappers_SparseFactor {
2121 PyObject_HEAD
2122 struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtab;
2123 superlu_options_t options;
2124 SuperMatrix A;
2125 SuperMatrix AC;
2126 SuperMatrix L;
2127 SuperMatrix U;
2128 SuperMatrix X;
2129 GlobalLU_t Glu;
2130 SuperLUStat_t stat;
2131 struct __pyx_t_15superluWrappers__NCformat storeA;
2132 struct __pyx_t_15superluWrappers__DNformat storeX;
2133 int *perm_c;
2134 int *perm_r;
2135 int *etree;
2136 unsigned int use_same_perm_c;
2137 unsigned int use_same_sparsity;
2138 int dim;
2139};
2140
2141
2142/* "View.MemoryView":128
2143 *
2144 *
2145 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2146 * @cname("__pyx_array")
2147 * cdef class array:
2148*/
2149struct __pyx_array_obj {
2150 PyObject_HEAD
2151 struct __pyx_vtabstruct_array *__pyx_vtab;
2152 char *data;
2153 Py_ssize_t len;
2154 char *format;
2155 int ndim;
2156 Py_ssize_t *_shape;
2157 Py_ssize_t *_strides;
2158 Py_ssize_t itemsize;
2159 PyObject *mode;
2160 PyObject *_format;
2161 void (*callback_free_data)(void *);
2162 int free_data;
2163 int dtype_is_object;
2164};
2165
2166
2167/* "View.MemoryView":318
2168 *
2169 *
2170 * @cname('__pyx_MemviewEnum') # <<<<<<<<<<<<<<
2171 * cdef class Enum(object):
2172 * cdef object name
2173*/
2174struct __pyx_MemviewEnum_obj {
2175 PyObject_HEAD
2176 PyObject *name;
2177};
2178
2179
2180/* "View.MemoryView":353
2181 *
2182 *
2183 * @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
2184 * cdef class memoryview:
2185 *
2186*/
2187struct __pyx_memoryview_obj {
2188 PyObject_HEAD
2189 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2190 PyObject *obj;
2191 PyObject *_size;
2192 void *_unused;
2193 PyThread_type_lock lock;
2194 __pyx_atomic_int_type acquisition_count;
2195 Py_buffer view;
2196 int flags;
2197 int dtype_is_object;
2198 __Pyx_TypeInfo const *typeinfo;
2199};
2200
2201
2202/* "View.MemoryView":947
2203 *
2204 *
2205 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2206 * @cname('__pyx_memoryviewslice')
2207 * cdef class _memoryviewslice(memoryview):
2208*/
2209struct __pyx_memoryviewslice_obj {
2210 struct __pyx_memoryview_obj __pyx_base;
2211 __Pyx_memviewslice from_slice;
2212 PyObject *from_object;
2213 PyObject *(*to_object_func)(char *);
2214 __pyx_memoryview_to_dtype_func_type to_dtype_func;
2215};
2216
2217
2218
2219/* "superluWrappers.pyx":148
2220 * np.int32_t * colend
2221 *
2222 * cdef class SparseFactor(object): # <<<<<<<<<<<<<<
2223 *
2224 * cdef _superlu_options_t options
2225*/
2226
2227struct __pyx_vtabstruct_15superluWrappers_SparseFactor {
2228 PyObject *(*_set_mat_types)(struct __pyx_obj_15superluWrappers_SparseFactor *);
2229};
2230static struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtabptr_15superluWrappers_SparseFactor;
2231
2232
2233/* "View.MemoryView":128
2234 *
2235 *
2236 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2237 * @cname("__pyx_array")
2238 * cdef class array:
2239*/
2240
2241struct __pyx_vtabstruct_array {
2242 PyObject *(*get_memview)(struct __pyx_array_obj *);
2243};
2244static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2245
2246
2247/* "View.MemoryView":353
2248 *
2249 *
2250 * @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
2251 * cdef class memoryview:
2252 *
2253*/
2254
2255struct __pyx_vtabstruct_memoryview {
2256 char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
2257 PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
2258 PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2259 PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
2260 PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2261 PyObject *(*setitem_indexed1)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2262 PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
2263 PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
2264 PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
2265};
2266static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2267
2268
2269/* "View.MemoryView":947
2270 *
2271 *
2272 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2273 * @cname('__pyx_memoryviewslice')
2274 * cdef class _memoryviewslice(memoryview):
2275*/
2276
2277struct __pyx_vtabstruct__memoryviewslice {
2278 struct __pyx_vtabstruct_memoryview __pyx_base;
2279};
2280static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2281/* #### Code section: utility_code_proto ### */
2282
2283/* --- Runtime support code (head) --- */
2284/* Refnanny.proto */
2285#ifndef CYTHON_REFNANNY
2286 #define CYTHON_REFNANNY 0
2287#endif
2288#if CYTHON_REFNANNY
2289 typedef struct {
2290 void (*INCREF)(void*, PyObject*, Py_ssize_t);
2291 void (*DECREF)(void*, PyObject*, Py_ssize_t);
2292 void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2293 void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2294 void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2295 void (*FinishContext)(void**);
2296 } __Pyx_RefNannyAPIStruct;
2297 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2298 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2299 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2300 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2301 if (acquire_gil) {\
2302 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2303 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2304 PyGILState_Release(__pyx_gilstate_save);\
2305 } else {\
2306 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2307 }
2308 #define __Pyx_RefNannyFinishContextNogil() {\
2309 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2310 __Pyx_RefNannyFinishContext();\
2311 PyGILState_Release(__pyx_gilstate_save);\
2312 }
2313 #define __Pyx_RefNannyFinishContextNogil() {\
2314 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2315 __Pyx_RefNannyFinishContext();\
2316 PyGILState_Release(__pyx_gilstate_save);\
2317 }
2318 #define __Pyx_RefNannyFinishContext()\
2319 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2320 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2321 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2322 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2323 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2324 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2325 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2326 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2327 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2328#else
2329 #define __Pyx_RefNannyDeclarations
2330 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2331 #define __Pyx_RefNannyFinishContextNogil()
2332 #define __Pyx_RefNannyFinishContext()
2333 #define __Pyx_INCREF(r) Py_INCREF(r)
2334 #define __Pyx_DECREF(r) Py_DECREF(r)
2335 #define __Pyx_GOTREF(r)
2336 #define __Pyx_GIVEREF(r)
2337 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2338 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2339 #define __Pyx_XGOTREF(r)
2340 #define __Pyx_XGIVEREF(r)
2341#endif
2342#define __Pyx_Py_XDECREF_SET(r, v) do {\
2343 PyObject *tmp = (PyObject *) r;\
2344 r = v; Py_XDECREF(tmp);\
2345 } while (0)
2346#define __Pyx_XDECREF_SET(r, v) do {\
2347 PyObject *tmp = (PyObject *) r;\
2348 r = v; __Pyx_XDECREF(tmp);\
2349 } while (0)
2350#define __Pyx_DECREF_SET(r, v) do {\
2351 PyObject *tmp = (PyObject *) r;\
2352 r = v; __Pyx_DECREF(tmp);\
2353 } while (0)
2354#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2355#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2356
2357/* FastTypeChecks.proto (used by GivenExceptionMatches) */
2358#if CYTHON_COMPILING_IN_CPYTHON
2359#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2360#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2361static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2362static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2363#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2364#else
2365#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2366#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2367#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2368#endif
2369
2370/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
2371#if CYTHON_FAST_THREAD_STATE
2372#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2373#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2374#if PY_VERSION_HEX >= 0x030C00A6
2375#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2376#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2377#else
2378#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2379#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2380#endif
2381#else
2382#define __Pyx_PyThreadState_declare
2383#define __Pyx_PyThreadState_assign
2384#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2385#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2386#endif
2387
2388/* PyErrFetchRestore.proto (used by GivenExceptionMatches) */
2389#if CYTHON_FAST_THREAD_STATE
2390#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2391#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2392#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2393#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2394#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2395static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2396static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2397#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2398#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2399#else
2400#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2401#endif
2402#else
2403#define __Pyx_PyErr_Clear() PyErr_Clear()
2404#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2405#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2406#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2407#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2408#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2409#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2410#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2411#endif
2412
2413/* GivenExceptionMatches.proto (used by PyErrExceptionMatches) */
2414#if CYTHON_COMPILING_IN_CPYTHON
2415static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2416static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2417#else
2418#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2419static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2420 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2421}
2422#endif
2423#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2424
2425/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
2426#if CYTHON_FAST_THREAD_STATE
2427#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2428static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2429#else
2430#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2431#endif
2432
2433/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */
2434#if CYTHON_USE_TYPE_SLOTS
2435static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2436#else
2437#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2438#endif
2439
2440/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */
2441static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2442
2443/* GetBuiltinName.proto */
2444static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2445
2446/* CopyObjectArray.proto (used by TupleOrListFromArrayImpl) */
2447#if CYTHON_COMPILING_IN_CPYTHON
2448static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2449#endif
2450
2451/* TupleOrListFromArrayImpl.proto (used by TupleFromArray) */
2452#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2453#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2454#else
2455CYTHON_UNUSED static PyObject *
2456__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2457#endif
2458
2459/* TupleFromArray.proto (used by fastcall) */
2460
2461
2462/* IncludeStringH.proto (used by PyObjectCompare) */
2463#include <string.h>
2464
2465/* PyObjectCompare.proto (used by UnicodeEquals) */
2466static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop);
2467
2468/* UnicodeEquals.proto (used by fastcall) */
2469#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2470
2471/* fastcall.proto */
2472#if CYTHON_AVOID_BORROWED_REFS
2473 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2474#elif CYTHON_ASSUME_SAFE_MACROS
2475 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2476#else
2477 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2478#endif
2479#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2480#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2481#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2482#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2483#if CYTHON_VECTORCALL
2484 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2485 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2486 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2487 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2488 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2489 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2490 #else
2491 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2492 #endif
2493#else
2494 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2495 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2496 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2497 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2498 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2499#endif
2500#if CYTHON_VECTORCALL_TPNEW
2501 #if !CYTHON_VECTORCALL
2502 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2503 #endif
2504 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2505 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2506 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2507 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2508 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2509#else
2510 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2511 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2512 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2513 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2514 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2515#endif
2516#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2517#if CYTHON_VECTORCALL
2518#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2519#else
2520#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2521#endif
2522
2523/* py_dict_items.proto (used by OwnedDictNext) */
2524#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2525#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2526#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2527static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2528
2529/* CallCFunction.proto (used by CallUnboundCMethod0) */
2530#define __Pyx_CallCFunction(cfunc, self, args)\
2531 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2532#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2533 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2534#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2535 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2536#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2537 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2538
2539/* PyObjectCall.proto (used by PyObjectFastCall) */
2540#if CYTHON_COMPILING_IN_CPYTHON
2541static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2542#else
2543#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2544#endif
2545
2546/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
2547#if CYTHON_COMPILING_IN_CPYTHON
2548static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2549#endif
2550
2551/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */
2552#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2553static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargsf, PyObject *kwargs);
2554
2555/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
2556static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2557
2558/* UnpackUnboundCMethod_decl.proto (used by UnpackUnboundCMethod) */
2559typedef struct {
2560 PyObject *type;
2561 PyObject **method_name;
2562 PyCFunction func;
2563 PyObject *method;
2564 int flag;
2565#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2566 __pyx_atomic_int_type initialized;
2567#endif
2568} __Pyx_CachedCFunction;
2569
2570/* IgnoreException.proto (used by UnpackUnboundCMethod_impl) */
2571static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2572#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2573
2574/* UnpackUnboundCMethod_impl.export */
2575static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2576
2577/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
2578#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2579static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2580#if !CYTHON_ATOMICS
2581 return 1;
2582#else
2583 __pyx_nonatomic_int_type expected = 0;
2584 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2585 return 0;
2586 }
2587 return expected;
2588#endif
2589}
2590static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2591#if CYTHON_ATOMICS
2592 __pyx_atomic_store(&cfunc->initialized, 2);
2593#endif
2594}
2595#else
2596#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2597#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2598#endif
2599
2600/* CallUnboundCMethod0.proto */
2601CYTHON_UNUSED
2602static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2603#if CYTHON_COMPILING_IN_CPYTHON
2604static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2605#else
2606#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2607#endif
2608
2609/* py_dict_values.proto (used by OwnedDictNext) */
2610#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2611#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2612#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2613static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2614
2615/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
2616#if CYTHON_AVOID_BORROWED_REFS
2617static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2618#else
2619CYTHON_INLINE
2620static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2621#endif
2622
2623/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
2624static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2625
2626/* ParseKeywordsImpl.export */
2627static int __Pyx_ParseKeywordsTuple(
2628 PyObject *kwds,
2629 PyObject * const *kwvalues,
2630 PyObject ** const argnames[],
2631 PyObject *kwds2,
2632 PyObject *values[],
2633 Py_ssize_t num_pos_args,
2634 Py_ssize_t num_kwargs,
2635 const char* function_name,
2636 int ignore_unknown_kwargs
2637);
2638static int __Pyx_ParseKeywordDictToDict(
2639 PyObject *kwds,
2640 PyObject ** const argnames[],
2641 PyObject *kwds2,
2642 PyObject *values[],
2643 Py_ssize_t num_pos_args,
2644 const char* function_name
2645);
2646static int __Pyx_ParseKeywordDict(
2647 PyObject *kwds,
2648 PyObject ** const argnames[],
2649 PyObject *values[],
2650 Py_ssize_t num_pos_args,
2651 Py_ssize_t num_kwargs,
2652 const char* function_name,
2653 int ignore_unknown_kwargs
2654);
2655
2656/* CallUnboundCMethod2.proto */
2657CYTHON_UNUSED
2658static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2659#if CYTHON_COMPILING_IN_CPYTHON
2660static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2661#else
2662#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2663#endif
2664
2665/* ParseKeywords.proto */
2666static CYTHON_INLINE int __Pyx_ParseKeywords(
2667 PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
2668 PyObject *kwds2, PyObject *values[],
2669 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2670 const char* function_name,
2671 int ignore_unknown_kwargs
2672);
2673
2674/* RaiseArgTupleInvalid.export */
2675static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2676 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2677
2678/* ArgTypeTestError.export */
2679static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2680
2681/* ArgTypeTest.proto */
2682static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact);
2683
2684/* PyObjectFastCallMethod.proto */
2685#if CYTHON_VECTORCALL
2686#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
2687#else
2688static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
2689#endif
2690
2691/* FormatTypeName.proto (used by RaiseErrorWithObjectType1) */
2692#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2693typedef PyObject *__Pyx_TypeName;
2694#define __Pyx_FMT_TYPENAME "%N"
2695#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2696#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2697#elif CYTHON_COMPILING_IN_LIMITED_API
2698typedef PyObject *__Pyx_TypeName;
2699#define __Pyx_FMT_TYPENAME "%U"
2700#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2701static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2702#else // !LIMITED_API
2703typedef const char *__Pyx_TypeName;
2704#define __Pyx_FMT_TYPENAME "%.200s"
2705#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2706#define __Pyx_DECREF_TypeName(obj)
2707#endif
2708
2709/* RaiseErrorWithObjectType1.proto (used by RaiseUnexpectedTypeError) */
2710#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
2711#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
2712CYTHON_UNUSED
2713static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj);
2714
2715/* RaiseUnexpectedTypeError.proto */
2716CYTHON_UNUSED
2717static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2718
2719/* PyMemoryError_Check.proto */
2720#define __Pyx_PyExc_MemoryError_Check(obj) __Pyx_TypeCheck(obj, PyExc_MemoryError)
2721
2722/* RaiseException.export */
2723static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2724
2725/* PyValueError_Check.proto */
2726#define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError)
2727
2728/* BuildPyUnicode.proto (used by COrdinalToPyUnicode) */
2729static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
2730 int prepend_sign, char padding_char);
2731
2732/* COrdinalToPyUnicode.proto (used by CIntToPyUnicode) */
2733static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value);
2734static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char);
2735
2736/* GCCDiagnostics.proto (used by CIntToPyUnicode) */
2737#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2738#define __Pyx_HAS_GCC_DIAGNOSTIC
2739#endif
2740
2741/* IncludeStdlibH.proto (used by CIntToPyUnicode) */
2742#include <stdlib.h>
2743
2744/* CIntToPyUnicode.proto */
2745#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\
2746 ((format_char) == ('c')) ?\
2747 __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\
2748 __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\
2749 )
2750static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char);
2751static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
2752
2753/* CIntToPyUnicode.proto */
2754#define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\
2755 ((format_char) == ('c')) ?\
2756 __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
2757 __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
2758 )
2759static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char);
2760static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
2761
2762/* JoinPyUnicode.proto */
2763#define __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH\
2764 (!CYTHON_COMPILING_IN_GRAAL && !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API)
2765
2766/* JoinPyUnicode.export */
2767static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind);
2768
2769/* UnicodeEqualsUCS4.proto (used by UnicodeEquals_uchar) */
2770#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
2771#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2772 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2773 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2774 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2775 )
2776#else
2777#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2778 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2779 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2780 (likely((s1_is_str) || PyUnicode_CheckExact(s1)) ?\
2781 __Pyx__PyUnicode_EqualsUCS4(s1, ch2, equals) :\
2782 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2783 ))
2784static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals);
2785#endif
2786
2787/* UnicodeEquals_uchar.proto */
2788#define __Pyx_PyObject_Equals_obj_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 0)
2789
2790/* PyObjectCompare.proto */
2791static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop);
2792
2793/* PyObjectFormatSimple.proto */
2794#if CYTHON_COMPILING_IN_PYPY
2795 #define __Pyx_PyObject_FormatSimple(s, f) (\
2796 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2797 PyObject_Format(s, f))
2798#elif CYTHON_USE_TYPE_SLOTS
2799 #define __Pyx_PyObject_FormatSimple(s, f) (\
2800 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2801 likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2802 likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2803 PyObject_Format(s, f))
2804#else
2805 #define __Pyx_PyObject_FormatSimple(s, f) (\
2806 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2807 PyObject_Format(s, f))
2808#endif
2809
2810/* PyObjectCompare.proto */
2811static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2, int pyop);
2812
2813CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2814/* UnicodeEquals_uchar.proto */
2815#define __Pyx_PyObject_Equals_str_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 1)
2816
2817static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2818/* GetAttr.proto */
2819static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2820
2821/* PyFrozenDict.proto (used by GetItemInt) */
2822#if CYTHON_COMPILING_IN_LIMITED_API
2823#define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
2824#define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
2825static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
2826#define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
2827#define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
2828#define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
2829#define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
2830static CYTHON_INLINE int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
2831 return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
2832}
2833#define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
2834static CYTHON_INLINE int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
2835 return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
2836}
2837#elif PY_VERSION_HEX >= 0x030f00a6 ||\
2838 (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
2839#define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
2840#define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
2841#define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
2842#define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
2843#define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
2844#define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
2845#define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
2846#else
2847#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
2848static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
2849 if (!it) {
2850 return PyDict_New();
2851 } else if (PyDict_Check(it)) {
2852 return PyDict_Copy(it);
2853 } else {
2854 PyObject *dict = PyDict_New();
2855 if (!dict) return NULL;
2856 PyObject *result = PyNumber_InPlaceOr(dict, it);
2857 Py_DECREF(dict);
2858 return result;
2859 }
2860}
2861#define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
2862#define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
2863#define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
2864#define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
2865#define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
2866#endif
2867
2868/* GetItemInt.proto */
2869#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2870 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2871 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2872 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
2873#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2874 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2875 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2876 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2877static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2878 int wraparound, int boundscheck, int unsafe_shared);
2879#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2880 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2881 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2882 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2883static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2884 int wraparound, int boundscheck, int unsafe_shared);
2885static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2886static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2887 int wraparound, int boundscheck, int unsafe_shared);
2888
2889/* RaiseErrorWithObjectType.proto (used by ObjectGetItem) */
2890#define __Pyx_RaiseTypeErrorWithObjectType(message, obj) __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
2891#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj) __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
2892CYTHON_UNUSED
2893static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj);
2894
2895/* ObjectGetItem.proto */
2896#if CYTHON_USE_TYPE_SLOTS
2897static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2898#else
2899#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2900#endif
2901
2902/* RejectKeywords.export */
2903static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);
2904
2905/* PyTypeError_Check.proto */
2906#define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError)
2907
2908/* DivInt[Py_ssize_t].proto */
2909static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);
2910
2911/* UnaryNegOverflows.proto */
2912#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2913 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2914
2915/* GetAttr3.proto */
2916static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2917
2918/* PyDictVersioning.proto (used by GetModuleGlobalName) */
2919#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2920#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2921#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2922#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2923 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2924 (cache_var) = (value);
2925#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2926 static PY_UINT64_T __pyx_dict_version = 0;\
2927 static PyObject *__pyx_dict_cached_value = NULL;\
2928 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2929 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2930 } else {\
2931 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2932 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2933 }\
2934}
2935static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2936static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2937static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2938#else
2939#define __PYX_GET_DICT_VERSION(dict) (0)
2940#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2941#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2942#endif
2943
2944/* GetModuleGlobalName.proto */
2945#if CYTHON_USE_DICT_VERSIONS
2946#define __Pyx_GetModuleGlobalName(var, name) do {\
2947 static PY_UINT64_T __pyx_dict_version = 0;\
2948 static PyObject *__pyx_dict_cached_value = NULL;\
2949 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
2950 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2951 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2952} while(0)
2953#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2954 PY_UINT64_T __pyx_dict_version;\
2955 PyObject *__pyx_dict_cached_value;\
2956 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2957} while(0)
2958static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2959#else
2960#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2961#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2962static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2963#endif
2964
2965/* AssertionsEnabled.proto */
2966#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
2967 static int __pyx_assertions_enabled_flag;
2968 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2969 #if __clang__ || __GNUC__
2970 __attribute__((no_sanitize("thread")))
2971 #endif
2972 static int __Pyx_init_assertions_enabled(void) {
2973 PyObject *builtins, *debug, *debug_str;
2974 int flag;
2975 builtins = PyEval_GetBuiltins();
2976 if (!builtins) goto bad;
2977 debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2978 if (!debug_str) goto bad;
2979 debug = PyObject_GetItem(builtins, debug_str);
2980 Py_DECREF(debug_str);
2981 if (!debug) goto bad;
2982 flag = PyObject_IsTrue(debug);
2983 Py_DECREF(debug);
2984 if (flag == -1) goto bad;
2985 __pyx_assertions_enabled_flag = flag;
2986 return 0;
2987 bad:
2988 __pyx_assertions_enabled_flag = 1;
2989 return -1;
2990 }
2991#else
2992 #define __Pyx_init_assertions_enabled() (0)
2993 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2994#endif
2995
2996/* PyAssertionError_Check.proto */
2997#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
2998
2999/* RaiseTooManyValuesToUnpack.proto */
3000static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
3001
3002/* RaiseNeedMoreValuesToUnpack.proto */
3003static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
3004
3005/* RaiseNoneIterError.proto */
3006static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
3007
3008/* GetTopmostException.proto (used by SaveResetException) */
3009#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
3010static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
3011#endif
3012
3013/* SaveResetException.proto */
3014#if CYTHON_FAST_THREAD_STATE
3015#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
3016static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3017#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
3018static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
3019#else
3020#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
3021#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
3022#endif
3023
3024/* RaiseErrorWithObjectTypes.proto (used by ExtTypeTest) */
3025#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
3026#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
3027#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
3028CYTHON_UNUSED
3029static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
3030
3031/* ExtTypeTest.proto */
3032static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
3033
3034/* GetException.proto */
3035#if CYTHON_FAST_THREAD_STATE
3036#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
3037static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3038#else
3039static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
3040#endif
3041
3042/* SwapException.proto */
3043#if CYTHON_FAST_THREAD_STATE
3044#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
3045static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3046#else
3047static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
3048#endif
3049
3050/* HasAttr.proto (used by ImportImpl) */
3051#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
3052#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
3053#else
3054static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
3055#endif
3056
3057/* TupleOrListFromArrayImpl.proto (used by ListFromArray) */
3058CYTHON_UNUSED static PyObject *
3059__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
3060
3061/* ListFromArray.proto (used by ImportImpl) */
3062
3063
3064/* ImportImpl.export */
3065static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);
3066
3067/* Import.proto */
3068static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);
3069
3070CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3071/* ListCompAppendAndDecref.proto */
3072static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x);
3073
3074/* PySequenceMultiply.proto */
3075#define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
3076#if !CYTHON_USE_TYPE_SLOTS
3077#define __Pyx_PySequence_Multiply PySequence_Repeat
3078#else
3079static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
3080#endif
3081
3082/* PyNumberBinop.proto */
3083#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
3084#define __Pyx_PyNumber_Multiply_object_int(op1, op2) PyNumber_Multiply(op1, op2)
3085#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
3086#else
3087#define __Pyx_PyNumber_Multiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 0)
3088#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 1)
3089static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2, int inplace);
3090#endif
3091
3092/* PyObjectFormatAndDecref.proto */
3093static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
3094static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
3095
3096/* PyObjectFormat.proto */
3097#if CYTHON_USE_UNICODE_WRITER
3098static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
3099#else
3100#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
3101#endif
3102
3103/* PyObject_Unicode.proto */
3104#define __Pyx_PyObject_Unicode(obj)\
3105 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
3106
3107/* SetItemInt.proto */
3108#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
3109 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3110 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, wraparound, boundscheck, unsafe_shared) :\
3111 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
3112static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
3113static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
3114 int wraparound, int boundscheck, int unsafe_shared);
3115
3116/* RaiseUnboundLocalError.proto */
3117static void __Pyx_RaiseUnboundLocalError(const char *varname);
3118
3119/* DivInt[long].proto */
3120static CYTHON_INLINE long __Pyx_div_long(long, long, int b_is_constant);
3121
3122/* PyException_Check.proto */
3123#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3124
3125/* PyImportError_Check.proto */
3126#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
3127
3128/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */
3129#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
3130#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
3131#else
3132#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
3133#endif
3134
3135/* PyObjectSetAttrStr.proto */
3136#if CYTHON_USE_TYPE_SLOTS
3137#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
3138static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
3139#else
3140#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n)
3141#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
3142#endif
3143
3144/* PyObjectLookupSpecial.proto */
3145#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3146#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
3147#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
3148static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
3149#else
3150#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
3151#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
3152#endif
3153
3154/* PyRange_Check.proto */
3155#if CYTHON_COMPILING_IN_PYPY && !defined(PyRange_Check)
3156 #define PyRange_Check(obj) __Pyx_TypeCheck((obj), &PyRange_Type)
3157#endif
3158
3159/* PyLongBinop.proto */
3160#if !CYTHON_COMPILING_IN_PYPY
3161static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
3162#else
3163#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
3164 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
3165#endif
3166
3167/* PyNumberBinop.proto */
3168#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
3169#define __Pyx_PyNumber_Add_object_object(op1, op2) PyNumber_Add(op1, op2)
3170#define __Pyx_PyNumber_InPlaceAdd_object_object(op1, op2) PyNumber_InPlaceAdd(op1, op2)
3171#else
3172#define __Pyx_PyNumber_Add_object_object(op1, op2) __Pyx__PyNumber_Add_object_object(op1, op2, 0)
3173#define __Pyx_PyNumber_InPlaceAdd_object_object(op1, op2) __Pyx__PyNumber_Add_object_object(op1, op2, 1)
3174static CYTHON_INLINE PyObject* __Pyx__PyNumber_Add_object_object(PyObject *op1, PyObject *op2, int inplace);
3175#endif
3176
3177/* PyObjectCompare.proto */
3178static CYTHON_INLINE int __Pyx_PyObject_CompareBoolGe_object_int(PyObject *op1, PyObject *op2, int pyop);
3179
3180/* PyObjectCompare.proto */
3181static CYTHON_INLINE int __Pyx_PyObject_CompareBoolLe_object_object(PyObject *op1, PyObject *op2, int pyop);
3182
3183/* PyObjectCompare.proto */
3184static CYTHON_INLINE int __Pyx_PyObject_CompareBoolGt_object_object(PyObject *op1, PyObject *op2, int pyop);
3185
3186/* PyNumberBinop.proto */
3187#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
3188#define __Pyx_PyNumber_Subtract_object_object(op1, op2) PyNumber_Subtract(op1, op2)
3189#define __Pyx_PyNumber_InPlaceSubtract_object_object(op1, op2) PyNumber_InPlaceSubtract(op1, op2)
3190#else
3191#define __Pyx_PyNumber_Subtract_object_object(op1, op2) __Pyx__PyNumber_Subtract_object_object(op1, op2, 0)
3192#define __Pyx_PyNumber_InPlaceSubtract_object_object(op1, op2) __Pyx__PyNumber_Subtract_object_object(op1, op2, 1)
3193static CYTHON_INLINE PyObject* __Pyx__PyNumber_Subtract_object_object(PyObject *op1, PyObject *op2, int inplace);
3194#endif
3195
3196/* SliceObject.proto */
3197static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
3198 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
3199 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
3200 int has_cstart, int has_cstop, int wraparound);
3201
3202/* pybuiltin_invalid.export */
3203static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *builtin_type_name, const char *argname);
3204
3205/* pyint_simplify.proto */
3206static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none);
3207
3208/* AllocateExtensionType.proto */
3209static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);
3210
3211/* CallSlotAsVectorcall.proto */
3212#if CYTHON_VECTORCALL_TPNEW
3213typedef PyObject * (*__Pyx_tpnewvectorcallfunc)(PyTypeObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
3214static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k);
3215#endif
3216
3217/* CallNewInitFromVectorcall.proto */
3218#if CYTHON_VECTORCALL_TPNEW
3219static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3220#endif
3221
3222/* CallSlotAsVectorcall.proto */
3223#if CYTHON_VECTORCALL_TPNEW
3224typedef int (*__Pyx_tpinitvectorcallfunc)(PyObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
3225static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k);
3226#endif
3227
3228/* DeallocKeepAlive.proto */
3229#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3230#define __Pyx_DeallocKeepAliveBegin(o) do {\
3231 _Py_atomic_store_uintptr_relaxed(&(o)->ob_tid, _Py_ThreadId());\
3232 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 1);\
3233 _Py_atomic_store_ssize_relaxed(&(o)->ob_ref_shared, 0);\
3234 } while (0)
3235#define __Pyx_DeallocKeepAliveEnd(o)\
3236 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 0)
3237#else
3238#define __Pyx_DeallocKeepAliveBegin(o) Py_SET_REFCNT(o, Py_REFCNT(o) + 1)
3239#define __Pyx_DeallocKeepAliveEnd(o) Py_SET_REFCNT(o, Py_REFCNT(o) - 1)
3240#endif
3241
3242/* CallTypeTraverse.proto */
3243#if !CYTHON_USE_TYPE_SPECS
3244#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
3245#else
3246static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
3247#endif
3248
3249/* PyObjectCallMethod0.proto (used by PyType_Ready) */
3250static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
3251
3252/* GetTypeDictOffset.proto (used by ValidateBasesTuple) */
3253#if !CYTHON_USE_TYPE_SLOTS
3254CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result);
3255#endif
3256
3257/* ValidateBasesTuple.proto (used by PyType_Ready) */
3258#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
3259static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases);
3260#endif
3261
3262/* PyType_Ready.export */
3263CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
3264
3265/* LimitedApiGetTypeTypeDict.proto (used by DelItemOnTypeDict) */
3266#if CYTHON_COMPILING_IN_LIMITED_API
3267static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp);
3268#endif
3269
3270/* DelItemOnTypeDict.proto (used by SetupReduce) */
3271#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)
3272
3273/* DelItemOnTypeDict.export */
3274static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
3275
3276/* SetItemOnTypeDict.proto (used by SetupReduce) */
3277#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
3278
3279/* SetItemOnTypeDict.export */
3280static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
3281
3282/* SetupReduce.export */
3283static int __Pyx_setup_reduce(PyObject* type_obj);
3284
3285/* GetVTable.proto (used by MergeVTables) */
3286static int __Pyx_GetVtable(PyTypeObject *type, void** table);
3287
3288/* MergeVTables.proto (used by SetVTable) */
3289static int __Pyx_MergeVtables(PyTypeObject *type);
3290
3291/* SetVTable.export */
3292static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
3293
3294/* ApplySequenceOrMappingFlag.proto */
3295#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3296int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence);
3297#else
3298#define __Pyx_ApplySequenceOrMappingFlag(tp, is_sequence) (0)
3299#endif
3300
3301/* TypeImport.proto */
3302#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
3303#define __PYX_HAVE_RT_ImportType_proto_3_3_0
3304#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
3305#include <stdalign.h>
3306#endif
3307#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
3308#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
3309#else
3310#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
3311#endif
3312enum __Pyx_ImportType_CheckSize_3_3_0 {
3313 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
3314 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
3315 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
3316};
3317static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size);
3318#endif
3319
3320/* Py3UpdateBases.export */
3321static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);
3322
3323/* CalculateMetaclass.proto */
3324static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
3325
3326/* dict_setdefault.proto (used by FetchCommonType) */
3327static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
3328
3329/* AddModuleRef.proto (used by FetchSharedCythonModule) */
3330#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
3331 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
3332 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
3333#else
3334 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
3335#endif
3336
3337/* FetchSharedCythonModule.proto (used by FetchCommonType) */
3338static PyObject *__Pyx_FetchSharedCythonABIModule(void);
3339
3340/* VerifyCachedType.proto (used by FetchCommonType) */
3341static int __Pyx_VerifyCachedType(PyObject *cached_type,
3342 const char *name,
3343 Py_ssize_t expected_basicsize);
3344
3345/* FetchCommonType.proto (used by CommonTypesMetaclass) */
3346static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
3347
3348/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
3349static int __pyx_CommonTypesMetaclass_init(PyObject *module);
3350#define __Pyx_CommonTypesMetaclass_USED
3351
3352/* CythonFunctionPerModule.proto (used by CythonFunctionShared) */
3353#define __Pyx_CyFunction_USED
3354#if CYTHON_OPAQUE_SHARED_TYPES
3355#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
3356#else
3357#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
3358#endif
3359#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
3360#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
3361#define __Pyx_CYFUNCTION_CCLASS 0x04
3362#define __Pyx_CYFUNCTION_COROUTINE 0x08
3363#define __Pyx_CyFunction_GetClosure(f)\
3364 ((__Pyx_as_CyFunctionObject(f))->func_closure)
3365#if CYTHON_COMPILING_IN_LIMITED_API
3366 #define __Pyx__CyFunction_GetClassObj(f)\
3367 ((f)->func_classobj)
3368#else
3369 #define __Pyx__CyFunction_GetClassObj(f)\
3370 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
3371#endif
3372#define __Pyx_CyFunction_GetClassObj(f)\
3373 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
3374#define __Pyx_CyFunction_SetClassObj(f, classobj)\
3375 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
3376#define __Pyx_CyFunction_Defaults(type, f)\
3377 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
3378#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
3379 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
3380typedef struct {
3381#if CYTHON_COMPILING_IN_LIMITED_API
3382#if !CYTHON_OPAQUE_OBJECTS
3383 PyObject_HEAD
3384#endif
3385 PyMethodDef *func_methoddef;
3386 PyObject *func_module;
3387#else
3388 PyCMethodObject func;
3389#endif
3390#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
3391 __pyx_vectorcallfunc func_vectorcall;
3392#endif
3393#if CYTHON_COMPILING_IN_LIMITED_API
3394 PyObject *func_weakreflist;
3395#endif
3396#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
3397 PyObject *func_dict;
3398#endif
3399 PyObject *func_name;
3400 PyObject *func_qualname;
3401 PyObject *func_doc;
3402 PyObject *func_globals;
3403 PyObject *func_code;
3404 PyObject *func_closure;
3405#if CYTHON_COMPILING_IN_LIMITED_API
3406 PyObject *func_classobj;
3407#endif
3408 PyObject *defaults;
3409 int flags;
3410 PyObject *defaults_tuple;
3411 PyObject *defaults_kwdict;
3412 PyObject *(*defaults_getter)(PyObject *);
3413 PyObject *func_annotations;
3414#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
3415 PyObject *func_is_coroutine;
3416#endif
3417} __pyx_CyFunctionObject;
3418#undef __Pyx_CyOrPyCFunction_Check
3419#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3420#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
3421#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3422static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
3423#undef __Pyx_IsSameCFunction
3424#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
3425static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
3426static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
3427 PyTypeObject *defaults_type);
3428static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
3429 PyObject *tuple);
3430static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3431 PyObject *dict);
3432static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
3433 PyObject *dict);
3434static int __pyx_CyFunction_init(PyObject *module);
3435#if CYTHON_VECTORCALL
3436#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3437#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
3438#else
3439#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3440#endif
3441#endif
3442
3443/* PyMethodNew.proto (used by CythonFunctionShared) */
3444static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
3445
3446/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
3447#if CYTHON_VECTORCALL
3448static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
3449#endif
3450
3451/* CythonFunctionShared.proto (used by CythonFunction) */
3452static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
3453 int flags, PyObject* qualname,
3454 PyObject *closure,
3455 PyObject *module, PyObject *globals,
3456 PyObject* code);
3457#if CYTHON_VECTORCALL
3458static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3459static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3460static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3461static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3462#endif
3463
3464/* CythonFunction.export */
3465static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3466 int flags, PyObject* qualname,
3467 PyObject *closure,
3468 PyObject *module, PyObject *globals,
3469 PyObject* code);
3470static PyTypeObject *__Pyx_Get_CyFunction_Type(void);
3471
3472/* SetNameInClass.proto */
3473#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
3474#define __Pyx_SetNameInClass(ns, name, value)\
3475 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
3476#elif CYTHON_COMPILING_IN_CPYTHON
3477#define __Pyx_SetNameInClass(ns, name, value)\
3478 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
3479#else
3480#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
3481#endif
3482
3483/* PyObjectCall2Args.proto (used by Py3ClassCreate) */
3484static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
3485
3486/* Py3ClassCreate.export */
3487static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
3488 PyObject *mkw, PyObject *modname, PyObject *doc);
3489static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
3490 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
3491
3492/* CLineInTraceback.proto (used by AddTraceback) */
3493#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
3494static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3495#else
3496#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3497#endif
3498
3499/* CodeObjectCache.proto (used by AddTraceback) */
3500#if CYTHON_COMPILING_IN_LIMITED_API
3501typedef PyObject __Pyx_CachedCodeObjectType;
3502#else
3503typedef PyCodeObject __Pyx_CachedCodeObjectType;
3504#endif
3505typedef struct {
3506 __Pyx_CachedCodeObjectType* code_object;
3507 int code_line;
3508} __Pyx_CodeObjectCacheEntry;
3509struct __Pyx_CodeObjectCache {
3510 int count;
3511 int max_count;
3512 __Pyx_CodeObjectCacheEntry* entries;
3513 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3514 __pyx_atomic_int_type accessor_count;
3515 #endif
3516};
3517static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3518static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
3519static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);
3520
3521/* AddTraceback.proto */
3522static void __Pyx_AddTraceback(const char *funcname, int c_line,
3523 int py_line, const char *filename);
3524
3525/* BufferStructDeclare.proto */
3526typedef struct {
3527 Py_ssize_t shape, strides, suboffsets;
3528} __Pyx_Buf_DimInfo;
3529typedef struct {
3530 size_t refcount;
3531 Py_buffer pybuffer;
3532} __Pyx_Buffer;
3533typedef struct {
3534 __Pyx_Buffer *rcbuffer;
3535 char *data;
3536 __Pyx_Buf_DimInfo diminfo[8];
3537} __Pyx_LocalBuf_ND;
3538
3539/* MemviewRefcount.proto */
3540static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3541 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3542static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3543 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3544#define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3545#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3546#define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3547static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3548static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
3549
3550/* MemviewSliceIsContig.proto */
3551static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3552
3553/* OverlappingSlices.proto */
3554static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3555 __Pyx_memviewslice *slice2,
3556 int ndim, size_t itemsize);
3557
3558/* MemviewSliceInit.proto */
3559static int __Pyx_init_memviewslice(
3560 struct __pyx_memoryview_obj *memview,
3561 int ndim,
3562 __Pyx_memviewslice *memviewslice,
3563 int memview_is_new_reference);
3564
3565/* SliceMemoryviewSlice.proto */
3566static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
3567 __Pyx_memviewslice *dst,
3568 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
3569 int dim, int new_ndim, int *suboffset_dim,
3570 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
3571 int have_start, int have_stop, int have_step,
3572 int is_slice);
3573
3574/* IsLittleEndian.proto (used by BufferFormatCheck) */
3575static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
3576
3577/* BufferFormatCheck.proto (used by MemviewSliceValidateAndInit) */
3578static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
3579static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
3580 __Pyx_BufFmt_StackElem* stack,
3581 const __Pyx_TypeInfo* type);
3582
3583/* TypeInfoCompare.proto (used by MemviewSliceValidateAndInit) */
3584static int __pyx_typeinfo_cmp(const __Pyx_TypeInfo *a, const __Pyx_TypeInfo *b);
3585
3586/* MemviewSliceValidateAndInit.export */
3587static int __Pyx_ValidateAndInit_memviewslice(
3588 int *axes_specs,
3589 int c_or_f_flag,
3590 int buf_flags,
3591 int ndim,
3592 const __Pyx_TypeInfo *dtype,
3593 __Pyx_BufFmt_StackElem stack[],
3594 __Pyx_memviewslice *memviewslice,
3595 PyObject *original_obj);
3596
3597/* ObjectToMemviewSlice.proto */
3598static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
3599
3600/* ObjectToMemviewSlice.proto */
3601static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *, int writable_flag);
3602
3603/* RealImag.proto */
3604#if CYTHON_CCOMPLEX
3605 #ifdef __cplusplus
3606 #define __Pyx_CREAL(z) ((z).real())
3607 #define __Pyx_CIMAG(z) ((z).imag())
3608 #else
3609 #define __Pyx_CREAL(z) (__real__(z))
3610 #define __Pyx_CIMAG(z) (__imag__(z))
3611 #endif
3612#else
3613 #define __Pyx_CREAL(z) ((z).real)
3614 #define __Pyx_CIMAG(z) ((z).imag)
3615#endif
3616#if defined(__cplusplus) && CYTHON_CCOMPLEX\
3617 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3618 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3619 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3620#else
3621 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3622 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3623#endif
3624
3625/* Arithmetic.proto */
3626#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3627 #define __Pyx_c_eq_float(a, b) ((a)==(b))
3628 #define __Pyx_c_sum_float(a, b) ((a)+(b))
3629 #define __Pyx_c_diff_float(a, b) ((a)-(b))
3630 #define __Pyx_c_prod_float(a, b) ((a)*(b))
3631 #define __Pyx_c_quot_float(a, b) ((a)/(b))
3632 #define __Pyx_c_neg_float(a) (-(a))
3633 #ifdef __cplusplus
3634 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3635 #define __Pyx_c_conj_float(z) (::std::conj(z))
3636 #if 1
3637 #define __Pyx_c_abs_float(z) (::std::abs(z))
3638 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3639 #endif
3640 #else
3641 #define __Pyx_c_is_zero_float(z) ((z)==0)
3642 #define __Pyx_c_conj_float(z) (conjf(z))
3643 #if 1
3644 #define __Pyx_c_abs_float(z) (cabsf(z))
3645 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3646 #endif
3647 #endif
3648#else
3649 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3650 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3651 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3652 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3653 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3654 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3655 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3656 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3657 #if 1
3658 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3659 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3660 #endif
3661#endif
3662
3663/* Arithmetic.proto */
3664#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3665 #define __Pyx_c_eq_double(a, b) ((a)==(b))
3666 #define __Pyx_c_sum_double(a, b) ((a)+(b))
3667 #define __Pyx_c_diff_double(a, b) ((a)-(b))
3668 #define __Pyx_c_prod_double(a, b) ((a)*(b))
3669 #define __Pyx_c_quot_double(a, b) ((a)/(b))
3670 #define __Pyx_c_neg_double(a) (-(a))
3671 #ifdef __cplusplus
3672 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3673 #define __Pyx_c_conj_double(z) (::std::conj(z))
3674 #if 1
3675 #define __Pyx_c_abs_double(z) (::std::abs(z))
3676 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3677 #endif
3678 #else
3679 #define __Pyx_c_is_zero_double(z) ((z)==0)
3680 #define __Pyx_c_conj_double(z) (conj(z))
3681 #if 1
3682 #define __Pyx_c_abs_double(z) (cabs(z))
3683 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3684 #endif
3685 #endif
3686#else
3687 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3688 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3689 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3690 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3691 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3692 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3693 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3694 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3695 #if 1
3696 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3697 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3698 #endif
3699#endif
3700
3701/* Arithmetic.proto */
3702#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3703 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3704 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3705 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3706 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3707 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3708 #define __Pyx_c_neg_long__double(a) (-(a))
3709 #ifdef __cplusplus
3710 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3711 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3712 #if 1
3713 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3714 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3715 #endif
3716 #else
3717 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3718 #define __Pyx_c_conj_long__double(z) (conjl(z))
3719 #if 1
3720 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3721 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3722 #endif
3723 #endif
3724#else
3725 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3726 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3727 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3728 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3729 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3730 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3731 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3732 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3733 #if 1
3734 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3735 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3736 #endif
3737#endif
3738
3739/* MemviewSliceCopy.proto */
3740static __Pyx_memviewslice
3741__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3742 const char *mode, int ndim,
3743 Py_ssize_t sizeof_dtype, int contig_flag,
3744 int dtype_is_object);
3745
3746/* CIntFromPy.proto */
3747static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
3748
3749/* PyObjectVectorcallKwds.proto (used by PyObjectVectorcallMethodKwds) */
3750#if CYTHON_VECTORCALL
3751#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
3752CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
3753#else
3754#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
3755CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n);
3756CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
3757#endif
3758
3759/* PyObjectVectorcallMethodKwds.proto (used by CIntToPy) */
3760#if CYTHON_VECTORCALL
3761#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
3762#else
3763static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3764#endif
3765
3766/* CIntToPy.proto */
3767static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_int32(npy_int32 value);
3768
3769/* CIntToPy.proto */
3770static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value);
3771
3772/* CIntFromPy.proto */
3773static CYTHON_INLINE npy_int32 __Pyx_PyLong_As_npy_int32(PyObject *);
3774
3775/* CIntFromPy.proto */
3776static CYTHON_INLINE size_t __Pyx_PyLong_As_size_t(PyObject *);
3777
3778/* PyObjectCallMethod1.proto (used by UpdateUnpickledDict) */
3779static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3780
3781/* UpdateUnpickledDict.export */
3782static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);
3783
3784/* CheckUnpickleChecksumError.export */
3785static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
3786
3787/* CheckUnpickleChecksum.proto */
3788static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
3789
3790/* CIntFromPy.proto */
3791static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
3792
3793/* CIntToPy.proto */
3794static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
3795
3796/* CIntFromPy.proto */
3797static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *);
3798
3799/* GetRuntimeVersion.proto */
3800#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
3801static unsigned long __Pyx_cached_runtime_version = 0;
3802static void __Pyx_init_runtime_version(void);
3803#else
3804#define __Pyx_init_runtime_version()
3805#endif
3806static unsigned long __Pyx_get_runtime_version(void);
3807
3808/* CheckBinaryVersion.proto */
3809static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3810
3811/* DecompressString.proto */
3812static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
3813
3814/* DecompressString_LZSS.proto */
3815static PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length);
3816
3817/* MultiPhaseInitModuleState.proto */
3818#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
3819#include <stdlib.h>
3820static PyObject *__Pyx_State_FindModule(void*);
3821static int __Pyx_State_AddModule(PyObject* module, void*);
3822static int __Pyx_State_RemoveModule(void*);
3823#elif CYTHON_USE_MODULE_STATE
3824#define __Pyx_State_FindModule PyState_FindModule
3825#define __Pyx_State_AddModule PyState_AddModule
3826#define __Pyx_State_RemoveModule PyState_RemoveModule
3827#endif
3828
3829/* #### Code section: module_declarations ### */
3830/* CythonABIVersion.proto */
3831#if CYTHON_COMPILING_IN_LIMITED_API
3832 #if CYTHON_VECTORCALL
3833 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
3834 #else
3835 #define __PYX_VECTORCALL_ABI_SUFFIX
3836 #endif
3837 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
3838#else
3839 #define __PYX_LIMITED_ABI_SUFFIX
3840#endif
3841#if __PYX_HAS_PY_AM_SEND == 1
3842 #define __PYX_AM_SEND_ABI_SUFFIX
3843#elif __PYX_HAS_PY_AM_SEND == 2
3844 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
3845#else
3846 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
3847#endif
3848#ifndef __PYX_MONITORING_ABI_SUFFIX
3849 #define __PYX_MONITORING_ABI_SUFFIX
3850#endif
3851#if CYTHON_USE_TP_FINALIZE
3852 #define __PYX_TP_FINALIZE_ABI_SUFFIX
3853#else
3854 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
3855#endif
3856#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
3857 #define __PYX_FREELISTS_ABI_SUFFIX
3858#else
3859 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
3860#endif
3861#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
3862 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
3863#else
3864 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3865#endif
3866#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3867#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
3868#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
3869
3870static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3871static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3872static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3873static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3874static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
3875static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value); /* proto*/
3876static PyObject *__pyx_memoryview_setitem_indexed1(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3877static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3878static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3879static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
3880static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3881static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3882static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
3883static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3884static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3885static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3886static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3887static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3888static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3889static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3890static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3891static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3892static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3893static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3894static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3895static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3896static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3897static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3898static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3899static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3900static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self); /* proto*/
3901static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self); /* proto*/
3902static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self); /* proto*/
3903static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self); /* proto*/
3904static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self); /* proto*/
3905static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self); /* proto*/
3906static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self); /* proto*/
3907static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3908static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3909static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3910static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3911static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3912static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3913static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3914static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3915static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3916static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3917static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3918static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto*/
3919
3920/* Module declarations from "libc.string" */
3921
3922/* Module declarations from "libc.stdio" */
3923
3924/* Module declarations from "__builtin__" */
3925
3926/* Module declarations from "cpython.type" */
3927
3928/* Module declarations from "cpython" */
3929
3930/* Module declarations from "cpython.object" */
3931
3932/* Module declarations from "cpython.ref" */
3933
3934/* Module declarations from "numpy" */
3935
3936/* Module declarations from "numpy" */
3937
3938/* Module declarations from "cython.view" */
3939
3940/* Module declarations from "cython.dataclasses" */
3941
3942/* Module declarations from "cython" */
3943
3944/* Module declarations from "libc.stdlib" */
3945
3946/* Module declarations from "superluWrappers" */
3947static PyObject *__pyx_collections_abc_Sequence = 0;
3948static PyObject *generic = 0;
3949static PyObject *strided = 0;
3950static PyObject *indirect = 0;
3951static PyObject *contiguous = 0;
3952static PyObject *indirect_contiguous = 0;
3953static int __pyx_memoryview_thread_locks_used;
3954static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3955static void __pyx_f_15superluWrappers_SparseMatrix_matvec(struct __pyx_obj_15superluWrappers_cSparseMatrix *, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
3956static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(struct __pyx_obj_15superluWrappers_cSparseMatrix *, struct __pyx_obj_15superluWrappers_SparseFactor *); /*proto*/
3957static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(struct __pyx_obj_15superluWrappers_SparseFactor *, __Pyx_memviewslice); /*proto*/
3958static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
3959static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char const *, char *); /*proto*/
3960static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo const *); /*proto*/
3961static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3962static int __pyx_memoryview_err_invalid_index(PyObject *); /*proto*/
3963static PyObject *_unellipsify_index_tuple(PyObject *, int); /*proto*/
3964static PyObject *_unellipsify(PyObject *, int); /*proto*/
3965static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3966static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3967static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3968static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3969static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), __pyx_memoryview_to_dtype_func_type, int); /*proto*/
3970static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3971static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3972static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3973static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3974static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3975static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3976static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3977static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3978static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3979static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3980static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3981static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3982static int __pyx_memoryview_err_dim(PyObject *, char const *, int); /*proto*/
3983static int __pyx_memoryview_err(PyObject *, char const *); /*proto*/
3984static int __pyx_memoryview_err_no_memory(void); /*proto*/
3985static int __pyx_memoryview_err_ValueError(char const *); /*proto*/
3986static int __pyx_memoryview_err_IndexError(char const *, Py_ssize_t); /*proto*/
3987static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3988static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3989static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3990static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3991static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3992static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3993static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3994static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3995/* #### Code section: typeinfo ### */
3996static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
3997static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
3998/* #### Code section: before_global_var ### */
3999#define __Pyx_MODULE_NAME "superluWrappers"
4000extern int __pyx_module_is_main_superluWrappers;
4001int __pyx_module_is_main_superluWrappers = 0;
4002
4003/* Implementation of "superluWrappers" */
4004/* #### Code section: global_var ### */
4005static PyObject *__pyx_builtin_object;
4006static PyObject *__pyx_builtin_open;
4007static PyObject *__pyx_builtin___import__;
4008static PyObject *__pyx_builtin_enumerate;
4009static PyObject *__pyx_builtin_Ellipsis;
4010static PyObject *__pyx_builtin_id;
4011/* #### Code section: string_decls ### */
4012static const char __pyx_k_c[] = "c";
4013static const char __pyx_k_name[] = "name";
4014static const char __pyx_k_fortran[] = "fortran";
4015static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
4016static const char __pyx_k_Cannot_index_with_type_200U[] = "Cannot index with type \047%.200U\047";
4017static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
4018static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
4019static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
4020static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
4021static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
4022static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
4023static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
4024static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %zd)";
4025static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
4026static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %zd and %zd)";
4027/* #### Code section: decls ### */
4028static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
4029static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
4030static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4031static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4032static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4033static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
4034static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
4035static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
4036static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
4037static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4038static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
4039static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
4040static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
4041static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
4042static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
4043static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4044static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
4045static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
4046static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
4047static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4048static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4049static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4050static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4051static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4052static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4053static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4054static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4055static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4056static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4057static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4058static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4059static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4060static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4061static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4062static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4063static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4064static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4065static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4066static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4067static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4068static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
4069static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr); /* proto */
4070static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
4071static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base); /* proto */
4072static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
4073static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end); /* proto */
4074static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, int __pyx_v_nr, int __pyx_v_nc, int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr); /* proto */
4075static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self); /* proto */
4076static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4077static int __pyx_pf_15superluWrappers_12SparseFactor___init__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */
4078static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto */
4079static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
4080static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto */
4081static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4082static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor); /* proto */
4083static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x); /* proto */
4084static PyObject *__pyx_tp_new__initialisation_15superluWrappers_cSparseMatrix(PyObject *o,
4085#if CYTHON_VECTORCALL_TPNEW
4086 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4087#else
4088 PyObject *a, PyObject *k
4089#endif
4090); /*proto*/
4091static PyObject *__pyx_tp_new_vectorcall_15superluWrappers_cSparseMatrix(PyTypeObject *t,
4092#if CYTHON_VECTORCALL_TPNEW
4093 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4094#else
4095 PyObject *a, PyObject *k
4096#endif
4097); /*proto*/
4098#if CYTHON_VECTORCALL_TPNEW
4099static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4100#endif
4101#if !CYTHON_VECTORCALL_TPNEW
4102#define __pyx_tp_new_15superluWrappers_cSparseMatrix __pyx_tp_new_vectorcall_15superluWrappers_cSparseMatrix
4103#endif
4104#if CYTHON_VECTORCALL_TPNEW
4105static PyObject *__pyx_tp_vectorcall_15superluWrappers_cSparseMatrix(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4106#endif
4107static PyObject *__pyx_tp_new__initialisation_15superluWrappers_SparseFactor(PyObject *o,
4108#if CYTHON_VECTORCALL_TPNEW
4109 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4110#else
4111 PyObject *a, PyObject *k
4112#endif
4113); /*proto*/
4114static PyObject *__pyx_tp_new_vectorcall_15superluWrappers_SparseFactor(PyTypeObject *t,
4115#if CYTHON_VECTORCALL_TPNEW
4116 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4117#else
4118 PyObject *a, PyObject *k
4119#endif
4120); /*proto*/
4121#if CYTHON_VECTORCALL_TPNEW
4122static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4123#endif
4124#if !CYTHON_VECTORCALL_TPNEW
4125#define __pyx_tp_new_15superluWrappers_SparseFactor __pyx_tp_new_vectorcall_15superluWrappers_SparseFactor
4126#endif
4127#if CYTHON_VECTORCALL_TPNEW
4128static PyObject *__pyx_tp_vectorcall_15superluWrappers_SparseFactor(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4129#endif
4130#if CYTHON_VECTORCALL_TPNEW
4131static int __pyx_tp_init_15superluWrappers_SparseFactor(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
4132#endif
4133#if !CYTHON_VECTORCALL_TPNEW
4134#define __pyx_tp_init_15superluWrappers_SparseFactor __pyx_pw_15superluWrappers_12SparseFactor_1__init__
4135#endif
4136static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
4137#if CYTHON_VECTORCALL_TPNEW
4138 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4139#else
4140 PyObject *a, PyObject *k
4141#endif
4142); /*proto*/
4143static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
4144#if CYTHON_VECTORCALL_TPNEW
4145 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4146#else
4147 PyObject *a, PyObject *k
4148#endif
4149); /*proto*/
4150#if CYTHON_VECTORCALL_TPNEW
4151static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4152#endif
4153#if !CYTHON_VECTORCALL_TPNEW
4154#define __pyx_tp_new_array __pyx_tp_new_vectorcall_array
4155#endif
4156#if CYTHON_VECTORCALL_TPNEW
4157static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4158#endif
4159static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
4160#if CYTHON_VECTORCALL_TPNEW
4161 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4162#else
4163 PyObject *a, PyObject *k
4164#endif
4165); /*proto*/
4166static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
4167#if CYTHON_VECTORCALL_TPNEW
4168 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4169#else
4170 PyObject *a, PyObject *k
4171#endif
4172); /*proto*/
4173#if CYTHON_VECTORCALL_TPNEW
4174static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4175#endif
4176#if !CYTHON_VECTORCALL_TPNEW
4177#define __pyx_tp_new_Enum __pyx_tp_new_vectorcall_Enum
4178#endif
4179#if CYTHON_VECTORCALL_TPNEW
4180static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4181#endif
4182#if CYTHON_VECTORCALL_TPNEW
4183static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
4184#endif
4185#if !CYTHON_VECTORCALL_TPNEW
4186#define __pyx_tp_init_Enum __pyx_MemviewEnum___init__
4187#endif
4188static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
4189#if CYTHON_VECTORCALL_TPNEW
4190 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4191#else
4192 PyObject *a, PyObject *k
4193#endif
4194); /*proto*/
4195static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
4196#if CYTHON_VECTORCALL_TPNEW
4197 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4198#else
4199 PyObject *a, PyObject *k
4200#endif
4201); /*proto*/
4202#if CYTHON_VECTORCALL_TPNEW
4203static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4204#endif
4205#if !CYTHON_VECTORCALL_TPNEW
4206#define __pyx_tp_new_memoryview __pyx_tp_new_vectorcall_memoryview
4207#endif
4208#if CYTHON_VECTORCALL_TPNEW
4209static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4210#endif
4211static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
4212#if CYTHON_VECTORCALL_TPNEW
4213 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4214#else
4215 PyObject *a, PyObject *k
4216#endif
4217); /*proto*/
4218static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
4219#if CYTHON_VECTORCALL_TPNEW
4220 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4221#else
4222 PyObject *a, PyObject *k
4223#endif
4224); /*proto*/
4225#if CYTHON_VECTORCALL_TPNEW
4226static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4227#endif
4228#if !CYTHON_VECTORCALL_TPNEW
4229#define __pyx_tp_new__memoryviewslice __pyx_tp_new_vectorcall__memoryviewslice
4230#endif
4231#if CYTHON_VECTORCALL_TPNEW
4232static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4233#endif
4234/* #### Code section: late_includes ### */
4235/* #### Code section: module_state ### */
4236/* SmallCodeConfig */
4237#ifndef CYTHON_SMALL_CODE
4238#if defined(__clang__)
4239 #define CYTHON_SMALL_CODE
4240#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
4241 #define CYTHON_SMALL_CODE __attribute__((cold))
4242#else
4243 #define CYTHON_SMALL_CODE
4244#endif
4245#endif
4246
4247#ifdef __cplusplus
4248namespace {
4249 #endif
4250 typedef struct {
4251 PyObject *__pyx_d;
4252 PyObject *__pyx_b;
4253 PyObject *__pyx_cython_runtime;
4254 PyObject *__pyx_empty_tuple;
4255 PyObject *__pyx_empty_bytes;
4256 PyObject *__pyx_empty_unicode;
4257 PyTypeObject *__pyx_ptype_7cpython_4type_type;
4258 PyTypeObject *__pyx_ptype_5numpy_dtype;
4259 PyTypeObject *__pyx_ptype_5numpy_flatiter;
4260 PyTypeObject *__pyx_ptype_5numpy_broadcast;
4261 PyTypeObject *__pyx_ptype_5numpy_ndarray;
4262 PyTypeObject *__pyx_ptype_5numpy_generic;
4263 PyTypeObject *__pyx_ptype_5numpy_number;
4264 PyTypeObject *__pyx_ptype_5numpy_integer;
4265 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
4266 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
4267 PyTypeObject *__pyx_ptype_5numpy_inexact;
4268 PyTypeObject *__pyx_ptype_5numpy_floating;
4269 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
4270 PyTypeObject *__pyx_ptype_5numpy_flexible;
4271 PyTypeObject *__pyx_ptype_5numpy_character;
4272 PyTypeObject *__pyx_ptype_5numpy_ufunc;
4273 PyObject *__pyx_type_15superluWrappers_cSparseMatrix;
4274 PyObject *__pyx_type_15superluWrappers_SparseFactor;
4275 PyObject *__pyx_type___pyx_array;
4276 PyObject *__pyx_type___pyx_MemviewEnum;
4277 PyObject *__pyx_type___pyx_memoryview;
4278 PyObject *__pyx_type___pyx_memoryviewslice;
4279 PyTypeObject *__pyx_ptype_15superluWrappers_cSparseMatrix;
4280 PyTypeObject *__pyx_ptype_15superluWrappers_SparseFactor;
4281 PyTypeObject *__pyx_array_type;
4282 PyTypeObject *__pyx_MemviewEnum_type;
4283 PyTypeObject *__pyx_memoryview_type;
4284 PyTypeObject *__pyx_memoryviewslice_type;
4285 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
4286 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
4287 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
4288 PyObject *__pyx_slice[1];
4289 PyObject *__pyx_tuple[5];
4290 PyObject *__pyx_codeobj_tab[11];
4291 PyObject *__pyx_string_tab[160];
4292 PyObject *__pyx_number_tab[4];
4293/* #### Code section: module_state_contents ### */
4294/* PyFrozenDict.module_state_decls */
4295#if CYTHON_COMPILING_IN_LIMITED_API
4296PyObject *__Pyx_PyFrozenDictType;
4297#endif
4298
4299/* CommonTypesMetaclass.module_state_decls */
4300PyTypeObject *__pyx_CommonTypesMetaclassType;
4301
4302/* CachedMethodType.module_state_decls */
4303#if CYTHON_COMPILING_IN_LIMITED_API
4304PyObject *__Pyx_CachedMethodType;
4305#endif
4306
4307/* CythonFunctionPerModule.module_state_decls */
4308PyTypeObject *__pyx_CyFunctionType;
4309
4310/* CodeObjectCache.module_state_decls */
4311struct __Pyx_CodeObjectCache __pyx_code_cache;
4312
4313/* #### Code section: module_state_end ### */
4314} __pyx_mstatetype;
4315#ifdef __cplusplus
4316} /* anonymous namespace */
4317#endif
4318
4319#if CYTHON_USE_MODULE_STATE
4320#ifdef __cplusplus
4321namespace {
4322extern struct PyModuleDef __pyx_moduledef;
4323} /* anonymous namespace */
4324#else
4325static struct PyModuleDef __pyx_moduledef;
4326#endif
4327
4328#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
4329
4330#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
4331#else
4332static __pyx_mstatetype __pyx_mstate_global_static =
4333#ifdef __cplusplus
4334 {};
4335#else
4336 {0};
4337#endif
4338static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
4339#endif
4340/* #### Code section: constant_name_defines ### */
4341#define __pyx_kp_u_at_0x __pyx_string_tab[0]
4342#define __pyx_kp_u_object_2 __pyx_string_tab[1]
4343#define __pyx_kp_u_d_d_13_8e __pyx_string_tab[2]
4344#define __pyx_kp_u_i_i_i __pyx_string_tab[3]
4345#define __pyx_kp_u_tree_fragment __pyx_string_tab[4]
4346#define __pyx_kp_u__3 __pyx_string_tab[5]
4347#define __pyx_kp_u__2 __pyx_string_tab[6]
4348#define __pyx_kp_u_MemoryView_of __pyx_string_tab[7]
4349#define __pyx_kp_u_contiguous_and_direct __pyx_string_tab[8]
4350#define __pyx_kp_u_contiguous_and_indirect __pyx_string_tab[9]
4351#define __pyx_kp_u_strided_and_direct_or_indirect __pyx_string_tab[10]
4352#define __pyx_kp_u_strided_and_direct __pyx_string_tab[11]
4353#define __pyx_kp_u_strided_and_indirect __pyx_string_tab[12]
4354#define __pyx_kp_u__4 __pyx_string_tab[13]
4355#define __pyx_kp_u_ __pyx_string_tab[14]
4356#define __pyx_kp_u_Cannot_assign_to_read_only_memor __pyx_string_tab[15]
4357#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_string_tab[16]
4358#define __pyx_kp_u_Invalid_shape_in_axis __pyx_string_tab[17]
4359#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[18]
4360#define __pyx_kp_u_add_note __pyx_string_tab[19]
4361#define __pyx_kp_u_collections_abc __pyx_string_tab[20]
4362#define __pyx_kp_u_disable __pyx_string_tab[21]
4363#define __pyx_kp_u_enable __pyx_string_tab[22]
4364#define __pyx_kp_u_gc __pyx_string_tab[23]
4365#define __pyx_kp_u_isenabled __pyx_string_tab[24]
4366#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[25]
4367#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[26]
4368#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[27]
4369#define __pyx_kp_u_proteus_superluWrappers_pyx __pyx_string_tab[28]
4370#define __pyx_kp_u_self_A_self_AC_self_L_self_U_sel __pyx_string_tab[29]
4371#define __pyx_kp_u_unable_to_allocate_array_data __pyx_string_tab[30]
4372#define __pyx_kp_u_unable_to_allocate_shape_and_str __pyx_string_tab[31]
4373#define __pyx_n_u_ASCII __pyx_string_tab[32]
4374#define __pyx_n_u_Ellipsis __pyx_string_tab[33]
4375#define __pyx_n_u_Sequence __pyx_string_tab[34]
4376#define __pyx_n_u_SparseFactor __pyx_string_tab[35]
4377#define __pyx_n_u_SparseFactor___reduce_cython __pyx_string_tab[36]
4378#define __pyx_n_u_SparseFactor___setstate_cython __pyx_string_tab[37]
4379#define __pyx_n_u_SparseMatrix __pyx_string_tab[38]
4380#define __pyx_n_u_SparseMatrix___init __pyx_string_tab[39]
4381#define __pyx_n_u_SparseMatrix_fwrite __pyx_string_tab[40]
4382#define __pyx_n_u_SparseMatrix_getCSRrepresentatio __pyx_string_tab[41]
4383#define __pyx_n_u_SparseMatrix_getSubMatCSRreprese __pyx_string_tab[42]
4384#define __pyx_n_u_SparseMatrix_matvec __pyx_string_tab[43]
4385#define __pyx_n_u_View_MemoryView __pyx_string_tab[44]
4386#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[45]
4387#define __pyx_n_u_annotate __pyx_string_tab[46]
4388#define __pyx_n_u_class __pyx_string_tab[47]
4389#define __pyx_n_u_class_getitem __pyx_string_tab[48]
4390#define __pyx_n_u_dict __pyx_string_tab[49]
4391#define __pyx_n_u_doc __pyx_string_tab[50]
4392#define __pyx_n_u_enter __pyx_string_tab[51]
4393#define __pyx_n_u_exit __pyx_string_tab[52]
4394#define __pyx_n_u_func __pyx_string_tab[53]
4395#define __pyx_n_u_getstate __pyx_string_tab[54]
4396#define __pyx_n_u_import __pyx_string_tab[55]
4397#define __pyx_n_u_init __pyx_string_tab[56]
4398#define __pyx_n_u_main __pyx_string_tab[57]
4399#define __pyx_n_u_metaclass __pyx_string_tab[58]
4400#define __pyx_n_u_module __pyx_string_tab[59]
4401#define __pyx_n_u_mro_entries __pyx_string_tab[60]
4402#define __pyx_n_u_name_2 __pyx_string_tab[61]
4403#define __pyx_n_u_new __pyx_string_tab[62]
4404#define __pyx_n_u_prepare __pyx_string_tab[63]
4405#define __pyx_n_u_pyx_checksum __pyx_string_tab[64]
4406#define __pyx_n_u_pyx_state __pyx_string_tab[65]
4407#define __pyx_n_u_pyx_type __pyx_string_tab[66]
4408#define __pyx_n_u_pyx_unpickle_Enum __pyx_string_tab[67]
4409#define __pyx_n_u_pyx_vtable __pyx_string_tab[68]
4410#define __pyx_n_u_qualname __pyx_string_tab[69]
4411#define __pyx_n_u_reduce __pyx_string_tab[70]
4412#define __pyx_n_u_reduce_cython __pyx_string_tab[71]
4413#define __pyx_n_u_reduce_ex __pyx_string_tab[72]
4414#define __pyx_n_u_set_name __pyx_string_tab[73]
4415#define __pyx_n_u_setstate __pyx_string_tab[74]
4416#define __pyx_n_u_setstate_cython __pyx_string_tab[75]
4417#define __pyx_n_u_test __pyx_string_tab[76]
4418#define __pyx_n_u_cSparseMatrix __pyx_string_tab[77]
4419#define __pyx_n_u_is_coroutine __pyx_string_tab[78]
4420#define __pyx_n_u_rows __pyx_string_tab[79]
4421#define __pyx_n_u_abc __pyx_string_tab[80]
4422#define __pyx_n_u_allocate_buffer __pyx_string_tab[81]
4423#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[82]
4424#define __pyx_n_u_base __pyx_string_tab[83]
4425#define __pyx_n_u_c __pyx_string_tab[84]
4426#define __pyx_n_u_cSparseMatrix_2 __pyx_string_tab[85]
4427#define __pyx_n_u_cSparseMatrix___reduce_cython __pyx_string_tab[86]
4428#define __pyx_n_u_cSparseMatrix___setstate_cython __pyx_string_tab[87]
4429#define __pyx_n_u_cline_in_traceback __pyx_string_tab[88]
4430#define __pyx_n_u_colind __pyx_string_tab[89]
4431#define __pyx_n_u_count __pyx_string_tab[90]
4432#define __pyx_n_u_dim __pyx_string_tab[91]
4433#define __pyx_n_u_dtype_is_object __pyx_string_tab[92]
4434#define __pyx_n_u_encode __pyx_string_tab[93]
4435#define __pyx_n_u_enumerate __pyx_string_tab[94]
4436#define __pyx_n_u_error __pyx_string_tab[95]
4437#define __pyx_n_u_filename __pyx_string_tab[96]
4438#define __pyx_n_u_flags __pyx_string_tab[97]
4439#define __pyx_n_u_format __pyx_string_tab[98]
4440#define __pyx_n_u_fortran __pyx_string_tab[99]
4441#define __pyx_n_u_fwrite __pyx_string_tab[100]
4442#define __pyx_n_u_getCSRrepresentation __pyx_string_tab[101]
4443#define __pyx_n_u_getSubMatCSRrepresentation __pyx_string_tab[102]
4444#define __pyx_n_u_i __pyx_string_tab[103]
4445#define __pyx_n_u_id __pyx_string_tab[104]
4446#define __pyx_n_u_index __pyx_string_tab[105]
4447#define __pyx_n_u_items __pyx_string_tab[106]
4448#define __pyx_n_u_itemsize __pyx_string_tab[107]
4449#define __pyx_n_u_k __pyx_string_tab[108]
4450#define __pyx_n_u_matvec __pyx_string_tab[109]
4451#define __pyx_n_u_memview __pyx_string_tab[110]
4452#define __pyx_n_u_mode __pyx_string_tab[111]
4453#define __pyx_n_u_name __pyx_string_tab[112]
4454#define __pyx_n_u_nc __pyx_string_tab[113]
4455#define __pyx_n_u_ndim __pyx_string_tab[114]
4456#define __pyx_n_u_nnz __pyx_string_tab[115]
4457#define __pyx_n_u_np __pyx_string_tab[116]
4458#define __pyx_n_u_nr __pyx_string_tab[117]
4459#define __pyx_n_u_numpy __pyx_string_tab[118]
4460#define __pyx_n_u_nzval __pyx_string_tab[119]
4461#define __pyx_n_u_nzvals __pyx_string_tab[120]
4462#define __pyx_n_u_obj __pyx_string_tab[121]
4463#define __pyx_n_u_object __pyx_string_tab[122]
4464#define __pyx_n_u_open __pyx_string_tab[123]
4465#define __pyx_n_u_output_file __pyx_string_tab[124]
4466#define __pyx_n_u_pack __pyx_string_tab[125]
4467#define __pyx_n_u_pop __pyx_string_tab[126]
4468#define __pyx_n_u_range_end __pyx_string_tab[127]
4469#define __pyx_n_u_range_start __pyx_string_tab[128]
4470#define __pyx_n_u_register __pyx_string_tab[129]
4471#define __pyx_n_u_rowptr __pyx_string_tab[130]
4472#define __pyx_n_u_self __pyx_string_tab[131]
4473#define __pyx_n_u_setdefault __pyx_string_tab[132]
4474#define __pyx_n_u_shape __pyx_string_tab[133]
4475#define __pyx_n_u_size __pyx_string_tab[134]
4476#define __pyx_n_u_sparseFactor __pyx_string_tab[135]
4477#define __pyx_n_u_sparseFactorPrepare __pyx_string_tab[136]
4478#define __pyx_n_u_sparseFactorSolve __pyx_string_tab[137]
4479#define __pyx_n_u_sparse_matrix __pyx_string_tab[138]
4480#define __pyx_n_u_start __pyx_string_tab[139]
4481#define __pyx_n_u_step __pyx_string_tab[140]
4482#define __pyx_n_u_stop __pyx_string_tab[141]
4483#define __pyx_n_u_struct __pyx_string_tab[142]
4484#define __pyx_n_u_superluWrappers __pyx_string_tab[143]
4485#define __pyx_n_u_unpack __pyx_string_tab[144]
4486#define __pyx_n_u_update __pyx_string_tab[145]
4487#define __pyx_n_u_values __pyx_string_tab[146]
4488#define __pyx_n_u_w __pyx_string_tab[147]
4489#define __pyx_n_u_write __pyx_string_tab[148]
4490#define __pyx_n_u_x __pyx_string_tab[149]
4491#define __pyx_n_u_y __pyx_string_tab[150]
4492#define __pyx_n_b_O __pyx_string_tab[151]
4493#define __pyx_kp_b_iso88591_Q __pyx_string_tab[152]
4494#define __pyx_kp_b_iso88591_AQ __pyx_string_tab[153]
4495#define __pyx_kp_b_iso88591_a_A __pyx_string_tab[154]
4496#define __pyx_kp_b_iso88591_A_F_t6_G1_IQd_t1_Ja_Ja_Ja_m1A_0 __pyx_string_tab[155]
4497#define __pyx_kp_b_iso88591_A_IT_a __pyx_string_tab[156]
4498#define __pyx_kp_b_iso88591_A_1D_1_A __pyx_string_tab[157]
4499#define __pyx_kp_b_iso88591_A_HA_vQnCt5_E_WATQR_U_4q_E_at7_4 __pyx_string_tab[158]
4500#define __pyx_kp_b_iso88591_A_3d_3d_z_1_A_vS_A_d_Rt7_1_WA_r __pyx_string_tab[159]
4501#define __pyx_int_0 __pyx_number_tab[0]
4502#define __pyx_int_neg_1 __pyx_number_tab[1]
4503#define __pyx_int_1 __pyx_number_tab[2]
4504#define __pyx_int_136983863 __pyx_number_tab[3]
4505/* #### Code section: module_state_clear ### */
4506#if CYTHON_USE_MODULE_STATE
4507static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
4508 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
4509 if (!clear_module_state) return 0;
4510 Py_CLEAR(clear_module_state->__pyx_d);
4511 Py_CLEAR(clear_module_state->__pyx_b);
4512 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4513 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4514 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4515 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4516 #if CYTHON_PEP489_MULTI_PHASE_INIT
4517 __Pyx_State_RemoveModule(NULL);
4518 #endif
4519 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4520 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4521 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4522 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4523 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4524 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4525 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4526 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4527 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4528 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4529 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4530 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4531 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4532 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4533 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4534 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4535 Py_CLEAR(clear_module_state->__pyx_ptype_15superluWrappers_cSparseMatrix);
4536 Py_CLEAR(clear_module_state->__pyx_type_15superluWrappers_cSparseMatrix);
4537 Py_CLEAR(clear_module_state->__pyx_ptype_15superluWrappers_SparseFactor);
4538 Py_CLEAR(clear_module_state->__pyx_type_15superluWrappers_SparseFactor);
4539 Py_CLEAR(clear_module_state->__pyx_array_type);
4540 Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
4541 Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
4542 Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
4543 Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4544 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4545 Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4546 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4547 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
4548 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
4549 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
4550 for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
4551 for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
4552 for (int i=0; i<11; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
4553 for (int i=0; i<160; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
4554 for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
4555/* #### Code section: module_state_clear_contents ### */
4556/* CommonTypesMetaclass.module_state_clear */
4557Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
4558
4559/* CythonFunctionPerModule.module_state_clear */
4560Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4561
4562/* #### Code section: module_state_clear_end ### */
4563return 0;
4564}
4565#endif
4566/* #### Code section: module_state_traverse ### */
4567#if CYTHON_USE_MODULE_STATE
4568static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4569 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
4570 if (!traverse_module_state) return 0;
4571 Py_VISIT(traverse_module_state->__pyx_d);
4572 Py_VISIT(traverse_module_state->__pyx_b);
4573 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4574 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
4575 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
4576 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
4577 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4578 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4579 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4580 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4581 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4582 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4583 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4584 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4585 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4586 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4587 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4588 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4589 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4590 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4591 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4592 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4593 Py_VISIT(traverse_module_state->__pyx_ptype_15superluWrappers_cSparseMatrix);
4594 Py_VISIT(traverse_module_state->__pyx_type_15superluWrappers_cSparseMatrix);
4595 Py_VISIT(traverse_module_state->__pyx_ptype_15superluWrappers_SparseFactor);
4596 Py_VISIT(traverse_module_state->__pyx_type_15superluWrappers_SparseFactor);
4597 Py_VISIT(traverse_module_state->__pyx_array_type);
4598 Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4599 Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4600 Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4601 Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4602 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4603 Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4604 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4605 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
4606 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
4607 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
4608 for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
4609 for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
4610 for (int i=0; i<11; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
4611 for (int i=0; i<160; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4612 for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
4613/* #### Code section: module_state_traverse_contents ### */
4614/* CommonTypesMetaclass.module_state_traverse */
4615Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
4616
4617/* CythonFunctionPerModule.module_state_traverse */
4618Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4619
4620/* #### Code section: module_state_traverse_end ### */
4621return 0;
4622}
4623#endif
4624/* #### Code section: module_code ### */
4625
4626/* "View.MemoryView":147
4627 * cdef bint dtype_is_object
4628 *
4629 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4630 * mode="c", bint allocate_buffer=True):
4631 *
4632*/
4633
4634/* Python wrapper */
4635static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4636#if CYTHON_VECTORCALL_TPNEW
4637PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4638#else
4639PyObject *__pyx_args, PyObject *__pyx_kwds
4640#endif
4641); /*proto*/
4642static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4643#if CYTHON_VECTORCALL_TPNEW
4644PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4645#else
4646PyObject *__pyx_args, PyObject *__pyx_kwds
4647#endif
4648) {
4649 PyObject *__pyx_v_shape = 0;
4650 Py_ssize_t __pyx_v_itemsize;
4651 PyObject *__pyx_v_format = 0;
4652 PyObject *__pyx_v_mode = 0;
4653 int __pyx_v_allocate_buffer;
4654 #if !CYTHON_VECTORCALL_TPNEW
4655 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
4656 #endif
4657 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
4658 PyObject* values[5] = {0,0,0,0,0};
4659 int __pyx_lineno = 0;
4660 const char *__pyx_filename = NULL;
4661 int __pyx_clineno = 0;
4662 int __pyx_r;
4663 __Pyx_RefNannyDeclarations
4664 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4665 #if !CYTHON_VECTORCALL_TPNEW
4666 #if CYTHON_ASSUME_SAFE_SIZE
4667 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
4668 #else
4669 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
4670 #endif
4671 #endif
4672 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
4673 {
4674 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shape,&__pyx_mstate_global->__pyx_n_u_itemsize,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_allocate_buffer,0};
4675 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
4676 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 147, __pyx_L3_error)
4677 if (__pyx_kwds_len > 0) {
4678 switch (__pyx_nargs) {
4679 case 5:
4680 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4681 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4682 CYTHON_FALLTHROUGH;
4683 case 4:
4684 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4685 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4686 CYTHON_FALLTHROUGH;
4687 case 3:
4688 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4689 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4690 CYTHON_FALLTHROUGH;
4691 case 2:
4692 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4693 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4694 CYTHON_FALLTHROUGH;
4695 case 1:
4696 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4697 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4698 CYTHON_FALLTHROUGH;
4699 case 0: break;
4700 default: goto __pyx_L5_argtuple_error;
4701 }
4702 const Py_ssize_t kwd_pos_args = __pyx_nargs;
4703 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(1, 147, __pyx_L3_error)
4704 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4705 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
4706 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, i); __PYX_ERR(1, 147, __pyx_L3_error) }
4707 }
4708 } else {
4709 switch (__pyx_nargs) {
4710 case 5:
4711 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4712 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4713 CYTHON_FALLTHROUGH;
4714 case 4:
4715 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4716 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4717 CYTHON_FALLTHROUGH;
4718 case 3:
4719 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4720 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4721 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4722 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4723 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4724 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4725 break;
4726 default: goto __pyx_L5_argtuple_error;
4727 }
4728 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4729 }
4730 __pyx_v_shape = ((PyObject*)values[0]);
4731 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L3_error)
4732 __pyx_v_format = values[2];
4733 __pyx_v_mode = values[3];
4734 if (values[4]) {
4735 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 148, __pyx_L3_error)
4736 } else {
4737
4738 /* "View.MemoryView":148
4739 *
4740 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
4741 * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
4742 *
4743 * cdef int idx
4744*/
4745 __pyx_v_allocate_buffer = ((int)1);
4746 }
4747 }
4748 goto __pyx_L6_skip;
4749 __pyx_L5_argtuple_error:;
4750 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 147, __pyx_L3_error)
4751 __pyx_L6_skip:;
4752 goto __pyx_L4_argument_unpacking_done;
4753 __pyx_L3_error:;
4754 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4755 Py_XDECREF(values[__pyx_temp]);
4756 }
4757 __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4758 __Pyx_RefNannyFinishContext();
4759 return -1;
4760 __pyx_L4_argument_unpacking_done:;
4761 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 147, __pyx_L1_error)
4762 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
4763 PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 147, __pyx_L1_error)
4764 }
4765 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
4766
4767 /* "View.MemoryView":147
4768 * cdef bint dtype_is_object
4769 *
4770 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4771 * mode="c", bint allocate_buffer=True):
4772 *
4773*/
4774
4775 /* function exit code */
4776 goto __pyx_L0;
4777 __pyx_L1_error:;
4778 __pyx_r = -1;
4779 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4780 Py_XDECREF(values[__pyx_temp]);
4781 }
4782 goto __pyx_L7_cleaned_up;
4783 __pyx_L0:;
4784 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4785 Py_XDECREF(values[__pyx_temp]);
4786 }
4787 __pyx_L7_cleaned_up:;
4788
4789
4790 __Pyx_RefNannyFinishContext();
4791 return __pyx_r;
4792}
4793
4794static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
4795 int __pyx_v_idx;
4796 Py_ssize_t __pyx_v_dim;
4797 char __pyx_v_order;
4798 int __pyx_r;
4799 __Pyx_RefNannyDeclarations
4800 Py_ssize_t __pyx_t_1;
4801 int __pyx_t_2;
4802 int __pyx_t_3;
4803 int __pyx_t_4;
4804 PyObject *__pyx_t_5 = NULL;
4805 PyObject *__pyx_t_6 = NULL;
4806 size_t __pyx_t_7;
4807 char *__pyx_t_8;
4808 Py_ssize_t __pyx_t_9;
4809 PyObject *__pyx_t_10 = NULL;
4810 PyObject *__pyx_t_11[5];
4811 int __pyx_t_12;
4812 PyObject *__pyx_t_13 = NULL;
4813 int __pyx_lineno = 0;
4814 const char *__pyx_filename = NULL;
4815 int __pyx_clineno = 0;
4816 __Pyx_RefNannySetupContext("__cinit__", 0);
4817 __Pyx_INCREF(__pyx_v_format);
4818
4819 /* "View.MemoryView":153
4820 * cdef Py_ssize_t dim
4821 *
4822 * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
4823 * self.itemsize = itemsize
4824 *
4825*/
4826 if (unlikely(__pyx_v_shape == Py_None)) {
4827 PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
4828 __PYX_ERR(1, 153, __pyx_L1_error)
4829 }
4830 __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 153, __pyx_L1_error)
4831 __pyx_v_self->ndim = ((int)__pyx_t_1);
4832
4833
4834 /* "View.MemoryView":154
4835 *
4836 * self.ndim = <int> len(shape)
4837 * self.itemsize = itemsize # <<<<<<<<<<<<<<
4838 *
4839 * if cython.unlikely(not self.ndim):
4840*/
4841 __pyx_v_self->itemsize = __pyx_v_itemsize;
4842
4843 /* "View.MemoryView":156
4844 * self.itemsize = itemsize
4845 *
4846 * if cython.unlikely(not self.ndim): # <<<<<<<<<<<<<<
4847 * _err_ValueError("Empty shape tuple for cython.array")
4848 *
4849*/
4850 __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
4851
4852 if (unlikely(__pyx_t_2)) {
4853
4854
4855 /* "View.MemoryView":157
4856 *
4857 * if cython.unlikely(not self.ndim):
4858 * _err_ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
4859 *
4860 * if cython.unlikely(itemsize <= 0):
4861*/
4862 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_Empty_shape_tuple_for_cython_arr); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 157, __pyx_L1_error)
4863
4864
4865 /* "View.MemoryView":156
4866 * self.itemsize = itemsize
4867 *
4868 * if cython.unlikely(not self.ndim): # <<<<<<<<<<<<<<
4869 * _err_ValueError("Empty shape tuple for cython.array")
4870 *
4871*/
4872 }
4873
4874 /* "View.MemoryView":159
4875 * _err_ValueError("Empty shape tuple for cython.array")
4876 *
4877 * if cython.unlikely(itemsize <= 0): # <<<<<<<<<<<<<<
4878 * _err_ValueError("itemsize <= 0 for cython.array")
4879 *
4880*/
4881 __pyx_t_2 = (__pyx_v_itemsize <= 0);
4882
4883 if (unlikely(__pyx_t_2)) {
4884
4885
4886 /* "View.MemoryView":160
4887 *
4888 * if cython.unlikely(itemsize <= 0):
4889 * _err_ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
4890 *
4891 * if not isinstance(format, bytes):
4892*/
4893 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_itemsize_0_for_cython_array); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 160, __pyx_L1_error)
4894
4895
4896 /* "View.MemoryView":159
4897 * _err_ValueError("Empty shape tuple for cython.array")
4898 *
4899 * if cython.unlikely(itemsize <= 0): # <<<<<<<<<<<<<<
4900 * _err_ValueError("itemsize <= 0 for cython.array")
4901 *
4902*/
4903 }
4904
4905 /* "View.MemoryView":162
4906 * _err_ValueError("itemsize <= 0 for cython.array")
4907 *
4908 * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
4909 * format = format.encode('ASCII')
4910 * self._format = format # keep a reference to the byte string
4911*/
4912 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
4913 __pyx_t_4 = (!__pyx_t_2);
4914
4915
4916 if (__pyx_t_4) {
4917
4918
4919 /* "View.MemoryView":163
4920 *
4921 * if not isinstance(format, bytes):
4922 * format = format.encode('ASCII') # <<<<<<<<<<<<<<
4923 * self._format = format # keep a reference to the byte string
4924 * self.format = self._format
4925*/
4926 __pyx_t_6 = __pyx_v_format;
4927 __Pyx_INCREF(__pyx_t_6);
4928 __pyx_t_7 = 0;
4929 {
4930 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ASCII};
4931 __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
4932 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4933 if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
4934 __Pyx_GOTREF(__pyx_t_5);
4935 }
4936 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
4937 __pyx_t_5 = 0;
4938
4939 /* "View.MemoryView":162
4940 * _err_ValueError("itemsize <= 0 for cython.array")
4941 *
4942 * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
4943 * format = format.encode('ASCII')
4944 * self._format = format # keep a reference to the byte string
4945*/
4946 }
4947
4948 /* "View.MemoryView":164
4949 * if not isinstance(format, bytes):
4950 * format = format.encode('ASCII')
4951 * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
4952 * self.format = self._format
4953 *
4954*/
4955 __pyx_t_5 = __pyx_v_format;
4956 __Pyx_INCREF(__pyx_t_5);
4957 if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(1, 164, __pyx_L1_error)
4958 __Pyx_GIVEREF(__pyx_t_5);
4959 __Pyx_GOTREF(__pyx_v_self->_format);
4960 __Pyx_DECREF(__pyx_v_self->_format);
4961 __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
4962 __pyx_t_5 = 0;
4963
4964 /* "View.MemoryView":165
4965 * format = format.encode('ASCII')
4966 * self._format = format # keep a reference to the byte string
4967 * self.format = self._format # <<<<<<<<<<<<<<
4968 *
4969 *
4970*/
4971 if (unlikely(__pyx_v_self->_format == Py_None)) {
4972 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
4973 __PYX_ERR(1, 165, __pyx_L1_error)
4974 }
4975 __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 165, __pyx_L1_error)
4976 __pyx_v_self->format = __pyx_t_8;
4977
4978 /* "View.MemoryView":168
4979 *
4980 *
4981 * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t> self.ndim) # <<<<<<<<<<<<<<
4982 * self._strides = self._shape + self.ndim
4983 *
4984*/
4985 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_self->ndim))));
4986
4987 /* "View.MemoryView":169
4988 *
4989 * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t> self.ndim)
4990 * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
4991 *
4992 * if not self._shape:
4993*/
4994 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
4995
4996 /* "View.MemoryView":171
4997 * self._strides = self._shape + self.ndim
4998 *
4999 * if not self._shape: # <<<<<<<<<<<<<<
5000 * raise MemoryError, "unable to allocate shape and strides."
5001 *
5002*/
5003 __pyx_t_4 = (!(__pyx_v_self->_shape != 0));
5004
5005 if (unlikely(__pyx_t_4)) {
5006
5007
5008 /* "View.MemoryView":172
5009 *
5010 * if not self._shape:
5011 * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
5012 *
5013 *
5014*/
5015 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_shape_and_str, 0, 0);
5016 __PYX_ERR(1, 172, __pyx_L1_error)
5017
5018 /* "View.MemoryView":171
5019 * self._strides = self._shape + self.ndim
5020 *
5021 * if not self._shape: # <<<<<<<<<<<<<<
5022 * raise MemoryError, "unable to allocate shape and strides."
5023 *
5024*/
5025 }
5026
5027 /* "View.MemoryView":175
5028 *
5029 *
5030 * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5031 * if dim <= 0:
5032 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5033*/
5034
5035 __pyx_t_3 = 0;
5036 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5);
5037 __pyx_t_1 = 0;
5038 for (;;) {
5039 {
5040 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
5041 #if !CYTHON_ASSUME_SAFE_SIZE
5042 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 175, __pyx_L1_error)
5043 #endif
5044 if (__pyx_t_1 >= __pyx_temp) break;
5045 }
5046 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5047 __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1));
5048 #else
5049 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_1);
5050 #endif
5051 ++__pyx_t_1;
5052 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 175, __pyx_L1_error)
5053 __Pyx_GOTREF(__pyx_t_6);
5054 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L1_error)
5055 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5056 __pyx_v_dim = __pyx_t_9;
5057 __pyx_v_idx = __pyx_t_3;
5058 __pyx_t_3 = (__pyx_t_3 + 1);
5059
5060 /* "View.MemoryView":176
5061 *
5062 * for idx, dim in enumerate(shape):
5063 * if dim <= 0: # <<<<<<<<<<<<<<
5064 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5065 * self._shape[idx] = dim
5066*/
5067 __pyx_t_4 = (__pyx_v_dim <= 0);
5068
5069 if (unlikely(__pyx_t_4)) {
5070
5071
5072 /* "View.MemoryView":177
5073 * for idx, dim in enumerate(shape):
5074 * if dim <= 0:
5075 * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
5076 * self._shape[idx] = dim
5077 *
5078*/
5079 __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
5080 __Pyx_GOTREF(__pyx_t_6);
5081 __pyx_t_10 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
5082 __Pyx_GOTREF(__pyx_t_10);
5083 __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis;
5084 __pyx_t_11[1] = __pyx_t_6;
5085 __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u__2;
5086 __pyx_t_11[3] = __pyx_t_10;
5087 __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__3;
5088 __pyx_t_9 = 25;
5089 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
5090 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]);
5091 #endif
5092 __pyx_t_12 = 0;
5093 __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_9, __pyx_t_12);
5094 if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 177, __pyx_L1_error)
5095 __Pyx_GOTREF(__pyx_t_13);
5096 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5097 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5098 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
5099 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5100 __PYX_ERR(1, 177, __pyx_L1_error)
5101
5102 /* "View.MemoryView":176
5103 *
5104 * for idx, dim in enumerate(shape):
5105 * if dim <= 0: # <<<<<<<<<<<<<<
5106 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5107 * self._shape[idx] = dim
5108*/
5109 }
5110
5111 /* "View.MemoryView":178
5112 * if dim <= 0:
5113 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5114 * self._shape[idx] = dim # <<<<<<<<<<<<<<
5115 *
5116 * cdef char order
5117*/
5118 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
5119
5120 /* "View.MemoryView":175
5121 *
5122 *
5123 * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5124 * if dim <= 0:
5125 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5126*/
5127 }
5128 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5129
5130 /* "View.MemoryView":181
5131 *
5132 * cdef char order
5133 * if mode == 'c': # <<<<<<<<<<<<<<
5134 * order = b'C'
5135 * self.mode = u'c'
5136*/
5137 __pyx_t_4 = (__Pyx_PyObject_Equals_obj_ch99(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 181, __pyx_L1_error)
5138 if (__pyx_t_4) {
5139
5140
5141 /* "View.MemoryView":182
5142 * cdef char order
5143 * if mode == 'c':
5144 * order = b'C' # <<<<<<<<<<<<<<
5145 * self.mode = u'c'
5146 * elif mode == 'fortran':
5147*/
5148 __pyx_v_order = 'C';
5149
5150 /* "View.MemoryView":183
5151 * if mode == 'c':
5152 * order = b'C'
5153 * self.mode = u'c' # <<<<<<<<<<<<<<
5154 * elif mode == 'fortran':
5155 * order = b'F'
5156*/
5157 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
5158 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_c);
5159 __Pyx_GOTREF(__pyx_v_self->mode);
5160 __Pyx_DECREF(__pyx_v_self->mode);
5161 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_c;
5162
5163 /* "View.MemoryView":181
5164 *
5165 * cdef char order
5166 * if mode == 'c': # <<<<<<<<<<<<<<
5167 * order = b'C'
5168 * self.mode = u'c'
5169*/
5170 goto __pyx_L11;
5171 }
5172
5173 /* "View.MemoryView":184
5174 * order = b'C'
5175 * self.mode = u'c'
5176 * elif mode == 'fortran': # <<<<<<<<<<<<<<
5177 * order = b'F'
5178 * self.mode = u'fortran'
5179*/
5180 __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 184, __pyx_L1_error)
5181 if (likely(__pyx_t_4)) {
5182
5183
5184 /* "View.MemoryView":185
5185 * self.mode = u'c'
5186 * elif mode == 'fortran':
5187 * order = b'F' # <<<<<<<<<<<<<<
5188 * self.mode = u'fortran'
5189 * else:
5190*/
5191 __pyx_v_order = 'F';
5192
5193 /* "View.MemoryView":186
5194 * elif mode == 'fortran':
5195 * order = b'F'
5196 * self.mode = u'fortran' # <<<<<<<<<<<<<<
5197 * else:
5198 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5199*/
5200 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
5201 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fortran);
5202 __Pyx_GOTREF(__pyx_v_self->mode);
5203 __Pyx_DECREF(__pyx_v_self->mode);
5204 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_fortran;
5205
5206 /* "View.MemoryView":184
5207 * order = b'C'
5208 * self.mode = u'c'
5209 * elif mode == 'fortran': # <<<<<<<<<<<<<<
5210 * order = b'F'
5211 * self.mode = u'fortran'
5212*/
5213 goto __pyx_L11;
5214 }
5215
5216 /* "View.MemoryView":188
5217 * self.mode = u'fortran'
5218 * else:
5219 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
5220 *
5221 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5222*/
5223 /*else*/ {
5224 __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 188, __pyx_L1_error)
5225 __Pyx_GOTREF(__pyx_t_5);
5226 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 188, __pyx_L1_error)
5227 __Pyx_GOTREF(__pyx_t_13);
5228 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5229 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
5230 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5231 __PYX_ERR(1, 188, __pyx_L1_error)
5232 }
5233 __pyx_L11:;
5234
5235 /* "View.MemoryView":190
5236 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5237 *
5238 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
5239 *
5240 * self.free_data = allocate_buffer
5241*/
5242 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
5243
5244 /* "View.MemoryView":192
5245 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5246 *
5247 * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
5248 * self.dtype_is_object = format == b'O'
5249 *
5250*/
5251 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
5252
5253 /* "View.MemoryView":193
5254 *
5255 * self.free_data = allocate_buffer
5256 * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
5257 *
5258 * if allocate_buffer:
5259*/
5260 __pyx_t_13 = __Pyx_PyObject_CompareEq_object_bytes(__pyx_v_format, __pyx_mstate_global->__pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 193, __pyx_L1_error)
5261 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 193, __pyx_L1_error)
5262 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5263 __pyx_v_self->dtype_is_object = __pyx_t_4;
5264
5265 /* "View.MemoryView":195
5266 * self.dtype_is_object = format == b'O'
5267 *
5268 * if allocate_buffer: # <<<<<<<<<<<<<<
5269 * _allocate_buffer(self)
5270 *
5271*/
5272 if (__pyx_v_allocate_buffer) {
5273
5274 /* "View.MemoryView":196
5275 *
5276 * if allocate_buffer:
5277 * _allocate_buffer(self) # <<<<<<<<<<<<<<
5278 *
5279 * @cname('getbuffer')
5280*/
5281 __pyx_t_3 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 196, __pyx_L1_error)
5282
5283
5284 /* "View.MemoryView":195
5285 * self.dtype_is_object = format == b'O'
5286 *
5287 * if allocate_buffer: # <<<<<<<<<<<<<<
5288 * _allocate_buffer(self)
5289 *
5290*/
5291 }
5292
5293 /* "View.MemoryView":147
5294 * cdef bint dtype_is_object
5295 *
5296 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5297 * mode="c", bint allocate_buffer=True):
5298 *
5299*/
5300
5301 /* function exit code */
5302 __pyx_r = 0;
5303 goto __pyx_L0;
5304 __pyx_L1_error:;
5305 __Pyx_XDECREF(__pyx_t_5);
5306 __Pyx_XDECREF(__pyx_t_6);
5307 __Pyx_XDECREF(__pyx_t_10);
5308 __Pyx_XDECREF(__pyx_t_13);
5309 __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5310 __pyx_r = -1;
5311 __pyx_L0:;
5312
5313
5314
5315 __Pyx_XDECREF(__pyx_v_format);
5316
5317 __Pyx_RefNannyFinishContext();
5318 return __pyx_r;
5319}
5320
5321/* "View.MemoryView":198
5322 * _allocate_buffer(self)
5323 *
5324 * @cname('getbuffer') # <<<<<<<<<<<<<<
5325 * def __getbuffer__(self, Py_buffer *info, int flags):
5326 * cdef int bufmode = -1
5327*/
5328
5329/* Python wrapper */
5330CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5331CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5332 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5333 int __pyx_r;
5334 __Pyx_RefNannyDeclarations
5335 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5336 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5337 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
5338
5339 /* function exit code */
5340
5341
5342 __Pyx_RefNannyFinishContext();
5343 return __pyx_r;
5344}
5345
5346static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5347 int __pyx_v_bufmode;
5348 int __pyx_r;
5349 __Pyx_RefNannyDeclarations
5350 int __pyx_t_1;
5351 int __pyx_t_2;
5352 char *__pyx_t_3;
5353 Py_ssize_t __pyx_t_4;
5354 Py_ssize_t *__pyx_t_5;
5355 int __pyx_lineno = 0;
5356 const char *__pyx_filename = NULL;
5357 int __pyx_clineno = 0;
5358 if (unlikely(__pyx_v_info == NULL)) {
5359 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5360 return -1;
5361 }
5362 __Pyx_RefNannySetupContext("__getbuffer__", 0);
5363 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5364 __Pyx_GIVEREF(__pyx_v_info->obj);
5365
5366 /* "View.MemoryView":200
5367 * @cname('getbuffer')
5368 * def __getbuffer__(self, Py_buffer *info, int flags):
5369 * cdef int bufmode = -1 # <<<<<<<<<<<<<<
5370 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5371 * if self.mode == u"c":
5372*/
5373 __pyx_v_bufmode = -1;
5374
5375 /* "View.MemoryView":201
5376 * def __getbuffer__(self, Py_buffer *info, int flags):
5377 * cdef int bufmode = -1
5378 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5379 * if self.mode == u"c":
5380 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5381*/
5382 __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
5383
5384 if (__pyx_t_1) {
5385
5386
5387 /* "View.MemoryView":202
5388 * cdef int bufmode = -1
5389 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5390 * if self.mode == u"c": # <<<<<<<<<<<<<<
5391 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5392 * elif self.mode == u"fortran":
5393*/
5394 __pyx_t_1 = (__Pyx_PyObject_Equals_str_ch99(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 202, __pyx_L1_error)
5395 if (__pyx_t_1) {
5396
5397
5398 /* "View.MemoryView":203
5399 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5400 * if self.mode == u"c":
5401 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5402 * elif self.mode == u"fortran":
5403 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5404*/
5405 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5406
5407 /* "View.MemoryView":202
5408 * cdef int bufmode = -1
5409 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5410 * if self.mode == u"c": # <<<<<<<<<<<<<<
5411 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5412 * elif self.mode == u"fortran":
5413*/
5414 goto __pyx_L4;
5415 }
5416
5417 /* "View.MemoryView":204
5418 * if self.mode == u"c":
5419 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5420 * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5421 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5422 * if cython.unlikely(not (flags & bufmode)):
5423*/
5424 __pyx_t_1 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 204, __pyx_L1_error)
5425 if (__pyx_t_1) {
5426
5427
5428 /* "View.MemoryView":205
5429 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5430 * elif self.mode == u"fortran":
5431 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5432 * if cython.unlikely(not (flags & bufmode)):
5433 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5434*/
5435 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5436
5437 /* "View.MemoryView":204
5438 * if self.mode == u"c":
5439 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5440 * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5441 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5442 * if cython.unlikely(not (flags & bufmode)):
5443*/
5444 }
5445 __pyx_L4:;
5446
5447 /* "View.MemoryView":206
5448 * elif self.mode == u"fortran":
5449 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5450 * if cython.unlikely(not (flags & bufmode)): # <<<<<<<<<<<<<<
5451 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5452 * info.buf = self.data
5453*/
5454 __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5455
5456 if (unlikely(__pyx_t_1)) {
5457
5458
5459 /* "View.MemoryView":207
5460 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5461 * if cython.unlikely(not (flags & bufmode)):
5462 * _err_ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
5463 * info.buf = self.data
5464 * info.len = self.len
5465*/
5466 __pyx_t_2 = __pyx_memoryview_err_ValueError(__pyx_k_Can_only_create_a_buffer_that_is); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 207, __pyx_L1_error)
5467
5468
5469 /* "View.MemoryView":206
5470 * elif self.mode == u"fortran":
5471 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5472 * if cython.unlikely(not (flags & bufmode)): # <<<<<<<<<<<<<<
5473 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5474 * info.buf = self.data
5475*/
5476 }
5477
5478 /* "View.MemoryView":201
5479 * def __getbuffer__(self, Py_buffer *info, int flags):
5480 * cdef int bufmode = -1
5481 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5482 * if self.mode == u"c":
5483 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5484*/
5485 }
5486
5487 /* "View.MemoryView":208
5488 * if cython.unlikely(not (flags & bufmode)):
5489 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5490 * info.buf = self.data # <<<<<<<<<<<<<<
5491 * info.len = self.len
5492 *
5493*/
5494 __pyx_t_3 = __pyx_v_self->data;
5495
5496 __pyx_v_info->buf = __pyx_t_3;
5497
5498 /* "View.MemoryView":209
5499 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5500 * info.buf = self.data
5501 * info.len = self.len # <<<<<<<<<<<<<<
5502 *
5503 * if flags & PyBUF_STRIDES:
5504*/
5505 __pyx_t_4 = __pyx_v_self->len;
5506
5507 __pyx_v_info->len = __pyx_t_4;
5508
5509 /* "View.MemoryView":211
5510 * info.len = self.len
5511 *
5512 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5513 * info.ndim = self.ndim
5514 * info.shape = self._shape
5515*/
5516 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5517
5518 if (__pyx_t_1) {
5519
5520
5521 /* "View.MemoryView":212
5522 *
5523 * if flags & PyBUF_STRIDES:
5524 * info.ndim = self.ndim # <<<<<<<<<<<<<<
5525 * info.shape = self._shape
5526 * info.strides = self._strides
5527*/
5528 __pyx_t_2 = __pyx_v_self->ndim;
5529
5530 __pyx_v_info->ndim = __pyx_t_2;
5531
5532 /* "View.MemoryView":213
5533 * if flags & PyBUF_STRIDES:
5534 * info.ndim = self.ndim
5535 * info.shape = self._shape # <<<<<<<<<<<<<<
5536 * info.strides = self._strides
5537 * else:
5538*/
5539 __pyx_t_5 = __pyx_v_self->_shape;
5540
5541 __pyx_v_info->shape = __pyx_t_5;
5542
5543 /* "View.MemoryView":214
5544 * info.ndim = self.ndim
5545 * info.shape = self._shape
5546 * info.strides = self._strides # <<<<<<<<<<<<<<
5547 * else:
5548 * info.ndim = 1
5549*/
5550 __pyx_t_5 = __pyx_v_self->_strides;
5551
5552 __pyx_v_info->strides = __pyx_t_5;
5553
5554 /* "View.MemoryView":211
5555 * info.len = self.len
5556 *
5557 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5558 * info.ndim = self.ndim
5559 * info.shape = self._shape
5560*/
5561 goto __pyx_L6;
5562 }
5563
5564 /* "View.MemoryView":216
5565 * info.strides = self._strides
5566 * else:
5567 * info.ndim = 1 # <<<<<<<<<<<<<<
5568 * info.shape = &self.len if flags & PyBUF_ND else NULL
5569 * info.strides = NULL
5570*/
5571 /*else*/ {
5572 __pyx_v_info->ndim = 1;
5573
5574 /* "View.MemoryView":217
5575 * else:
5576 * info.ndim = 1
5577 * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
5578 * info.strides = NULL
5579 *
5580*/
5581 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5582
5583 if (__pyx_t_1) {
5584
5585 __pyx_t_5 = (&__pyx_v_self->len);
5586 } else {
5587
5588 __pyx_t_5 = NULL;
5589 }
5590
5591 __pyx_v_info->shape = __pyx_t_5;
5592
5593 /* "View.MemoryView":218
5594 * info.ndim = 1
5595 * info.shape = &self.len if flags & PyBUF_ND else NULL
5596 * info.strides = NULL # <<<<<<<<<<<<<<
5597 *
5598 * info.suboffsets = NULL
5599*/
5600 __pyx_v_info->strides = NULL;
5601 }
5602 __pyx_L6:;
5603
5604 /* "View.MemoryView":220
5605 * info.strides = NULL
5606 *
5607 * info.suboffsets = NULL # <<<<<<<<<<<<<<
5608 * info.itemsize = self.itemsize
5609 * info.readonly = 0
5610*/
5611 __pyx_v_info->suboffsets = NULL;
5612
5613 /* "View.MemoryView":221
5614 *
5615 * info.suboffsets = NULL
5616 * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
5617 * info.readonly = 0
5618 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5619*/
5620 __pyx_t_4 = __pyx_v_self->itemsize;
5621
5622 __pyx_v_info->itemsize = __pyx_t_4;
5623
5624 /* "View.MemoryView":222
5625 * info.suboffsets = NULL
5626 * info.itemsize = self.itemsize
5627 * info.readonly = 0 # <<<<<<<<<<<<<<
5628 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5629 * info.obj = self
5630*/
5631 __pyx_v_info->readonly = 0;
5632
5633 /* "View.MemoryView":223
5634 * info.itemsize = self.itemsize
5635 * info.readonly = 0
5636 * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
5637 * info.obj = self
5638 *
5639*/
5640 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5641
5642 if (__pyx_t_1) {
5643
5644 __pyx_t_3 = __pyx_v_self->format;
5645 } else {
5646
5647 __pyx_t_3 = NULL;
5648 }
5649
5650 __pyx_v_info->format = __pyx_t_3;
5651
5652 /* "View.MemoryView":224
5653 * info.readonly = 0
5654 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5655 * info.obj = self # <<<<<<<<<<<<<<
5656 *
5657 * def __dealloc__(array self):
5658*/
5659 __Pyx_INCREF((PyObject *)__pyx_v_self);
5660 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5661 __Pyx_GOTREF(__pyx_v_info->obj);
5662 __Pyx_DECREF(__pyx_v_info->obj);
5663 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5664
5665 /* "View.MemoryView":198
5666 * _allocate_buffer(self)
5667 *
5668 * @cname('getbuffer') # <<<<<<<<<<<<<<
5669 * def __getbuffer__(self, Py_buffer *info, int flags):
5670 * cdef int bufmode = -1
5671*/
5672
5673 /* function exit code */
5674 __pyx_r = 0;
5675 goto __pyx_L0;
5676 __pyx_L1_error:;
5677 __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5678 __pyx_r = -1;
5679 if (__pyx_v_info->obj != NULL) {
5680 __Pyx_GOTREF(__pyx_v_info->obj);
5681 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5682 }
5683 goto __pyx_L2;
5684 __pyx_L0:;
5685 if (__pyx_v_info->obj == Py_None) {
5686 __Pyx_GOTREF(__pyx_v_info->obj);
5687 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5688 }
5689 __pyx_L2:;
5690
5691
5692 __Pyx_RefNannyFinishContext();
5693 return __pyx_r;
5694}
5695
5696/* "View.MemoryView":226
5697 * info.obj = self
5698 *
5699 * def __dealloc__(array self): # <<<<<<<<<<<<<<
5700 * if self.callback_free_data != NULL:
5701 * self.callback_free_data(self.data)
5702*/
5703
5704/* Python wrapper */
5705static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
5706static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
5707 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5708 __Pyx_RefNannyDeclarations
5709 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
5710 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5711 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
5712
5713 /* function exit code */
5714 __Pyx_RefNannyFinishContext();
5715}
5716
5717static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
5718 int __pyx_t_1;
5719 int __pyx_t_2;
5720
5721 /* "View.MemoryView":227
5722 *
5723 * def __dealloc__(array self):
5724 * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
5725 * self.callback_free_data(self.data)
5726 * elif self.free_data and self.data is not NULL:
5727*/
5728 __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
5729
5730 if (__pyx_t_1) {
5731
5732
5733 /* "View.MemoryView":228
5734 * def __dealloc__(array self):
5735 * if self.callback_free_data != NULL:
5736 * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
5737 * elif self.free_data and self.data is not NULL:
5738 * if self.dtype_is_object:
5739*/
5740 __pyx_v_self->callback_free_data(__pyx_v_self->data);
5741
5742 /* "View.MemoryView":227
5743 *
5744 * def __dealloc__(array self):
5745 * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
5746 * self.callback_free_data(self.data)
5747 * elif self.free_data and self.data is not NULL:
5748*/
5749 goto __pyx_L3;
5750 }
5751
5752 /* "View.MemoryView":229
5753 * if self.callback_free_data != NULL:
5754 * self.callback_free_data(self.data)
5755 * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
5756 * if self.dtype_is_object:
5757 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5758*/
5759 if (__pyx_v_self->free_data) {
5760 } else {
5761
5762 __pyx_t_1 = __pyx_v_self->free_data;
5763 goto __pyx_L4_bool_binop_done;
5764 }
5765 __pyx_t_2 = (__pyx_v_self->data != NULL);
5766
5767
5768 __pyx_t_1 = __pyx_t_2;
5769
5770 __pyx_L4_bool_binop_done:;
5771 if (__pyx_t_1) {
5772
5773
5774 /* "View.MemoryView":230
5775 * self.callback_free_data(self.data)
5776 * elif self.free_data and self.data is not NULL:
5777 * if self.dtype_is_object: # <<<<<<<<<<<<<<
5778 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5779 * free(self.data)
5780*/
5781 if (__pyx_v_self->dtype_is_object) {
5782
5783 /* "View.MemoryView":231
5784 * elif self.free_data and self.data is not NULL:
5785 * if self.dtype_is_object:
5786 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
5787 * free(self.data)
5788 * PyObject_Free(self._shape)
5789*/
5790 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
5791
5792 /* "View.MemoryView":230
5793 * self.callback_free_data(self.data)
5794 * elif self.free_data and self.data is not NULL:
5795 * if self.dtype_is_object: # <<<<<<<<<<<<<<
5796 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5797 * free(self.data)
5798*/
5799 }
5800
5801 /* "View.MemoryView":232
5802 * if self.dtype_is_object:
5803 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5804 * free(self.data) # <<<<<<<<<<<<<<
5805 * PyObject_Free(self._shape)
5806 *
5807*/
5808 free(__pyx_v_self->data);
5809
5810 /* "View.MemoryView":229
5811 * if self.callback_free_data != NULL:
5812 * self.callback_free_data(self.data)
5813 * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
5814 * if self.dtype_is_object:
5815 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5816*/
5817 }
5818 __pyx_L3:;
5819
5820 /* "View.MemoryView":233
5821 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5822 * free(self.data)
5823 * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
5824 *
5825 * @property
5826*/
5827 PyObject_Free(__pyx_v_self->_shape);
5828
5829 /* "View.MemoryView":226
5830 * info.obj = self
5831 *
5832 * def __dealloc__(array self): # <<<<<<<<<<<<<<
5833 * if self.callback_free_data != NULL:
5834 * self.callback_free_data(self.data)
5835*/
5836
5837 /* function exit code */
5838
5839}
5840
5841/* "View.MemoryView":235
5842 * PyObject_Free(self._shape)
5843 *
5844 * @property # <<<<<<<<<<<<<<
5845 * def memview(self):
5846 * return array.get_memview(self)
5847*/
5848
5849/* Python wrapper */
5850static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
5851static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
5852 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5853 PyObject *__pyx_r = 0;
5854 __Pyx_RefNannyDeclarations
5855 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5856 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5857 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
5858
5859 /* function exit code */
5860 __Pyx_RefNannyFinishContext();
5861 return __pyx_r;
5862}
5863
5864static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
5865 PyObject *__pyx_r = NULL;
5866 __Pyx_RefNannyDeclarations
5867 PyObject *__pyx_t_1 = NULL;
5868 int __pyx_lineno = 0;
5869 const char *__pyx_filename = NULL;
5870 int __pyx_clineno = 0;
5871 __Pyx_RefNannySetupContext("__get__", 0);
5872
5873 /* "View.MemoryView":237
5874 * @property
5875 * def memview(self):
5876 * return array.get_memview(self) # <<<<<<<<<<<<<<
5877 *
5878 *
5879*/
5880 __pyx_t_1 = __pyx_array_get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
5881 __Pyx_GOTREF(__pyx_t_1);
5882 {
5883 PyObject *__pyx_temp;
5884 {
5885 __pyx_temp = __pyx_r;
5886 __pyx_r = __pyx_t_1;
5887 }
5888 __Pyx_XDECREF(__pyx_temp);
5889 }
5890 __pyx_t_1 = 0;
5891 goto __pyx_L0;
5892
5893 /* "View.MemoryView":235
5894 * PyObject_Free(self._shape)
5895 *
5896 * @property # <<<<<<<<<<<<<<
5897 * def memview(self):
5898 * return array.get_memview(self)
5899*/
5900
5901 /* function exit code */
5902 __pyx_L1_error:;
5903 __Pyx_XDECREF(__pyx_t_1);
5904 __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5905 __pyx_r = NULL;
5906 __pyx_L0:;
5907 __Pyx_XGIVEREF(__pyx_r);
5908 __Pyx_RefNannyFinishContext();
5909 return __pyx_r;
5910}
5911
5912/* "View.MemoryView":240
5913 *
5914 *
5915 * @cname('get_memview') # <<<<<<<<<<<<<<
5916 * cdef get_memview(self):
5917 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5918*/
5919
5920static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
5921 int __pyx_v_flags;
5922 PyObject *__pyx_r = NULL;
5923 __Pyx_RefNannyDeclarations
5924 PyObject *__pyx_t_1 = NULL;
5925 PyObject *__pyx_t_2 = NULL;
5926 PyObject *__pyx_t_3 = NULL;
5927 PyObject *__pyx_t_4 = NULL;
5928 size_t __pyx_t_5;
5929 int __pyx_lineno = 0;
5930 const char *__pyx_filename = NULL;
5931 int __pyx_clineno = 0;
5932 __Pyx_RefNannySetupContext("get_memview", 0);
5933
5934 /* "View.MemoryView":242
5935 * @cname('get_memview')
5936 * cdef get_memview(self):
5937 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
5938 * return memoryview(self, flags, self.dtype_is_object)
5939 *
5940*/
5941 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
5942
5943 /* "View.MemoryView":243
5944 * cdef get_memview(self):
5945 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5946 * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
5947 *
5948 * def __len__(self):
5949*/
5950 __pyx_t_2 = NULL;
5951 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 243, __pyx_L1_error)
5952 __Pyx_GOTREF(__pyx_t_3);
5953 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 243, __pyx_L1_error)
5954 __Pyx_GOTREF(__pyx_t_4);
5955 __pyx_t_5 = 1;
5956 {
5957 PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4};
5958 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5959 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5960 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5961 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5962 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
5963 __Pyx_GOTREF((PyObject *)__pyx_t_1);
5964 }
5965 {
5966 PyObject *__pyx_temp;
5967 {
5968 __pyx_temp = __pyx_r;
5969 __pyx_r = ((PyObject *)__pyx_t_1);
5970 }
5971 __Pyx_XDECREF(__pyx_temp);
5972 }
5973 __pyx_t_1 = 0;
5974 goto __pyx_L0;
5975
5976 /* "View.MemoryView":240
5977 *
5978 *
5979 * @cname('get_memview') # <<<<<<<<<<<<<<
5980 * cdef get_memview(self):
5981 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5982*/
5983
5984 /* function exit code */
5985 __pyx_L1_error:;
5986 __Pyx_XDECREF(__pyx_t_1);
5987 __Pyx_XDECREF(__pyx_t_2);
5988 __Pyx_XDECREF(__pyx_t_3);
5989 __Pyx_XDECREF(__pyx_t_4);
5990 __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
5991 __pyx_r = 0;
5992 __pyx_L0:;
5993
5994 __Pyx_XGIVEREF(__pyx_r);
5995 __Pyx_RefNannyFinishContext();
5996 return __pyx_r;
5997}
5998
5999/* "View.MemoryView":245
6000 * return memoryview(self, flags, self.dtype_is_object)
6001 *
6002 * def __len__(self): # <<<<<<<<<<<<<<
6003 * return self._shape[0]
6004 *
6005*/
6006
6007/* Python wrapper */
6008static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
6009static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
6010 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6011 Py_ssize_t __pyx_r;
6012 __Pyx_RefNannyDeclarations
6013 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
6014 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6015 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
6016
6017 /* function exit code */
6018 __Pyx_RefNannyFinishContext();
6019 return __pyx_r;
6020}
6021
6022static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
6023 Py_ssize_t __pyx_r;
6024
6025 /* "View.MemoryView":246
6026 *
6027 * def __len__(self):
6028 * return self._shape[0] # <<<<<<<<<<<<<<
6029 *
6030 * def __getattr__(self, attr):
6031*/
6032 {
6033
6034 __pyx_r = (__pyx_v_self->_shape[0]);
6035 }
6036 goto __pyx_L0;
6037
6038 /* "View.MemoryView":245
6039 * return memoryview(self, flags, self.dtype_is_object)
6040 *
6041 * def __len__(self): # <<<<<<<<<<<<<<
6042 * return self._shape[0]
6043 *
6044*/
6045
6046 /* function exit code */
6047 __pyx_L0:;
6048
6049 return __pyx_r;
6050}
6051
6052/* "View.MemoryView":248
6053 * return self._shape[0]
6054 *
6055 * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6056 * return getattr(self.memview, attr)
6057 *
6058*/
6059
6060/* Python wrapper */
6061static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
6062static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
6063 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6064 PyObject *__pyx_r = 0;
6065 __Pyx_RefNannyDeclarations
6066 __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
6067 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6068 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
6069
6070 /* function exit code */
6071 __Pyx_RefNannyFinishContext();
6072 return __pyx_r;
6073}
6074
6075static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
6076 PyObject *__pyx_r = NULL;
6077 __Pyx_RefNannyDeclarations
6078 PyObject *__pyx_t_1 = NULL;
6079 PyObject *__pyx_t_2 = NULL;
6080 int __pyx_lineno = 0;
6081 const char *__pyx_filename = NULL;
6082 int __pyx_clineno = 0;
6083 __Pyx_RefNannySetupContext("__getattr__", 0);
6084
6085 /* "View.MemoryView":249
6086 *
6087 * def __getattr__(self, attr):
6088 * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
6089 *
6090 * def __getitem__(self, item):
6091*/
6092 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error)
6093 __Pyx_GOTREF(__pyx_t_1);
6094 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
6095 __Pyx_GOTREF(__pyx_t_2);
6096 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6097 {
6098 PyObject *__pyx_temp;
6099 {
6100 __pyx_temp = __pyx_r;
6101 __pyx_r = __pyx_t_2;
6102 }
6103 __Pyx_XDECREF(__pyx_temp);
6104 }
6105 __pyx_t_2 = 0;
6106 goto __pyx_L0;
6107
6108 /* "View.MemoryView":248
6109 * return self._shape[0]
6110 *
6111 * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6112 * return getattr(self.memview, attr)
6113 *
6114*/
6115
6116 /* function exit code */
6117 __pyx_L1_error:;
6118 __Pyx_XDECREF(__pyx_t_1);
6119 __Pyx_XDECREF(__pyx_t_2);
6120 __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6121 __pyx_r = NULL;
6122 __pyx_L0:;
6123 __Pyx_XGIVEREF(__pyx_r);
6124 __Pyx_RefNannyFinishContext();
6125 return __pyx_r;
6126}
6127
6128/* "View.MemoryView":251
6129 * return getattr(self.memview, attr)
6130 *
6131 * def __getitem__(self, item): # <<<<<<<<<<<<<<
6132 * return self.memview[item]
6133 *
6134*/
6135
6136/* Python wrapper */
6137static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
6138static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
6139 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6140 PyObject *__pyx_r = 0;
6141 __Pyx_RefNannyDeclarations
6142 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
6143 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6144 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
6145
6146 /* function exit code */
6147 __Pyx_RefNannyFinishContext();
6148 return __pyx_r;
6149}
6150
6151static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
6152 PyObject *__pyx_r = NULL;
6153 __Pyx_RefNannyDeclarations
6154 PyObject *__pyx_t_1 = NULL;
6155 PyObject *__pyx_t_2 = NULL;
6156 int __pyx_lineno = 0;
6157 const char *__pyx_filename = NULL;
6158 int __pyx_clineno = 0;
6159 __Pyx_RefNannySetupContext("__getitem__", 0);
6160
6161 /* "View.MemoryView":252
6162 *
6163 * def __getitem__(self, item):
6164 * return self.memview[item] # <<<<<<<<<<<<<<
6165 *
6166 * def __setitem__(self, item, value):
6167*/
6168 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 252, __pyx_L1_error)
6169 __Pyx_GOTREF(__pyx_t_1);
6170 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
6171 __Pyx_GOTREF(__pyx_t_2);
6172 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6173 {
6174 PyObject *__pyx_temp;
6175 {
6176 __pyx_temp = __pyx_r;
6177 __pyx_r = __pyx_t_2;
6178 }
6179 __Pyx_XDECREF(__pyx_temp);
6180 }
6181 __pyx_t_2 = 0;
6182 goto __pyx_L0;
6183
6184 /* "View.MemoryView":251
6185 * return getattr(self.memview, attr)
6186 *
6187 * def __getitem__(self, item): # <<<<<<<<<<<<<<
6188 * return self.memview[item]
6189 *
6190*/
6191
6192 /* function exit code */
6193 __pyx_L1_error:;
6194 __Pyx_XDECREF(__pyx_t_1);
6195 __Pyx_XDECREF(__pyx_t_2);
6196 __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6197 __pyx_r = NULL;
6198 __pyx_L0:;
6199 __Pyx_XGIVEREF(__pyx_r);
6200 __Pyx_RefNannyFinishContext();
6201 return __pyx_r;
6202}
6203
6204/* "View.MemoryView":254
6205 * return self.memview[item]
6206 *
6207 * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6208 * self.memview[item] = value
6209 *
6210*/
6211
6212/* Python wrapper */
6213static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
6214static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6215 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6216 int __pyx_r;
6217 __Pyx_RefNannyDeclarations
6218 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
6219 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6220 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
6221
6222 /* function exit code */
6223 __Pyx_RefNannyFinishContext();
6224 return __pyx_r;
6225}
6226
6227static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6228 int __pyx_r;
6229 __Pyx_RefNannyDeclarations
6230 PyObject *__pyx_t_1 = NULL;
6231 int __pyx_lineno = 0;
6232 const char *__pyx_filename = NULL;
6233 int __pyx_clineno = 0;
6234 __Pyx_RefNannySetupContext("__setitem__", 0);
6235
6236 /* "View.MemoryView":255
6237 *
6238 * def __setitem__(self, item, value):
6239 * self.memview[item] = value # <<<<<<<<<<<<<<
6240 *
6241 *
6242*/
6243 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 255, __pyx_L1_error)
6244 __Pyx_GOTREF(__pyx_t_1);
6245 if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 255, __pyx_L1_error)
6246 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6247
6248 /* "View.MemoryView":254
6249 * return self.memview[item]
6250 *
6251 * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6252 * self.memview[item] = value
6253 *
6254*/
6255
6256 /* function exit code */
6257 __pyx_r = 0;
6258 goto __pyx_L0;
6259 __pyx_L1_error:;
6260 __Pyx_XDECREF(__pyx_t_1);
6261 __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6262 __pyx_r = -1;
6263 __pyx_L0:;
6264
6265 __Pyx_RefNannyFinishContext();
6266 return __pyx_r;
6267}
6268
6269/* "(tree fragment)":1
6270 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6271 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6272 * def __setstate_cython__(self, __pyx_state):
6273*/
6274
6275/* Python wrapper */
6276static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6277#if CYTHON_VECTORCALL
6278PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6279#else
6280PyObject *__pyx_args, PyObject *__pyx_kwds
6281#endif
6282); /*proto*/
6283static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6284#if CYTHON_VECTORCALL
6285PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6286#else
6287PyObject *__pyx_args, PyObject *__pyx_kwds
6288#endif
6289) {
6290 #if !CYTHON_VECTORCALL
6291 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6292 #endif
6293 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6294 PyObject *__pyx_r = 0;
6295 __Pyx_RefNannyDeclarations
6296 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6297 #if !CYTHON_VECTORCALL
6298 #if CYTHON_ASSUME_SAFE_SIZE
6299 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6300 #else
6301 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6302 #endif
6303 #endif
6304 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6305 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
6306 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6307 if (unlikely(__pyx_kwds_len < 0)) return NULL;
6308 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
6309 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
6310
6311 /* function exit code */
6312 __Pyx_RefNannyFinishContext();
6313 return __pyx_r;
6314}
6315
6316static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
6317 PyObject *__pyx_r = NULL;
6318 __Pyx_RefNannyDeclarations
6319 int __pyx_lineno = 0;
6320 const char *__pyx_filename = NULL;
6321 int __pyx_clineno = 0;
6322 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6323
6324 /* "(tree fragment)":2
6325 * def __reduce_cython__(self):
6326 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6327 * def __setstate_cython__(self, __pyx_state):
6328 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6329*/
6330 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6331 __PYX_ERR(1, 2, __pyx_L1_error)
6332
6333 /* "(tree fragment)":1
6334 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6335 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6336 * def __setstate_cython__(self, __pyx_state):
6337*/
6338
6339 /* function exit code */
6340 __pyx_L1_error:;
6341 __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6342 __pyx_r = NULL;
6343 __Pyx_XGIVEREF(__pyx_r);
6344 __Pyx_RefNannyFinishContext();
6345 return __pyx_r;
6346}
6347
6348/* "(tree fragment)":3
6349 * def __reduce_cython__(self):
6350 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6351 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6352 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6353*/
6354
6355/* Python wrapper */
6356static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6357#if CYTHON_VECTORCALL
6358PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6359#else
6360PyObject *__pyx_args, PyObject *__pyx_kwds
6361#endif
6362); /*proto*/
6363static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6364#if CYTHON_VECTORCALL
6365PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6366#else
6367PyObject *__pyx_args, PyObject *__pyx_kwds
6368#endif
6369) {
6370 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6371 #if !CYTHON_VECTORCALL
6372 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6373 #endif
6374 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6375 PyObject* values[1] = {0};
6376 int __pyx_lineno = 0;
6377 const char *__pyx_filename = NULL;
6378 int __pyx_clineno = 0;
6379 PyObject *__pyx_r = 0;
6380 __Pyx_RefNannyDeclarations
6381 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6382 #if !CYTHON_VECTORCALL
6383 #if CYTHON_ASSUME_SAFE_SIZE
6384 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6385 #else
6386 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6387 #endif
6388 #endif
6389 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6390 {
6391 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
6392 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6393 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
6394 if (__pyx_kwds_len > 0) {
6395 switch (__pyx_nargs) {
6396 case 1:
6397 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6398 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6399 CYTHON_FALLTHROUGH;
6400 case 0: break;
6401 default: goto __pyx_L5_argtuple_error;
6402 }
6403 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6404 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
6405 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6406 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
6407 }
6408 } else if (unlikely(__pyx_nargs != 1)) {
6409 goto __pyx_L5_argtuple_error;
6410 } else {
6411 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6412 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6413 }
6414 __pyx_v___pyx_state = values[0];
6415 }
6416 goto __pyx_L6_skip;
6417 __pyx_L5_argtuple_error:;
6418 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6419 __pyx_L6_skip:;
6420 goto __pyx_L4_argument_unpacking_done;
6421 __pyx_L3_error:;
6422 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6423 Py_XDECREF(values[__pyx_temp]);
6424 }
6425 __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6426 __Pyx_RefNannyFinishContext();
6427 return NULL;
6428 __pyx_L4_argument_unpacking_done:;
6429 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
6430
6431 /* function exit code */
6432 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6433 Py_XDECREF(values[__pyx_temp]);
6434 }
6435 __Pyx_RefNannyFinishContext();
6436 return __pyx_r;
6437}
6438
6439static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6440 PyObject *__pyx_r = NULL;
6441 __Pyx_RefNannyDeclarations
6442 int __pyx_lineno = 0;
6443 const char *__pyx_filename = NULL;
6444 int __pyx_clineno = 0;
6445 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6446
6447 /* "(tree fragment)":4
6448 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6449 * def __setstate_cython__(self, __pyx_state):
6450 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6451*/
6452 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6453 __PYX_ERR(1, 4, __pyx_L1_error)
6454
6455 /* "(tree fragment)":3
6456 * def __reduce_cython__(self):
6457 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6458 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6459 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6460*/
6461
6462 /* function exit code */
6463 __pyx_L1_error:;
6464 __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6465 __pyx_r = NULL;
6466 __Pyx_XGIVEREF(__pyx_r);
6467 __Pyx_RefNannyFinishContext();
6468 return __pyx_r;
6469}
6470
6471/* "View.MemoryView":264
6472 * pass
6473 *
6474 * @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
6475 * cdef int _allocate_buffer(array self) except -1:
6476 *
6477*/
6478
6479static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
6480 Py_ssize_t __pyx_v_i;
6481 PyObject **__pyx_v_p;
6482 int __pyx_r;
6483 int __pyx_t_1;
6484 Py_ssize_t __pyx_t_2;
6485 Py_ssize_t __pyx_t_3;
6486 Py_ssize_t __pyx_t_4;
6487 int __pyx_lineno = 0;
6488 const char *__pyx_filename = NULL;
6489 int __pyx_clineno = 0;
6490
6491 /* "View.MemoryView":271
6492 * cdef PyObject **p
6493 *
6494 * self.free_data = True # <<<<<<<<<<<<<<
6495 * self.data = <char *>malloc(<size_t> self.len)
6496 * if not self.data:
6497*/
6498 __pyx_v_self->free_data = 1;
6499
6500 /* "View.MemoryView":272
6501 *
6502 * self.free_data = True
6503 * self.data = <char *>malloc(<size_t> self.len) # <<<<<<<<<<<<<<
6504 * if not self.data:
6505 * raise MemoryError, "unable to allocate array data."
6506*/
6507 __pyx_v_self->data = ((char *)malloc(((size_t)__pyx_v_self->len)));
6508
6509 /* "View.MemoryView":273
6510 * self.free_data = True
6511 * self.data = <char *>malloc(<size_t> self.len)
6512 * if not self.data: # <<<<<<<<<<<<<<
6513 * raise MemoryError, "unable to allocate array data."
6514 *
6515*/
6516 __pyx_t_1 = (!(__pyx_v_self->data != 0));
6517
6518 if (unlikely(__pyx_t_1)) {
6519
6520
6521 /* "View.MemoryView":274
6522 * self.data = <char *>malloc(<size_t> self.len)
6523 * if not self.data:
6524 * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
6525 *
6526 * if self.dtype_is_object:
6527*/
6528 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_array_data, 0, 0);
6529 __PYX_ERR(1, 274, __pyx_L1_error)
6530
6531 /* "View.MemoryView":273
6532 * self.free_data = True
6533 * self.data = <char *>malloc(<size_t> self.len)
6534 * if not self.data: # <<<<<<<<<<<<<<
6535 * raise MemoryError, "unable to allocate array data."
6536 *
6537*/
6538 }
6539
6540 /* "View.MemoryView":276
6541 * raise MemoryError, "unable to allocate array data."
6542 *
6543 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6544 * p = <PyObject **> self.data
6545 * for i in range(self.len // self.itemsize):
6546*/
6547 if (__pyx_v_self->dtype_is_object) {
6548
6549 /* "View.MemoryView":277
6550 *
6551 * if self.dtype_is_object:
6552 * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6553 * for i in range(self.len // self.itemsize):
6554 * p[i] = Py_None
6555*/
6556 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6557
6558 /* "View.MemoryView":278
6559 * if self.dtype_is_object:
6560 * p = <PyObject **> self.data
6561 * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
6562 * p[i] = Py_None
6563 * Py_INCREF(Py_None)
6564*/
6565 if (unlikely(__pyx_v_self->itemsize == 0)) {
6566 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6567 __PYX_ERR(1, 278, __pyx_L1_error)
6568 }
6569 else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6570 PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6571 __PYX_ERR(1, 278, __pyx_L1_error)
6572 }
6573
6574 __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize, 0);
6575 __pyx_t_3 = __pyx_t_2;
6576
6577 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6578 __pyx_v_i = __pyx_t_4;
6579
6580 /* "View.MemoryView":279
6581 * p = <PyObject **> self.data
6582 * for i in range(self.len // self.itemsize):
6583 * p[i] = Py_None # <<<<<<<<<<<<<<
6584 * Py_INCREF(Py_None)
6585 * return 0
6586*/
6587 (__pyx_v_p[__pyx_v_i]) = Py_None;
6588
6589 /* "View.MemoryView":280
6590 * for i in range(self.len // self.itemsize):
6591 * p[i] = Py_None
6592 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6593 * return 0
6594 *
6595*/
6596 Py_INCREF(Py_None);
6597 }
6598
6599
6600 /* "View.MemoryView":276
6601 * raise MemoryError, "unable to allocate array data."
6602 *
6603 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6604 * p = <PyObject **> self.data
6605 * for i in range(self.len // self.itemsize):
6606*/
6607 }
6608
6609 /* "View.MemoryView":281
6610 * p[i] = Py_None
6611 * Py_INCREF(Py_None)
6612 * return 0 # <<<<<<<<<<<<<<
6613 *
6614 *
6615*/
6616 {
6617
6618 __pyx_r = 0;
6619 }
6620 goto __pyx_L0;
6621
6622 /* "View.MemoryView":264
6623 * pass
6624 *
6625 * @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
6626 * cdef int _allocate_buffer(array self) except -1:
6627 *
6628*/
6629
6630 /* function exit code */
6631 __pyx_L1_error:;
6632 __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6633 __pyx_r = -1;
6634 __pyx_L0:;
6635
6636
6637
6638 return __pyx_r;
6639}
6640
6641/* "View.MemoryView":284
6642 *
6643 *
6644 * @cname("__pyx_array_new") # <<<<<<<<<<<<<<
6645 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6646 * cdef array result
6647*/
6648
6649static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char const *__pyx_v_c_mode, char *__pyx_v_buf) {
6650 struct __pyx_array_obj *__pyx_v_result = 0;
6651 PyObject *__pyx_v_mode = 0;
6652 struct __pyx_array_obj *__pyx_r = NULL;
6653 __Pyx_RefNannyDeclarations
6654 PyObject *__pyx_t_1 = NULL;
6655 int __pyx_t_2;
6656 PyObject *__pyx_t_3 = NULL;
6657 PyObject *__pyx_t_4 = NULL;
6658 int __pyx_lineno = 0;
6659 const char *__pyx_filename = NULL;
6660 int __pyx_clineno = 0;
6661 __Pyx_RefNannySetupContext("array_cwrapper", 0);
6662
6663 /* "View.MemoryView":287
6664 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6665 * cdef array result
6666 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
6667 *
6668 * if buf is NULL:
6669*/
6670 __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
6671
6672 if (__pyx_t_2) {
6673 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
6674 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
6675 } else {
6676 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
6677 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
6678 }
6679
6680 __pyx_v_mode = ((PyObject*)__pyx_t_1);
6681 __pyx_t_1 = 0;
6682
6683 /* "View.MemoryView":289
6684 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6685 *
6686 * if buf is NULL: # <<<<<<<<<<<<<<
6687 * result = array.__new__(array, shape, itemsize, format, mode)
6688 * else:
6689*/
6690 __pyx_t_2 = (__pyx_v_buf == NULL);
6691
6692 if (__pyx_t_2) {
6693
6694
6695 /* "View.MemoryView":290
6696 *
6697 * if buf is NULL:
6698 * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
6699 * else:
6700 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6701*/
6702 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
6703 __Pyx_GOTREF(__pyx_t_1);
6704 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
6705 __Pyx_GOTREF(__pyx_t_3);
6706 __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 290, __pyx_L1_error)
6707 __Pyx_GOTREF(__pyx_t_4);
6708 __Pyx_INCREF(__pyx_v_shape);
6709 __Pyx_GIVEREF(__pyx_v_shape);
6710 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6711 __Pyx_GIVEREF(__pyx_t_1);
6712 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6713 __Pyx_GIVEREF(__pyx_t_3);
6714 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6715 __Pyx_INCREF(__pyx_v_mode);
6716 __Pyx_GIVEREF(__pyx_v_mode);
6717 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6718 __pyx_t_1 = 0;
6719 __pyx_t_3 = 0;
6720 __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
6721 __Pyx_GOTREF(__pyx_t_3);
6722 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6723 __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6724 __pyx_t_3 = 0;
6725
6726 /* "View.MemoryView":289
6727 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6728 *
6729 * if buf is NULL: # <<<<<<<<<<<<<<
6730 * result = array.__new__(array, shape, itemsize, format, mode)
6731 * else:
6732*/
6733 goto __pyx_L3;
6734 }
6735
6736 /* "View.MemoryView":292
6737 * result = array.__new__(array, shape, itemsize, format, mode)
6738 * else:
6739 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
6740 * result.data = buf
6741 *
6742*/
6743 /*else*/ {
6744 __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
6745 __Pyx_GOTREF(__pyx_t_3);
6746 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6747 __Pyx_GOTREF(__pyx_t_4);
6748 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
6749 __Pyx_GOTREF(__pyx_t_1);
6750 __Pyx_INCREF(__pyx_v_shape);
6751 __Pyx_GIVEREF(__pyx_v_shape);
6752 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6753 __Pyx_GIVEREF(__pyx_t_3);
6754 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6755 __Pyx_GIVEREF(__pyx_t_4);
6756 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6757 __Pyx_INCREF(__pyx_v_mode);
6758 __Pyx_GIVEREF(__pyx_v_mode);
6759 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6760 __pyx_t_3 = 0;
6761 __pyx_t_4 = 0;
6762 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6763 __Pyx_GOTREF(__pyx_t_4);
6764 if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_allocate_buffer, Py_False) < (0)) __PYX_ERR(1, 292, __pyx_L1_error)
6765 __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
6766 __Pyx_GOTREF(__pyx_t_3);
6767 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6768 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6769 __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6770 __pyx_t_3 = 0;
6771
6772 /* "View.MemoryView":293
6773 * else:
6774 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6775 * result.data = buf # <<<<<<<<<<<<<<
6776 *
6777 * return result
6778*/
6779 __pyx_v_result->data = __pyx_v_buf;
6780 }
6781 __pyx_L3:;
6782
6783 /* "View.MemoryView":295
6784 * result.data = buf
6785 *
6786 * return result # <<<<<<<<<<<<<<
6787 *
6788 *
6789*/
6790 {
6791 struct __pyx_array_obj *__pyx_temp;
6792 {
6793 __pyx_temp = __pyx_r;
6794 __Pyx_INCREF((PyObject *)__pyx_v_result);
6795 __pyx_r = __pyx_v_result;
6796 }
6797 __Pyx_XDECREF((PyObject *)__pyx_temp);
6798 }
6799 goto __pyx_L0;
6800
6801 /* "View.MemoryView":284
6802 *
6803 *
6804 * @cname("__pyx_array_new") # <<<<<<<<<<<<<<
6805 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6806 * cdef array result
6807*/
6808
6809 /* function exit code */
6810 __pyx_L1_error:;
6811 __Pyx_XDECREF(__pyx_t_1);
6812 __Pyx_XDECREF(__pyx_t_3);
6813 __Pyx_XDECREF(__pyx_t_4);
6814 __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
6815 __pyx_r = 0;
6816 __pyx_L0:;
6817 __Pyx_XDECREF((PyObject *)__pyx_v_result);
6818 __Pyx_XDECREF(__pyx_v_mode);
6819 __Pyx_XGIVEREF((PyObject *)__pyx_r);
6820 __Pyx_RefNannyFinishContext();
6821 return __pyx_r;
6822}
6823
6824/* "View.MemoryView":321
6825 * cdef class Enum(object):
6826 * cdef object name
6827 * def __init__(self, name): # <<<<<<<<<<<<<<
6828 * self.name = name
6829 * def __repr__(self):
6830*/
6831
6832/* Python wrapper */
6833static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6834#if CYTHON_VECTORCALL_TPNEW
6835PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6836#else
6837PyObject *__pyx_args, PyObject *__pyx_kwds
6838#endif
6839); /*proto*/
6840static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6841#if CYTHON_VECTORCALL_TPNEW
6842PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6843#else
6844PyObject *__pyx_args, PyObject *__pyx_kwds
6845#endif
6846) {
6847 PyObject *__pyx_v_name = 0;
6848 #if !CYTHON_VECTORCALL_TPNEW
6849 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6850 #endif
6851 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6852 PyObject* values[1] = {0};
6853 int __pyx_lineno = 0;
6854 const char *__pyx_filename = NULL;
6855 int __pyx_clineno = 0;
6856 int __pyx_r;
6857 __Pyx_RefNannyDeclarations
6858 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
6859 #if !CYTHON_VECTORCALL_TPNEW
6860 #if CYTHON_ASSUME_SAFE_SIZE
6861 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6862 #else
6863 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
6864 #endif
6865 #endif
6866 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
6867 {
6868 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
6869 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
6870 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 321, __pyx_L3_error)
6871 if (__pyx_kwds_len > 0) {
6872 switch (__pyx_nargs) {
6873 case 1:
6874 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6875 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6876 CYTHON_FALLTHROUGH;
6877 case 0: break;
6878 default: goto __pyx_L5_argtuple_error;
6879 }
6880 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6881 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(1, 321, __pyx_L3_error)
6882 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6883 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(1, 321, __pyx_L3_error) }
6884 }
6885 } else if (unlikely(__pyx_nargs != 1)) {
6886 goto __pyx_L5_argtuple_error;
6887 } else {
6888 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6889 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6890 }
6891 __pyx_v_name = values[0];
6892 }
6893 goto __pyx_L6_skip;
6894 __pyx_L5_argtuple_error:;
6895 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 321, __pyx_L3_error)
6896 __pyx_L6_skip:;
6897 goto __pyx_L4_argument_unpacking_done;
6898 __pyx_L3_error:;
6899 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6900 Py_XDECREF(values[__pyx_temp]);
6901 }
6902 __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6903 __Pyx_RefNannyFinishContext();
6904 return -1;
6905 __pyx_L4_argument_unpacking_done:;
6906 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
6907
6908 /* function exit code */
6909 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6910 Py_XDECREF(values[__pyx_temp]);
6911 }
6912 __Pyx_RefNannyFinishContext();
6913 return __pyx_r;
6914}
6915
6916static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
6917 int __pyx_r;
6918 __Pyx_RefNannyDeclarations
6919 __Pyx_RefNannySetupContext("__init__", 0);
6920
6921 /* "View.MemoryView":322
6922 * cdef object name
6923 * def __init__(self, name):
6924 * self.name = name # <<<<<<<<<<<<<<
6925 * def __repr__(self):
6926 * return self.name
6927*/
6928 __Pyx_INCREF(__pyx_v_name);
6929 __Pyx_GIVEREF(__pyx_v_name);
6930 __Pyx_GOTREF(__pyx_v_self->name);
6931 __Pyx_DECREF(__pyx_v_self->name);
6932 __pyx_v_self->name = __pyx_v_name;
6933
6934 /* "View.MemoryView":321
6935 * cdef class Enum(object):
6936 * cdef object name
6937 * def __init__(self, name): # <<<<<<<<<<<<<<
6938 * self.name = name
6939 * def __repr__(self):
6940*/
6941
6942 /* function exit code */
6943 __pyx_r = 0;
6944
6945 __Pyx_RefNannyFinishContext();
6946 return __pyx_r;
6947}
6948
6949/* "View.MemoryView":323
6950 * def __init__(self, name):
6951 * self.name = name
6952 * def __repr__(self): # <<<<<<<<<<<<<<
6953 * return self.name
6954 *
6955*/
6956
6957/* Python wrapper */
6958static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
6959static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
6960 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6961 PyObject *__pyx_r = 0;
6962 __Pyx_RefNannyDeclarations
6963 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
6964 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6965 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6966
6967 /* function exit code */
6968 __Pyx_RefNannyFinishContext();
6969 return __pyx_r;
6970}
6971
6972static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6973 PyObject *__pyx_r = NULL;
6974 __Pyx_RefNannyDeclarations
6975 __Pyx_RefNannySetupContext("__repr__", 0);
6976
6977 /* "View.MemoryView":324
6978 * self.name = name
6979 * def __repr__(self):
6980 * return self.name # <<<<<<<<<<<<<<
6981 *
6982 * cdef generic = Enum("<strided and direct or indirect>")
6983*/
6984 {
6985 PyObject *__pyx_temp;
6986 {
6987 __pyx_temp = __pyx_r;
6988 __Pyx_INCREF(__pyx_v_self->name);
6989 __pyx_r = __pyx_v_self->name;
6990 }
6991 __Pyx_XDECREF(__pyx_temp);
6992 }
6993 goto __pyx_L0;
6994
6995 /* "View.MemoryView":323
6996 * def __init__(self, name):
6997 * self.name = name
6998 * def __repr__(self): # <<<<<<<<<<<<<<
6999 * return self.name
7000 *
7001*/
7002
7003 /* function exit code */
7004 __pyx_L0:;
7005 __Pyx_XGIVEREF(__pyx_r);
7006 __Pyx_RefNannyFinishContext();
7007 return __pyx_r;
7008}
7009
7010/* "(tree fragment)":1
7011 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7012 * cdef tuple state
7013 * cdef object _dict
7014*/
7015
7016/* Python wrapper */
7017static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7018#if CYTHON_VECTORCALL
7019PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7020#else
7021PyObject *__pyx_args, PyObject *__pyx_kwds
7022#endif
7023); /*proto*/
7024static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7025#if CYTHON_VECTORCALL
7026PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7027#else
7028PyObject *__pyx_args, PyObject *__pyx_kwds
7029#endif
7030) {
7031 #if !CYTHON_VECTORCALL
7032 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7033 #endif
7034 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7035 PyObject *__pyx_r = 0;
7036 __Pyx_RefNannyDeclarations
7037 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7038 #if !CYTHON_VECTORCALL
7039 #if CYTHON_ASSUME_SAFE_SIZE
7040 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7041 #else
7042 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7043 #endif
7044 #endif
7045 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7046 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
7047 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7048 if (unlikely(__pyx_kwds_len < 0)) return NULL;
7049 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
7050 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7051
7052 /* function exit code */
7053 __Pyx_RefNannyFinishContext();
7054 return __pyx_r;
7055}
7056
7057static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7058 PyObject *__pyx_v_state = 0;
7059 PyObject *__pyx_v__dict = 0;
7060 int __pyx_v_use_setstate;
7061 PyObject *__pyx_r = NULL;
7062 __Pyx_RefNannyDeclarations
7063 PyObject *__pyx_t_1 = NULL;
7064 PyObject *__pyx_t_2 = NULL;
7065 int __pyx_t_3;
7066 int __pyx_t_4;
7067 PyObject *__pyx_t_5 = NULL;
7068 int __pyx_lineno = 0;
7069 const char *__pyx_filename = NULL;
7070 int __pyx_clineno = 0;
7071 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7072
7073 /* "(tree fragment)":5
7074 * cdef object _dict
7075 * cdef bint use_setstate
7076 * with CRITICAL_SECTION(self): # <<<<<<<<<<<<<<
7077 * state = (self.name,)
7078 * _dict = getattr(self, '__dict__', None)
7079*/
7080 {
7081 __Pyx_PyCriticalSection __pyx_cs;
7082 __pyx_t_1 = ((PyObject *)__pyx_v_self);
7083 __Pyx_INCREF(__pyx_t_1);
7084 __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
7085 /*try:*/ {
7086
7087 /* "(tree fragment)":6
7088 * cdef bint use_setstate
7089 * with CRITICAL_SECTION(self):
7090 * state = (self.name,) # <<<<<<<<<<<<<<
7091 * _dict = getattr(self, '__dict__', None)
7092 * if _dict is not None and _dict:
7093*/
7094 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L4_error)
7095 __Pyx_GOTREF(__pyx_t_2);
7096 __Pyx_INCREF(__pyx_v_self->name);
7097 __Pyx_GIVEREF(__pyx_v_self->name);
7098 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name) != (0)) __PYX_ERR(1, 6, __pyx_L4_error);
7099 __pyx_v_state = ((PyObject*)__pyx_t_2);
7100 __pyx_t_2 = 0;
7101
7102 /* "(tree fragment)":7
7103 * with CRITICAL_SECTION(self):
7104 * state = (self.name,)
7105 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
7106 * if _dict is not None and _dict:
7107 * state += (_dict,)
7108*/
7109 __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L4_error)
7110 __Pyx_GOTREF(__pyx_t_2);
7111 __pyx_v__dict = __pyx_t_2;
7112 __pyx_t_2 = 0;
7113 }
7114
7115 /* "(tree fragment)":5
7116 * cdef object _dict
7117 * cdef bint use_setstate
7118 * with CRITICAL_SECTION(self): # <<<<<<<<<<<<<<
7119 * state = (self.name,)
7120 * _dict = getattr(self, '__dict__', None)
7121*/
7122 /*finally:*/ {
7123 /*normal exit:*/{
7124 __Pyx_PyCriticalSection_End(&__pyx_cs);
7125 goto __pyx_L5;
7126 }
7127 __pyx_L4_error: {
7128 __Pyx_PyCriticalSection_End(&__pyx_cs);
7129 goto __pyx_L1_error;
7130 }
7131 __pyx_L5:;
7132 }
7133 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7134 }
7135
7136 /* "(tree fragment)":8
7137 * state = (self.name,)
7138 * _dict = getattr(self, '__dict__', None)
7139 * if _dict is not None and _dict: # <<<<<<<<<<<<<<
7140 * state += (_dict,)
7141 * use_setstate = True
7142*/
7143 __pyx_t_4 = (__pyx_v__dict != Py_None);
7144 if (__pyx_t_4) {
7145
7146 } else {
7147
7148 __pyx_t_3 = __pyx_t_4;
7149
7150 goto __pyx_L7_bool_binop_done;
7151 }
7152 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 8, __pyx_L1_error)
7153
7154 __pyx_t_3 = __pyx_t_4;
7155
7156 __pyx_L7_bool_binop_done:;
7157 if (__pyx_t_3) {
7158
7159
7160 /* "(tree fragment)":9
7161 * _dict = getattr(self, '__dict__', None)
7162 * if _dict is not None and _dict:
7163 * state += (_dict,) # <<<<<<<<<<<<<<
7164 * use_setstate = True
7165 * else:
7166*/
7167 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
7168 __Pyx_GOTREF(__pyx_t_1);
7169 __Pyx_INCREF(__pyx_v__dict);
7170 __Pyx_GIVEREF(__pyx_v__dict);
7171 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 9, __pyx_L1_error);
7172 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
7173 __Pyx_GOTREF(__pyx_t_2);
7174 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7175 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
7176 __pyx_t_2 = 0;
7177
7178 /* "(tree fragment)":10
7179 * if _dict is not None and _dict:
7180 * state += (_dict,)
7181 * use_setstate = True # <<<<<<<<<<<<<<
7182 * else:
7183 * use_setstate = self.name is not None
7184*/
7185 __pyx_v_use_setstate = 1;
7186
7187 /* "(tree fragment)":8
7188 * state = (self.name,)
7189 * _dict = getattr(self, '__dict__', None)
7190 * if _dict is not None and _dict: # <<<<<<<<<<<<<<
7191 * state += (_dict,)
7192 * use_setstate = True
7193*/
7194 goto __pyx_L6;
7195 }
7196
7197 /* "(tree fragment)":12
7198 * use_setstate = True
7199 * else:
7200 * use_setstate = self.name is not None # <<<<<<<<<<<<<<
7201 * if use_setstate:
7202 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7203*/
7204 /*else*/ {
7205 __pyx_t_3 = (__pyx_v_self->name != Py_None);
7206 __pyx_v_use_setstate = __pyx_t_3;
7207 }
7208 __pyx_L6:;
7209
7210 /* "(tree fragment)":13
7211 * else:
7212 * use_setstate = self.name is not None
7213 * if use_setstate: # <<<<<<<<<<<<<<
7214 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7215 * else:
7216*/
7217 if (__pyx_v_use_setstate) {
7218
7219 /* "(tree fragment)":14
7220 * use_setstate = self.name is not None
7221 * if use_setstate:
7222 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
7223 * else:
7224 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7225*/
7226 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
7227 __Pyx_GOTREF(__pyx_t_2);
7228 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
7229 __Pyx_GOTREF(__pyx_t_1);
7230 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7231 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7232 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7233 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
7234 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
7235 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7236 __Pyx_INCREF(Py_None);
7237 __Pyx_GIVEREF(Py_None);
7238 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7239 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
7240 __Pyx_GOTREF(__pyx_t_5);
7241 __Pyx_GIVEREF(__pyx_t_2);
7242 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7243 __Pyx_GIVEREF(__pyx_t_1);
7244 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7245 __Pyx_INCREF(__pyx_v_state);
7246 __Pyx_GIVEREF(__pyx_v_state);
7247 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7248 __pyx_t_2 = 0;
7249 __pyx_t_1 = 0;
7250 {
7251 PyObject *__pyx_temp;
7252 {
7253 __pyx_temp = __pyx_r;
7254 __pyx_r = __pyx_t_5;
7255 }
7256 __Pyx_XDECREF(__pyx_temp);
7257 }
7258 __pyx_t_5 = 0;
7259 goto __pyx_L0;
7260
7261 /* "(tree fragment)":13
7262 * else:
7263 * use_setstate = self.name is not None
7264 * if use_setstate: # <<<<<<<<<<<<<<
7265 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7266 * else:
7267*/
7268 }
7269
7270 /* "(tree fragment)":16
7271 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7272 * else:
7273 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
7274 * def __setstate_cython__(self, __pyx_state):
7275 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7276*/
7277 /*else*/ {
7278 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 16, __pyx_L1_error)
7279 __Pyx_GOTREF(__pyx_t_5);
7280 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
7281 __Pyx_GOTREF(__pyx_t_1);
7282 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7283 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7284 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7285 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
7286 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
7287 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7288 __Pyx_INCREF(__pyx_v_state);
7289 __Pyx_GIVEREF(__pyx_v_state);
7290 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7291 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
7292 __Pyx_GOTREF(__pyx_t_2);
7293 __Pyx_GIVEREF(__pyx_t_5);
7294 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7295 __Pyx_GIVEREF(__pyx_t_1);
7296 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7297 __pyx_t_5 = 0;
7298 __pyx_t_1 = 0;
7299 {
7300 PyObject *__pyx_temp;
7301 {
7302 __pyx_temp = __pyx_r;
7303 __pyx_r = __pyx_t_2;
7304 }
7305 __Pyx_XDECREF(__pyx_temp);
7306 }
7307 __pyx_t_2 = 0;
7308 goto __pyx_L0;
7309 }
7310
7311 /* "(tree fragment)":1
7312 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7313 * cdef tuple state
7314 * cdef object _dict
7315*/
7316
7317 /* function exit code */
7318 __pyx_L1_error:;
7319 __Pyx_XDECREF(__pyx_t_1);
7320 __Pyx_XDECREF(__pyx_t_2);
7321 __Pyx_XDECREF(__pyx_t_5);
7322 __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7323 __pyx_r = NULL;
7324 __pyx_L0:;
7325 __Pyx_XDECREF(__pyx_v_state);
7326 __Pyx_XDECREF(__pyx_v__dict);
7327
7328 __Pyx_XGIVEREF(__pyx_r);
7329 __Pyx_RefNannyFinishContext();
7330 return __pyx_r;
7331}
7332
7333/* "(tree fragment)":17
7334 * else:
7335 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7336 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7337 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7338*/
7339
7340/* Python wrapper */
7341static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7342#if CYTHON_VECTORCALL
7343PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7344#else
7345PyObject *__pyx_args, PyObject *__pyx_kwds
7346#endif
7347); /*proto*/
7348static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7349#if CYTHON_VECTORCALL
7350PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7351#else
7352PyObject *__pyx_args, PyObject *__pyx_kwds
7353#endif
7354) {
7355 PyObject *__pyx_v___pyx_state = 0;
7356 #if !CYTHON_VECTORCALL
7357 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7358 #endif
7359 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7360 PyObject* values[1] = {0};
7361 int __pyx_lineno = 0;
7362 const char *__pyx_filename = NULL;
7363 int __pyx_clineno = 0;
7364 PyObject *__pyx_r = 0;
7365 __Pyx_RefNannyDeclarations
7366 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7367 #if !CYTHON_VECTORCALL
7368 #if CYTHON_ASSUME_SAFE_SIZE
7369 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7370 #else
7371 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7372 #endif
7373 #endif
7374 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7375 {
7376 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
7377 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7378 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 17, __pyx_L3_error)
7379 if (__pyx_kwds_len > 0) {
7380 switch (__pyx_nargs) {
7381 case 1:
7382 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7383 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7384 CYTHON_FALLTHROUGH;
7385 case 0: break;
7386 default: goto __pyx_L5_argtuple_error;
7387 }
7388 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7389 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 17, __pyx_L3_error)
7390 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
7391 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 17, __pyx_L3_error) }
7392 }
7393 } else if (unlikely(__pyx_nargs != 1)) {
7394 goto __pyx_L5_argtuple_error;
7395 } else {
7396 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7397 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7398 }
7399 __pyx_v___pyx_state = values[0];
7400 }
7401 goto __pyx_L6_skip;
7402 __pyx_L5_argtuple_error:;
7403 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 17, __pyx_L3_error)
7404 __pyx_L6_skip:;
7405 goto __pyx_L4_argument_unpacking_done;
7406 __pyx_L3_error:;
7407 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7408 Py_XDECREF(values[__pyx_temp]);
7409 }
7410 __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7411 __Pyx_RefNannyFinishContext();
7412 return NULL;
7413 __pyx_L4_argument_unpacking_done:;
7414 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
7415
7416 /* function exit code */
7417 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7418 Py_XDECREF(values[__pyx_temp]);
7419 }
7420 __Pyx_RefNannyFinishContext();
7421 return __pyx_r;
7422}
7423
7424static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7425 PyObject *__pyx_r = NULL;
7426 __Pyx_RefNannyDeclarations
7427 PyObject *__pyx_t_1 = NULL;
7428 PyObject *__pyx_t_2 = NULL;
7429 int __pyx_lineno = 0;
7430 const char *__pyx_filename = NULL;
7431 int __pyx_clineno = 0;
7432 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7433
7434 /* "(tree fragment)":18
7435 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7436 * def __setstate_cython__(self, __pyx_state):
7437 * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
7438*/
7439 __pyx_t_1 = __pyx_v___pyx_state;
7440 __Pyx_INCREF(__pyx_t_1);
7441 if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 18, __pyx_L1_error)
7442 if (unlikely(__pyx_t_1 == Py_None)) {
7443 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
7444 __PYX_ERR(1, 18, __pyx_L1_error)
7445 }
7446 __pyx_t_2 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 18, __pyx_L1_error)
7447 __Pyx_GOTREF(__pyx_t_2);
7448 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7449 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7450
7451 /* "(tree fragment)":17
7452 * else:
7453 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7454 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7455 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7456*/
7457
7458 /* function exit code */
7459 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7460 goto __pyx_L0;
7461 __pyx_L1_error:;
7462 __Pyx_XDECREF(__pyx_t_1);
7463 __Pyx_XDECREF(__pyx_t_2);
7464 __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7465 __pyx_r = NULL;
7466 __pyx_L0:;
7467 __Pyx_XGIVEREF(__pyx_r);
7468 __Pyx_RefNannyFinishContext();
7469 return __pyx_r;
7470}
7471
7472/* "View.MemoryView":367
7473 * cdef const __Pyx_TypeInfo *typeinfo
7474 *
7475 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7476 * self.obj = obj
7477 * self.flags = flags
7478*/
7479
7480/* Python wrapper */
7481static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7482#if CYTHON_VECTORCALL_TPNEW
7483PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7484#else
7485PyObject *__pyx_args, PyObject *__pyx_kwds
7486#endif
7487); /*proto*/
7488static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7489#if CYTHON_VECTORCALL_TPNEW
7490PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7491#else
7492PyObject *__pyx_args, PyObject *__pyx_kwds
7493#endif
7494) {
7495 PyObject *__pyx_v_obj = 0;
7496 int __pyx_v_flags;
7497 int __pyx_v_dtype_is_object;
7498 #if !CYTHON_VECTORCALL_TPNEW
7499 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7500 #endif
7501 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7502 PyObject* values[3] = {0,0,0};
7503 int __pyx_lineno = 0;
7504 const char *__pyx_filename = NULL;
7505 int __pyx_clineno = 0;
7506 int __pyx_r;
7507 __Pyx_RefNannyDeclarations
7508 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7509 #if !CYTHON_VECTORCALL_TPNEW
7510 #if CYTHON_ASSUME_SAFE_SIZE
7511 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7512 #else
7513 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7514 #endif
7515 #endif
7516 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
7517 {
7518 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_obj,&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_dtype_is_object,0};
7519 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
7520 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 367, __pyx_L3_error)
7521 if (__pyx_kwds_len > 0) {
7522 switch (__pyx_nargs) {
7523 case 3:
7524 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7525 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7526 CYTHON_FALLTHROUGH;
7527 case 2:
7528 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7529 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7530 CYTHON_FALLTHROUGH;
7531 case 1:
7532 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7533 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7534 CYTHON_FALLTHROUGH;
7535 case 0: break;
7536 default: goto __pyx_L5_argtuple_error;
7537 }
7538 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7539 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(1, 367, __pyx_L3_error)
7540 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
7541 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, i); __PYX_ERR(1, 367, __pyx_L3_error) }
7542 }
7543 } else {
7544 switch (__pyx_nargs) {
7545 case 3:
7546 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7547 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7548 CYTHON_FALLTHROUGH;
7549 case 2:
7550 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7551 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7552 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7553 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7554 break;
7555 default: goto __pyx_L5_argtuple_error;
7556 }
7557 }
7558 __pyx_v_obj = values[0];
7559 __pyx_v_flags = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 367, __pyx_L3_error)
7560 if (values[2]) {
7561 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 367, __pyx_L3_error)
7562 } else {
7563 __pyx_v_dtype_is_object = ((int)0);
7564 }
7565 }
7566 goto __pyx_L6_skip;
7567 __pyx_L5_argtuple_error:;
7568 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 367, __pyx_L3_error)
7569 __pyx_L6_skip:;
7570 goto __pyx_L4_argument_unpacking_done;
7571 __pyx_L3_error:;
7572 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7573 Py_XDECREF(values[__pyx_temp]);
7574 }
7575 __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7576 __Pyx_RefNannyFinishContext();
7577 return -1;
7578 __pyx_L4_argument_unpacking_done:;
7579 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
7580
7581 /* function exit code */
7582 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7583 Py_XDECREF(values[__pyx_temp]);
7584 }
7585
7586
7587 __Pyx_RefNannyFinishContext();
7588 return __pyx_r;
7589}
7590
7591static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
7592 int __pyx_r;
7593 __Pyx_RefNannyDeclarations
7594 int __pyx_t_1;
7595 int __pyx_t_2;
7596 int __pyx_t_3;
7597 int __pyx_lineno = 0;
7598 const char *__pyx_filename = NULL;
7599 int __pyx_clineno = 0;
7600 __Pyx_RefNannySetupContext("__cinit__", 0);
7601
7602 /* "View.MemoryView":368
7603 *
7604 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7605 * self.obj = obj # <<<<<<<<<<<<<<
7606 * self.flags = flags
7607 * if type(self) is memoryview or obj is not None:
7608*/
7609 __Pyx_INCREF(__pyx_v_obj);
7610 __Pyx_GIVEREF(__pyx_v_obj);
7611 __Pyx_GOTREF(__pyx_v_self->obj);
7612 __Pyx_DECREF(__pyx_v_self->obj);
7613 __pyx_v_self->obj = __pyx_v_obj;
7614
7615 /* "View.MemoryView":369
7616 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7617 * self.obj = obj
7618 * self.flags = flags # <<<<<<<<<<<<<<
7619 * if type(self) is memoryview or obj is not None:
7620 * PyObject_GetBuffer(obj, &self.view, flags)
7621*/
7622 __pyx_v_self->flags = __pyx_v_flags;
7623
7624 /* "View.MemoryView":370
7625 * self.obj = obj
7626 * self.flags = flags
7627 * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7628 * PyObject_GetBuffer(obj, &self.view, flags)
7629 * if <PyObject *> self.view.obj == NULL:
7630*/
7631 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type));
7632 if (!__pyx_t_2) {
7633
7634 } else {
7635
7636 __pyx_t_1 = __pyx_t_2;
7637
7638 goto __pyx_L4_bool_binop_done;
7639 }
7640 __pyx_t_2 = (__pyx_v_obj != Py_None);
7641
7642 __pyx_t_1 = __pyx_t_2;
7643
7644 __pyx_L4_bool_binop_done:;
7645 if (__pyx_t_1) {
7646
7647
7648 /* "View.MemoryView":371
7649 * self.flags = flags
7650 * if type(self) is memoryview or obj is not None:
7651 * PyObject_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
7652 * if <PyObject *> self.view.obj == NULL:
7653 * (<__pyx_buffer *> &self.view).obj = Py_None
7654*/
7655 __pyx_t_3 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 371, __pyx_L1_error)
7656
7657
7658 /* "View.MemoryView":372
7659 * if type(self) is memoryview or obj is not None:
7660 * PyObject_GetBuffer(obj, &self.view, flags)
7661 * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7662 * (<__pyx_buffer *> &self.view).obj = Py_None
7663 * Py_INCREF(Py_None)
7664*/
7665 __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
7666
7667 if (__pyx_t_1) {
7668
7669
7670 /* "View.MemoryView":373
7671 * PyObject_GetBuffer(obj, &self.view, flags)
7672 * if <PyObject *> self.view.obj == NULL:
7673 * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
7674 * Py_INCREF(Py_None)
7675 *
7676*/
7677 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7678
7679 /* "View.MemoryView":374
7680 * if <PyObject *> self.view.obj == NULL:
7681 * (<__pyx_buffer *> &self.view).obj = Py_None
7682 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7683 *
7684 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7685*/
7686 Py_INCREF(Py_None);
7687
7688 /* "View.MemoryView":372
7689 * if type(self) is memoryview or obj is not None:
7690 * PyObject_GetBuffer(obj, &self.view, flags)
7691 * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7692 * (<__pyx_buffer *> &self.view).obj = Py_None
7693 * Py_INCREF(Py_None)
7694*/
7695 }
7696
7697 /* "View.MemoryView":370
7698 * self.obj = obj
7699 * self.flags = flags
7700 * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7701 * PyObject_GetBuffer(obj, &self.view, flags)
7702 * if <PyObject *> self.view.obj == NULL:
7703*/
7704 }
7705
7706 /* "View.MemoryView":376
7707 * Py_INCREF(Py_None)
7708 *
7709 * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7710 * global __pyx_memoryview_thread_locks_used
7711 * if (__pyx_memoryview_thread_locks_used < 8 and
7712*/
7713 __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
7714
7715 if (__pyx_t_1) {
7716
7717
7718 /* "View.MemoryView":378
7719 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7720 * global __pyx_memoryview_thread_locks_used
7721 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
7722 *
7723 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7724*/
7725 __pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
7726
7727 if (__pyx_t_2) {
7728
7729 } else {
7730
7731 __pyx_t_1 = __pyx_t_2;
7732
7733 goto __pyx_L9_bool_binop_done;
7734 }
7735
7736 /* "View.MemoryView":380
7737 * if (__pyx_memoryview_thread_locks_used < 8 and
7738 *
7739 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()): # <<<<<<<<<<<<<<
7740 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7741 * __pyx_memoryview_thread_locks_used += 1
7742*/
7743 __pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
7744
7745
7746 __pyx_t_1 = __pyx_t_2;
7747
7748 __pyx_L9_bool_binop_done:;
7749
7750 /* "View.MemoryView":378
7751 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7752 * global __pyx_memoryview_thread_locks_used
7753 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
7754 *
7755 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7756*/
7757 if (__pyx_t_1) {
7758
7759
7760 /* "View.MemoryView":381
7761 *
7762 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7763 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
7764 * __pyx_memoryview_thread_locks_used += 1
7765 * if self.lock is NULL:
7766*/
7767 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7768
7769 /* "View.MemoryView":382
7770 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7771 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7772 * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
7773 * if self.lock is NULL:
7774 * self.lock = PyThread_allocate_lock()
7775*/
7776 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
7777
7778 /* "View.MemoryView":378
7779 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7780 * global __pyx_memoryview_thread_locks_used
7781 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
7782 *
7783 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7784*/
7785 }
7786
7787 /* "View.MemoryView":383
7788 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7789 * __pyx_memoryview_thread_locks_used += 1
7790 * if self.lock is NULL: # <<<<<<<<<<<<<<
7791 * self.lock = PyThread_allocate_lock()
7792 * if self.lock is NULL:
7793*/
7794 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7795
7796 if (__pyx_t_1) {
7797
7798
7799 /* "View.MemoryView":384
7800 * __pyx_memoryview_thread_locks_used += 1
7801 * if self.lock is NULL:
7802 * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
7803 * if self.lock is NULL:
7804 * raise MemoryError
7805*/
7806 __pyx_v_self->lock = PyThread_allocate_lock();
7807
7808 /* "View.MemoryView":385
7809 * if self.lock is NULL:
7810 * self.lock = PyThread_allocate_lock()
7811 * if self.lock is NULL: # <<<<<<<<<<<<<<
7812 * raise MemoryError
7813 *
7814*/
7815 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7816
7817 if (unlikely(__pyx_t_1)) {
7818
7819
7820 /* "View.MemoryView":386
7821 * self.lock = PyThread_allocate_lock()
7822 * if self.lock is NULL:
7823 * raise MemoryError # <<<<<<<<<<<<<<
7824 *
7825 * if flags & PyBUF_FORMAT:
7826*/
7827 PyErr_NoMemory(); __PYX_ERR(1, 386, __pyx_L1_error)
7828
7829 /* "View.MemoryView":385
7830 * if self.lock is NULL:
7831 * self.lock = PyThread_allocate_lock()
7832 * if self.lock is NULL: # <<<<<<<<<<<<<<
7833 * raise MemoryError
7834 *
7835*/
7836 }
7837
7838 /* "View.MemoryView":383
7839 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7840 * __pyx_memoryview_thread_locks_used += 1
7841 * if self.lock is NULL: # <<<<<<<<<<<<<<
7842 * self.lock = PyThread_allocate_lock()
7843 * if self.lock is NULL:
7844*/
7845 }
7846
7847 /* "View.MemoryView":376
7848 * Py_INCREF(Py_None)
7849 *
7850 * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7851 * global __pyx_memoryview_thread_locks_used
7852 * if (__pyx_memoryview_thread_locks_used < 8 and
7853*/
7854 }
7855
7856 /* "View.MemoryView":388
7857 * raise MemoryError
7858 *
7859 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7860 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7861 * else:
7862*/
7863 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7864
7865 if (__pyx_t_1) {
7866
7867
7868 /* "View.MemoryView":389
7869 *
7870 * if flags & PyBUF_FORMAT:
7871 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
7872 * else:
7873 * self.dtype_is_object = dtype_is_object
7874*/
7875 __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
7876
7877 if (__pyx_t_2) {
7878
7879 } else {
7880
7881 __pyx_t_1 = __pyx_t_2;
7882
7883 goto __pyx_L14_bool_binop_done;
7884 }
7885 __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
7886
7887
7888 __pyx_t_1 = __pyx_t_2;
7889
7890 __pyx_L14_bool_binop_done:;
7891 __pyx_v_self->dtype_is_object = __pyx_t_1;
7892
7893 /* "View.MemoryView":388
7894 * raise MemoryError
7895 *
7896 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7897 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7898 * else:
7899*/
7900 goto __pyx_L13;
7901 }
7902
7903 /* "View.MemoryView":391
7904 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7905 * else:
7906 * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
7907 *
7908 * with cython.cdivision(True):
7909*/
7910 /*else*/ {
7911 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
7912 }
7913 __pyx_L13:;
7914
7915 /* "View.MemoryView":394
7916 *
7917 * with cython.cdivision(True):
7918 * assert <uintptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
7919 * self.typeinfo = NULL
7920 *
7921*/
7922 #ifndef CYTHON_WITHOUT_ASSERTIONS
7923 if (unlikely(__pyx_assertions_enabled())) {
7924 __pyx_t_1 = ((((__pyx_uintptr_t)(&__pyx_v_self->acquisition_count)) % (sizeof(__pyx_atomic_int_type))) == 0);
7925
7926 if (unlikely(!__pyx_t_1)) {
7927 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
7928 __PYX_ERR(1, 394, __pyx_L1_error)
7929 }
7930
7931 }
7932 #else
7933 if ((1)); else __PYX_ERR(1, 394, __pyx_L1_error)
7934 #endif
7935
7936 /* "View.MemoryView":395
7937 * with cython.cdivision(True):
7938 * assert <uintptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
7939 * self.typeinfo = NULL # <<<<<<<<<<<<<<
7940 *
7941 * def __dealloc__(memoryview self):
7942*/
7943 __pyx_v_self->typeinfo = NULL;
7944
7945 /* "View.MemoryView":367
7946 * cdef const __Pyx_TypeInfo *typeinfo
7947 *
7948 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7949 * self.obj = obj
7950 * self.flags = flags
7951*/
7952
7953 /* function exit code */
7954 __pyx_r = 0;
7955 goto __pyx_L0;
7956 __pyx_L1_error:;
7957 __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7958 __pyx_r = -1;
7959 __pyx_L0:;
7960
7961 __Pyx_RefNannyFinishContext();
7962 return __pyx_r;
7963}
7964
7965/* "View.MemoryView":397
7966 * self.typeinfo = NULL
7967 *
7968 * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
7969 * if self.obj is not None:
7970 * PyBuffer_Release(&self.view)
7971*/
7972
7973/* Python wrapper */
7974static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
7975static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
7976 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7977 __Pyx_RefNannyDeclarations
7978 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7979 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7980 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
7981
7982 /* function exit code */
7983 __Pyx_RefNannyFinishContext();
7984}
7985
7986static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
7987 int __pyx_v_i;
7988 int __pyx_t_1;
7989 Py_ssize_t __pyx_t_2;
7990 Py_ssize_t __pyx_t_3;
7991 int __pyx_t_4;
7992 PyThread_type_lock __pyx_t_5;
7993 PyThread_type_lock __pyx_t_6;
7994
7995 /* "View.MemoryView":398
7996 *
7997 * def __dealloc__(memoryview self):
7998 * if self.obj is not None: # <<<<<<<<<<<<<<
7999 * PyBuffer_Release(&self.view)
8000 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8001*/
8002 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
8003 if (__pyx_t_1) {
8004
8005
8006 /* "View.MemoryView":399
8007 * def __dealloc__(memoryview self):
8008 * if self.obj is not None:
8009 * PyBuffer_Release(&self.view) # <<<<<<<<<<<<<<
8010 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8011 *
8012*/
8013 PyBuffer_Release((&__pyx_v_self->view));
8014
8015 /* "View.MemoryView":398
8016 *
8017 * def __dealloc__(memoryview self):
8018 * if self.obj is not None: # <<<<<<<<<<<<<<
8019 * PyBuffer_Release(&self.view)
8020 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8021*/
8022 goto __pyx_L3;
8023 }
8024
8025 /* "View.MemoryView":400
8026 * if self.obj is not None:
8027 * PyBuffer_Release(&self.view)
8028 * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8029 *
8030 * (<__pyx_buffer *> &self.view).obj = NULL
8031*/
8032 __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
8033
8034 if (__pyx_t_1) {
8035
8036
8037 /* "View.MemoryView":402
8038 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8039 *
8040 * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
8041 * Py_DECREF(Py_None)
8042 *
8043*/
8044 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
8045
8046 /* "View.MemoryView":403
8047 *
8048 * (<__pyx_buffer *> &self.view).obj = NULL
8049 * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
8050 *
8051 * cdef int i
8052*/
8053 Py_DECREF(Py_None);
8054
8055 /* "View.MemoryView":400
8056 * if self.obj is not None:
8057 * PyBuffer_Release(&self.view)
8058 * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8059 *
8060 * (<__pyx_buffer *> &self.view).obj = NULL
8061*/
8062 }
8063 __pyx_L3:;
8064
8065 /* "View.MemoryView":407
8066 * cdef int i
8067 * global __pyx_memoryview_thread_locks_used
8068 * if self.lock != NULL: # <<<<<<<<<<<<<<
8069 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8070 * if __pyx_memoryview_thread_locks[i] is self.lock:
8071*/
8072 __pyx_t_1 = (__pyx_v_self->lock != NULL);
8073
8074 if (__pyx_t_1) {
8075
8076
8077 /* "View.MemoryView":408
8078 * global __pyx_memoryview_thread_locks_used
8079 * if self.lock != NULL:
8080 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
8081 * if __pyx_memoryview_thread_locks[i] is self.lock:
8082 * __pyx_memoryview_thread_locks_used -= 1
8083*/
8084 __pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
8085
8086 if (__pyx_t_1) {
8087
8088 __pyx_t_2 = 0;
8089 } else {
8090
8091 __pyx_t_2 = __pyx_memoryview_thread_locks_used;
8092 }
8093
8094 __pyx_t_3 = __pyx_t_2;
8095
8096 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
8097 __pyx_v_i = __pyx_t_4;
8098
8099 /* "View.MemoryView":409
8100 * if self.lock != NULL:
8101 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8102 * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8103 * __pyx_memoryview_thread_locks_used -= 1
8104 * if i != __pyx_memoryview_thread_locks_used:
8105*/
8106 __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
8107
8108 if (__pyx_t_1) {
8109
8110
8111 /* "View.MemoryView":410
8112 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8113 * if __pyx_memoryview_thread_locks[i] is self.lock:
8114 * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
8115 * if i != __pyx_memoryview_thread_locks_used:
8116 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8117*/
8118 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8119
8120 /* "View.MemoryView":411
8121 * if __pyx_memoryview_thread_locks[i] is self.lock:
8122 * __pyx_memoryview_thread_locks_used -= 1
8123 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8124 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8125 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8126*/
8127 __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
8128
8129 if (__pyx_t_1) {
8130
8131
8132 /* "View.MemoryView":413
8133 * if i != __pyx_memoryview_thread_locks_used:
8134 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8135 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
8136 * break
8137 * else:
8138*/
8139 __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8140
8141 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8142
8143
8144 /* "View.MemoryView":412
8145 * __pyx_memoryview_thread_locks_used -= 1
8146 * if i != __pyx_memoryview_thread_locks_used:
8147 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
8148 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8149 * break
8150*/
8151 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
8152
8153 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
8154
8155
8156 /* "View.MemoryView":411
8157 * if __pyx_memoryview_thread_locks[i] is self.lock:
8158 * __pyx_memoryview_thread_locks_used -= 1
8159 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8160 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8161 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8162*/
8163 }
8164
8165 /* "View.MemoryView":414
8166 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8167 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8168 * break # <<<<<<<<<<<<<<
8169 * else:
8170 * PyThread_free_lock(self.lock)
8171*/
8172 goto __pyx_L6_break;
8173
8174 /* "View.MemoryView":409
8175 * if self.lock != NULL:
8176 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8177 * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8178 * __pyx_memoryview_thread_locks_used -= 1
8179 * if i != __pyx_memoryview_thread_locks_used:
8180*/
8181 }
8182 }
8183 /*else*/ {
8184
8185 /* "View.MemoryView":416
8186 * break
8187 * else:
8188 * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
8189 *
8190 *
8191*/
8192 PyThread_free_lock(__pyx_v_self->lock);
8193 }
8194 __pyx_L6_break:;
8195
8196
8197
8198 /* "View.MemoryView":407
8199 * cdef int i
8200 * global __pyx_memoryview_thread_locks_used
8201 * if self.lock != NULL: # <<<<<<<<<<<<<<
8202 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8203 * if __pyx_memoryview_thread_locks[i] is self.lock:
8204*/
8205 }
8206
8207 /* "View.MemoryView":397
8208 * self.typeinfo = NULL
8209 *
8210 * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8211 * if self.obj is not None:
8212 * PyBuffer_Release(&self.view)
8213*/
8214
8215 /* function exit code */
8216
8217
8218}
8219
8220/* "View.MemoryView":419
8221 *
8222 *
8223 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL: # <<<<<<<<<<<<<<
8224 * cdef Py_ssize_t dim
8225 * cdef char *itemp = <char *> self.view.buf
8226*/
8227
8228static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8229 Py_ssize_t __pyx_v_dim;
8230 char *__pyx_v_itemp;
8231 PyObject *__pyx_v_idx = NULL;
8232 char *__pyx_r;
8233 __Pyx_RefNannyDeclarations
8234 Py_ssize_t __pyx_t_1;
8235 PyObject *__pyx_t_2 = NULL;
8236 Py_ssize_t __pyx_t_3;
8237 PyObject *__pyx_t_4 = NULL;
8238 Py_ssize_t __pyx_t_5;
8239 char *__pyx_t_6;
8240 int __pyx_lineno = 0;
8241 const char *__pyx_filename = NULL;
8242 int __pyx_clineno = 0;
8243 __Pyx_RefNannySetupContext("get_item_pointer", 0);
8244
8245 /* "View.MemoryView":421
8246 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL:
8247 * cdef Py_ssize_t dim
8248 * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
8249 *
8250 * for dim, idx in enumerate(index):
8251*/
8252 __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
8253
8254 /* "View.MemoryView":423
8255 * cdef char *itemp = <char *> self.view.buf
8256 *
8257 * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8258 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8259 *
8260*/
8261
8262 __pyx_t_1 = 0;
8263 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
8264 __pyx_t_3 = 0;
8265 for (;;) {
8266 {
8267 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
8268 #if !CYTHON_ASSUME_SAFE_SIZE
8269 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 423, __pyx_L1_error)
8270 #endif
8271 if (__pyx_t_3 >= __pyx_temp) break;
8272 }
8273 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8274 __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
8275 #else
8276 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
8277 #endif
8278 ++__pyx_t_3;
8279 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
8280 __Pyx_GOTREF(__pyx_t_4);
8281 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
8282 __pyx_t_4 = 0;
8283 __pyx_v_dim = __pyx_t_1;
8284 __pyx_t_1 = (__pyx_t_1 + 1);
8285
8286 /* "View.MemoryView":424
8287 *
8288 * for dim, idx in enumerate(index):
8289 * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
8290 *
8291 * return itemp
8292*/
8293 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 424, __pyx_L1_error)
8294 __pyx_t_6 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_5, __pyx_v_dim); if (unlikely(__pyx_t_6 == ((void *)NULL))) __PYX_ERR(1, 424, __pyx_L1_error)
8295 __pyx_v_itemp = __pyx_t_6;
8296
8297
8298 /* "View.MemoryView":423
8299 * cdef char *itemp = <char *> self.view.buf
8300 *
8301 * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8302 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8303 *
8304*/
8305 }
8306 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8307
8308 /* "View.MemoryView":426
8309 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8310 *
8311 * return itemp # <<<<<<<<<<<<<<
8312 *
8313 *
8314*/
8315 {
8316
8317 __pyx_r = __pyx_v_itemp;
8318 }
8319 goto __pyx_L0;
8320
8321 /* "View.MemoryView":419
8322 *
8323 *
8324 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL: # <<<<<<<<<<<<<<
8325 * cdef Py_ssize_t dim
8326 * cdef char *itemp = <char *> self.view.buf
8327*/
8328
8329 /* function exit code */
8330 __pyx_L1_error:;
8331 __Pyx_XDECREF(__pyx_t_2);
8332 __Pyx_XDECREF(__pyx_t_4);
8333 __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8334 __pyx_r = NULL;
8335 __pyx_L0:;
8336
8337
8338 __Pyx_XDECREF(__pyx_v_idx);
8339
8340 __Pyx_RefNannyFinishContext();
8341 return __pyx_r;
8342}
8343
8344/* "View.MemoryView":429
8345 *
8346 *
8347 * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8348 * cdef char *buffer
8349 * if self.view.ndim == 1 and isinstance(index, int):
8350*/
8351
8352/* Python wrapper */
8353static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
8354static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8355 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8356 PyObject *__pyx_r = 0;
8357 __Pyx_RefNannyDeclarations
8358 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8359 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8360 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8361
8362 /* function exit code */
8363 __Pyx_RefNannyFinishContext();
8364 return __pyx_r;
8365}
8366
8367static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8368 char *__pyx_v_buffer;
8369 int __pyx_v_have_slices;
8370 PyObject *__pyx_v_indices = NULL;
8371 char *__pyx_v_itemp;
8372 PyObject *__pyx_r = NULL;
8373 __Pyx_RefNannyDeclarations
8374 int __pyx_t_1;
8375 int __pyx_t_2;
8376 Py_ssize_t __pyx_t_3;
8377 char *__pyx_t_4;
8378 PyObject *__pyx_t_5 = NULL;
8379 PyObject *__pyx_t_6 = NULL;
8380 PyObject *__pyx_t_7 = NULL;
8381 int __pyx_lineno = 0;
8382 const char *__pyx_filename = NULL;
8383 int __pyx_clineno = 0;
8384 __Pyx_RefNannySetupContext("__getitem__", 0);
8385
8386 /* "View.MemoryView":431
8387 * def __getitem__(memoryview self, object index):
8388 * cdef char *buffer
8389 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8390 * buffer = <char *> self.view.buf
8391 * return self.convert_item_to_object(
8392*/
8393 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8394
8395 if (__pyx_t_2) {
8396
8397 } else {
8398
8399 __pyx_t_1 = __pyx_t_2;
8400
8401 goto __pyx_L4_bool_binop_done;
8402 }
8403 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8404
8405 __pyx_t_1 = __pyx_t_2;
8406
8407 __pyx_L4_bool_binop_done:;
8408 if (__pyx_t_1) {
8409
8410
8411 /* "View.MemoryView":432
8412 * cdef char *buffer
8413 * if self.view.ndim == 1 and isinstance(index, int):
8414 * buffer = <char *> self.view.buf # <<<<<<<<<<<<<<
8415 * return self.convert_item_to_object(
8416 * pybuffer_index(&self.view, buffer, index, 0))
8417*/
8418 __pyx_v_buffer = ((char *)__pyx_v_self->view.buf);
8419
8420 /* "View.MemoryView":434
8421 * buffer = <char *> self.view.buf
8422 * return self.convert_item_to_object(
8423 * pybuffer_index(&self.view, buffer, index, 0)) # <<<<<<<<<<<<<<
8424 *
8425 * if index is Ellipsis:
8426*/
8427 __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 434, __pyx_L1_error)
8428 __pyx_t_4 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_buffer, __pyx_t_3, 0); if (unlikely(__pyx_t_4 == ((void *)NULL))) __PYX_ERR(1, 434, __pyx_L1_error)
8429
8430 /* "View.MemoryView":433
8431 * if self.view.ndim == 1 and isinstance(index, int):
8432 * buffer = <char *> self.view.buf
8433 * return self.convert_item_to_object( # <<<<<<<<<<<<<<
8434 * pybuffer_index(&self.view, buffer, index, 0))
8435 *
8436*/
8437 __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 433, __pyx_L1_error)
8438 __Pyx_GOTREF(__pyx_t_5);
8439
8440
8441 {
8442 PyObject *__pyx_temp;
8443 {
8444 __pyx_temp = __pyx_r;
8445 __pyx_r = __pyx_t_5;
8446 }
8447 __Pyx_XDECREF(__pyx_temp);
8448 }
8449 __pyx_t_5 = 0;
8450 goto __pyx_L0;
8451
8452 /* "View.MemoryView":431
8453 * def __getitem__(memoryview self, object index):
8454 * cdef char *buffer
8455 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8456 * buffer = <char *> self.view.buf
8457 * return self.convert_item_to_object(
8458*/
8459 }
8460
8461 /* "View.MemoryView":436
8462 * pybuffer_index(&self.view, buffer, index, 0))
8463 *
8464 * if index is Ellipsis: # <<<<<<<<<<<<<<
8465 * return self
8466 *
8467*/
8468 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8469 if (__pyx_t_1) {
8470
8471
8472 /* "View.MemoryView":437
8473 *
8474 * if index is Ellipsis:
8475 * return self # <<<<<<<<<<<<<<
8476 *
8477 * have_slices, indices = _unellipsify(index, self.view.ndim)
8478*/
8479 {
8480 PyObject *__pyx_temp;
8481 {
8482 __pyx_temp = __pyx_r;
8483 __Pyx_INCREF((PyObject *)__pyx_v_self);
8484 __pyx_r = ((PyObject *)__pyx_v_self);
8485 }
8486 __Pyx_XDECREF(__pyx_temp);
8487 }
8488 goto __pyx_L0;
8489
8490 /* "View.MemoryView":436
8491 * pybuffer_index(&self.view, buffer, index, 0))
8492 *
8493 * if index is Ellipsis: # <<<<<<<<<<<<<<
8494 * return self
8495 *
8496*/
8497 }
8498
8499 /* "View.MemoryView":439
8500 * return self
8501 *
8502 * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8503 *
8504 * cdef char *itemp
8505*/
8506 __pyx_t_5 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 439, __pyx_L1_error)
8507 __Pyx_GOTREF(__pyx_t_5);
8508 if (likely(__pyx_t_5 != Py_None)) {
8509 PyObject* sequence = __pyx_t_5;
8510 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8511 if (unlikely(size != 2)) {
8512 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8513 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8514 __PYX_ERR(1, 439, __pyx_L1_error)
8515 }
8516 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8517 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
8518 __Pyx_INCREF(__pyx_t_6);
8519 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
8520 __Pyx_INCREF(__pyx_t_7);
8521 #else
8522 __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 439, __pyx_L1_error)
8523 __Pyx_GOTREF(__pyx_t_6);
8524 __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L1_error)
8525 __Pyx_GOTREF(__pyx_t_7);
8526 #endif
8527 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8528 } else {
8529 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 439, __pyx_L1_error)
8530 }
8531 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 439, __pyx_L1_error)
8532 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8533 if (!(likely(PyTuple_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_7))) __PYX_ERR(1, 439, __pyx_L1_error)
8534 __pyx_v_have_slices = __pyx_t_1;
8535 __pyx_v_indices = ((PyObject*)__pyx_t_7);
8536 __pyx_t_7 = 0;
8537
8538 /* "View.MemoryView":442
8539 *
8540 * cdef char *itemp
8541 * if have_slices: # <<<<<<<<<<<<<<
8542 * return memview_slice(self, indices)
8543 * else:
8544*/
8545 if (__pyx_v_have_slices) {
8546
8547 /* "View.MemoryView":443
8548 * cdef char *itemp
8549 * if have_slices:
8550 * return memview_slice(self, indices) # <<<<<<<<<<<<<<
8551 * else:
8552 * itemp = memoryview.get_item_pointer(self, <tuple> indices)
8553*/
8554 __pyx_t_5 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 443, __pyx_L1_error)
8555 __Pyx_GOTREF(__pyx_t_5);
8556 {
8557 PyObject *__pyx_temp;
8558 {
8559 __pyx_temp = __pyx_r;
8560 __pyx_r = __pyx_t_5;
8561 }
8562 __Pyx_XDECREF(__pyx_temp);
8563 }
8564 __pyx_t_5 = 0;
8565 goto __pyx_L0;
8566
8567 /* "View.MemoryView":442
8568 *
8569 * cdef char *itemp
8570 * if have_slices: # <<<<<<<<<<<<<<
8571 * return memview_slice(self, indices)
8572 * else:
8573*/
8574 }
8575
8576 /* "View.MemoryView":445
8577 * return memview_slice(self, indices)
8578 * else:
8579 * itemp = memoryview.get_item_pointer(self, <tuple> indices) # <<<<<<<<<<<<<<
8580 * return self.convert_item_to_object(itemp)
8581 *
8582*/
8583 /*else*/ {
8584 if (unlikely(__pyx_v_indices == Py_None)) {
8585 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
8586 __PYX_ERR(1, 445, __pyx_L1_error)
8587 }
8588 __pyx_t_4 = __pyx_memoryview_get_item_pointer(__pyx_v_self, ((PyObject*)__pyx_v_indices)); if (unlikely(__pyx_t_4 == ((void *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
8589 __pyx_v_itemp = __pyx_t_4;
8590
8591 /* "View.MemoryView":446
8592 * else:
8593 * itemp = memoryview.get_item_pointer(self, <tuple> indices)
8594 * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
8595 *
8596 * def __setitem__(memoryview self, object index, object value):
8597*/
8598 __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 446, __pyx_L1_error)
8599 __Pyx_GOTREF(__pyx_t_5);
8600 {
8601 PyObject *__pyx_temp;
8602 {
8603 __pyx_temp = __pyx_r;
8604 __pyx_r = __pyx_t_5;
8605 }
8606 __Pyx_XDECREF(__pyx_temp);
8607 }
8608 __pyx_t_5 = 0;
8609 goto __pyx_L0;
8610 }
8611
8612 /* "View.MemoryView":429
8613 *
8614 *
8615 * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8616 * cdef char *buffer
8617 * if self.view.ndim == 1 and isinstance(index, int):
8618*/
8619
8620 /* function exit code */
8621 __pyx_L1_error:;
8622 __Pyx_XDECREF(__pyx_t_5);
8623 __Pyx_XDECREF(__pyx_t_6);
8624 __Pyx_XDECREF(__pyx_t_7);
8625 __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8626 __pyx_r = NULL;
8627 __pyx_L0:;
8628
8629
8630 __Pyx_XDECREF(__pyx_v_indices);
8631
8632 __Pyx_XGIVEREF(__pyx_r);
8633 __Pyx_RefNannyFinishContext();
8634 return __pyx_r;
8635}
8636
8637/* "View.MemoryView":448
8638 * return self.convert_item_to_object(itemp)
8639 *
8640 * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8641 * if self.view.readonly:
8642 * raise TypeError, "Cannot assign to read-only memoryview"
8643*/
8644
8645/* Python wrapper */
8646static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
8647static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8648 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8649 int __pyx_r;
8650 __Pyx_RefNannyDeclarations
8651 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8652 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8653 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
8654
8655 /* function exit code */
8656 __Pyx_RefNannyFinishContext();
8657 return __pyx_r;
8658}
8659
8660static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8661 int __pyx_v_have_slices;
8662 PyObject *__pyx_v_indices = NULL;
8663 PyObject *__pyx_v_obj = NULL;
8664 struct __pyx_memoryview_obj *__pyx_v_target_slice = NULL;
8665 int __pyx_r;
8666 __Pyx_RefNannyDeclarations
8667 int __pyx_t_1;
8668 int __pyx_t_2;
8669 PyObject *__pyx_t_3 = NULL;
8670 PyObject *__pyx_t_4 = NULL;
8671 PyObject *__pyx_t_5 = NULL;
8672 int __pyx_lineno = 0;
8673 const char *__pyx_filename = NULL;
8674 int __pyx_clineno = 0;
8675 __Pyx_RefNannySetupContext("__setitem__", 0);
8676
8677 /* "View.MemoryView":449
8678 *
8679 * def __setitem__(memoryview self, object index, object value):
8680 * if self.view.readonly: # <<<<<<<<<<<<<<
8681 * raise TypeError, "Cannot assign to read-only memoryview"
8682 *
8683*/
8684 if (unlikely(__pyx_v_self->view.readonly)) {
8685
8686 /* "View.MemoryView":450
8687 * def __setitem__(memoryview self, object index, object value):
8688 * if self.view.readonly:
8689 * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
8690 *
8691 * if self.view.ndim == 1 and isinstance(index, int):
8692*/
8693 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_read_only_memor, 0, 0);
8694 __PYX_ERR(1, 450, __pyx_L1_error)
8695
8696 /* "View.MemoryView":449
8697 *
8698 * def __setitem__(memoryview self, object index, object value):
8699 * if self.view.readonly: # <<<<<<<<<<<<<<
8700 * raise TypeError, "Cannot assign to read-only memoryview"
8701 *
8702*/
8703 }
8704
8705 /* "View.MemoryView":452
8706 * raise TypeError, "Cannot assign to read-only memoryview"
8707 *
8708 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8709 * memoryview.setitem_indexed1(self, index, value)
8710 * return
8711*/
8712 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8713
8714 if (__pyx_t_2) {
8715
8716 } else {
8717
8718 __pyx_t_1 = __pyx_t_2;
8719
8720 goto __pyx_L5_bool_binop_done;
8721 }
8722 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8723
8724 __pyx_t_1 = __pyx_t_2;
8725
8726 __pyx_L5_bool_binop_done:;
8727 if (__pyx_t_1) {
8728
8729
8730 /* "View.MemoryView":453
8731 *
8732 * if self.view.ndim == 1 and isinstance(index, int):
8733 * memoryview.setitem_indexed1(self, index, value) # <<<<<<<<<<<<<<
8734 * return
8735 *
8736*/
8737 __pyx_t_3 = __pyx_memoryview_setitem_indexed1(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 453, __pyx_L1_error)
8738 __Pyx_GOTREF(__pyx_t_3);
8739 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8740
8741 /* "View.MemoryView":454
8742 * if self.view.ndim == 1 and isinstance(index, int):
8743 * memoryview.setitem_indexed1(self, index, value)
8744 * return # <<<<<<<<<<<<<<
8745 *
8746 * have_slices, indices = _unellipsify(index, self.view.ndim)
8747*/
8748 {
8749 __pyx_r = 0;
8750 }
8751 goto __pyx_L0;
8752
8753 /* "View.MemoryView":452
8754 * raise TypeError, "Cannot assign to read-only memoryview"
8755 *
8756 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8757 * memoryview.setitem_indexed1(self, index, value)
8758 * return
8759*/
8760 }
8761
8762 /* "View.MemoryView":456
8763 * return
8764 *
8765 * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8766 *
8767 * if have_slices:
8768*/
8769 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 456, __pyx_L1_error)
8770 __Pyx_GOTREF(__pyx_t_3);
8771 if (likely(__pyx_t_3 != Py_None)) {
8772 PyObject* sequence = __pyx_t_3;
8773 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8774 if (unlikely(size != 2)) {
8775 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8776 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8777 __PYX_ERR(1, 456, __pyx_L1_error)
8778 }
8779 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8780 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
8781 __Pyx_INCREF(__pyx_t_4);
8782 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
8783 __Pyx_INCREF(__pyx_t_5);
8784 #else
8785 __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 456, __pyx_L1_error)
8786 __Pyx_GOTREF(__pyx_t_4);
8787 __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error)
8788 __Pyx_GOTREF(__pyx_t_5);
8789 #endif
8790 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8791 } else {
8792 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 456, __pyx_L1_error)
8793 }
8794 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 456, __pyx_L1_error)
8795 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8796 if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_5))) __PYX_ERR(1, 456, __pyx_L1_error)
8797 __pyx_v_have_slices = __pyx_t_1;
8798 __pyx_v_indices = ((PyObject*)__pyx_t_5);
8799 __pyx_t_5 = 0;
8800
8801 /* "View.MemoryView":458
8802 * have_slices, indices = _unellipsify(index, self.view.ndim)
8803 *
8804 * if have_slices: # <<<<<<<<<<<<<<
8805 * obj = memoryview.is_slice(self, value)
8806 * target_slice = memview_slice(self, indices)
8807*/
8808 if (__pyx_v_have_slices) {
8809
8810 /* "View.MemoryView":459
8811 *
8812 * if have_slices:
8813 * obj = memoryview.is_slice(self, value) # <<<<<<<<<<<<<<
8814 * target_slice = memview_slice(self, indices)
8815 * if obj is not None:
8816*/
8817 __pyx_t_3 = __pyx_memoryview_is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 459, __pyx_L1_error)
8818 __Pyx_GOTREF(__pyx_t_3);
8819 __pyx_v_obj = __pyx_t_3;
8820 __pyx_t_3 = 0;
8821
8822 /* "View.MemoryView":460
8823 * if have_slices:
8824 * obj = memoryview.is_slice(self, value)
8825 * target_slice = memview_slice(self, indices) # <<<<<<<<<<<<<<
8826 * if obj is not None:
8827 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8828*/
8829 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 460, __pyx_L1_error)
8830 __Pyx_GOTREF(__pyx_t_3);
8831 __pyx_v_target_slice = ((struct __pyx_memoryview_obj *)__pyx_t_3);
8832 __pyx_t_3 = 0;
8833
8834 /* "View.MemoryView":461
8835 * obj = memoryview.is_slice(self, value)
8836 * target_slice = memview_slice(self, indices)
8837 * if obj is not None: # <<<<<<<<<<<<<<
8838 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8839 * else:
8840*/
8841 __pyx_t_1 = (__pyx_v_obj != Py_None);
8842 if (__pyx_t_1) {
8843
8844
8845 /* "View.MemoryView":462
8846 * target_slice = memview_slice(self, indices)
8847 * if obj is not None:
8848 * memoryview.setitem_slice_assignment(self, target_slice, obj) # <<<<<<<<<<<<<<
8849 * else:
8850 * memoryview.setitem_slice_assign_scalar(self, target_slice, value)
8851*/
8852 __pyx_t_3 = __pyx_memoryview_setitem_slice_assignment(__pyx_v_self, ((PyObject *)__pyx_v_target_slice), __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 462, __pyx_L1_error)
8853 __Pyx_GOTREF(__pyx_t_3);
8854 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8855
8856 /* "View.MemoryView":461
8857 * obj = memoryview.is_slice(self, value)
8858 * target_slice = memview_slice(self, indices)
8859 * if obj is not None: # <<<<<<<<<<<<<<
8860 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8861 * else:
8862*/
8863 goto __pyx_L8;
8864 }
8865
8866 /* "View.MemoryView":464
8867 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8868 * else:
8869 * memoryview.setitem_slice_assign_scalar(self, target_slice, value) # <<<<<<<<<<<<<<
8870 * else:
8871 * memoryview.setitem_indexed(self, <tuple> indices, value)
8872*/
8873 /*else*/ {
8874 __pyx_t_3 = __pyx_memoryview_setitem_slice_assign_scalar(__pyx_v_self, __pyx_v_target_slice, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 464, __pyx_L1_error)
8875 __Pyx_GOTREF(__pyx_t_3);
8876 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8877 }
8878 __pyx_L8:;
8879
8880 /* "View.MemoryView":458
8881 * have_slices, indices = _unellipsify(index, self.view.ndim)
8882 *
8883 * if have_slices: # <<<<<<<<<<<<<<
8884 * obj = memoryview.is_slice(self, value)
8885 * target_slice = memview_slice(self, indices)
8886*/
8887 goto __pyx_L7;
8888 }
8889
8890 /* "View.MemoryView":466
8891 * memoryview.setitem_slice_assign_scalar(self, target_slice, value)
8892 * else:
8893 * memoryview.setitem_indexed(self, <tuple> indices, value) # <<<<<<<<<<<<<<
8894 *
8895 *
8896*/
8897 /*else*/ {
8898 if (unlikely(__pyx_v_indices == Py_None)) {
8899 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
8900 __PYX_ERR(1, 466, __pyx_L1_error)
8901 }
8902 __pyx_t_3 = __pyx_memoryview_setitem_indexed(__pyx_v_self, ((PyObject*)__pyx_v_indices), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 466, __pyx_L1_error)
8903 __Pyx_GOTREF(__pyx_t_3);
8904 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8905 }
8906 __pyx_L7:;
8907
8908 /* "View.MemoryView":448
8909 * return self.convert_item_to_object(itemp)
8910 *
8911 * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8912 * if self.view.readonly:
8913 * raise TypeError, "Cannot assign to read-only memoryview"
8914*/
8915
8916 /* function exit code */
8917 __pyx_r = 0;
8918 goto __pyx_L0;
8919 __pyx_L1_error:;
8920 __Pyx_XDECREF(__pyx_t_3);
8921 __Pyx_XDECREF(__pyx_t_4);
8922 __Pyx_XDECREF(__pyx_t_5);
8923 __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8924 __pyx_r = -1;
8925 __pyx_L0:;
8926
8927 __Pyx_XDECREF(__pyx_v_indices);
8928 __Pyx_XDECREF(__pyx_v_obj);
8929 __Pyx_XDECREF((PyObject *)__pyx_v_target_slice);
8930
8931 __Pyx_RefNannyFinishContext();
8932 return __pyx_r;
8933}
8934
8935/* "View.MemoryView":469
8936 *
8937 *
8938 * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8939 * if not isinstance(obj, memoryview):
8940 * try:
8941*/
8942
8943static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
8944 PyObject *__pyx_r = NULL;
8945 __Pyx_RefNannyDeclarations
8946 int __pyx_t_1;
8947 int __pyx_t_2;
8948 PyObject *__pyx_t_3 = NULL;
8949 PyObject *__pyx_t_4 = NULL;
8950 PyObject *__pyx_t_5 = NULL;
8951 PyObject *__pyx_t_6 = NULL;
8952 PyObject *__pyx_t_7 = NULL;
8953 PyObject *__pyx_t_8 = NULL;
8954 PyObject *__pyx_t_9 = NULL;
8955 size_t __pyx_t_10;
8956 int __pyx_t_11;
8957 int __pyx_lineno = 0;
8958 const char *__pyx_filename = NULL;
8959 int __pyx_clineno = 0;
8960 __Pyx_RefNannySetupContext("is_slice", 0);
8961 __Pyx_INCREF(__pyx_v_obj);
8962
8963 /* "View.MemoryView":470
8964 *
8965 * cdef is_slice(self, obj):
8966 * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8967 * try:
8968 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8969*/
8970 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_memoryview_type);
8971 __pyx_t_2 = (!__pyx_t_1);
8972
8973
8974 if (__pyx_t_2) {
8975
8976
8977 /* "View.MemoryView":471
8978 * cdef is_slice(self, obj):
8979 * if not isinstance(obj, memoryview):
8980 * try: # <<<<<<<<<<<<<<
8981 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8982 * self.dtype_is_object)
8983*/
8984 {
8985 __Pyx_PyThreadState_declare
8986 __Pyx_PyThreadState_assign
8987 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8988 __Pyx_XGOTREF(__pyx_t_3);
8989 __Pyx_XGOTREF(__pyx_t_4);
8990 __Pyx_XGOTREF(__pyx_t_5);
8991 /*try:*/ {
8992
8993 /* "View.MemoryView":472
8994 * if not isinstance(obj, memoryview):
8995 * try:
8996 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8997 * self.dtype_is_object)
8998 * except TypeError:
8999*/
9000 __pyx_t_7 = NULL;
9001 __pyx_t_8 = __Pyx_PyLong_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 472, __pyx_L4_error)
9002 __Pyx_GOTREF(__pyx_t_8);
9003
9004 /* "View.MemoryView":473
9005 * try:
9006 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9007 * self.dtype_is_object) # <<<<<<<<<<<<<<
9008 * except TypeError:
9009 * return None
9010*/
9011 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 473, __pyx_L4_error)
9012 __Pyx_GOTREF(__pyx_t_9);
9013 __pyx_t_10 = 1;
9014 {
9015 PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_obj, __pyx_t_8, __pyx_t_9};
9016 __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
9017 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9018 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9019 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9020 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 472, __pyx_L4_error)
9021 __Pyx_GOTREF((PyObject *)__pyx_t_6);
9022 }
9023 __Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
9024 __pyx_t_6 = 0;
9025
9026 /* "View.MemoryView":471
9027 * cdef is_slice(self, obj):
9028 * if not isinstance(obj, memoryview):
9029 * try: # <<<<<<<<<<<<<<
9030 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9031 * self.dtype_is_object)
9032*/
9033 }
9034 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9035 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9036 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9037 goto __pyx_L9_try_end;
9038 __pyx_L4_error:;
9039 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9040 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9041 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9042 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9043
9044 /* "View.MemoryView":474
9045 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9046 * self.dtype_is_object)
9047 * except TypeError: # <<<<<<<<<<<<<<
9048 * return None
9049 *
9050*/
9051 __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
9052 if (__pyx_t_11) {
9053 __Pyx_ErrRestore(0,0,0);
9054
9055 /* "View.MemoryView":475
9056 * self.dtype_is_object)
9057 * except TypeError:
9058 * return None # <<<<<<<<<<<<<<
9059 *
9060 * return obj
9061*/
9062 {
9063 PyObject *__pyx_temp;
9064 {
9065 __pyx_temp = __pyx_r;
9066 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9067 }
9068 __Pyx_XDECREF(__pyx_temp);
9069 }
9070 goto __pyx_L7_except_return;
9071 }
9072 goto __pyx_L6_except_error;
9073
9074 /* "View.MemoryView":471
9075 * cdef is_slice(self, obj):
9076 * if not isinstance(obj, memoryview):
9077 * try: # <<<<<<<<<<<<<<
9078 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9079 * self.dtype_is_object)
9080*/
9081 __pyx_L6_except_error:;
9082 __Pyx_XGIVEREF(__pyx_t_3);
9083 __Pyx_XGIVEREF(__pyx_t_4);
9084 __Pyx_XGIVEREF(__pyx_t_5);
9085 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9086 goto __pyx_L1_error;
9087 __pyx_L7_except_return:;
9088 __Pyx_XGIVEREF(__pyx_t_3);
9089 __Pyx_XGIVEREF(__pyx_t_4);
9090 __Pyx_XGIVEREF(__pyx_t_5);
9091 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9092 goto __pyx_L0;
9093 __pyx_L9_try_end:;
9094 }
9095
9096 /* "View.MemoryView":470
9097 *
9098 * cdef is_slice(self, obj):
9099 * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9100 * try:
9101 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9102*/
9103 }
9104
9105 /* "View.MemoryView":477
9106 * return None
9107 *
9108 * return obj # <<<<<<<<<<<<<<
9109 *
9110 *
9111*/
9112 {
9113 PyObject *__pyx_temp;
9114 {
9115 __pyx_temp = __pyx_r;
9116 __Pyx_INCREF(__pyx_v_obj);
9117 __pyx_r = __pyx_v_obj;
9118 }
9119 __Pyx_XDECREF(__pyx_temp);
9120 }
9121 goto __pyx_L0;
9122
9123 /* "View.MemoryView":469
9124 *
9125 *
9126 * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9127 * if not isinstance(obj, memoryview):
9128 * try:
9129*/
9130
9131 /* function exit code */
9132 __pyx_L1_error:;
9133 __Pyx_XDECREF(__pyx_t_6);
9134 __Pyx_XDECREF(__pyx_t_7);
9135 __Pyx_XDECREF(__pyx_t_8);
9136 __Pyx_XDECREF(__pyx_t_9);
9137 __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9138 __pyx_r = 0;
9139 __pyx_L0:;
9140 __Pyx_XDECREF(__pyx_v_obj);
9141 __Pyx_XGIVEREF(__pyx_r);
9142 __Pyx_RefNannyFinishContext();
9143 return __pyx_r;
9144}
9145
9146/* "View.MemoryView":480
9147 *
9148 *
9149 * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9150 * cdef __Pyx_memviewslice dst_slice
9151 * cdef __Pyx_memviewslice src_slice
9152*/
9153
9154static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
9155 __Pyx_memviewslice __pyx_v_dst_slice;
9156 __Pyx_memviewslice __pyx_v_src_slice;
9157 __Pyx_memviewslice __pyx_v_msrc;
9158 __Pyx_memviewslice __pyx_v_mdst;
9159 PyObject *__pyx_r = NULL;
9160 __Pyx_RefNannyDeclarations
9161 __Pyx_memviewslice *__pyx_t_1;
9162 PyObject *__pyx_t_2 = NULL;
9163 int __pyx_t_3;
9164 int __pyx_t_4;
9165 int __pyx_t_5;
9166 int __pyx_lineno = 0;
9167 const char *__pyx_filename = NULL;
9168 int __pyx_clineno = 0;
9169 __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
9170
9171 /* "View.MemoryView":483
9172 * cdef __Pyx_memviewslice dst_slice
9173 * cdef __Pyx_memviewslice src_slice
9174 * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
9175 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9176 *
9177*/
9178 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 483, __pyx_L1_error)
9179 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 483, __pyx_L1_error)
9180 __pyx_v_msrc = (__pyx_t_1[0]);
9181
9182
9183 /* "View.MemoryView":484
9184 * cdef __Pyx_memviewslice src_slice
9185 * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
9186 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
9187 *
9188 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9189*/
9190 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 484, __pyx_L1_error)
9191 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
9192 __pyx_v_mdst = (__pyx_t_1[0]);
9193
9194
9195 /* "View.MemoryView":486
9196 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9197 *
9198 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
9199 *
9200 *
9201*/
9202 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 486, __pyx_L1_error)
9203 __Pyx_GOTREF(__pyx_t_2);
9204 __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 486, __pyx_L1_error)
9205 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9206 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 486, __pyx_L1_error)
9207 __Pyx_GOTREF(__pyx_t_2);
9208 __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 486, __pyx_L1_error)
9209 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9210 __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 486, __pyx_L1_error)
9211
9212
9213
9214
9215 /* "View.MemoryView":480
9216 *
9217 *
9218 * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9219 * cdef __Pyx_memviewslice dst_slice
9220 * cdef __Pyx_memviewslice src_slice
9221*/
9222
9223 /* function exit code */
9224 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9225 goto __pyx_L0;
9226 __pyx_L1_error:;
9227 __Pyx_XDECREF(__pyx_t_2);
9228 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9229 __pyx_r = 0;
9230 __pyx_L0:;
9231
9232
9233
9234
9235 __Pyx_XGIVEREF(__pyx_r);
9236 __Pyx_RefNannyFinishContext();
9237 return __pyx_r;
9238}
9239
9240/* "View.MemoryView":489
9241 *
9242 *
9243 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9244 * cdef int array[128]
9245 * cdef void *tmp = NULL
9246*/
9247
9248static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
9249 int __pyx_v_array[128];
9250 void *__pyx_v_tmp;
9251 void *__pyx_v_item;
9252 __Pyx_memviewslice *__pyx_v_dst_slice;
9253 __Pyx_memviewslice __pyx_v_tmp_slice;
9254 PyObject *__pyx_r = NULL;
9255 __Pyx_RefNannyDeclarations
9256 __Pyx_memviewslice *__pyx_t_1;
9257 int __pyx_t_2;
9258 PyObject *__pyx_t_3 = NULL;
9259 int __pyx_t_4;
9260 int __pyx_t_5;
9261 char const *__pyx_t_6;
9262 PyObject *__pyx_t_7 = NULL;
9263 PyObject *__pyx_t_8 = NULL;
9264 PyObject *__pyx_t_9 = NULL;
9265 PyObject *__pyx_t_10 = NULL;
9266 PyObject *__pyx_t_11 = NULL;
9267 PyObject *__pyx_t_12 = NULL;
9268 int __pyx_lineno = 0;
9269 const char *__pyx_filename = NULL;
9270 int __pyx_clineno = 0;
9271 __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
9272
9273 /* "View.MemoryView":491
9274 * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9275 * cdef int array[128]
9276 * cdef void *tmp = NULL # <<<<<<<<<<<<<<
9277 * cdef void *item
9278 *
9279*/
9280 __pyx_v_tmp = NULL;
9281
9282 /* "View.MemoryView":496
9283 * cdef __Pyx_memviewslice *dst_slice
9284 * cdef __Pyx_memviewslice tmp_slice
9285 * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
9286 *
9287 * if <size_t>self.view.itemsize > sizeof(array):
9288*/
9289 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 496, __pyx_L1_error)
9290 __pyx_v_dst_slice = __pyx_t_1;
9291
9292 /* "View.MemoryView":498
9293 * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9294 *
9295 * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9296 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9297 * if tmp == NULL:
9298*/
9299 __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
9300
9301 if (__pyx_t_2) {
9302
9303
9304 /* "View.MemoryView":499
9305 *
9306 * if <size_t>self.view.itemsize > sizeof(array):
9307 * tmp = PyMem_Malloc(<size_t> self.view.itemsize) # <<<<<<<<<<<<<<
9308 * if tmp == NULL:
9309 * raise MemoryError
9310*/
9311 __pyx_v_tmp = PyMem_Malloc(((size_t)__pyx_v_self->view.itemsize));
9312
9313 /* "View.MemoryView":500
9314 * if <size_t>self.view.itemsize > sizeof(array):
9315 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9316 * if tmp == NULL: # <<<<<<<<<<<<<<
9317 * raise MemoryError
9318 * item = tmp
9319*/
9320 __pyx_t_2 = (__pyx_v_tmp == NULL);
9321
9322 if (unlikely(__pyx_t_2)) {
9323
9324
9325 /* "View.MemoryView":501
9326 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9327 * if tmp == NULL:
9328 * raise MemoryError # <<<<<<<<<<<<<<
9329 * item = tmp
9330 * else:
9331*/
9332 PyErr_NoMemory(); __PYX_ERR(1, 501, __pyx_L1_error)
9333
9334 /* "View.MemoryView":500
9335 * if <size_t>self.view.itemsize > sizeof(array):
9336 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9337 * if tmp == NULL: # <<<<<<<<<<<<<<
9338 * raise MemoryError
9339 * item = tmp
9340*/
9341 }
9342
9343 /* "View.MemoryView":502
9344 * if tmp == NULL:
9345 * raise MemoryError
9346 * item = tmp # <<<<<<<<<<<<<<
9347 * else:
9348 * item = <void *> array
9349*/
9350 __pyx_v_item = __pyx_v_tmp;
9351
9352 /* "View.MemoryView":498
9353 * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9354 *
9355 * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9356 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9357 * if tmp == NULL:
9358*/
9359 goto __pyx_L3;
9360 }
9361
9362 /* "View.MemoryView":504
9363 * item = tmp
9364 * else:
9365 * item = <void *> array # <<<<<<<<<<<<<<
9366 *
9367 * try:
9368*/
9369 /*else*/ {
9370 __pyx_v_item = ((void *)__pyx_v_array);
9371 }
9372 __pyx_L3:;
9373
9374 /* "View.MemoryView":506
9375 * item = <void *> array
9376 *
9377 * try: # <<<<<<<<<<<<<<
9378 * if self.dtype_is_object:
9379 * (<PyObject **> item)[0] = <PyObject *> value
9380*/
9381 /*try:*/ {
9382
9383 /* "View.MemoryView":507
9384 *
9385 * try:
9386 * if self.dtype_is_object: # <<<<<<<<<<<<<<
9387 * (<PyObject **> item)[0] = <PyObject *> value
9388 * else:
9389*/
9390 if (__pyx_v_self->dtype_is_object) {
9391
9392 /* "View.MemoryView":508
9393 * try:
9394 * if self.dtype_is_object:
9395 * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
9396 * else:
9397 * self.assign_item_from_object(<char *> item, value)
9398*/
9399 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9400
9401 /* "View.MemoryView":507
9402 *
9403 * try:
9404 * if self.dtype_is_object: # <<<<<<<<<<<<<<
9405 * (<PyObject **> item)[0] = <PyObject *> value
9406 * else:
9407*/
9408 goto __pyx_L8;
9409 }
9410
9411 /* "View.MemoryView":510
9412 * (<PyObject **> item)[0] = <PyObject *> value
9413 * else:
9414 * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
9415 *
9416 *
9417*/
9418 /*else*/ {
9419 __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 510, __pyx_L6_error)
9420 __Pyx_GOTREF(__pyx_t_3);
9421 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9422 }
9423 __pyx_L8:;
9424
9425 /* "View.MemoryView":514
9426 *
9427 *
9428 * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9429 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9430 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9431*/
9432 __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9433
9434 if (__pyx_t_2) {
9435
9436
9437 /* "View.MemoryView":515
9438 *
9439 * if self.view.suboffsets != NULL:
9440 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
9441 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9442 * item, self.dtype_is_object)
9443*/
9444 __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 515, __pyx_L6_error)
9445
9446
9447 /* "View.MemoryView":514
9448 *
9449 *
9450 * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9451 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9452 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9453*/
9454 }
9455
9456 /* "View.MemoryView":516
9457 * if self.view.suboffsets != NULL:
9458 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9459 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize, # <<<<<<<<<<<<<<
9460 * item, self.dtype_is_object)
9461 * finally:
9462*/
9463 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, ((size_t)__pyx_v_self->view.itemsize), __pyx_v_item, __pyx_v_self->dtype_is_object);
9464 }
9465
9466 /* "View.MemoryView":519
9467 * item, self.dtype_is_object)
9468 * finally:
9469 * PyMem_Free(tmp) # <<<<<<<<<<<<<<
9470 *
9471 *
9472*/
9473 /*finally:*/ {
9474 /*normal exit:*/{
9475 PyMem_Free(__pyx_v_tmp);
9476 goto __pyx_L7;
9477 }
9478 __pyx_L6_error:;
9479 /*exception exit:*/{
9480 __Pyx_PyThreadState_declare
9481 __Pyx_PyThreadState_assign
9482 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9483 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9484 __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9485 if ( unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
9486 __Pyx_XGOTREF(__pyx_t_7);
9487 __Pyx_XGOTREF(__pyx_t_8);
9488 __Pyx_XGOTREF(__pyx_t_9);
9489 __Pyx_XGOTREF(__pyx_t_10);
9490 __Pyx_XGOTREF(__pyx_t_11);
9491 __Pyx_XGOTREF(__pyx_t_12);
9492 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9493 {
9494 PyMem_Free(__pyx_v_tmp);
9495 }
9496 __Pyx_XGIVEREF(__pyx_t_10);
9497 __Pyx_XGIVEREF(__pyx_t_11);
9498 __Pyx_XGIVEREF(__pyx_t_12);
9499 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9500 __Pyx_XGIVEREF(__pyx_t_7);
9501 __Pyx_XGIVEREF(__pyx_t_8);
9502 __Pyx_XGIVEREF(__pyx_t_9);
9503 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9504 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9505 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9506 goto __pyx_L1_error;
9507 }
9508 __pyx_L7:;
9509 }
9510
9511 /* "View.MemoryView":489
9512 *
9513 *
9514 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9515 * cdef int array[128]
9516 * cdef void *tmp = NULL
9517*/
9518
9519 /* function exit code */
9520 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9521 goto __pyx_L0;
9522 __pyx_L1_error:;
9523 __Pyx_XDECREF(__pyx_t_3);
9524 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9525 __pyx_r = 0;
9526 __pyx_L0:;
9527
9528
9529
9530
9531
9532 __Pyx_XGIVEREF(__pyx_r);
9533 __Pyx_RefNannyFinishContext();
9534 return __pyx_r;
9535}
9536
9537/* "View.MemoryView":522
9538 *
9539 *
9540 * cdef setitem_indexed(self, indices: tuple, value): # <<<<<<<<<<<<<<
9541 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9542 * self.assign_item_from_object(itemp, value)
9543*/
9544
9545static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value) {
9546 char *__pyx_v_itemp;
9547 PyObject *__pyx_r = NULL;
9548 __Pyx_RefNannyDeclarations
9549 char *__pyx_t_1;
9550 PyObject *__pyx_t_2 = NULL;
9551 int __pyx_lineno = 0;
9552 const char *__pyx_filename = NULL;
9553 int __pyx_clineno = 0;
9554 __Pyx_RefNannySetupContext("setitem_indexed", 0);
9555
9556 /* "View.MemoryView":523
9557 *
9558 * cdef setitem_indexed(self, indices: tuple, value):
9559 * cdef char *itemp = memoryview.get_item_pointer(self, indices) # <<<<<<<<<<<<<<
9560 * self.assign_item_from_object(itemp, value)
9561 *
9562*/
9563 __pyx_t_1 = __pyx_memoryview_get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 523, __pyx_L1_error)
9564 __pyx_v_itemp = __pyx_t_1;
9565
9566 /* "View.MemoryView":524
9567 * cdef setitem_indexed(self, indices: tuple, value):
9568 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9569 * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9570 *
9571 *
9572*/
9573 __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error)
9574 __Pyx_GOTREF(__pyx_t_2);
9575 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9576
9577 /* "View.MemoryView":522
9578 *
9579 *
9580 * cdef setitem_indexed(self, indices: tuple, value): # <<<<<<<<<<<<<<
9581 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9582 * self.assign_item_from_object(itemp, value)
9583*/
9584
9585 /* function exit code */
9586 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9587 goto __pyx_L0;
9588 __pyx_L1_error:;
9589 __Pyx_XDECREF(__pyx_t_2);
9590 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9591 __pyx_r = 0;
9592 __pyx_L0:;
9593
9594 __Pyx_XGIVEREF(__pyx_r);
9595 __Pyx_RefNannyFinishContext();
9596 return __pyx_r;
9597}
9598
9599/* "View.MemoryView":527
9600 *
9601 *
9602 * cdef setitem_indexed1(self, index, value): # <<<<<<<<<<<<<<
9603 * cdef char *buffer = <char *> self.view.buf
9604 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9605*/
9606
9607static PyObject *__pyx_memoryview_setitem_indexed1(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9608 char *__pyx_v_buffer;
9609 char *__pyx_v_itemp;
9610 PyObject *__pyx_r = NULL;
9611 __Pyx_RefNannyDeclarations
9612 Py_ssize_t __pyx_t_1;
9613 char *__pyx_t_2;
9614 PyObject *__pyx_t_3 = NULL;
9615 int __pyx_lineno = 0;
9616 const char *__pyx_filename = NULL;
9617 int __pyx_clineno = 0;
9618 __Pyx_RefNannySetupContext("setitem_indexed1", 0);
9619
9620 /* "View.MemoryView":528
9621 *
9622 * cdef setitem_indexed1(self, index, value):
9623 * cdef char *buffer = <char *> self.view.buf # <<<<<<<<<<<<<<
9624 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9625 * self.assign_item_from_object(itemp, value)
9626*/
9627 __pyx_v_buffer = ((char *)__pyx_v_self->view.buf);
9628
9629 /* "View.MemoryView":529
9630 * cdef setitem_indexed1(self, index, value):
9631 * cdef char *buffer = <char *> self.view.buf
9632 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0) # <<<<<<<<<<<<<<
9633 * self.assign_item_from_object(itemp, value)
9634 *
9635*/
9636 __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 529, __pyx_L1_error)
9637 __pyx_t_2 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_buffer, __pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((void *)NULL))) __PYX_ERR(1, 529, __pyx_L1_error)
9638 __pyx_v_itemp = __pyx_t_2;
9639
9640
9641 /* "View.MemoryView":530
9642 * cdef char *buffer = <char *> self.view.buf
9643 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9644 * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9645 *
9646 * cdef convert_item_to_object(self, char *itemp):
9647*/
9648 __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 530, __pyx_L1_error)
9649 __Pyx_GOTREF(__pyx_t_3);
9650 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9651
9652 /* "View.MemoryView":527
9653 *
9654 *
9655 * cdef setitem_indexed1(self, index, value): # <<<<<<<<<<<<<<
9656 * cdef char *buffer = <char *> self.view.buf
9657 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9658*/
9659
9660 /* function exit code */
9661 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9662 goto __pyx_L0;
9663 __pyx_L1_error:;
9664 __Pyx_XDECREF(__pyx_t_3);
9665 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed1", __pyx_clineno, __pyx_lineno, __pyx_filename);
9666 __pyx_r = 0;
9667 __pyx_L0:;
9668
9669
9670 __Pyx_XGIVEREF(__pyx_r);
9671 __Pyx_RefNannyFinishContext();
9672 return __pyx_r;
9673}
9674
9675/* "View.MemoryView":532
9676 * self.assign_item_from_object(itemp, value)
9677 *
9678 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9679 * """Only used if instantiated manually by the user, or if Cython doesn't
9680 * know how to convert the type"""
9681*/
9682
9683static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
9684 PyObject *__pyx_v_struct = NULL;
9685 PyObject *__pyx_v_bytesitem = 0;
9686 PyObject *__pyx_v_result = NULL;
9687 PyObject *__pyx_r = NULL;
9688 __Pyx_RefNannyDeclarations
9689 PyObject *__pyx_t_1 = NULL;
9690 PyObject *__pyx_t_2 = NULL;
9691 PyObject *__pyx_t_3 = NULL;
9692 PyObject *__pyx_t_4 = NULL;
9693 PyObject *__pyx_t_5 = NULL;
9694 PyObject *__pyx_t_6 = NULL;
9695 size_t __pyx_t_7;
9696 Py_ssize_t __pyx_t_8;
9697 int __pyx_t_9;
9698 PyObject *__pyx_t_10 = NULL;
9699 int __pyx_t_11;
9700 int __pyx_lineno = 0;
9701 const char *__pyx_filename = NULL;
9702 int __pyx_clineno = 0;
9703 __Pyx_RefNannySetupContext("convert_item_to_object", 0);
9704
9705 /* "View.MemoryView":535
9706 * """Only used if instantiated manually by the user, or if Cython doesn't
9707 * know how to convert the type"""
9708 * import struct # <<<<<<<<<<<<<<
9709 * cdef bytes bytesitem
9710 *
9711*/
9712 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error)
9713 __pyx_t_1 = __pyx_t_2;
9714 __Pyx_GOTREF(__pyx_t_1);
9715 __pyx_v_struct = __pyx_t_1;
9716 __pyx_t_1 = 0;
9717
9718 /* "View.MemoryView":538
9719 * cdef bytes bytesitem
9720 *
9721 * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
9722 * try:
9723 * result = struct.unpack(self.view.format, bytesitem)
9724*/
9725 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 538, __pyx_L1_error)
9726 __Pyx_GOTREF(__pyx_t_1);
9727 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9728 __pyx_t_1 = 0;
9729
9730 /* "View.MemoryView":539
9731 *
9732 * bytesitem = itemp[:self.view.itemsize]
9733 * try: # <<<<<<<<<<<<<<
9734 * result = struct.unpack(self.view.format, bytesitem)
9735 * except struct.error:
9736*/
9737 {
9738 __Pyx_PyThreadState_declare
9739 __Pyx_PyThreadState_assign
9740 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9741 __Pyx_XGOTREF(__pyx_t_2);
9742 __Pyx_XGOTREF(__pyx_t_3);
9743 __Pyx_XGOTREF(__pyx_t_4);
9744 /*try:*/ {
9745
9746 /* "View.MemoryView":540
9747 * bytesitem = itemp[:self.view.itemsize]
9748 * try:
9749 * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
9750 * except struct.error:
9751 * _err_ValueError("Unable to convert item to object")
9752*/
9753 __pyx_t_5 = __pyx_v_struct;
9754 __Pyx_INCREF(__pyx_t_5);
9755 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 540, __pyx_L3_error)
9756 __Pyx_GOTREF(__pyx_t_6);
9757 __pyx_t_7 = 0;
9758 {
9759 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_bytesitem};
9760 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_unpack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
9761 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9762 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9763 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L3_error)
9764 __Pyx_GOTREF(__pyx_t_1);
9765 }
9766 __pyx_v_result = __pyx_t_1;
9767 __pyx_t_1 = 0;
9768
9769 /* "View.MemoryView":539
9770 *
9771 * bytesitem = itemp[:self.view.itemsize]
9772 * try: # <<<<<<<<<<<<<<
9773 * result = struct.unpack(self.view.format, bytesitem)
9774 * except struct.error:
9775*/
9776 }
9777
9778 /* "View.MemoryView":544
9779 * _err_ValueError("Unable to convert item to object")
9780 * else:
9781 * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9782 * return result[0]
9783 * return result
9784*/
9785 /*else:*/ {
9786 __pyx_t_8 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 544, __pyx_L5_except_error)
9787 __pyx_t_9 = (__pyx_t_8 == 1);
9788
9789
9790 if (__pyx_t_9) {
9791
9792
9793 /* "View.MemoryView":545
9794 * else:
9795 * if len(self.view.format) == 1:
9796 * return result[0] # <<<<<<<<<<<<<<
9797 * return result
9798 *
9799*/
9800 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L5_except_error)
9801 __Pyx_GOTREF(__pyx_t_1);
9802 {
9803 PyObject *__pyx_temp;
9804 {
9805 __pyx_temp = __pyx_r;
9806 __pyx_r = __pyx_t_1;
9807 }
9808 __Pyx_XDECREF(__pyx_temp);
9809 }
9810 __pyx_t_1 = 0;
9811 goto __pyx_L6_except_return;
9812
9813 /* "View.MemoryView":544
9814 * _err_ValueError("Unable to convert item to object")
9815 * else:
9816 * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9817 * return result[0]
9818 * return result
9819*/
9820 }
9821
9822 /* "View.MemoryView":546
9823 * if len(self.view.format) == 1:
9824 * return result[0]
9825 * return result # <<<<<<<<<<<<<<
9826 *
9827 * cdef assign_item_from_object(self, char *itemp, object value):
9828*/
9829 {
9830 PyObject *__pyx_temp;
9831 {
9832 __pyx_temp = __pyx_r;
9833 __Pyx_INCREF(__pyx_v_result);
9834 __pyx_r = __pyx_v_result;
9835 }
9836 __Pyx_XDECREF(__pyx_temp);
9837 }
9838 goto __pyx_L6_except_return;
9839 }
9840 __pyx_L3_error:;
9841 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9842 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9843 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9844
9845 /* "View.MemoryView":541
9846 * try:
9847 * result = struct.unpack(self.view.format, bytesitem)
9848 * except struct.error: # <<<<<<<<<<<<<<
9849 * _err_ValueError("Unable to convert item to object")
9850 * else:
9851*/
9852 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5);
9853 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 541, __pyx_L5_except_error)
9854 __Pyx_GOTREF(__pyx_t_10);
9855 __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_10);
9856 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9857 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5);
9858 __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
9859 if (__pyx_t_11) {
9860 __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9861 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(1, 541, __pyx_L5_except_error)
9862 __Pyx_XGOTREF(__pyx_t_5);
9863 __Pyx_XGOTREF(__pyx_t_6);
9864 __Pyx_XGOTREF(__pyx_t_1);
9865
9866 /* "View.MemoryView":542
9867 * result = struct.unpack(self.view.format, bytesitem)
9868 * except struct.error:
9869 * _err_ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
9870 * else:
9871 * if len(self.view.format) == 1:
9872*/
9873 __pyx_t_11 = __pyx_memoryview_err_ValueError(__pyx_k_Unable_to_convert_item_to_object); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 542, __pyx_L5_except_error)
9874
9875 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9876 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9877 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9878 goto __pyx_L4_exception_handled;
9879 }
9880 goto __pyx_L5_except_error;
9881
9882 /* "View.MemoryView":539
9883 *
9884 * bytesitem = itemp[:self.view.itemsize]
9885 * try: # <<<<<<<<<<<<<<
9886 * result = struct.unpack(self.view.format, bytesitem)
9887 * except struct.error:
9888*/
9889 __pyx_L5_except_error:;
9890 __Pyx_XGIVEREF(__pyx_t_2);
9891 __Pyx_XGIVEREF(__pyx_t_3);
9892 __Pyx_XGIVEREF(__pyx_t_4);
9893 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9894 goto __pyx_L1_error;
9895 __pyx_L6_except_return:;
9896 __Pyx_XGIVEREF(__pyx_t_2);
9897 __Pyx_XGIVEREF(__pyx_t_3);
9898 __Pyx_XGIVEREF(__pyx_t_4);
9899 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9900 goto __pyx_L0;
9901 __pyx_L4_exception_handled:;
9902 __Pyx_XGIVEREF(__pyx_t_2);
9903 __Pyx_XGIVEREF(__pyx_t_3);
9904 __Pyx_XGIVEREF(__pyx_t_4);
9905 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9906 }
9907
9908 /* "View.MemoryView":532
9909 * self.assign_item_from_object(itemp, value)
9910 *
9911 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9912 * """Only used if instantiated manually by the user, or if Cython doesn't
9913 * know how to convert the type"""
9914*/
9915
9916 /* function exit code */
9917 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9918 goto __pyx_L0;
9919 __pyx_L1_error:;
9920 __Pyx_XDECREF(__pyx_t_1);
9921 __Pyx_XDECREF(__pyx_t_5);
9922 __Pyx_XDECREF(__pyx_t_6);
9923 __Pyx_XDECREF(__pyx_t_10);
9924 __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9925 __pyx_r = 0;
9926 __pyx_L0:;
9927 __Pyx_XDECREF(__pyx_v_struct);
9928 __Pyx_XDECREF(__pyx_v_bytesitem);
9929 __Pyx_XDECREF(__pyx_v_result);
9930 __Pyx_XGIVEREF(__pyx_r);
9931 __Pyx_RefNannyFinishContext();
9932 return __pyx_r;
9933}
9934
9935/* "View.MemoryView":548
9936 * return result
9937 *
9938 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9939 * """Only used if instantiated manually by the user, or if Cython doesn't
9940 * know how to convert the type"""
9941*/
9942
9943static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
9944 PyObject *__pyx_v_struct = NULL;
9945 char __pyx_v_c;
9946 PyObject *__pyx_v_bytesvalue = 0;
9947 Py_ssize_t __pyx_v_i;
9948 PyObject *__pyx_r = NULL;
9949 __Pyx_RefNannyDeclarations
9950 PyObject *__pyx_t_1 = NULL;
9951 PyObject *__pyx_t_2 = NULL;
9952 int __pyx_t_3;
9953 PyObject *__pyx_t_4 = NULL;
9954 PyObject *__pyx_t_5 = NULL;
9955 PyObject *__pyx_t_6 = NULL;
9956 size_t __pyx_t_7;
9957 Py_ssize_t __pyx_t_8;
9958 PyObject *__pyx_t_9 = NULL;
9959 char *__pyx_t_10;
9960 char *__pyx_t_11;
9961 Py_ssize_t __pyx_t_12;
9962 char *__pyx_t_13;
9963 char *__pyx_t_14;
9964 int __pyx_lineno = 0;
9965 const char *__pyx_filename = NULL;
9966 int __pyx_clineno = 0;
9967 __Pyx_RefNannySetupContext("assign_item_from_object", 0);
9968
9969 /* "View.MemoryView":551
9970 * """Only used if instantiated manually by the user, or if Cython doesn't
9971 * know how to convert the type"""
9972 * import struct # <<<<<<<<<<<<<<
9973 * cdef char c
9974 * cdef bytes bytesvalue
9975*/
9976 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
9977 __pyx_t_1 = __pyx_t_2;
9978 __Pyx_GOTREF(__pyx_t_1);
9979 __pyx_v_struct = __pyx_t_1;
9980 __pyx_t_1 = 0;
9981
9982 /* "View.MemoryView":556
9983 * cdef Py_ssize_t i
9984 *
9985 * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9986 * bytesvalue = struct.pack(self.view.format, *value)
9987 * else:
9988*/
9989 __pyx_t_3 = PyTuple_Check(__pyx_v_value);
9990 if (__pyx_t_3) {
9991
9992
9993 /* "View.MemoryView":557
9994 *
9995 * if isinstance(value, tuple):
9996 * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
9997 * else:
9998 * bytesvalue = struct.pack(self.view.format, value)
9999*/
10000 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 557, __pyx_L1_error)
10001 __Pyx_GOTREF(__pyx_t_1);
10002 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
10003 __Pyx_GOTREF(__pyx_t_4);
10004 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
10005 __Pyx_GOTREF(__pyx_t_5);
10006 __Pyx_GIVEREF(__pyx_t_4);
10007 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 557, __pyx_L1_error);
10008 __pyx_t_4 = 0;
10009 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
10010 __Pyx_GOTREF(__pyx_t_4);
10011 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 557, __pyx_L1_error)
10012 __Pyx_GOTREF(__pyx_t_6);
10013 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10014 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10015 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
10016 __Pyx_GOTREF(__pyx_t_4);
10017 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10018 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10019 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(1, 557, __pyx_L1_error)
10020 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10021 __pyx_t_4 = 0;
10022
10023 /* "View.MemoryView":556
10024 * cdef Py_ssize_t i
10025 *
10026 * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10027 * bytesvalue = struct.pack(self.view.format, *value)
10028 * else:
10029*/
10030 goto __pyx_L3;
10031 }
10032
10033 /* "View.MemoryView":559
10034 * bytesvalue = struct.pack(self.view.format, *value)
10035 * else:
10036 * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
10037 *
10038 * for i, c in enumerate(bytesvalue):
10039*/
10040 /*else*/ {
10041 __pyx_t_6 = __pyx_v_struct;
10042 __Pyx_INCREF(__pyx_t_6);
10043 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
10044 __Pyx_GOTREF(__pyx_t_1);
10045 __pyx_t_7 = 0;
10046 {
10047 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_value};
10048 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_pack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
10049 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10050 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10051 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 559, __pyx_L1_error)
10052 __Pyx_GOTREF(__pyx_t_4);
10053 }
10054 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(1, 559, __pyx_L1_error)
10055 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10056 __pyx_t_4 = 0;
10057 }
10058 __pyx_L3:;
10059
10060 /* "View.MemoryView":561
10061 * bytesvalue = struct.pack(self.view.format, value)
10062 *
10063 * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10064 * itemp[i] = c
10065 *
10066*/
10067
10068 __pyx_t_8 = 0;
10069 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
10070 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 is not iterable");
10071 __PYX_ERR(1, 561, __pyx_L1_error)
10072 }
10073 __Pyx_INCREF(__pyx_v_bytesvalue);
10074 __pyx_t_9 = __pyx_v_bytesvalue;
10075 __pyx_t_11 = __Pyx_PyBytes_AsWritableString(__pyx_t_9); if (unlikely(__pyx_t_11 == ((char *)NULL))) __PYX_ERR(1, 561, __pyx_L1_error)
10076 __pyx_t_12 = __Pyx_PyBytes_GET_SIZE(__pyx_t_9); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(1, 561, __pyx_L1_error)
10077 __pyx_t_13 = (__pyx_t_11 + __pyx_t_12);
10078
10079 for (__pyx_t_14 = __pyx_t_11; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
10080 __pyx_t_10 = __pyx_t_14;
10081 __pyx_v_c = (__pyx_t_10[0]);
10082
10083 /* "View.MemoryView":562
10084 *
10085 * for i, c in enumerate(bytesvalue):
10086 * itemp[i] = c # <<<<<<<<<<<<<<
10087 *
10088 * @cname('getbuffer')
10089*/
10090 __pyx_v_i = __pyx_t_8;
10091
10092 /* "View.MemoryView":561
10093 * bytesvalue = struct.pack(self.view.format, value)
10094 *
10095 * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10096 * itemp[i] = c
10097 *
10098*/
10099 __pyx_t_8 = (__pyx_t_8 + 1);
10100
10101 /* "View.MemoryView":562
10102 *
10103 * for i, c in enumerate(bytesvalue):
10104 * itemp[i] = c # <<<<<<<<<<<<<<
10105 *
10106 * @cname('getbuffer')
10107*/
10108 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10109 }
10110
10111
10112
10113 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10114
10115 /* "View.MemoryView":548
10116 * return result
10117 *
10118 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
10119 * """Only used if instantiated manually by the user, or if Cython doesn't
10120 * know how to convert the type"""
10121*/
10122
10123 /* function exit code */
10124 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10125 goto __pyx_L0;
10126 __pyx_L1_error:;
10127 __Pyx_XDECREF(__pyx_t_1);
10128 __Pyx_XDECREF(__pyx_t_4);
10129 __Pyx_XDECREF(__pyx_t_5);
10130 __Pyx_XDECREF(__pyx_t_6);
10131 __Pyx_XDECREF(__pyx_t_9);
10132 __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10133 __pyx_r = 0;
10134 __pyx_L0:;
10135 __Pyx_XDECREF(__pyx_v_struct);
10136
10137 __Pyx_XDECREF(__pyx_v_bytesvalue);
10138
10139 __Pyx_XGIVEREF(__pyx_r);
10140 __Pyx_RefNannyFinishContext();
10141 return __pyx_r;
10142}
10143
10144/* "View.MemoryView":564
10145 * itemp[i] = c
10146 *
10147 * @cname('getbuffer') # <<<<<<<<<<<<<<
10148 * def __getbuffer__(self, Py_buffer *info, int flags):
10149 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
10150*/
10151
10152/* Python wrapper */
10153CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
10154CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10155 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10156 int __pyx_r;
10157 __Pyx_RefNannyDeclarations
10158 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
10159 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10160 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
10161
10162 /* function exit code */
10163
10164
10165 __Pyx_RefNannyFinishContext();
10166 return __pyx_r;
10167}
10168
10169static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10170 int __pyx_r;
10171 __Pyx_RefNannyDeclarations
10172 int __pyx_t_1;
10173 int __pyx_t_2;
10174 int __pyx_t_3;
10175 Py_ssize_t *__pyx_t_4;
10176 char *__pyx_t_5;
10177 void *__pyx_t_6;
10178 Py_ssize_t __pyx_t_7;
10179 int __pyx_lineno = 0;
10180 const char *__pyx_filename = NULL;
10181 int __pyx_clineno = 0;
10182 if (unlikely(__pyx_v_info == NULL)) {
10183 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
10184 return -1;
10185 }
10186 __Pyx_RefNannySetupContext("__getbuffer__", 0);
10187 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10188 __Pyx_GIVEREF(__pyx_v_info->obj);
10189
10190 /* "View.MemoryView":566
10191 * @cname('getbuffer')
10192 * def __getbuffer__(self, Py_buffer *info, int flags):
10193 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly): # <<<<<<<<<<<<<<
10194 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10195 *
10196*/
10197 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10198
10199 if (__pyx_t_2) {
10200
10201 } else {
10202
10203 __pyx_t_1 = __pyx_t_2;
10204
10205 goto __pyx_L4_bool_binop_done;
10206 }
10207
10208 __pyx_t_1 = __pyx_v_self->view.readonly;
10209 __pyx_L4_bool_binop_done:;
10210 if (unlikely(__pyx_t_1)) {
10211
10212
10213 /* "View.MemoryView":567
10214 * def __getbuffer__(self, Py_buffer *info, int flags):
10215 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
10216 * _err_ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
10217 *
10218 * if flags & PyBUF_ND:
10219*/
10220 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_Cannot_create_writable_memory_vi); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 567, __pyx_L1_error)
10221
10222
10223 /* "View.MemoryView":566
10224 * @cname('getbuffer')
10225 * def __getbuffer__(self, Py_buffer *info, int flags):
10226 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly): # <<<<<<<<<<<<<<
10227 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10228 *
10229*/
10230 }
10231
10232 /* "View.MemoryView":569
10233 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10234 *
10235 * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10236 * info.shape = self.view.shape
10237 * else:
10238*/
10239 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10240
10241 if (__pyx_t_1) {
10242
10243
10244 /* "View.MemoryView":570
10245 *
10246 * if flags & PyBUF_ND:
10247 * info.shape = self.view.shape # <<<<<<<<<<<<<<
10248 * else:
10249 * info.shape = NULL
10250*/
10251 __pyx_t_4 = __pyx_v_self->view.shape;
10252
10253 __pyx_v_info->shape = __pyx_t_4;
10254
10255 /* "View.MemoryView":569
10256 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10257 *
10258 * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10259 * info.shape = self.view.shape
10260 * else:
10261*/
10262 goto __pyx_L6;
10263 }
10264
10265 /* "View.MemoryView":572
10266 * info.shape = self.view.shape
10267 * else:
10268 * info.shape = NULL # <<<<<<<<<<<<<<
10269 *
10270 * if flags & PyBUF_STRIDES:
10271*/
10272 /*else*/ {
10273 __pyx_v_info->shape = NULL;
10274 }
10275 __pyx_L6:;
10276
10277 /* "View.MemoryView":574
10278 * info.shape = NULL
10279 *
10280 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10281 * info.strides = self.view.strides
10282 * else:
10283*/
10284 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10285
10286 if (__pyx_t_1) {
10287
10288
10289 /* "View.MemoryView":575
10290 *
10291 * if flags & PyBUF_STRIDES:
10292 * info.strides = self.view.strides # <<<<<<<<<<<<<<
10293 * else:
10294 * info.strides = NULL
10295*/
10296 __pyx_t_4 = __pyx_v_self->view.strides;
10297
10298 __pyx_v_info->strides = __pyx_t_4;
10299
10300 /* "View.MemoryView":574
10301 * info.shape = NULL
10302 *
10303 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10304 * info.strides = self.view.strides
10305 * else:
10306*/
10307 goto __pyx_L7;
10308 }
10309
10310 /* "View.MemoryView":577
10311 * info.strides = self.view.strides
10312 * else:
10313 * info.strides = NULL # <<<<<<<<<<<<<<
10314 *
10315 * if flags & PyBUF_INDIRECT:
10316*/
10317 /*else*/ {
10318 __pyx_v_info->strides = NULL;
10319 }
10320 __pyx_L7:;
10321
10322 /* "View.MemoryView":579
10323 * info.strides = NULL
10324 *
10325 * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10326 * info.suboffsets = self.view.suboffsets
10327 * else:
10328*/
10329 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10330
10331 if (__pyx_t_1) {
10332
10333
10334 /* "View.MemoryView":580
10335 *
10336 * if flags & PyBUF_INDIRECT:
10337 * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
10338 * else:
10339 * info.suboffsets = NULL
10340*/
10341 __pyx_t_4 = __pyx_v_self->view.suboffsets;
10342
10343 __pyx_v_info->suboffsets = __pyx_t_4;
10344
10345 /* "View.MemoryView":579
10346 * info.strides = NULL
10347 *
10348 * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10349 * info.suboffsets = self.view.suboffsets
10350 * else:
10351*/
10352 goto __pyx_L8;
10353 }
10354
10355 /* "View.MemoryView":582
10356 * info.suboffsets = self.view.suboffsets
10357 * else:
10358 * info.suboffsets = NULL # <<<<<<<<<<<<<<
10359 *
10360 * if flags & PyBUF_FORMAT:
10361*/
10362 /*else*/ {
10363 __pyx_v_info->suboffsets = NULL;
10364 }
10365 __pyx_L8:;
10366
10367 /* "View.MemoryView":584
10368 * info.suboffsets = NULL
10369 *
10370 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10371 * info.format = self.view.format
10372 * else:
10373*/
10374 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10375
10376 if (__pyx_t_1) {
10377
10378
10379 /* "View.MemoryView":585
10380 *
10381 * if flags & PyBUF_FORMAT:
10382 * info.format = self.view.format # <<<<<<<<<<<<<<
10383 * else:
10384 * info.format = NULL
10385*/
10386 __pyx_t_5 = __pyx_v_self->view.format;
10387
10388 __pyx_v_info->format = __pyx_t_5;
10389
10390 /* "View.MemoryView":584
10391 * info.suboffsets = NULL
10392 *
10393 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10394 * info.format = self.view.format
10395 * else:
10396*/
10397 goto __pyx_L9;
10398 }
10399
10400 /* "View.MemoryView":587
10401 * info.format = self.view.format
10402 * else:
10403 * info.format = NULL # <<<<<<<<<<<<<<
10404 *
10405 * info.buf = self.view.buf
10406*/
10407 /*else*/ {
10408 __pyx_v_info->format = NULL;
10409 }
10410 __pyx_L9:;
10411
10412 /* "View.MemoryView":589
10413 * info.format = NULL
10414 *
10415 * info.buf = self.view.buf # <<<<<<<<<<<<<<
10416 * info.ndim = self.view.ndim
10417 * info.itemsize = self.view.itemsize
10418*/
10419 __pyx_t_6 = __pyx_v_self->view.buf;
10420
10421 __pyx_v_info->buf = __pyx_t_6;
10422
10423 /* "View.MemoryView":590
10424 *
10425 * info.buf = self.view.buf
10426 * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
10427 * info.itemsize = self.view.itemsize
10428 * info.len = self.view.len
10429*/
10430 __pyx_t_3 = __pyx_v_self->view.ndim;
10431
10432 __pyx_v_info->ndim = __pyx_t_3;
10433
10434 /* "View.MemoryView":591
10435 * info.buf = self.view.buf
10436 * info.ndim = self.view.ndim
10437 * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
10438 * info.len = self.view.len
10439 * info.readonly = self.view.readonly
10440*/
10441 __pyx_t_7 = __pyx_v_self->view.itemsize;
10442
10443 __pyx_v_info->itemsize = __pyx_t_7;
10444
10445 /* "View.MemoryView":592
10446 * info.ndim = self.view.ndim
10447 * info.itemsize = self.view.itemsize
10448 * info.len = self.view.len # <<<<<<<<<<<<<<
10449 * info.readonly = self.view.readonly
10450 * info.obj = self
10451*/
10452 __pyx_t_7 = __pyx_v_self->view.len;
10453
10454 __pyx_v_info->len = __pyx_t_7;
10455
10456 /* "View.MemoryView":593
10457 * info.itemsize = self.view.itemsize
10458 * info.len = self.view.len
10459 * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
10460 * info.obj = self
10461 *
10462*/
10463 __pyx_t_1 = __pyx_v_self->view.readonly;
10464
10465 __pyx_v_info->readonly = __pyx_t_1;
10466
10467 /* "View.MemoryView":594
10468 * info.len = self.view.len
10469 * info.readonly = self.view.readonly
10470 * info.obj = self # <<<<<<<<<<<<<<
10471 *
10472 *
10473*/
10474 __Pyx_INCREF((PyObject *)__pyx_v_self);
10475 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10476 __Pyx_GOTREF(__pyx_v_info->obj);
10477 __Pyx_DECREF(__pyx_v_info->obj);
10478 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10479
10480 /* "View.MemoryView":564
10481 * itemp[i] = c
10482 *
10483 * @cname('getbuffer') # <<<<<<<<<<<<<<
10484 * def __getbuffer__(self, Py_buffer *info, int flags):
10485 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
10486*/
10487
10488 /* function exit code */
10489 __pyx_r = 0;
10490 goto __pyx_L0;
10491 __pyx_L1_error:;
10492 __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10493 __pyx_r = -1;
10494 if (__pyx_v_info->obj != NULL) {
10495 __Pyx_GOTREF(__pyx_v_info->obj);
10496 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10497 }
10498 goto __pyx_L2;
10499 __pyx_L0:;
10500 if (__pyx_v_info->obj == Py_None) {
10501 __Pyx_GOTREF(__pyx_v_info->obj);
10502 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10503 }
10504 __pyx_L2:;
10505
10506 __Pyx_RefNannyFinishContext();
10507 return __pyx_r;
10508}
10509
10510/* "View.MemoryView":597
10511 *
10512 *
10513 * @property # <<<<<<<<<<<<<<
10514 * def T(self):
10515 * cdef _memoryviewslice result = memoryview_copy(self)
10516*/
10517
10518/* Python wrapper */
10519static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
10520static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10521 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10522 PyObject *__pyx_r = 0;
10523 __Pyx_RefNannyDeclarations
10524 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10525 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10526 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10527
10528 /* function exit code */
10529 __Pyx_RefNannyFinishContext();
10530 return __pyx_r;
10531}
10532
10533static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10534 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10535 PyObject *__pyx_r = NULL;
10536 __Pyx_RefNannyDeclarations
10537 PyObject *__pyx_t_1 = NULL;
10538 int __pyx_t_2;
10539 int __pyx_lineno = 0;
10540 const char *__pyx_filename = NULL;
10541 int __pyx_clineno = 0;
10542 __Pyx_RefNannySetupContext("__get__", 0);
10543
10544 /* "View.MemoryView":599
10545 * @property
10546 * def T(self):
10547 * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
10548 * transpose_memslice(&result.from_slice)
10549 * return result
10550*/
10551 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 599, __pyx_L1_error)
10552 __Pyx_GOTREF(__pyx_t_1);
10553 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 599, __pyx_L1_error)
10554 __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10555 __pyx_t_1 = 0;
10556
10557 /* "View.MemoryView":600
10558 * def T(self):
10559 * cdef _memoryviewslice result = memoryview_copy(self)
10560 * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
10561 * return result
10562 *
10563*/
10564 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 600, __pyx_L1_error)
10565
10566
10567 /* "View.MemoryView":601
10568 * cdef _memoryviewslice result = memoryview_copy(self)
10569 * transpose_memslice(&result.from_slice)
10570 * return result # <<<<<<<<<<<<<<
10571 *
10572 * @property
10573*/
10574 {
10575 PyObject *__pyx_temp;
10576 {
10577 __pyx_temp = __pyx_r;
10578 __Pyx_INCREF((PyObject *)__pyx_v_result);
10579 __pyx_r = ((PyObject *)__pyx_v_result);
10580 }
10581 __Pyx_XDECREF(__pyx_temp);
10582 }
10583 goto __pyx_L0;
10584
10585 /* "View.MemoryView":597
10586 *
10587 *
10588 * @property # <<<<<<<<<<<<<<
10589 * def T(self):
10590 * cdef _memoryviewslice result = memoryview_copy(self)
10591*/
10592
10593 /* function exit code */
10594 __pyx_L1_error:;
10595 __Pyx_XDECREF(__pyx_t_1);
10596 __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10597 __pyx_r = NULL;
10598 __pyx_L0:;
10599 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10600 __Pyx_XGIVEREF(__pyx_r);
10601 __Pyx_RefNannyFinishContext();
10602 return __pyx_r;
10603}
10604
10605/* "View.MemoryView":603
10606 * return result
10607 *
10608 * @property # <<<<<<<<<<<<<<
10609 * def base(self):
10610 * return self._get_base()
10611*/
10612
10613/* Python wrapper */
10614static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
10615static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10616 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10617 PyObject *__pyx_r = 0;
10618 __Pyx_RefNannyDeclarations
10619 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10620 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10621 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10622
10623 /* function exit code */
10624 __Pyx_RefNannyFinishContext();
10625 return __pyx_r;
10626}
10627
10628static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10629 PyObject *__pyx_r = NULL;
10630 __Pyx_RefNannyDeclarations
10631 PyObject *__pyx_t_1 = NULL;
10632 int __pyx_lineno = 0;
10633 const char *__pyx_filename = NULL;
10634 int __pyx_clineno = 0;
10635 __Pyx_RefNannySetupContext("__get__", 0);
10636
10637 /* "View.MemoryView":605
10638 * @property
10639 * def base(self):
10640 * return self._get_base() # <<<<<<<<<<<<<<
10641 *
10642 * cdef _get_base(self):
10643*/
10644 __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 605, __pyx_L1_error)
10645 __Pyx_GOTREF(__pyx_t_1);
10646 {
10647 PyObject *__pyx_temp;
10648 {
10649 __pyx_temp = __pyx_r;
10650 __pyx_r = __pyx_t_1;
10651 }
10652 __Pyx_XDECREF(__pyx_temp);
10653 }
10654 __pyx_t_1 = 0;
10655 goto __pyx_L0;
10656
10657 /* "View.MemoryView":603
10658 * return result
10659 *
10660 * @property # <<<<<<<<<<<<<<
10661 * def base(self):
10662 * return self._get_base()
10663*/
10664
10665 /* function exit code */
10666 __pyx_L1_error:;
10667 __Pyx_XDECREF(__pyx_t_1);
10668 __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10669 __pyx_r = NULL;
10670 __pyx_L0:;
10671 __Pyx_XGIVEREF(__pyx_r);
10672 __Pyx_RefNannyFinishContext();
10673 return __pyx_r;
10674}
10675
10676/* "View.MemoryView":607
10677 * return self._get_base()
10678 *
10679 * cdef _get_base(self): # <<<<<<<<<<<<<<
10680 * return self.obj
10681 *
10682*/
10683
10684static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
10685 PyObject *__pyx_r = NULL;
10686 __Pyx_RefNannyDeclarations
10687 __Pyx_RefNannySetupContext("_get_base", 0);
10688
10689 /* "View.MemoryView":608
10690 *
10691 * cdef _get_base(self):
10692 * return self.obj # <<<<<<<<<<<<<<
10693 *
10694 * @property
10695*/
10696 {
10697 PyObject *__pyx_temp;
10698 {
10699 __pyx_temp = __pyx_r;
10700 __Pyx_INCREF(__pyx_v_self->obj);
10701 __pyx_r = __pyx_v_self->obj;
10702 }
10703 __Pyx_XDECREF(__pyx_temp);
10704 }
10705 goto __pyx_L0;
10706
10707 /* "View.MemoryView":607
10708 * return self._get_base()
10709 *
10710 * cdef _get_base(self): # <<<<<<<<<<<<<<
10711 * return self.obj
10712 *
10713*/
10714
10715 /* function exit code */
10716 __pyx_L0:;
10717 __Pyx_XGIVEREF(__pyx_r);
10718 __Pyx_RefNannyFinishContext();
10719 return __pyx_r;
10720}
10721
10722/* "View.MemoryView":610
10723 * return self.obj
10724 *
10725 * @property # <<<<<<<<<<<<<<
10726 * def shape(self):
10727 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10728*/
10729
10730/* Python wrapper */
10731static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
10732static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10733 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10734 PyObject *__pyx_r = 0;
10735 __Pyx_RefNannyDeclarations
10736 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10737 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10738 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10739
10740 /* function exit code */
10741 __Pyx_RefNannyFinishContext();
10742 return __pyx_r;
10743}
10744
10745static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10746 Py_ssize_t __pyx_7genexpr__pyx_v_length;
10747 PyObject *__pyx_r = NULL;
10748 __Pyx_RefNannyDeclarations
10749 PyObject *__pyx_t_1 = NULL;
10750 Py_ssize_t *__pyx_t_2;
10751 Py_ssize_t *__pyx_t_3;
10752 Py_ssize_t *__pyx_t_4;
10753 PyObject *__pyx_t_5 = NULL;
10754 int __pyx_lineno = 0;
10755 const char *__pyx_filename = NULL;
10756 int __pyx_clineno = 0;
10757 __Pyx_RefNannySetupContext("__get__", 0);
10758
10759 /* "View.MemoryView":612
10760 * @property
10761 * def shape(self):
10762 * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
10763 *
10764 * @property
10765*/
10766 { /* enter inner scope */
10767 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
10768 __Pyx_GOTREF(__pyx_t_1);
10769 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10770
10771 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10772 __pyx_t_2 = __pyx_t_4;
10773 __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
10774 __pyx_t_5 = PyLong_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10775 __Pyx_GOTREF(__pyx_t_5);
10776 __Pyx_GIVEREF(__pyx_t_5);
10777 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, __pyx_t_5))) __PYX_ERR(1, 612, __pyx_L1_error)
10778 __pyx_t_5 = 0;
10779 }
10780
10781 } /* exit inner scope */
10782 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10783 __Pyx_GOTREF(__pyx_t_5);
10784 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10785 {
10786 PyObject *__pyx_temp;
10787 {
10788 __pyx_temp = __pyx_r;
10789 __pyx_r = __pyx_t_5;
10790 }
10791 __Pyx_XDECREF(__pyx_temp);
10792 }
10793 __pyx_t_5 = 0;
10794 goto __pyx_L0;
10795
10796 /* "View.MemoryView":610
10797 * return self.obj
10798 *
10799 * @property # <<<<<<<<<<<<<<
10800 * def shape(self):
10801 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10802*/
10803
10804 /* function exit code */
10805 __pyx_L1_error:;
10806 __Pyx_XDECREF(__pyx_t_1);
10807 __Pyx_XDECREF(__pyx_t_5);
10808 __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10809 __pyx_r = NULL;
10810 __pyx_L0:;
10811
10812 __Pyx_XGIVEREF(__pyx_r);
10813 __Pyx_RefNannyFinishContext();
10814 return __pyx_r;
10815}
10816
10817/* "View.MemoryView":614
10818 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10819 *
10820 * @property # <<<<<<<<<<<<<<
10821 * def strides(self):
10822 * if cython.unlikely(self.view.strides == NULL):
10823*/
10824
10825/* Python wrapper */
10826static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
10827static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10828 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10829 PyObject *__pyx_r = 0;
10830 __Pyx_RefNannyDeclarations
10831 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10832 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10833 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10834
10835 /* function exit code */
10836 __Pyx_RefNannyFinishContext();
10837 return __pyx_r;
10838}
10839
10840static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10841 Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
10842 PyObject *__pyx_r = NULL;
10843 __Pyx_RefNannyDeclarations
10844 int __pyx_t_1;
10845 int __pyx_t_2;
10846 PyObject *__pyx_t_3 = NULL;
10847 Py_ssize_t *__pyx_t_4;
10848 Py_ssize_t *__pyx_t_5;
10849 Py_ssize_t *__pyx_t_6;
10850 PyObject *__pyx_t_7 = NULL;
10851 int __pyx_lineno = 0;
10852 const char *__pyx_filename = NULL;
10853 int __pyx_clineno = 0;
10854 __Pyx_RefNannySetupContext("__get__", 0);
10855
10856 /* "View.MemoryView":616
10857 * @property
10858 * def strides(self):
10859 * if cython.unlikely(self.view.strides == NULL): # <<<<<<<<<<<<<<
10860 *
10861 * _err_ValueError("Buffer view does not expose strides")
10862*/
10863 __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
10864
10865 if (unlikely(__pyx_t_1)) {
10866
10867
10868 /* "View.MemoryView":618
10869 * if cython.unlikely(self.view.strides == NULL):
10870 *
10871 * _err_ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
10872 *
10873 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10874*/
10875 __pyx_t_2 = __pyx_memoryview_err_ValueError(__pyx_k_Buffer_view_does_not_expose_stri); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 618, __pyx_L1_error)
10876
10877
10878 /* "View.MemoryView":616
10879 * @property
10880 * def strides(self):
10881 * if cython.unlikely(self.view.strides == NULL): # <<<<<<<<<<<<<<
10882 *
10883 * _err_ValueError("Buffer view does not expose strides")
10884*/
10885 }
10886
10887 /* "View.MemoryView":620
10888 * _err_ValueError("Buffer view does not expose strides")
10889 *
10890 * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
10891 *
10892 * @property
10893*/
10894 { /* enter inner scope */
10895 __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 620, __pyx_L1_error)
10896 __Pyx_GOTREF(__pyx_t_3);
10897 __pyx_t_5 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
10898
10899 for (__pyx_t_6 = __pyx_v_self->view.strides; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
10900 __pyx_t_4 = __pyx_t_6;
10901 __pyx_8genexpr1__pyx_v_stride = (__pyx_t_4[0]);
10902 __pyx_t_7 = PyLong_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10903 __Pyx_GOTREF(__pyx_t_7);
10904 __Pyx_GIVEREF(__pyx_t_7);
10905 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_3, __pyx_t_7))) __PYX_ERR(1, 620, __pyx_L1_error)
10906 __pyx_t_7 = 0;
10907 }
10908
10909 } /* exit inner scope */
10910 __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10911 __Pyx_GOTREF(__pyx_t_7);
10912 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10913 {
10914 PyObject *__pyx_temp;
10915 {
10916 __pyx_temp = __pyx_r;
10917 __pyx_r = __pyx_t_7;
10918 }
10919 __Pyx_XDECREF(__pyx_temp);
10920 }
10921 __pyx_t_7 = 0;
10922 goto __pyx_L0;
10923
10924 /* "View.MemoryView":614
10925 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10926 *
10927 * @property # <<<<<<<<<<<<<<
10928 * def strides(self):
10929 * if cython.unlikely(self.view.strides == NULL):
10930*/
10931
10932 /* function exit code */
10933 __pyx_L1_error:;
10934 __Pyx_XDECREF(__pyx_t_3);
10935 __Pyx_XDECREF(__pyx_t_7);
10936 __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10937 __pyx_r = NULL;
10938 __pyx_L0:;
10939
10940 __Pyx_XGIVEREF(__pyx_r);
10941 __Pyx_RefNannyFinishContext();
10942 return __pyx_r;
10943}
10944
10945/* "View.MemoryView":622
10946 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10947 *
10948 * @property # <<<<<<<<<<<<<<
10949 * def suboffsets(self):
10950 * if self.view.suboffsets == NULL:
10951*/
10952
10953/* Python wrapper */
10954static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
10955static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
10956 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10957 PyObject *__pyx_r = 0;
10958 __Pyx_RefNannyDeclarations
10959 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10960 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10961 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10962
10963 /* function exit code */
10964 __Pyx_RefNannyFinishContext();
10965 return __pyx_r;
10966}
10967
10968static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10969 Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
10970 PyObject *__pyx_r = NULL;
10971 __Pyx_RefNannyDeclarations
10972 int __pyx_t_1;
10973 PyObject *__pyx_t_2 = NULL;
10974 Py_ssize_t *__pyx_t_3;
10975 Py_ssize_t *__pyx_t_4;
10976 Py_ssize_t *__pyx_t_5;
10977 PyObject *__pyx_t_6 = NULL;
10978 int __pyx_lineno = 0;
10979 const char *__pyx_filename = NULL;
10980 int __pyx_clineno = 0;
10981 __Pyx_RefNannySetupContext("__get__", 0);
10982
10983 /* "View.MemoryView":624
10984 * @property
10985 * def suboffsets(self):
10986 * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10987 * return (-1,) * self.view.ndim
10988 *
10989*/
10990 __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
10991
10992 if (__pyx_t_1) {
10993
10994
10995 /* "View.MemoryView":625
10996 * def suboffsets(self):
10997 * if self.view.suboffsets == NULL:
10998 * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
10999 *
11000 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11001*/
11002 __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[0], __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
11003 __Pyx_GOTREF(__pyx_t_2);
11004 {
11005 PyObject *__pyx_temp;
11006 {
11007 __pyx_temp = __pyx_r;
11008 __pyx_r = __pyx_t_2;
11009 }
11010 __Pyx_XDECREF(__pyx_temp);
11011 }
11012 __pyx_t_2 = 0;
11013 goto __pyx_L0;
11014
11015 /* "View.MemoryView":624
11016 * @property
11017 * def suboffsets(self):
11018 * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11019 * return (-1,) * self.view.ndim
11020 *
11021*/
11022 }
11023
11024 /* "View.MemoryView":627
11025 * return (-1,) * self.view.ndim
11026 *
11027 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
11028 *
11029 * @property
11030*/
11031 { /* enter inner scope */
11032 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error)
11033 __Pyx_GOTREF(__pyx_t_2);
11034 __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
11035
11036 for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11037 __pyx_t_3 = __pyx_t_5;
11038 __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
11039 __pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
11040 __Pyx_GOTREF(__pyx_t_6);
11041 __Pyx_GIVEREF(__pyx_t_6);
11042 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_2, __pyx_t_6))) __PYX_ERR(1, 627, __pyx_L1_error)
11043 __pyx_t_6 = 0;
11044 }
11045
11046 } /* exit inner scope */
11047 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
11048 __Pyx_GOTREF(__pyx_t_6);
11049 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11050 {
11051 PyObject *__pyx_temp;
11052 {
11053 __pyx_temp = __pyx_r;
11054 __pyx_r = __pyx_t_6;
11055 }
11056 __Pyx_XDECREF(__pyx_temp);
11057 }
11058 __pyx_t_6 = 0;
11059 goto __pyx_L0;
11060
11061 /* "View.MemoryView":622
11062 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11063 *
11064 * @property # <<<<<<<<<<<<<<
11065 * def suboffsets(self):
11066 * if self.view.suboffsets == NULL:
11067*/
11068
11069 /* function exit code */
11070 __pyx_L1_error:;
11071 __Pyx_XDECREF(__pyx_t_2);
11072 __Pyx_XDECREF(__pyx_t_6);
11073 __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11074 __pyx_r = NULL;
11075 __pyx_L0:;
11076
11077 __Pyx_XGIVEREF(__pyx_r);
11078 __Pyx_RefNannyFinishContext();
11079 return __pyx_r;
11080}
11081
11082/* "View.MemoryView":629
11083 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11084 *
11085 * @property # <<<<<<<<<<<<<<
11086 * def ndim(self):
11087 * return self.view.ndim
11088*/
11089
11090/* Python wrapper */
11091static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
11092static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11093 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11094 PyObject *__pyx_r = 0;
11095 __Pyx_RefNannyDeclarations
11096 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11097 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11098 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11099
11100 /* function exit code */
11101 __Pyx_RefNannyFinishContext();
11102 return __pyx_r;
11103}
11104
11105static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11106 PyObject *__pyx_r = NULL;
11107 __Pyx_RefNannyDeclarations
11108 PyObject *__pyx_t_1 = NULL;
11109 int __pyx_lineno = 0;
11110 const char *__pyx_filename = NULL;
11111 int __pyx_clineno = 0;
11112 __Pyx_RefNannySetupContext("__get__", 0);
11113
11114 /* "View.MemoryView":631
11115 * @property
11116 * def ndim(self):
11117 * return self.view.ndim # <<<<<<<<<<<<<<
11118 *
11119 * @property
11120*/
11121 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 631, __pyx_L1_error)
11122 __Pyx_GOTREF(__pyx_t_1);
11123 {
11124 PyObject *__pyx_temp;
11125 {
11126 __pyx_temp = __pyx_r;
11127 __pyx_r = __pyx_t_1;
11128 }
11129 __Pyx_XDECREF(__pyx_temp);
11130 }
11131 __pyx_t_1 = 0;
11132 goto __pyx_L0;
11133
11134 /* "View.MemoryView":629
11135 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11136 *
11137 * @property # <<<<<<<<<<<<<<
11138 * def ndim(self):
11139 * return self.view.ndim
11140*/
11141
11142 /* function exit code */
11143 __pyx_L1_error:;
11144 __Pyx_XDECREF(__pyx_t_1);
11145 __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11146 __pyx_r = NULL;
11147 __pyx_L0:;
11148 __Pyx_XGIVEREF(__pyx_r);
11149 __Pyx_RefNannyFinishContext();
11150 return __pyx_r;
11151}
11152
11153/* "View.MemoryView":633
11154 * return self.view.ndim
11155 *
11156 * @property # <<<<<<<<<<<<<<
11157 * def itemsize(self):
11158 * return self.view.itemsize
11159*/
11160
11161/* Python wrapper */
11162static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
11163static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
11164 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11165 PyObject *__pyx_r = 0;
11166 __Pyx_RefNannyDeclarations
11167 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11168 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11169 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11170
11171 /* function exit code */
11172 __Pyx_RefNannyFinishContext();
11173 return __pyx_r;
11174}
11175
11176static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11177 PyObject *__pyx_r = NULL;
11178 __Pyx_RefNannyDeclarations
11179 PyObject *__pyx_t_1 = NULL;
11180 int __pyx_lineno = 0;
11181 const char *__pyx_filename = NULL;
11182 int __pyx_clineno = 0;
11183 __Pyx_RefNannySetupContext("__get__", 0);
11184
11185 /* "View.MemoryView":635
11186 * @property
11187 * def itemsize(self):
11188 * return self.view.itemsize # <<<<<<<<<<<<<<
11189 *
11190 * @property
11191*/
11192 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 635, __pyx_L1_error)
11193 __Pyx_GOTREF(__pyx_t_1);
11194 {
11195 PyObject *__pyx_temp;
11196 {
11197 __pyx_temp = __pyx_r;
11198 __pyx_r = __pyx_t_1;
11199 }
11200 __Pyx_XDECREF(__pyx_temp);
11201 }
11202 __pyx_t_1 = 0;
11203 goto __pyx_L0;
11204
11205 /* "View.MemoryView":633
11206 * return self.view.ndim
11207 *
11208 * @property # <<<<<<<<<<<<<<
11209 * def itemsize(self):
11210 * return self.view.itemsize
11211*/
11212
11213 /* function exit code */
11214 __pyx_L1_error:;
11215 __Pyx_XDECREF(__pyx_t_1);
11216 __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11217 __pyx_r = NULL;
11218 __pyx_L0:;
11219 __Pyx_XGIVEREF(__pyx_r);
11220 __Pyx_RefNannyFinishContext();
11221 return __pyx_r;
11222}
11223
11224/* "View.MemoryView":637
11225 * return self.view.itemsize
11226 *
11227 * @property # <<<<<<<<<<<<<<
11228 * def nbytes(self):
11229 * return self.size * self.view.itemsize
11230*/
11231
11232/* Python wrapper */
11233static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
11234static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
11235 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11236 PyObject *__pyx_r = 0;
11237 __Pyx_RefNannyDeclarations
11238 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11239 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11240 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11241
11242 /* function exit code */
11243 __Pyx_RefNannyFinishContext();
11244 return __pyx_r;
11245}
11246
11247static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11248 PyObject *__pyx_r = NULL;
11249 __Pyx_RefNannyDeclarations
11250 PyObject *__pyx_t_1 = NULL;
11251 PyObject *__pyx_t_2 = NULL;
11252 PyObject *__pyx_t_3 = NULL;
11253 int __pyx_lineno = 0;
11254 const char *__pyx_filename = NULL;
11255 int __pyx_clineno = 0;
11256 __Pyx_RefNannySetupContext("__get__", 0);
11257
11258 /* "View.MemoryView":639
11259 * @property
11260 * def nbytes(self):
11261 * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
11262 *
11263 * @property
11264*/
11265 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 639, __pyx_L1_error)
11266 __Pyx_GOTREF(__pyx_t_1);
11267 __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
11268 __Pyx_GOTREF(__pyx_t_2);
11269 __pyx_t_3 = __Pyx_PyNumber_Multiply_object_int(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 639, __pyx_L1_error)
11270 __Pyx_GOTREF(__pyx_t_3);
11271 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11272 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11273 {
11274 PyObject *__pyx_temp;
11275 {
11276 __pyx_temp = __pyx_r;
11277 __pyx_r = __pyx_t_3;
11278 }
11279 __Pyx_XDECREF(__pyx_temp);
11280 }
11281 __pyx_t_3 = 0;
11282 goto __pyx_L0;
11283
11284 /* "View.MemoryView":637
11285 * return self.view.itemsize
11286 *
11287 * @property # <<<<<<<<<<<<<<
11288 * def nbytes(self):
11289 * return self.size * self.view.itemsize
11290*/
11291
11292 /* function exit code */
11293 __pyx_L1_error:;
11294 __Pyx_XDECREF(__pyx_t_1);
11295 __Pyx_XDECREF(__pyx_t_2);
11296 __Pyx_XDECREF(__pyx_t_3);
11297 __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11298 __pyx_r = NULL;
11299 __pyx_L0:;
11300 __Pyx_XGIVEREF(__pyx_r);
11301 __Pyx_RefNannyFinishContext();
11302 return __pyx_r;
11303}
11304
11305/* "View.MemoryView":641
11306 * return self.size * self.view.itemsize
11307 *
11308 * @property # <<<<<<<<<<<<<<
11309 * def size(self):
11310 * cdef size_t result
11311*/
11312
11313/* Python wrapper */
11314static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
11315static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11316 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11317 PyObject *__pyx_r = 0;
11318 __Pyx_RefNannyDeclarations
11319 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11320 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11321 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11322
11323 /* function exit code */
11324 __Pyx_RefNannyFinishContext();
11325 return __pyx_r;
11326}
11327
11328static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11329 size_t __pyx_v_result;
11330 Py_ssize_t __pyx_v_length;
11331 PyObject *__pyx_r = NULL;
11332 __Pyx_RefNannyDeclarations
11333 int __pyx_t_1;
11334 Py_ssize_t *__pyx_t_2;
11335 Py_ssize_t *__pyx_t_3;
11336 Py_ssize_t *__pyx_t_4;
11337 PyObject *__pyx_t_5 = NULL;
11338 int __pyx_lineno = 0;
11339 const char *__pyx_filename = NULL;
11340 int __pyx_clineno = 0;
11341 __Pyx_RefNannySetupContext("__get__", 0);
11342
11343 /* "View.MemoryView":644
11344 * def size(self):
11345 * cdef size_t result
11346 * if self._size is None: # <<<<<<<<<<<<<<
11347 * result = 1
11348 *
11349*/
11350 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11351 if (__pyx_t_1) {
11352
11353
11354 /* "View.MemoryView":645
11355 * cdef size_t result
11356 * if self._size is None:
11357 * result = 1 # <<<<<<<<<<<<<<
11358 *
11359 * for length in self.view.shape[:self.view.ndim]:
11360*/
11361 __pyx_v_result = 1;
11362
11363 /* "View.MemoryView":647
11364 * result = 1
11365 *
11366 * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
11367 * result *= <size_t> length
11368 *
11369*/
11370 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11371
11372 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11373 __pyx_t_2 = __pyx_t_4;
11374 __pyx_v_length = (__pyx_t_2[0]);
11375
11376 /* "View.MemoryView":648
11377 *
11378 * for length in self.view.shape[:self.view.ndim]:
11379 * result *= <size_t> length # <<<<<<<<<<<<<<
11380 *
11381 * self._size = result
11382*/
11383 __pyx_v_result = (__pyx_v_result * ((size_t)__pyx_v_length));
11384 }
11385
11386
11387 /* "View.MemoryView":650
11388 * result *= <size_t> length
11389 *
11390 * self._size = result # <<<<<<<<<<<<<<
11391 *
11392 * return self._size
11393*/
11394 __pyx_t_5 = __Pyx_PyLong_FromSize_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 650, __pyx_L1_error)
11395 __Pyx_GOTREF(__pyx_t_5);
11396 __Pyx_GIVEREF(__pyx_t_5);
11397 __Pyx_GOTREF(__pyx_v_self->_size);
11398 __Pyx_DECREF(__pyx_v_self->_size);
11399 __pyx_v_self->_size = __pyx_t_5;
11400 __pyx_t_5 = 0;
11401
11402 /* "View.MemoryView":644
11403 * def size(self):
11404 * cdef size_t result
11405 * if self._size is None: # <<<<<<<<<<<<<<
11406 * result = 1
11407 *
11408*/
11409 }
11410
11411 /* "View.MemoryView":652
11412 * self._size = result
11413 *
11414 * return self._size # <<<<<<<<<<<<<<
11415 *
11416 * def __len__(self):
11417*/
11418 {
11419 PyObject *__pyx_temp;
11420 {
11421 __pyx_temp = __pyx_r;
11422 __Pyx_INCREF(__pyx_v_self->_size);
11423 __pyx_r = __pyx_v_self->_size;
11424 }
11425 __Pyx_XDECREF(__pyx_temp);
11426 }
11427 goto __pyx_L0;
11428
11429 /* "View.MemoryView":641
11430 * return self.size * self.view.itemsize
11431 *
11432 * @property # <<<<<<<<<<<<<<
11433 * def size(self):
11434 * cdef size_t result
11435*/
11436
11437 /* function exit code */
11438 __pyx_L1_error:;
11439 __Pyx_XDECREF(__pyx_t_5);
11440 __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11441 __pyx_r = NULL;
11442 __pyx_L0:;
11443
11444
11445 __Pyx_XGIVEREF(__pyx_r);
11446 __Pyx_RefNannyFinishContext();
11447 return __pyx_r;
11448}
11449
11450/* "View.MemoryView":654
11451 * return self._size
11452 *
11453 * def __len__(self): # <<<<<<<<<<<<<<
11454 * if self.view.ndim >= 1:
11455 * return self.view.shape[0]
11456*/
11457
11458/* Python wrapper */
11459static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
11460static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11461 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11462 Py_ssize_t __pyx_r;
11463 __Pyx_RefNannyDeclarations
11464 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
11465 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11466 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11467
11468 /* function exit code */
11469 __Pyx_RefNannyFinishContext();
11470 return __pyx_r;
11471}
11472
11473static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
11474 Py_ssize_t __pyx_r;
11475 int __pyx_t_1;
11476
11477 /* "View.MemoryView":655
11478 *
11479 * def __len__(self):
11480 * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11481 * return self.view.shape[0]
11482 *
11483*/
11484 __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11485
11486 if (__pyx_t_1) {
11487
11488
11489 /* "View.MemoryView":656
11490 * def __len__(self):
11491 * if self.view.ndim >= 1:
11492 * return self.view.shape[0] # <<<<<<<<<<<<<<
11493 *
11494 * return 0
11495*/
11496 {
11497
11498 __pyx_r = (__pyx_v_self->view.shape[0]);
11499 }
11500 goto __pyx_L0;
11501
11502 /* "View.MemoryView":655
11503 *
11504 * def __len__(self):
11505 * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11506 * return self.view.shape[0]
11507 *
11508*/
11509 }
11510
11511 /* "View.MemoryView":658
11512 * return self.view.shape[0]
11513 *
11514 * return 0 # <<<<<<<<<<<<<<
11515 *
11516 * def __repr__(self):
11517*/
11518 {
11519
11520 __pyx_r = 0;
11521 }
11522 goto __pyx_L0;
11523
11524 /* "View.MemoryView":654
11525 * return self._size
11526 *
11527 * def __len__(self): # <<<<<<<<<<<<<<
11528 * if self.view.ndim >= 1:
11529 * return self.view.shape[0]
11530*/
11531
11532 /* function exit code */
11533 __pyx_L0:;
11534
11535 return __pyx_r;
11536}
11537
11538/* "View.MemoryView":660
11539 * return 0
11540 *
11541 * def __repr__(self): # <<<<<<<<<<<<<<
11542 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11543 * id(self))
11544*/
11545
11546/* Python wrapper */
11547static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
11548static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11549 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11550 PyObject *__pyx_r = 0;
11551 __Pyx_RefNannyDeclarations
11552 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11553 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11554 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11555
11556 /* function exit code */
11557 __Pyx_RefNannyFinishContext();
11558 return __pyx_r;
11559}
11560
11561static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
11562 PyObject *__pyx_r = NULL;
11563 __Pyx_RefNannyDeclarations
11564 PyObject *__pyx_t_1 = NULL;
11565 PyObject *__pyx_t_2 = NULL;
11566 PyObject *__pyx_t_3 = NULL;
11567 PyObject *__pyx_t_4[5];
11568 Py_ssize_t __pyx_t_5;
11569 int __pyx_t_6;
11570 int __pyx_lineno = 0;
11571 const char *__pyx_filename = NULL;
11572 int __pyx_clineno = 0;
11573 __Pyx_RefNannySetupContext("__repr__", 0);
11574
11575 /* "View.MemoryView":661
11576 *
11577 * def __repr__(self):
11578 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11579 * id(self))
11580 *
11581*/
11582 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11583 __Pyx_GOTREF(__pyx_t_1);
11584 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error)
11585 __Pyx_GOTREF(__pyx_t_2);
11586 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11587 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11588 __Pyx_GOTREF(__pyx_t_1);
11589 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11590 __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error)
11591 __Pyx_GOTREF(__pyx_t_2);
11592 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11593
11594 /* "View.MemoryView":662
11595 * def __repr__(self):
11596 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11597 * id(self)) # <<<<<<<<<<<<<<
11598 *
11599 * def __str__(self):
11600*/
11601 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 662, __pyx_L1_error)
11602 __Pyx_GOTREF(__pyx_t_1);
11603 __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error)
11604 __Pyx_GOTREF(__pyx_t_3);
11605 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11606 __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11607 __pyx_t_4[1] = __pyx_t_2;
11608 __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
11609 __pyx_t_4[3] = __pyx_t_3;
11610 __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__4;
11611
11612 /* "View.MemoryView":661
11613 *
11614 * def __repr__(self):
11615 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11616 * id(self))
11617 *
11618*/
11619 __pyx_t_5 = 22;
11620 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11621 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[3]);
11622 #endif
11623 __pyx_t_6 = 0;
11624 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11625 __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[3]);
11626 #endif
11627 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6);
11628 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11629 __Pyx_GOTREF(__pyx_t_1);
11630 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11631 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11632 {
11633 PyObject *__pyx_temp;
11634 {
11635 __pyx_temp = __pyx_r;
11636 __pyx_r = __pyx_t_1;
11637 }
11638 __Pyx_XDECREF(__pyx_temp);
11639 }
11640 __pyx_t_1 = 0;
11641 goto __pyx_L0;
11642
11643 /* "View.MemoryView":660
11644 * return 0
11645 *
11646 * def __repr__(self): # <<<<<<<<<<<<<<
11647 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11648 * id(self))
11649*/
11650
11651 /* function exit code */
11652 __pyx_L1_error:;
11653 __Pyx_XDECREF(__pyx_t_1);
11654 __Pyx_XDECREF(__pyx_t_2);
11655 __Pyx_XDECREF(__pyx_t_3);
11656 __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11657 __pyx_r = NULL;
11658 __pyx_L0:;
11659 __Pyx_XGIVEREF(__pyx_r);
11660 __Pyx_RefNannyFinishContext();
11661 return __pyx_r;
11662}
11663
11664/* "View.MemoryView":664
11665 * id(self))
11666 *
11667 * def __str__(self): # <<<<<<<<<<<<<<
11668 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11669 *
11670*/
11671
11672/* Python wrapper */
11673static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
11674static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11675 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11676 PyObject *__pyx_r = 0;
11677 __Pyx_RefNannyDeclarations
11678 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
11679 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11680 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11681
11682 /* function exit code */
11683 __Pyx_RefNannyFinishContext();
11684 return __pyx_r;
11685}
11686
11687static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
11688 PyObject *__pyx_r = NULL;
11689 __Pyx_RefNannyDeclarations
11690 PyObject *__pyx_t_1 = NULL;
11691 PyObject *__pyx_t_2 = NULL;
11692 PyObject *__pyx_t_3[3];
11693 Py_ssize_t __pyx_t_4;
11694 int __pyx_t_5;
11695 int __pyx_lineno = 0;
11696 const char *__pyx_filename = NULL;
11697 int __pyx_clineno = 0;
11698 __Pyx_RefNannySetupContext("__str__", 0);
11699
11700 /* "View.MemoryView":665
11701 *
11702 * def __str__(self):
11703 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
11704 *
11705 *
11706*/
11707 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11708 __Pyx_GOTREF(__pyx_t_1);
11709 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 665, __pyx_L1_error)
11710 __Pyx_GOTREF(__pyx_t_2);
11711 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11712 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11713 __Pyx_GOTREF(__pyx_t_1);
11714 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11715 __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 665, __pyx_L1_error)
11716 __Pyx_GOTREF(__pyx_t_2);
11717 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11718 __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11719 __pyx_t_3[1] = __pyx_t_2;
11720 __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object_2;
11721 __pyx_t_4 = 23;
11722 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11723 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]);
11724 #endif
11725 __pyx_t_5 = 0;
11726 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11727 __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]);
11728 #endif
11729 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5);
11730 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11731 __Pyx_GOTREF(__pyx_t_1);
11732 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11733 {
11734 PyObject *__pyx_temp;
11735 {
11736 __pyx_temp = __pyx_r;
11737 __pyx_r = __pyx_t_1;
11738 }
11739 __Pyx_XDECREF(__pyx_temp);
11740 }
11741 __pyx_t_1 = 0;
11742 goto __pyx_L0;
11743
11744 /* "View.MemoryView":664
11745 * id(self))
11746 *
11747 * def __str__(self): # <<<<<<<<<<<<<<
11748 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11749 *
11750*/
11751
11752 /* function exit code */
11753 __pyx_L1_error:;
11754 __Pyx_XDECREF(__pyx_t_1);
11755 __Pyx_XDECREF(__pyx_t_2);
11756 __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11757 __pyx_r = NULL;
11758 __pyx_L0:;
11759 __Pyx_XGIVEREF(__pyx_r);
11760 __Pyx_RefNannyFinishContext();
11761 return __pyx_r;
11762}
11763
11764/* "View.MemoryView":668
11765 *
11766 *
11767 * def is_c_contig(self): # <<<<<<<<<<<<<<
11768 * cdef __Pyx_memviewslice *mslice
11769 * cdef __Pyx_memviewslice tmp
11770*/
11771
11772/* Python wrapper */
11773static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11774#if CYTHON_VECTORCALL
11775PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11776#else
11777PyObject *__pyx_args, PyObject *__pyx_kwds
11778#endif
11779); /*proto*/
11780static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11781#if CYTHON_VECTORCALL
11782PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11783#else
11784PyObject *__pyx_args, PyObject *__pyx_kwds
11785#endif
11786) {
11787 #if !CYTHON_VECTORCALL
11788 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11789 #endif
11790 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11791 PyObject *__pyx_r = 0;
11792 __Pyx_RefNannyDeclarations
11793 __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
11794 #if !CYTHON_VECTORCALL
11795 #if CYTHON_ASSUME_SAFE_SIZE
11796 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11797 #else
11798 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11799 #endif
11800 #endif
11801 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11802 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL; }
11803 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11804 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11805 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_c_contig", __pyx_kwds); return NULL;}
11806 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11807
11808 /* function exit code */
11809 __Pyx_RefNannyFinishContext();
11810 return __pyx_r;
11811}
11812
11813static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11814 __Pyx_memviewslice *__pyx_v_mslice;
11815 __Pyx_memviewslice __pyx_v_tmp;
11816 PyObject *__pyx_r = NULL;
11817 __Pyx_RefNannyDeclarations
11818 __Pyx_memviewslice *__pyx_t_1;
11819 PyObject *__pyx_t_2 = NULL;
11820 int __pyx_lineno = 0;
11821 const char *__pyx_filename = NULL;
11822 int __pyx_clineno = 0;
11823 __Pyx_RefNannySetupContext("is_c_contig", 0);
11824
11825 /* "View.MemoryView":671
11826 * cdef __Pyx_memviewslice *mslice
11827 * cdef __Pyx_memviewslice tmp
11828 * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11829 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11830 *
11831*/
11832 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 671, __pyx_L1_error)
11833 __pyx_v_mslice = __pyx_t_1;
11834
11835 /* "View.MemoryView":672
11836 * cdef __Pyx_memviewslice tmp
11837 * mslice = get_slice_from_memview(self, &tmp)
11838 * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
11839 *
11840 * def is_f_contig(self):
11841*/
11842 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 672, __pyx_L1_error)
11843 __Pyx_GOTREF(__pyx_t_2);
11844 {
11845 PyObject *__pyx_temp;
11846 {
11847 __pyx_temp = __pyx_r;
11848 __pyx_r = __pyx_t_2;
11849 }
11850 __Pyx_XDECREF(__pyx_temp);
11851 }
11852 __pyx_t_2 = 0;
11853 goto __pyx_L0;
11854
11855 /* "View.MemoryView":668
11856 *
11857 *
11858 * def is_c_contig(self): # <<<<<<<<<<<<<<
11859 * cdef __Pyx_memviewslice *mslice
11860 * cdef __Pyx_memviewslice tmp
11861*/
11862
11863 /* function exit code */
11864 __pyx_L1_error:;
11865 __Pyx_XDECREF(__pyx_t_2);
11866 __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11867 __pyx_r = NULL;
11868 __pyx_L0:;
11869
11870
11871 __Pyx_XGIVEREF(__pyx_r);
11872 __Pyx_RefNannyFinishContext();
11873 return __pyx_r;
11874}
11875
11876/* "View.MemoryView":674
11877 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11878 *
11879 * def is_f_contig(self): # <<<<<<<<<<<<<<
11880 * cdef __Pyx_memviewslice *mslice
11881 * cdef __Pyx_memviewslice tmp
11882*/
11883
11884/* Python wrapper */
11885static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11886#if CYTHON_VECTORCALL
11887PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11888#else
11889PyObject *__pyx_args, PyObject *__pyx_kwds
11890#endif
11891); /*proto*/
11892static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11893#if CYTHON_VECTORCALL
11894PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11895#else
11896PyObject *__pyx_args, PyObject *__pyx_kwds
11897#endif
11898) {
11899 #if !CYTHON_VECTORCALL
11900 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11901 #endif
11902 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11903 PyObject *__pyx_r = 0;
11904 __Pyx_RefNannyDeclarations
11905 __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
11906 #if !CYTHON_VECTORCALL
11907 #if CYTHON_ASSUME_SAFE_SIZE
11908 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11909 #else
11910 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11911 #endif
11912 #endif
11913 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11914 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL; }
11915 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11916 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11917 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_f_contig", __pyx_kwds); return NULL;}
11918 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11919
11920 /* function exit code */
11921 __Pyx_RefNannyFinishContext();
11922 return __pyx_r;
11923}
11924
11925static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11926 __Pyx_memviewslice *__pyx_v_mslice;
11927 __Pyx_memviewslice __pyx_v_tmp;
11928 PyObject *__pyx_r = NULL;
11929 __Pyx_RefNannyDeclarations
11930 __Pyx_memviewslice *__pyx_t_1;
11931 PyObject *__pyx_t_2 = NULL;
11932 int __pyx_lineno = 0;
11933 const char *__pyx_filename = NULL;
11934 int __pyx_clineno = 0;
11935 __Pyx_RefNannySetupContext("is_f_contig", 0);
11936
11937 /* "View.MemoryView":677
11938 * cdef __Pyx_memviewslice *mslice
11939 * cdef __Pyx_memviewslice tmp
11940 * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11941 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11942 *
11943*/
11944 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 677, __pyx_L1_error)
11945 __pyx_v_mslice = __pyx_t_1;
11946
11947 /* "View.MemoryView":678
11948 * cdef __Pyx_memviewslice tmp
11949 * mslice = get_slice_from_memview(self, &tmp)
11950 * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
11951 *
11952 * def copy(self):
11953*/
11954 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 678, __pyx_L1_error)
11955 __Pyx_GOTREF(__pyx_t_2);
11956 {
11957 PyObject *__pyx_temp;
11958 {
11959 __pyx_temp = __pyx_r;
11960 __pyx_r = __pyx_t_2;
11961 }
11962 __Pyx_XDECREF(__pyx_temp);
11963 }
11964 __pyx_t_2 = 0;
11965 goto __pyx_L0;
11966
11967 /* "View.MemoryView":674
11968 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11969 *
11970 * def is_f_contig(self): # <<<<<<<<<<<<<<
11971 * cdef __Pyx_memviewslice *mslice
11972 * cdef __Pyx_memviewslice tmp
11973*/
11974
11975 /* function exit code */
11976 __pyx_L1_error:;
11977 __Pyx_XDECREF(__pyx_t_2);
11978 __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11979 __pyx_r = NULL;
11980 __pyx_L0:;
11981
11982
11983 __Pyx_XGIVEREF(__pyx_r);
11984 __Pyx_RefNannyFinishContext();
11985 return __pyx_r;
11986}
11987
11988/* "View.MemoryView":680
11989 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11990 *
11991 * def copy(self): # <<<<<<<<<<<<<<
11992 * cdef __Pyx_memviewslice mslice
11993 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11994*/
11995
11996/* Python wrapper */
11997static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11998#if CYTHON_VECTORCALL
11999PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12000#else
12001PyObject *__pyx_args, PyObject *__pyx_kwds
12002#endif
12003); /*proto*/
12004static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
12005#if CYTHON_VECTORCALL
12006PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12007#else
12008PyObject *__pyx_args, PyObject *__pyx_kwds
12009#endif
12010) {
12011 #if !CYTHON_VECTORCALL
12012 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12013 #endif
12014 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12015 PyObject *__pyx_r = 0;
12016 __Pyx_RefNannyDeclarations
12017 __Pyx_RefNannySetupContext("copy (wrapper)", 0);
12018 #if !CYTHON_VECTORCALL
12019 #if CYTHON_ASSUME_SAFE_SIZE
12020 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12021 #else
12022 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12023 #endif
12024 #endif
12025 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12026 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
12027 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12028 if (unlikely(__pyx_kwds_len < 0)) return NULL;
12029 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
12030 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
12031
12032 /* function exit code */
12033 __Pyx_RefNannyFinishContext();
12034 return __pyx_r;
12035}
12036
12037static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
12038 __Pyx_memviewslice __pyx_v_mslice;
12039 int __pyx_v_flags;
12040 PyObject *__pyx_r = NULL;
12041 __Pyx_RefNannyDeclarations
12042 __Pyx_memviewslice __pyx_t_1;
12043 PyObject *__pyx_t_2 = NULL;
12044 int __pyx_lineno = 0;
12045 const char *__pyx_filename = NULL;
12046 int __pyx_clineno = 0;
12047 __Pyx_RefNannySetupContext("copy", 0);
12048
12049 /* "View.MemoryView":682
12050 * def copy(self):
12051 * cdef __Pyx_memviewslice mslice
12052 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
12053 *
12054 * slice_copy(self, &mslice)
12055*/
12056 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12057
12058 /* "View.MemoryView":684
12059 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12060 *
12061 * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
12062 * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
12063 * self.view.itemsize,
12064*/
12065 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12066
12067 /* "View.MemoryView":685
12068 *
12069 * slice_copy(self, &mslice)
12070 * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
12071 * self.view.itemsize,
12072 * flags|PyBUF_C_CONTIGUOUS,
12073*/
12074 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 685, __pyx_L1_error)
12075 __pyx_v_mslice = __pyx_t_1;
12076
12077 /* "View.MemoryView":690
12078 * self.dtype_is_object)
12079 *
12080 * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
12081 *
12082 * def copy_fortran(self):
12083*/
12084 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 690, __pyx_L1_error)
12085 __Pyx_GOTREF(__pyx_t_2);
12086 {
12087 PyObject *__pyx_temp;
12088 {
12089 __pyx_temp = __pyx_r;
12090 __pyx_r = __pyx_t_2;
12091 }
12092 __Pyx_XDECREF(__pyx_temp);
12093 }
12094 __pyx_t_2 = 0;
12095 goto __pyx_L0;
12096
12097 /* "View.MemoryView":680
12098 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12099 *
12100 * def copy(self): # <<<<<<<<<<<<<<
12101 * cdef __Pyx_memviewslice mslice
12102 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12103*/
12104
12105 /* function exit code */
12106 __pyx_L1_error:;
12107 __Pyx_XDECREF(__pyx_t_2);
12108 __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12109 __pyx_r = NULL;
12110 __pyx_L0:;
12111
12112
12113 __Pyx_XGIVEREF(__pyx_r);
12114 __Pyx_RefNannyFinishContext();
12115 return __pyx_r;
12116}
12117
12118/* "View.MemoryView":692
12119 * return memoryview_copy_from_slice(self, &mslice)
12120 *
12121 * def copy_fortran(self): # <<<<<<<<<<<<<<
12122 * cdef __Pyx_memviewslice src, dst
12123 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12124*/
12125
12126/* Python wrapper */
12127static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12128#if CYTHON_VECTORCALL
12129PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12130#else
12131PyObject *__pyx_args, PyObject *__pyx_kwds
12132#endif
12133); /*proto*/
12134static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12135#if CYTHON_VECTORCALL
12136PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12137#else
12138PyObject *__pyx_args, PyObject *__pyx_kwds
12139#endif
12140) {
12141 #if !CYTHON_VECTORCALL
12142 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12143 #endif
12144 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12145 PyObject *__pyx_r = 0;
12146 __Pyx_RefNannyDeclarations
12147 __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
12148 #if !CYTHON_VECTORCALL
12149 #if CYTHON_ASSUME_SAFE_SIZE
12150 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12151 #else
12152 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12153 #endif
12154 #endif
12155 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12156 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL; }
12157 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12158 if (unlikely(__pyx_kwds_len < 0)) return NULL;
12159 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy_fortran", __pyx_kwds); return NULL;}
12160 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
12161
12162 /* function exit code */
12163 __Pyx_RefNannyFinishContext();
12164 return __pyx_r;
12165}
12166
12167static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
12168 __Pyx_memviewslice __pyx_v_src;
12169 __Pyx_memviewslice __pyx_v_dst;
12170 int __pyx_v_flags;
12171 PyObject *__pyx_r = NULL;
12172 __Pyx_RefNannyDeclarations
12173 __Pyx_memviewslice __pyx_t_1;
12174 PyObject *__pyx_t_2 = NULL;
12175 int __pyx_lineno = 0;
12176 const char *__pyx_filename = NULL;
12177 int __pyx_clineno = 0;
12178 __Pyx_RefNannySetupContext("copy_fortran", 0);
12179
12180 /* "View.MemoryView":694
12181 * def copy_fortran(self):
12182 * cdef __Pyx_memviewslice src, dst
12183 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
12184 *
12185 * slice_copy(self, &src)
12186*/
12187 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12188
12189 /* "View.MemoryView":696
12190 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12191 *
12192 * slice_copy(self, &src) # <<<<<<<<<<<<<<
12193 * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
12194 * self.view.itemsize,
12195*/
12196 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12197
12198 /* "View.MemoryView":697
12199 *
12200 * slice_copy(self, &src)
12201 * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
12202 * self.view.itemsize,
12203 * flags|PyBUF_F_CONTIGUOUS,
12204*/
12205 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 697, __pyx_L1_error)
12206 __pyx_v_dst = __pyx_t_1;
12207
12208 /* "View.MemoryView":702
12209 * self.dtype_is_object)
12210 *
12211 * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
12212 *
12213 *
12214*/
12215 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 702, __pyx_L1_error)
12216 __Pyx_GOTREF(__pyx_t_2);
12217 {
12218 PyObject *__pyx_temp;
12219 {
12220 __pyx_temp = __pyx_r;
12221 __pyx_r = __pyx_t_2;
12222 }
12223 __Pyx_XDECREF(__pyx_temp);
12224 }
12225 __pyx_t_2 = 0;
12226 goto __pyx_L0;
12227
12228 /* "View.MemoryView":692
12229 * return memoryview_copy_from_slice(self, &mslice)
12230 *
12231 * def copy_fortran(self): # <<<<<<<<<<<<<<
12232 * cdef __Pyx_memviewslice src, dst
12233 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12234*/
12235
12236 /* function exit code */
12237 __pyx_L1_error:;
12238 __Pyx_XDECREF(__pyx_t_2);
12239 __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12240 __pyx_r = NULL;
12241 __pyx_L0:;
12242
12243
12244
12245 __Pyx_XGIVEREF(__pyx_r);
12246 __Pyx_RefNannyFinishContext();
12247 return __pyx_r;
12248}
12249
12250/* "(tree fragment)":1
12251 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12252 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12253 * def __setstate_cython__(self, __pyx_state):
12254*/
12255
12256/* Python wrapper */
12257static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12258#if CYTHON_VECTORCALL
12259PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12260#else
12261PyObject *__pyx_args, PyObject *__pyx_kwds
12262#endif
12263); /*proto*/
12264static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12265#if CYTHON_VECTORCALL
12266PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12267#else
12268PyObject *__pyx_args, PyObject *__pyx_kwds
12269#endif
12270) {
12271 #if !CYTHON_VECTORCALL
12272 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12273 #endif
12274 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12275 PyObject *__pyx_r = 0;
12276 __Pyx_RefNannyDeclarations
12277 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12278 #if !CYTHON_VECTORCALL
12279 #if CYTHON_ASSUME_SAFE_SIZE
12280 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12281 #else
12282 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12283 #endif
12284 #endif
12285 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12286 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
12287 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12288 if (unlikely(__pyx_kwds_len < 0)) return NULL;
12289 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
12290 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12291
12292 /* function exit code */
12293 __Pyx_RefNannyFinishContext();
12294 return __pyx_r;
12295}
12296
12297static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
12298 PyObject *__pyx_r = NULL;
12299 __Pyx_RefNannyDeclarations
12300 int __pyx_lineno = 0;
12301 const char *__pyx_filename = NULL;
12302 int __pyx_clineno = 0;
12303 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12304
12305 /* "(tree fragment)":2
12306 * def __reduce_cython__(self):
12307 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12308 * def __setstate_cython__(self, __pyx_state):
12309 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12310*/
12311 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12312 __PYX_ERR(1, 2, __pyx_L1_error)
12313
12314 /* "(tree fragment)":1
12315 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12316 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12317 * def __setstate_cython__(self, __pyx_state):
12318*/
12319
12320 /* function exit code */
12321 __pyx_L1_error:;
12322 __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12323 __pyx_r = NULL;
12324 __Pyx_XGIVEREF(__pyx_r);
12325 __Pyx_RefNannyFinishContext();
12326 return __pyx_r;
12327}
12328
12329/* "(tree fragment)":3
12330 * def __reduce_cython__(self):
12331 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12332 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12333 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12334*/
12335
12336/* Python wrapper */
12337static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12338#if CYTHON_VECTORCALL
12339PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12340#else
12341PyObject *__pyx_args, PyObject *__pyx_kwds
12342#endif
12343); /*proto*/
12344static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12345#if CYTHON_VECTORCALL
12346PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12347#else
12348PyObject *__pyx_args, PyObject *__pyx_kwds
12349#endif
12350) {
12351 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
12352 #if !CYTHON_VECTORCALL
12353 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12354 #endif
12355 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12356 PyObject* values[1] = {0};
12357 int __pyx_lineno = 0;
12358 const char *__pyx_filename = NULL;
12359 int __pyx_clineno = 0;
12360 PyObject *__pyx_r = 0;
12361 __Pyx_RefNannyDeclarations
12362 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12363 #if !CYTHON_VECTORCALL
12364 #if CYTHON_ASSUME_SAFE_SIZE
12365 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12366 #else
12367 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12368 #endif
12369 #endif
12370 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12371 {
12372 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
12373 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12374 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
12375 if (__pyx_kwds_len > 0) {
12376 switch (__pyx_nargs) {
12377 case 1:
12378 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12379 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12380 CYTHON_FALLTHROUGH;
12381 case 0: break;
12382 default: goto __pyx_L5_argtuple_error;
12383 }
12384 const Py_ssize_t kwd_pos_args = __pyx_nargs;
12385 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
12386 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
12387 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
12388 }
12389 } else if (unlikely(__pyx_nargs != 1)) {
12390 goto __pyx_L5_argtuple_error;
12391 } else {
12392 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12393 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12394 }
12395 __pyx_v___pyx_state = values[0];
12396 }
12397 goto __pyx_L6_skip;
12398 __pyx_L5_argtuple_error:;
12399 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
12400 __pyx_L6_skip:;
12401 goto __pyx_L4_argument_unpacking_done;
12402 __pyx_L3_error:;
12403 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12404 Py_XDECREF(values[__pyx_temp]);
12405 }
12406 __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12407 __Pyx_RefNannyFinishContext();
12408 return NULL;
12409 __pyx_L4_argument_unpacking_done:;
12410 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
12411
12412 /* function exit code */
12413 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12414 Py_XDECREF(values[__pyx_temp]);
12415 }
12416 __Pyx_RefNannyFinishContext();
12417 return __pyx_r;
12418}
12419
12420static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12421 PyObject *__pyx_r = NULL;
12422 __Pyx_RefNannyDeclarations
12423 int __pyx_lineno = 0;
12424 const char *__pyx_filename = NULL;
12425 int __pyx_clineno = 0;
12426 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12427
12428 /* "(tree fragment)":4
12429 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12430 * def __setstate_cython__(self, __pyx_state):
12431 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12432*/
12433 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12434 __PYX_ERR(1, 4, __pyx_L1_error)
12435
12436 /* "(tree fragment)":3
12437 * def __reduce_cython__(self):
12438 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12439 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12440 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12441*/
12442
12443 /* function exit code */
12444 __pyx_L1_error:;
12445 __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12446 __pyx_r = NULL;
12447 __Pyx_XGIVEREF(__pyx_r);
12448 __Pyx_RefNannyFinishContext();
12449 return __pyx_r;
12450}
12451
12452/* "View.MemoryView":705
12453 *
12454 *
12455 * @cname('__pyx_memoryview_new') # <<<<<<<<<<<<<<
12456 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12457 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12458*/
12459
12460static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo const *__pyx_v_typeinfo) {
12461 struct __pyx_memoryview_obj *__pyx_v_result = 0;
12462 PyObject *__pyx_r = NULL;
12463 __Pyx_RefNannyDeclarations
12464 PyObject *__pyx_t_1 = NULL;
12465 PyObject *__pyx_t_2 = NULL;
12466 PyObject *__pyx_t_3 = NULL;
12467 PyObject *__pyx_t_4 = NULL;
12468 size_t __pyx_t_5;
12469 int __pyx_lineno = 0;
12470 const char *__pyx_filename = NULL;
12471 int __pyx_clineno = 0;
12472 __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
12473
12474 /* "View.MemoryView":707
12475 * @cname('__pyx_memoryview_new')
12476 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12477 * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
12478 * result.typeinfo = typeinfo
12479 * return result
12480*/
12481 __pyx_t_2 = NULL;
12482 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 707, __pyx_L1_error)
12483 __Pyx_GOTREF(__pyx_t_3);
12484 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 707, __pyx_L1_error)
12485 __Pyx_GOTREF(__pyx_t_4);
12486 __pyx_t_5 = 1;
12487 {
12488 PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_o, __pyx_t_3, __pyx_t_4};
12489 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
12490 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12491 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12492 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12493 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 707, __pyx_L1_error)
12494 __Pyx_GOTREF((PyObject *)__pyx_t_1);
12495 }
12496 __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_1);
12497 __pyx_t_1 = 0;
12498
12499 /* "View.MemoryView":708
12500 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12501 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12502 * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
12503 * return result
12504 *
12505*/
12506 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12507
12508 /* "View.MemoryView":709
12509 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12510 * result.typeinfo = typeinfo
12511 * return result # <<<<<<<<<<<<<<
12512 *
12513 * @cname('__pyx_memoryview_check')
12514*/
12515 {
12516 PyObject *__pyx_temp;
12517 {
12518 __pyx_temp = __pyx_r;
12519 __Pyx_INCREF((PyObject *)__pyx_v_result);
12520 __pyx_r = ((PyObject *)__pyx_v_result);
12521 }
12522 __Pyx_XDECREF(__pyx_temp);
12523 }
12524 goto __pyx_L0;
12525
12526 /* "View.MemoryView":705
12527 *
12528 *
12529 * @cname('__pyx_memoryview_new') # <<<<<<<<<<<<<<
12530 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12531 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12532*/
12533
12534 /* function exit code */
12535 __pyx_L1_error:;
12536 __Pyx_XDECREF(__pyx_t_1);
12537 __Pyx_XDECREF(__pyx_t_2);
12538 __Pyx_XDECREF(__pyx_t_3);
12539 __Pyx_XDECREF(__pyx_t_4);
12540 __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12541 __pyx_r = 0;
12542 __pyx_L0:;
12543 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12544 __Pyx_XGIVEREF(__pyx_r);
12545 __Pyx_RefNannyFinishContext();
12546 return __pyx_r;
12547}
12548
12549/* "View.MemoryView":711
12550 * return result
12551 *
12552 * @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
12553 * cdef inline bint memoryview_check(object o) noexcept:
12554 * return isinstance(o, memoryview)
12555*/
12556
12557static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12558 int __pyx_r;
12559 int __pyx_t_1;
12560
12561 /* "View.MemoryView":713
12562 * @cname('__pyx_memoryview_check')
12563 * cdef inline bint memoryview_check(object o) noexcept:
12564 * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
12565 *
12566 *
12567*/
12568 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type);
12569 {
12570 __pyx_r = __pyx_t_1;
12571 }
12572 goto __pyx_L0;
12573
12574 /* "View.MemoryView":711
12575 * return result
12576 *
12577 * @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
12578 * cdef inline bint memoryview_check(object o) noexcept:
12579 * return isinstance(o, memoryview)
12580*/
12581
12582 /* function exit code */
12583 __pyx_L0:;
12584
12585 return __pyx_r;
12586}
12587
12588/* "View.MemoryView":716
12589 *
12590 *
12591 * @cname('__pyx_memoryview_err_invalid_index') # <<<<<<<<<<<<<<
12592 * cdef int _err_invalid_index(item) except -1:
12593 * type_name = str(type(item))
12594*/
12595
12596static int __pyx_memoryview_err_invalid_index(PyObject *__pyx_v_item) {
12597 PyObject *__pyx_v_type_name = NULL;
12598 int __pyx_r;
12599 __Pyx_RefNannyDeclarations
12600 PyObject *__pyx_t_1 = NULL;
12601 int __pyx_lineno = 0;
12602 const char *__pyx_filename = NULL;
12603 int __pyx_clineno = 0;
12604 __Pyx_RefNannySetupContext("_err_invalid_index", 0);
12605
12606 /* "View.MemoryView":718
12607 * @cname('__pyx_memoryview_err_invalid_index')
12608 * cdef int _err_invalid_index(item) except -1:
12609 * type_name = str(type(item)) # <<<<<<<<<<<<<<
12610 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name)
12611 * return -1
12612*/
12613 __pyx_t_1 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
12614 __Pyx_GOTREF(__pyx_t_1);
12615 __pyx_v_type_name = ((PyObject*)__pyx_t_1);
12616 __pyx_t_1 = 0;
12617
12618 /* "View.MemoryView":719
12619 * cdef int _err_invalid_index(item) except -1:
12620 * type_name = str(type(item))
12621 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name) # <<<<<<<<<<<<<<
12622 * return -1
12623 *
12624*/
12625 (void)(PyErr_Format(PyExc_TypeError, __pyx_k_Cannot_index_with_type_200U, ((PyObject *)__pyx_v_type_name)));
12626
12627 /* "View.MemoryView":720
12628 * type_name = str(type(item))
12629 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name)
12630 * return -1 # <<<<<<<<<<<<<<
12631 *
12632 *
12633*/
12634 {
12635
12636 __pyx_r = -1;
12637 }
12638 goto __pyx_L0;
12639
12640 /* "View.MemoryView":716
12641 *
12642 *
12643 * @cname('__pyx_memoryview_err_invalid_index') # <<<<<<<<<<<<<<
12644 * cdef int _err_invalid_index(item) except -1:
12645 * type_name = str(type(item))
12646*/
12647
12648 /* function exit code */
12649 __pyx_L1_error:;
12650 __Pyx_XDECREF(__pyx_t_1);
12651 __Pyx_AddTraceback("View.MemoryView._err_invalid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
12652 __pyx_r = -1;
12653 __pyx_L0:;
12654 __Pyx_XDECREF(__pyx_v_type_name);
12655
12656 __Pyx_RefNannyFinishContext();
12657 return __pyx_r;
12658}
12659
12660/* "View.MemoryView":723
12661 *
12662 *
12663 * cdef tuple[bint, tuple] _unellipsify_index_tuple(index_tuple: tuple, int ndim): # <<<<<<<<<<<<<<
12664 * """
12665 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12666*/
12667
12668static PyObject *_unellipsify_index_tuple(PyObject *__pyx_v_index_tuple, int __pyx_v_ndim) {
12669 Py_ssize_t __pyx_v_first_ellipsis_index;
12670 Py_ssize_t __pyx_v_idx;
12671 Py_ssize_t __pyx_v_ellipsis_end;
12672 Py_ssize_t __pyx_v_indices_from_ellipsis;
12673 int __pyx_v_have_slices;
12674 PyObject *__pyx_v_item = NULL;
12675 PyObject *__pyx_v_result = NULL;
12676 PyObject *__pyx_r = NULL;
12677 __Pyx_RefNannyDeclarations
12678 PyObject *__pyx_t_1 = NULL;
12679 Py_ssize_t __pyx_t_2;
12680 PyObject *__pyx_t_3 = NULL;
12681 int __pyx_t_4;
12682 int __pyx_t_5;
12683 Py_ssize_t __pyx_t_6;
12684 Py_ssize_t __pyx_t_7;
12685 Py_ssize_t __pyx_t_8;
12686 int __pyx_lineno = 0;
12687 const char *__pyx_filename = NULL;
12688 int __pyx_clineno = 0;
12689 __Pyx_RefNannySetupContext("_unellipsify_index_tuple", 0);
12690 __Pyx_INCREF(__pyx_v_index_tuple);
12691
12692 /* "View.MemoryView":727
12693 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12694 * """
12695 * cdef Py_ssize_t first_ellipsis_index = -1 # <<<<<<<<<<<<<<
12696 * cdef Py_ssize_t idx, ellipsis_end, indices_from_ellipsis
12697 *
12698*/
12699 __pyx_v_first_ellipsis_index = -1L;
12700
12701 /* "View.MemoryView":730
12702 * cdef Py_ssize_t idx, ellipsis_end, indices_from_ellipsis
12703 *
12704 * have_slices = False # <<<<<<<<<<<<<<
12705 *
12706 * idx = 0
12707*/
12708 __pyx_v_have_slices = 0;
12709
12710 /* "View.MemoryView":732
12711 * have_slices = False
12712 *
12713 * idx = 0 # <<<<<<<<<<<<<<
12714 * for item in index_tuple:
12715 * if item is Ellipsis:
12716*/
12717 __pyx_v_idx = 0;
12718
12719 /* "View.MemoryView":733
12720 *
12721 * idx = 0
12722 * for item in index_tuple: # <<<<<<<<<<<<<<
12723 * if item is Ellipsis:
12724 * have_slices = True
12725*/
12726 __pyx_t_1 = __pyx_v_index_tuple; __Pyx_INCREF(__pyx_t_1);
12727 __pyx_t_2 = 0;
12728 for (;;) {
12729 {
12730 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
12731 #if !CYTHON_ASSUME_SAFE_SIZE
12732 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 733, __pyx_L1_error)
12733 #endif
12734 if (__pyx_t_2 >= __pyx_temp) break;
12735 }
12736 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12737 __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
12738 #else
12739 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
12740 #endif
12741 ++__pyx_t_2;
12742 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 733, __pyx_L1_error)
12743 __Pyx_GOTREF(__pyx_t_3);
12744 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
12745 __pyx_t_3 = 0;
12746
12747 /* "View.MemoryView":734
12748 * idx = 0
12749 * for item in index_tuple:
12750 * if item is Ellipsis: # <<<<<<<<<<<<<<
12751 * have_slices = True
12752 * if first_ellipsis_index == -1:
12753*/
12754 __pyx_t_4 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12755 if (__pyx_t_4) {
12756
12757
12758 /* "View.MemoryView":735
12759 * for item in index_tuple:
12760 * if item is Ellipsis:
12761 * have_slices = True # <<<<<<<<<<<<<<
12762 * if first_ellipsis_index == -1:
12763 * first_ellipsis_index = idx
12764*/
12765 __pyx_v_have_slices = 1;
12766
12767 /* "View.MemoryView":736
12768 * if item is Ellipsis:
12769 * have_slices = True
12770 * if first_ellipsis_index == -1: # <<<<<<<<<<<<<<
12771 * first_ellipsis_index = idx
12772 * elif isinstance(item, slice):
12773*/
12774 __pyx_t_4 = (__pyx_v_first_ellipsis_index == -1L);
12775
12776 if (__pyx_t_4) {
12777
12778
12779 /* "View.MemoryView":737
12780 * have_slices = True
12781 * if first_ellipsis_index == -1:
12782 * first_ellipsis_index = idx # <<<<<<<<<<<<<<
12783 * elif isinstance(item, slice):
12784 * have_slices = True
12785*/
12786 __pyx_v_first_ellipsis_index = __pyx_v_idx;
12787
12788 /* "View.MemoryView":736
12789 * if item is Ellipsis:
12790 * have_slices = True
12791 * if first_ellipsis_index == -1: # <<<<<<<<<<<<<<
12792 * first_ellipsis_index = idx
12793 * elif isinstance(item, slice):
12794*/
12795 }
12796
12797 /* "View.MemoryView":734
12798 * idx = 0
12799 * for item in index_tuple:
12800 * if item is Ellipsis: # <<<<<<<<<<<<<<
12801 * have_slices = True
12802 * if first_ellipsis_index == -1:
12803*/
12804 goto __pyx_L5;
12805 }
12806
12807 /* "View.MemoryView":738
12808 * if first_ellipsis_index == -1:
12809 * first_ellipsis_index = idx
12810 * elif isinstance(item, slice): # <<<<<<<<<<<<<<
12811 * have_slices = True
12812 * elif cython.unlikely(not PyIndex_Check(item)):
12813*/
12814 __pyx_t_4 = PySlice_Check(__pyx_v_item);
12815 if (__pyx_t_4) {
12816
12817
12818 /* "View.MemoryView":739
12819 * first_ellipsis_index = idx
12820 * elif isinstance(item, slice):
12821 * have_slices = True # <<<<<<<<<<<<<<
12822 * elif cython.unlikely(not PyIndex_Check(item)):
12823 * _err_invalid_index(item)
12824*/
12825 __pyx_v_have_slices = 1;
12826
12827 /* "View.MemoryView":738
12828 * if first_ellipsis_index == -1:
12829 * first_ellipsis_index = idx
12830 * elif isinstance(item, slice): # <<<<<<<<<<<<<<
12831 * have_slices = True
12832 * elif cython.unlikely(not PyIndex_Check(item)):
12833*/
12834 goto __pyx_L5;
12835 }
12836
12837 /* "View.MemoryView":740
12838 * elif isinstance(item, slice):
12839 * have_slices = True
12840 * elif cython.unlikely(not PyIndex_Check(item)): # <<<<<<<<<<<<<<
12841 * _err_invalid_index(item)
12842 * idx += 1
12843*/
12844 __pyx_t_4 = (!(PyIndex_Check(__pyx_v_item) != 0));
12845
12846 if (unlikely(__pyx_t_4)) {
12847
12848
12849 /* "View.MemoryView":741
12850 * have_slices = True
12851 * elif cython.unlikely(not PyIndex_Check(item)):
12852 * _err_invalid_index(item) # <<<<<<<<<<<<<<
12853 * idx += 1
12854 *
12855*/
12856 __pyx_t_5 = __pyx_memoryview_err_invalid_index(__pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 741, __pyx_L1_error)
12857
12858
12859 /* "View.MemoryView":740
12860 * elif isinstance(item, slice):
12861 * have_slices = True
12862 * elif cython.unlikely(not PyIndex_Check(item)): # <<<<<<<<<<<<<<
12863 * _err_invalid_index(item)
12864 * idx += 1
12865*/
12866 }
12867 __pyx_L5:;
12868
12869 /* "View.MemoryView":742
12870 * elif cython.unlikely(not PyIndex_Check(item)):
12871 * _err_invalid_index(item)
12872 * idx += 1 # <<<<<<<<<<<<<<
12873 *
12874 * if first_ellipsis_index >= 0:
12875*/
12876 __pyx_v_idx = (__pyx_v_idx + 1);
12877
12878 /* "View.MemoryView":733
12879 *
12880 * idx = 0
12881 * for item in index_tuple: # <<<<<<<<<<<<<<
12882 * if item is Ellipsis:
12883 * have_slices = True
12884*/
12885 }
12886 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12887
12888 /* "View.MemoryView":744
12889 * idx += 1
12890 *
12891 * if first_ellipsis_index >= 0: # <<<<<<<<<<<<<<
12892 * result = [slice(None)] * ndim
12893 *
12894*/
12895 __pyx_t_4 = (__pyx_v_first_ellipsis_index >= 0);
12896
12897 if (__pyx_t_4) {
12898
12899
12900 /* "View.MemoryView":745
12901 *
12902 * if first_ellipsis_index >= 0:
12903 * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
12904 *
12905 * for idx in range(first_ellipsis_index):
12906*/
12907 __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
12908 __Pyx_GOTREF(__pyx_t_1);
12909 { Py_ssize_t __pyx_temp;
12910 for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
12911 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
12912 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
12913 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 745, __pyx_L1_error);
12914 }
12915 }
12916 __pyx_v_result = ((PyObject*)__pyx_t_1);
12917 __pyx_t_1 = 0;
12918
12919 /* "View.MemoryView":747
12920 * result = [slice(None)] * ndim
12921 *
12922 * for idx in range(first_ellipsis_index): # <<<<<<<<<<<<<<
12923 * result[idx] = index_tuple[idx]
12924 *
12925*/
12926
12927 __pyx_t_2 = __pyx_v_first_ellipsis_index;
12928 __pyx_t_6 = __pyx_t_2;
12929
12930 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12931 __pyx_v_idx = __pyx_t_7;
12932
12933 /* "View.MemoryView":748
12934 *
12935 * for idx in range(first_ellipsis_index):
12936 * result[idx] = index_tuple[idx] # <<<<<<<<<<<<<<
12937 *
12938 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index
12939*/
12940 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_index_tuple, __pyx_v_idx, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
12941 __Pyx_GOTREF(__pyx_t_1);
12942 if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_t_1, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(1, 748, __pyx_L1_error)
12943 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12944 }
12945
12946
12947 /* "View.MemoryView":750
12948 * result[idx] = index_tuple[idx]
12949 *
12950 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index # <<<<<<<<<<<<<<
12951 * ellipsis_end = ndim - indices_from_ellipsis
12952 *
12953*/
12954 __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_v_index_tuple); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
12955 __pyx_v_indices_from_ellipsis = (__pyx_t_2 - __pyx_v_first_ellipsis_index);
12956
12957
12958 /* "View.MemoryView":751
12959 *
12960 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index
12961 * ellipsis_end = ndim - indices_from_ellipsis # <<<<<<<<<<<<<<
12962 *
12963 * for idx in range(1, indices_from_ellipsis):
12964*/
12965 __pyx_v_ellipsis_end = (__pyx_v_ndim - __pyx_v_indices_from_ellipsis);
12966
12967 /* "View.MemoryView":753
12968 * ellipsis_end = ndim - indices_from_ellipsis
12969 *
12970 * for idx in range(1, indices_from_ellipsis): # <<<<<<<<<<<<<<
12971 * item = index_tuple[first_ellipsis_index + idx]
12972 * if item is not Ellipsis:
12973*/
12974
12975 __pyx_t_2 = __pyx_v_indices_from_ellipsis;
12976 __pyx_t_6 = __pyx_t_2;
12977
12978 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12979 __pyx_v_idx = __pyx_t_7;
12980
12981 /* "View.MemoryView":754
12982 *
12983 * for idx in range(1, indices_from_ellipsis):
12984 * item = index_tuple[first_ellipsis_index + idx] # <<<<<<<<<<<<<<
12985 * if item is not Ellipsis:
12986 * result[ellipsis_end + idx] = item
12987*/
12988 __pyx_t_8 = (__pyx_v_first_ellipsis_index + __pyx_v_idx);
12989
12990 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_index_tuple, __pyx_t_8, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 754, __pyx_L1_error)
12991 __Pyx_GOTREF(__pyx_t_1);
12992
12993 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
12994 __pyx_t_1 = 0;
12995
12996 /* "View.MemoryView":755
12997 * for idx in range(1, indices_from_ellipsis):
12998 * item = index_tuple[first_ellipsis_index + idx]
12999 * if item is not Ellipsis: # <<<<<<<<<<<<<<
13000 * result[ellipsis_end + idx] = item
13001 *
13002*/
13003 __pyx_t_4 = (__pyx_v_item != __pyx_builtin_Ellipsis);
13004 if (__pyx_t_4) {
13005
13006
13007 /* "View.MemoryView":756
13008 * item = index_tuple[first_ellipsis_index + idx]
13009 * if item is not Ellipsis:
13010 * result[ellipsis_end + idx] = item # <<<<<<<<<<<<<<
13011 *
13012 * index_tuple = tuple(result)
13013*/
13014 __pyx_t_8 = (__pyx_v_ellipsis_end + __pyx_v_idx);
13015
13016 if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_t_8, __pyx_v_item, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(1, 756, __pyx_L1_error)
13017
13018
13019 /* "View.MemoryView":755
13020 * for idx in range(1, indices_from_ellipsis):
13021 * item = index_tuple[first_ellipsis_index + idx]
13022 * if item is not Ellipsis: # <<<<<<<<<<<<<<
13023 * result[ellipsis_end + idx] = item
13024 *
13025*/
13026 }
13027 }
13028
13029
13030 /* "View.MemoryView":758
13031 * result[ellipsis_end + idx] = item
13032 *
13033 * index_tuple = tuple(result) # <<<<<<<<<<<<<<
13034 *
13035 * elif ndim > idx:
13036*/
13037 __pyx_t_1 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 758, __pyx_L1_error)
13038 __Pyx_GOTREF(__pyx_t_1);
13039 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_1));
13040 __pyx_t_1 = 0;
13041
13042 /* "View.MemoryView":744
13043 * idx += 1
13044 *
13045 * if first_ellipsis_index >= 0: # <<<<<<<<<<<<<<
13046 * result = [slice(None)] * ndim
13047 *
13048*/
13049 goto __pyx_L8;
13050 }
13051
13052 /* "View.MemoryView":760
13053 * index_tuple = tuple(result)
13054 *
13055 * elif ndim > idx: # <<<<<<<<<<<<<<
13056 *
13057 * have_slices = True
13058*/
13059 __pyx_t_4 = (__pyx_v_ndim > __pyx_v_idx);
13060
13061 if (__pyx_t_4) {
13062
13063
13064 /* "View.MemoryView":762
13065 * elif ndim > idx:
13066 *
13067 * have_slices = True # <<<<<<<<<<<<<<
13068 * index_tuple += (slice(None),) * (ndim - idx)
13069 *
13070*/
13071 __pyx_v_have_slices = 1;
13072
13073 /* "View.MemoryView":763
13074 *
13075 * have_slices = True
13076 * index_tuple += (slice(None),) * (ndim - idx) # <<<<<<<<<<<<<<
13077 *
13078 * return have_slices, index_tuple
13079*/
13080 __pyx_t_2 = (__pyx_v_ndim - __pyx_v_idx);
13081
13082 __pyx_t_1 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 763, __pyx_L1_error)
13083 __Pyx_GOTREF(__pyx_t_1);
13084
13085 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_index_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error)
13086 __Pyx_GOTREF(__pyx_t_3);
13087 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13088 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_3));
13089 __pyx_t_3 = 0;
13090
13091 /* "View.MemoryView":760
13092 * index_tuple = tuple(result)
13093 *
13094 * elif ndim > idx: # <<<<<<<<<<<<<<
13095 *
13096 * have_slices = True
13097*/
13098 }
13099 __pyx_L8:;
13100
13101 /* "View.MemoryView":765
13102 * index_tuple += (slice(None),) * (ndim - idx)
13103 *
13104 * return have_slices, index_tuple # <<<<<<<<<<<<<<
13105 *
13106 *
13107*/
13108 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 765, __pyx_L1_error)
13109 __Pyx_GOTREF(__pyx_t_3);
13110 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 765, __pyx_L1_error)
13111 __Pyx_GOTREF(__pyx_t_1);
13112 __Pyx_GIVEREF(__pyx_t_3);
13113 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
13114 __Pyx_INCREF(__pyx_v_index_tuple);
13115 __Pyx_GIVEREF(__pyx_v_index_tuple);
13116 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_index_tuple) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
13117 __pyx_t_3 = 0;
13118 {
13119 PyObject *__pyx_temp;
13120 {
13121 __pyx_temp = __pyx_r;
13122 __pyx_r = ((PyObject*)__pyx_t_1);
13123 }
13124 __Pyx_XDECREF(__pyx_temp);
13125 }
13126 __pyx_t_1 = 0;
13127 goto __pyx_L0;
13128
13129 /* "View.MemoryView":723
13130 *
13131 *
13132 * cdef tuple[bint, tuple] _unellipsify_index_tuple(index_tuple: tuple, int ndim): # <<<<<<<<<<<<<<
13133 * """
13134 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13135*/
13136
13137 /* function exit code */
13138 __pyx_L1_error:;
13139 __Pyx_XDECREF(__pyx_t_1);
13140 __Pyx_XDECREF(__pyx_t_3);
13141 __Pyx_AddTraceback("View.MemoryView._unellipsify_index_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
13142 __pyx_r = 0;
13143 __pyx_L0:;
13144
13145
13146
13147
13148
13149 __Pyx_XDECREF(__pyx_v_item);
13150 __Pyx_XDECREF(__pyx_v_result);
13151 __Pyx_XDECREF(__pyx_v_index_tuple);
13152 __Pyx_XGIVEREF(__pyx_r);
13153 __Pyx_RefNannyFinishContext();
13154 return __pyx_r;
13155}
13156
13157/* "View.MemoryView":768
13158 *
13159 *
13160 * cdef tuple[bint, tuple] _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13161 * """
13162 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13163*/
13164
13165static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
13166 PyObject *__pyx_v_result = 0;
13167 int __pyx_v_have_slices;
13168 PyObject *__pyx_r = NULL;
13169 __Pyx_RefNannyDeclarations
13170 int __pyx_t_1;
13171 PyObject *__pyx_t_2 = NULL;
13172 int __pyx_t_3;
13173 long __pyx_t_4;
13174 PyObject *__pyx_t_5 = NULL;
13175 PyObject *__pyx_t_6 = NULL;
13176 int __pyx_lineno = 0;
13177 const char *__pyx_filename = NULL;
13178 int __pyx_clineno = 0;
13179 __Pyx_RefNannySetupContext("_unellipsify", 0);
13180
13181 /* "View.MemoryView":773
13182 * """
13183 * result: tuple
13184 * have_slices = False # <<<<<<<<<<<<<<
13185 *
13186 * if index is Ellipsis:
13187*/
13188 __pyx_v_have_slices = 0;
13189
13190 /* "View.MemoryView":775
13191 * have_slices = False
13192 *
13193 * if index is Ellipsis: # <<<<<<<<<<<<<<
13194 * have_slices = True
13195 * result = (slice(None),) * ndim
13196*/
13197 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
13198 if (__pyx_t_1) {
13199
13200
13201 /* "View.MemoryView":776
13202 *
13203 * if index is Ellipsis:
13204 * have_slices = True # <<<<<<<<<<<<<<
13205 * result = (slice(None),) * ndim
13206 *
13207*/
13208 __pyx_v_have_slices = 1;
13209
13210 /* "View.MemoryView":777
13211 * if index is Ellipsis:
13212 * have_slices = True
13213 * result = (slice(None),) * ndim # <<<<<<<<<<<<<<
13214 *
13215 * elif isinstance(index, tuple):
13216*/
13217 __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 777, __pyx_L1_error)
13218 __Pyx_GOTREF(__pyx_t_2);
13219 __pyx_v_result = ((PyObject*)__pyx_t_2);
13220 __pyx_t_2 = 0;
13221
13222 /* "View.MemoryView":775
13223 * have_slices = False
13224 *
13225 * if index is Ellipsis: # <<<<<<<<<<<<<<
13226 * have_slices = True
13227 * result = (slice(None),) * ndim
13228*/
13229 goto __pyx_L3;
13230 }
13231
13232 /* "View.MemoryView":779
13233 * result = (slice(None),) * ndim
13234 *
13235 * elif isinstance(index, tuple): # <<<<<<<<<<<<<<
13236 * return _unellipsify_index_tuple(<tuple> index, ndim)
13237 *
13238*/
13239 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13240 if (__pyx_t_1) {
13241
13242
13243 /* "View.MemoryView":780
13244 *
13245 * elif isinstance(index, tuple):
13246 * return _unellipsify_index_tuple(<tuple> index, ndim) # <<<<<<<<<<<<<<
13247 *
13248 * else:
13249*/
13250 if (unlikely(__pyx_v_index == Py_None)) {
13251 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
13252 __PYX_ERR(1, 780, __pyx_L1_error)
13253 }
13254 __pyx_t_2 = _unellipsify_index_tuple(((PyObject*)__pyx_v_index), __pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 780, __pyx_L1_error)
13255 __Pyx_GOTREF(__pyx_t_2);
13256 {
13257 PyObject *__pyx_temp;
13258 {
13259 __pyx_temp = __pyx_r;
13260 __pyx_r = ((PyObject*)__pyx_t_2);
13261 }
13262 __Pyx_XDECREF(__pyx_temp);
13263 }
13264 __pyx_t_2 = 0;
13265 goto __pyx_L0;
13266
13267 /* "View.MemoryView":779
13268 * result = (slice(None),) * ndim
13269 *
13270 * elif isinstance(index, tuple): # <<<<<<<<<<<<<<
13271 * return _unellipsify_index_tuple(<tuple> index, ndim)
13272 *
13273*/
13274 }
13275
13276 /* "View.MemoryView":783
13277 *
13278 * else:
13279 * if isinstance(index, slice): # <<<<<<<<<<<<<<
13280 * have_slices = True
13281 * elif cython.unlikely(not PyIndex_Check(index)):
13282*/
13283 /*else*/ {
13284 __pyx_t_1 = PySlice_Check(__pyx_v_index);
13285 if (__pyx_t_1) {
13286
13287
13288 /* "View.MemoryView":784
13289 * else:
13290 * if isinstance(index, slice):
13291 * have_slices = True # <<<<<<<<<<<<<<
13292 * elif cython.unlikely(not PyIndex_Check(index)):
13293 * _err_invalid_index(index)
13294*/
13295 __pyx_v_have_slices = 1;
13296
13297 /* "View.MemoryView":783
13298 *
13299 * else:
13300 * if isinstance(index, slice): # <<<<<<<<<<<<<<
13301 * have_slices = True
13302 * elif cython.unlikely(not PyIndex_Check(index)):
13303*/
13304 goto __pyx_L4;
13305 }
13306
13307 /* "View.MemoryView":785
13308 * if isinstance(index, slice):
13309 * have_slices = True
13310 * elif cython.unlikely(not PyIndex_Check(index)): # <<<<<<<<<<<<<<
13311 * _err_invalid_index(index)
13312 *
13313*/
13314 __pyx_t_1 = (!(PyIndex_Check(__pyx_v_index) != 0));
13315
13316 if (unlikely(__pyx_t_1)) {
13317
13318
13319 /* "View.MemoryView":786
13320 * have_slices = True
13321 * elif cython.unlikely(not PyIndex_Check(index)):
13322 * _err_invalid_index(index) # <<<<<<<<<<<<<<
13323 *
13324 *
13325*/
13326 __pyx_t_3 = __pyx_memoryview_err_invalid_index(__pyx_v_index); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 786, __pyx_L1_error)
13327
13328
13329 /* "View.MemoryView":785
13330 * if isinstance(index, slice):
13331 * have_slices = True
13332 * elif cython.unlikely(not PyIndex_Check(index)): # <<<<<<<<<<<<<<
13333 * _err_invalid_index(index)
13334 *
13335*/
13336 }
13337 __pyx_L4:;
13338
13339 /* "View.MemoryView":789
13340 *
13341 *
13342 * if ndim == 1: # <<<<<<<<<<<<<<
13343 * result = (index,)
13344 * elif ndim == 2:
13345*/
13346 switch (__pyx_v_ndim) {
13347 case 1:
13348
13349 /* "View.MemoryView":790
13350 *
13351 * if ndim == 1:
13352 * result = (index,) # <<<<<<<<<<<<<<
13353 * elif ndim == 2:
13354 * have_slices = True
13355*/
13356 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
13357 __Pyx_GOTREF(__pyx_t_2);
13358 __Pyx_INCREF(__pyx_v_index);
13359 __Pyx_GIVEREF(__pyx_v_index);
13360 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 790, __pyx_L1_error);
13361 __pyx_v_result = ((PyObject*)__pyx_t_2);
13362 __pyx_t_2 = 0;
13363
13364 /* "View.MemoryView":789
13365 *
13366 *
13367 * if ndim == 1: # <<<<<<<<<<<<<<
13368 * result = (index,)
13369 * elif ndim == 2:
13370*/
13371 break;
13372 case 2:
13373
13374 /* "View.MemoryView":792
13375 * result = (index,)
13376 * elif ndim == 2:
13377 * have_slices = True # <<<<<<<<<<<<<<
13378 * result = (index, slice(None))
13379 * else:
13380*/
13381 __pyx_v_have_slices = 1;
13382
13383 /* "View.MemoryView":793
13384 * elif ndim == 2:
13385 * have_slices = True
13386 * result = (index, slice(None)) # <<<<<<<<<<<<<<
13387 * else:
13388 * have_slices = True
13389*/
13390 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __pyx_L1_error)
13391 __Pyx_GOTREF(__pyx_t_2);
13392 __Pyx_INCREF(__pyx_v_index);
13393 __Pyx_GIVEREF(__pyx_v_index);
13394 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13395 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
13396 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
13397 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13398 __pyx_v_result = ((PyObject*)__pyx_t_2);
13399 __pyx_t_2 = 0;
13400
13401 /* "View.MemoryView":791
13402 * if ndim == 1:
13403 * result = (index,)
13404 * elif ndim == 2: # <<<<<<<<<<<<<<
13405 * have_slices = True
13406 * result = (index, slice(None))
13407*/
13408 break;
13409 default:
13410
13411 /* "View.MemoryView":795
13412 * result = (index, slice(None))
13413 * else:
13414 * have_slices = True # <<<<<<<<<<<<<<
13415 * result = (index,) + (slice(None),) * (ndim - 1)
13416 *
13417*/
13418 __pyx_v_have_slices = 1;
13419
13420 /* "View.MemoryView":796
13421 * else:
13422 * have_slices = True
13423 * result = (index,) + (slice(None),) * (ndim - 1) # <<<<<<<<<<<<<<
13424 *
13425 * return have_slices, result
13426*/
13427 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 796, __pyx_L1_error)
13428 __Pyx_GOTREF(__pyx_t_2);
13429 __Pyx_INCREF(__pyx_v_index);
13430 __Pyx_GIVEREF(__pyx_v_index);
13431 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 796, __pyx_L1_error);
13432 __pyx_t_4 = (__pyx_v_ndim - 1);
13433
13434 __pyx_t_5 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 796, __pyx_L1_error)
13435 __Pyx_GOTREF(__pyx_t_5);
13436
13437 __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 796, __pyx_L1_error)
13438 __Pyx_GOTREF(__pyx_t_6);
13439 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13440 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13441 __pyx_v_result = ((PyObject*)__pyx_t_6);
13442 __pyx_t_6 = 0;
13443 break;
13444 }
13445 }
13446 __pyx_L3:;
13447
13448 /* "View.MemoryView":798
13449 * result = (index,) + (slice(None),) * (ndim - 1)
13450 *
13451 * return have_slices, result # <<<<<<<<<<<<<<
13452 *
13453 *
13454*/
13455 __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 798, __pyx_L1_error)
13456 __Pyx_GOTREF(__pyx_t_6);
13457 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 798, __pyx_L1_error)
13458 __Pyx_GOTREF(__pyx_t_5);
13459 __Pyx_GIVEREF(__pyx_t_6);
13460 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13461 __Pyx_INCREF(__pyx_v_result);
13462 __Pyx_GIVEREF(__pyx_v_result);
13463 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_result) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13464 __pyx_t_6 = 0;
13465 {
13466 PyObject *__pyx_temp;
13467 {
13468 __pyx_temp = __pyx_r;
13469 __pyx_r = ((PyObject*)__pyx_t_5);
13470 }
13471 __Pyx_XDECREF(__pyx_temp);
13472 }
13473 __pyx_t_5 = 0;
13474 goto __pyx_L0;
13475
13476 /* "View.MemoryView":768
13477 *
13478 *
13479 * cdef tuple[bint, tuple] _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13480 * """
13481 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13482*/
13483
13484 /* function exit code */
13485 __pyx_L1_error:;
13486 __Pyx_XDECREF(__pyx_t_2);
13487 __Pyx_XDECREF(__pyx_t_5);
13488 __Pyx_XDECREF(__pyx_t_6);
13489 __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13490 __pyx_r = 0;
13491 __pyx_L0:;
13492 __Pyx_XDECREF(__pyx_v_result);
13493
13494 __Pyx_XGIVEREF(__pyx_r);
13495 __Pyx_RefNannyFinishContext();
13496 return __pyx_r;
13497}
13498
13499/* "View.MemoryView":801
13500 *
13501 *
13502 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13503 * for suboffset in suboffsets[:ndim]:
13504 * if cython.unlikely(suboffset >= 0):
13505*/
13506
13507static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13508 Py_ssize_t __pyx_v_suboffset;
13509 int __pyx_r;
13510 Py_ssize_t *__pyx_t_1;
13511 Py_ssize_t *__pyx_t_2;
13512 Py_ssize_t *__pyx_t_3;
13513 int __pyx_t_4;
13514 int __pyx_t_5;
13515 int __pyx_lineno = 0;
13516 const char *__pyx_filename = NULL;
13517 int __pyx_clineno = 0;
13518
13519 /* "View.MemoryView":802
13520 *
13521 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13522 * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
13523 * if cython.unlikely(suboffset >= 0):
13524 * _err_ValueError("Indirect dimensions not supported")
13525*/
13526 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13527
13528 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13529 __pyx_t_1 = __pyx_t_3;
13530 __pyx_v_suboffset = (__pyx_t_1[0]);
13531
13532 /* "View.MemoryView":803
13533 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13534 * for suboffset in suboffsets[:ndim]:
13535 * if cython.unlikely(suboffset >= 0): # <<<<<<<<<<<<<<
13536 * _err_ValueError("Indirect dimensions not supported")
13537 * return 0 # return type just used as an error flag
13538*/
13539 __pyx_t_4 = (__pyx_v_suboffset >= 0);
13540
13541 if (unlikely(__pyx_t_4)) {
13542
13543
13544 /* "View.MemoryView":804
13545 * for suboffset in suboffsets[:ndim]:
13546 * if cython.unlikely(suboffset >= 0):
13547 * _err_ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
13548 * return 0 # return type just used as an error flag
13549 *
13550*/
13551 __pyx_t_5 = __pyx_memoryview_err_ValueError(__pyx_k_Indirect_dimensions_not_supporte); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 804, __pyx_L1_error)
13552
13553
13554 /* "View.MemoryView":803
13555 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13556 * for suboffset in suboffsets[:ndim]:
13557 * if cython.unlikely(suboffset >= 0): # <<<<<<<<<<<<<<
13558 * _err_ValueError("Indirect dimensions not supported")
13559 * return 0 # return type just used as an error flag
13560*/
13561 }
13562 }
13563
13564
13565 /* "View.MemoryView":805
13566 * if cython.unlikely(suboffset >= 0):
13567 * _err_ValueError("Indirect dimensions not supported")
13568 * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
13569 *
13570 *
13571*/
13572 {
13573
13574 __pyx_r = 0;
13575 }
13576 goto __pyx_L0;
13577
13578 /* "View.MemoryView":801
13579 *
13580 *
13581 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13582 * for suboffset in suboffsets[:ndim]:
13583 * if cython.unlikely(suboffset >= 0):
13584*/
13585
13586 /* function exit code */
13587 __pyx_L1_error:;
13588 __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13589 __pyx_r = -1;
13590 __pyx_L0:;
13591
13592
13593 return __pyx_r;
13594}
13595
13596/* "View.MemoryView":811
13597 *
13598 *
13599 * @cname('__pyx_memview_slice') # <<<<<<<<<<<<<<
13600 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13601 * cdef int new_ndim = 0, suboffset_dim = -1, dim
13602*/
13603
13604static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13605 int __pyx_v_new_ndim;
13606 int __pyx_v_suboffset_dim;
13607 int __pyx_v_dim;
13608 __Pyx_memviewslice __pyx_v_src;
13609 __Pyx_memviewslice __pyx_v_dst;
13610 __Pyx_memviewslice *__pyx_v_p_src;
13611 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13612 __Pyx_memviewslice *__pyx_v_p_dst;
13613 int *__pyx_v_p_suboffset_dim;
13614 Py_ssize_t __pyx_v_start;
13615 Py_ssize_t __pyx_v_stop;
13616 Py_ssize_t __pyx_v_step;
13617 Py_ssize_t __pyx_v_cindex;
13618 int __pyx_v_have_start;
13619 int __pyx_v_have_stop;
13620 int __pyx_v_have_step;
13621 PyObject *__pyx_v_index = NULL;
13622 struct __pyx_memoryview_obj *__pyx_r = NULL;
13623 __Pyx_RefNannyDeclarations
13624 int __pyx_t_1;
13625 PyObject *__pyx_t_2 = NULL;
13626 struct __pyx_memoryview_obj *__pyx_t_3;
13627 char *__pyx_t_4;
13628 int __pyx_t_5;
13629 Py_ssize_t __pyx_t_6;
13630 PyObject *__pyx_t_7 = NULL;
13631 Py_ssize_t __pyx_t_8;
13632 int __pyx_t_9;
13633 Py_ssize_t __pyx_t_10;
13634 int __pyx_lineno = 0;
13635 const char *__pyx_filename = NULL;
13636 int __pyx_clineno = 0;
13637 __Pyx_RefNannySetupContext("memview_slice", 0);
13638
13639 /* "View.MemoryView":813
13640 * @cname('__pyx_memview_slice')
13641 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13642 * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
13643 * cdef bint negative_step
13644 * cdef __Pyx_memviewslice src, dst
13645*/
13646 __pyx_v_new_ndim = 0;
13647 __pyx_v_suboffset_dim = -1;
13648
13649 /* "View.MemoryView":820
13650 *
13651 *
13652 * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
13653 *
13654 * cdef _memoryviewslice memviewsliceobj
13655*/
13656 (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
13657
13658 /* "View.MemoryView":824
13659 * cdef _memoryviewslice memviewsliceobj
13660 *
13661 * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
13662 *
13663 * if isinstance(memview, _memoryviewslice):
13664*/
13665 #ifndef CYTHON_WITHOUT_ASSERTIONS
13666 if (unlikely(__pyx_assertions_enabled())) {
13667 __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
13668
13669 if (unlikely(!__pyx_t_1)) {
13670 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
13671 __PYX_ERR(1, 824, __pyx_L1_error)
13672 }
13673
13674 }
13675 #else
13676 if ((1)); else __PYX_ERR(1, 824, __pyx_L1_error)
13677 #endif
13678
13679 /* "View.MemoryView":826
13680 * assert memview.view.ndim > 0
13681 *
13682 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13683 * memviewsliceobj = memview
13684 * p_src = &memviewsliceobj.from_slice
13685*/
13686 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
13687 if (__pyx_t_1) {
13688
13689
13690 /* "View.MemoryView":827
13691 *
13692 * if isinstance(memview, _memoryviewslice):
13693 * memviewsliceobj = memview # <<<<<<<<<<<<<<
13694 * p_src = &memviewsliceobj.from_slice
13695 * else:
13696*/
13697 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
13698 __Pyx_INCREF(__pyx_t_2);
13699 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 827, __pyx_L1_error)
13700 __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
13701 __pyx_t_2 = 0;
13702
13703 /* "View.MemoryView":828
13704 * if isinstance(memview, _memoryviewslice):
13705 * memviewsliceobj = memview
13706 * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
13707 * else:
13708 * slice_copy(memview, &src)
13709*/
13710 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13711
13712 /* "View.MemoryView":826
13713 * assert memview.view.ndim > 0
13714 *
13715 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13716 * memviewsliceobj = memview
13717 * p_src = &memviewsliceobj.from_slice
13718*/
13719 goto __pyx_L3;
13720 }
13721
13722 /* "View.MemoryView":830
13723 * p_src = &memviewsliceobj.from_slice
13724 * else:
13725 * slice_copy(memview, &src) # <<<<<<<<<<<<<<
13726 * p_src = &src
13727 *
13728*/
13729 /*else*/ {
13730 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13731
13732 /* "View.MemoryView":831
13733 * else:
13734 * slice_copy(memview, &src)
13735 * p_src = &src # <<<<<<<<<<<<<<
13736 *
13737 *
13738*/
13739 __pyx_v_p_src = (&__pyx_v_src);
13740 }
13741 __pyx_L3:;
13742
13743 /* "View.MemoryView":837
13744 *
13745 *
13746 * dst.memview = p_src.memview # <<<<<<<<<<<<<<
13747 * dst.data = p_src.data
13748 *
13749*/
13750 __pyx_t_3 = __pyx_v_p_src->memview;
13751
13752 __pyx_v_dst.memview = __pyx_t_3;
13753
13754 /* "View.MemoryView":838
13755 *
13756 * dst.memview = p_src.memview
13757 * dst.data = p_src.data # <<<<<<<<<<<<<<
13758 *
13759 *
13760*/
13761 __pyx_t_4 = __pyx_v_p_src->data;
13762
13763 __pyx_v_dst.data = __pyx_t_4;
13764
13765 /* "View.MemoryView":843
13766 *
13767 *
13768 * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
13769 * cdef int *p_suboffset_dim = &suboffset_dim
13770 * cdef Py_ssize_t start, stop, step, cindex
13771*/
13772 __pyx_v_p_dst = (&__pyx_v_dst);
13773
13774 /* "View.MemoryView":844
13775 *
13776 * cdef __Pyx_memviewslice *p_dst = &dst
13777 * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
13778 * cdef Py_ssize_t start, stop, step, cindex
13779 * cdef bint have_start, have_stop, have_step
13780*/
13781 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13782
13783 /* "View.MemoryView":848
13784 * cdef bint have_start, have_stop, have_step
13785 *
13786 * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13787 * if PyIndex_Check(index):
13788 * cindex = index
13789*/
13790
13791 __pyx_t_5 = 0;
13792 __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
13793 __pyx_t_6 = 0;
13794 for (;;) {
13795 {
13796 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
13797 #if !CYTHON_ASSUME_SAFE_SIZE
13798 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 848, __pyx_L1_error)
13799 #endif
13800 if (__pyx_t_6 >= __pyx_temp) break;
13801 }
13802 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13803 __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
13804 #else
13805 __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
13806 #endif
13807 ++__pyx_t_6;
13808 if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 848, __pyx_L1_error)
13809 __Pyx_GOTREF(__pyx_t_7);
13810 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_7);
13811 __pyx_t_7 = 0;
13812 __pyx_v_dim = __pyx_t_5;
13813 __pyx_t_5 = (__pyx_t_5 + 1);
13814
13815 /* "View.MemoryView":849
13816 *
13817 * for dim, index in enumerate(indices):
13818 * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13819 * cindex = index
13820 * slice_memviewslice(
13821*/
13822 __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
13823
13824 if (__pyx_t_1) {
13825
13826
13827 /* "View.MemoryView":850
13828 * for dim, index in enumerate(indices):
13829 * if PyIndex_Check(index):
13830 * cindex = index # <<<<<<<<<<<<<<
13831 * slice_memviewslice(
13832 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13833*/
13834 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 850, __pyx_L1_error)
13835 __pyx_v_cindex = __pyx_t_8;
13836
13837 /* "View.MemoryView":851
13838 * if PyIndex_Check(index):
13839 * cindex = index
13840 * slice_memviewslice( # <<<<<<<<<<<<<<
13841 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13842 * dim, new_ndim, p_suboffset_dim,
13843*/
13844 __pyx_t_9 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 851, __pyx_L1_error)
13845
13846
13847 /* "View.MemoryView":849
13848 *
13849 * for dim, index in enumerate(indices):
13850 * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13851 * cindex = index
13852 * slice_memviewslice(
13853*/
13854 goto __pyx_L6;
13855 }
13856
13857 /* "View.MemoryView":857
13858 * 0, 0, 0, # have_{start,stop,step}
13859 * False)
13860 * elif index is None: # <<<<<<<<<<<<<<
13861 * p_dst.shape[new_ndim] = 1
13862 * p_dst.strides[new_ndim] = 0
13863*/
13864 __pyx_t_1 = (__pyx_v_index == Py_None);
13865 if (__pyx_t_1) {
13866
13867
13868 /* "View.MemoryView":858
13869 * False)
13870 * elif index is None:
13871 * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
13872 * p_dst.strides[new_ndim] = 0
13873 * p_dst.suboffsets[new_ndim] = -1
13874*/
13875 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13876
13877 /* "View.MemoryView":859
13878 * elif index is None:
13879 * p_dst.shape[new_ndim] = 1
13880 * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
13881 * p_dst.suboffsets[new_ndim] = -1
13882 * new_ndim += 1
13883*/
13884 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13885
13886 /* "View.MemoryView":860
13887 * p_dst.shape[new_ndim] = 1
13888 * p_dst.strides[new_ndim] = 0
13889 * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
13890 * new_ndim += 1
13891 * else:
13892*/
13893 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13894
13895 /* "View.MemoryView":861
13896 * p_dst.strides[new_ndim] = 0
13897 * p_dst.suboffsets[new_ndim] = -1
13898 * new_ndim += 1 # <<<<<<<<<<<<<<
13899 * else:
13900 * start = index.start or 0
13901*/
13902 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13903
13904 /* "View.MemoryView":857
13905 * 0, 0, 0, # have_{start,stop,step}
13906 * False)
13907 * elif index is None: # <<<<<<<<<<<<<<
13908 * p_dst.shape[new_ndim] = 1
13909 * p_dst.strides[new_ndim] = 0
13910*/
13911 goto __pyx_L6;
13912 }
13913
13914 /* "View.MemoryView":863
13915 * new_ndim += 1
13916 * else:
13917 * start = index.start or 0 # <<<<<<<<<<<<<<
13918 * stop = index.stop or 0
13919 * step = index.step or 0
13920*/
13921 /*else*/ {
13922 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 863, __pyx_L1_error)
13923 __Pyx_GOTREF(__pyx_t_7);
13924 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 863, __pyx_L1_error)
13925 if (!__pyx_t_1) {
13926 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13927 } else {
13928 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 863, __pyx_L1_error)
13929 __pyx_t_8 = __pyx_t_10;
13930 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13931 goto __pyx_L7_bool_binop_done;
13932 }
13933
13934 __pyx_t_8 = 0;
13935 __pyx_L7_bool_binop_done:;
13936 __pyx_v_start = __pyx_t_8;
13937
13938 /* "View.MemoryView":864
13939 * else:
13940 * start = index.start or 0
13941 * stop = index.stop or 0 # <<<<<<<<<<<<<<
13942 * step = index.step or 0
13943 *
13944*/
13945 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 864, __pyx_L1_error)
13946 __Pyx_GOTREF(__pyx_t_7);
13947 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 864, __pyx_L1_error)
13948 if (!__pyx_t_1) {
13949 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13950 } else {
13951 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 864, __pyx_L1_error)
13952 __pyx_t_8 = __pyx_t_10;
13953 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13954 goto __pyx_L9_bool_binop_done;
13955 }
13956
13957 __pyx_t_8 = 0;
13958 __pyx_L9_bool_binop_done:;
13959 __pyx_v_stop = __pyx_t_8;
13960
13961 /* "View.MemoryView":865
13962 * start = index.start or 0
13963 * stop = index.stop or 0
13964 * step = index.step or 0 # <<<<<<<<<<<<<<
13965 *
13966 * have_start = index.start is not None
13967*/
13968 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 865, __pyx_L1_error)
13969 __Pyx_GOTREF(__pyx_t_7);
13970 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 865, __pyx_L1_error)
13971 if (!__pyx_t_1) {
13972 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13973 } else {
13974 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 865, __pyx_L1_error)
13975 __pyx_t_8 = __pyx_t_10;
13976 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13977 goto __pyx_L11_bool_binop_done;
13978 }
13979
13980 __pyx_t_8 = 0;
13981 __pyx_L11_bool_binop_done:;
13982 __pyx_v_step = __pyx_t_8;
13983
13984 /* "View.MemoryView":867
13985 * step = index.step or 0
13986 *
13987 * have_start = index.start is not None # <<<<<<<<<<<<<<
13988 * have_stop = index.stop is not None
13989 * have_step = index.step is not None
13990*/
13991 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 867, __pyx_L1_error)
13992 __Pyx_GOTREF(__pyx_t_7);
13993 __pyx_t_1 = (__pyx_t_7 != Py_None);
13994 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13995 __pyx_v_have_start = __pyx_t_1;
13996
13997 /* "View.MemoryView":868
13998 *
13999 * have_start = index.start is not None
14000 * have_stop = index.stop is not None # <<<<<<<<<<<<<<
14001 * have_step = index.step is not None
14002 *
14003*/
14004 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 868, __pyx_L1_error)
14005 __Pyx_GOTREF(__pyx_t_7);
14006 __pyx_t_1 = (__pyx_t_7 != Py_None);
14007 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14008 __pyx_v_have_stop = __pyx_t_1;
14009
14010 /* "View.MemoryView":869
14011 * have_start = index.start is not None
14012 * have_stop = index.stop is not None
14013 * have_step = index.step is not None # <<<<<<<<<<<<<<
14014 *
14015 * slice_memviewslice(
14016*/
14017 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 869, __pyx_L1_error)
14018 __Pyx_GOTREF(__pyx_t_7);
14019 __pyx_t_1 = (__pyx_t_7 != Py_None);
14020 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14021 __pyx_v_have_step = __pyx_t_1;
14022
14023 /* "View.MemoryView":871
14024 * have_step = index.step is not None
14025 *
14026 * slice_memviewslice( # <<<<<<<<<<<<<<
14027 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14028 * dim, new_ndim, p_suboffset_dim,
14029*/
14030 __pyx_t_9 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 871, __pyx_L1_error)
14031
14032
14033 /* "View.MemoryView":877
14034 * have_start, have_stop, have_step,
14035 * True)
14036 * new_ndim += 1 # <<<<<<<<<<<<<<
14037 *
14038 * if isinstance(memview, _memoryviewslice):
14039*/
14040 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14041 }
14042 __pyx_L6:;
14043
14044 /* "View.MemoryView":848
14045 * cdef bint have_start, have_stop, have_step
14046 *
14047 * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14048 * if PyIndex_Check(index):
14049 * cindex = index
14050*/
14051 }
14052 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14053
14054 /* "View.MemoryView":879
14055 * new_ndim += 1
14056 *
14057 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14058 * return memoryview_fromslice(dst, new_ndim,
14059 * memviewsliceobj.to_object_func,
14060*/
14061 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
14062 if (__pyx_t_1) {
14063
14064
14065 /* "View.MemoryView":881
14066 * if isinstance(memview, _memoryviewslice):
14067 * return memoryview_fromslice(dst, new_ndim,
14068 * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
14069 * memviewsliceobj.to_dtype_func,
14070 * memview.dtype_is_object)
14071*/
14072 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 881, __pyx_L1_error) }
14073
14074 /* "View.MemoryView":882
14075 * return memoryview_fromslice(dst, new_ndim,
14076 * memviewsliceobj.to_object_func,
14077 * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
14078 * memview.dtype_is_object)
14079 * else:
14080*/
14081 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 882, __pyx_L1_error) }
14082
14083 /* "View.MemoryView":880
14084 *
14085 * if isinstance(memview, _memoryviewslice):
14086 * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14087 * memviewsliceobj.to_object_func,
14088 * memviewsliceobj.to_dtype_func,
14089*/
14090 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 880, __pyx_L1_error)
14091 __Pyx_GOTREF(__pyx_t_2);
14092 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 880, __pyx_L1_error)
14093 {
14094 struct __pyx_memoryview_obj *__pyx_temp;
14095 {
14096 __pyx_temp = __pyx_r;
14097 __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14098 }
14099 __Pyx_XDECREF((PyObject *)__pyx_temp);
14100 }
14101 __pyx_t_2 = 0;
14102 goto __pyx_L0;
14103
14104 /* "View.MemoryView":879
14105 * new_ndim += 1
14106 *
14107 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14108 * return memoryview_fromslice(dst, new_ndim,
14109 * memviewsliceobj.to_object_func,
14110*/
14111 }
14112
14113 /* "View.MemoryView":885
14114 * memview.dtype_is_object)
14115 * else:
14116 * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14117 * memview.dtype_is_object)
14118 *
14119*/
14120 /*else*/ {
14121
14122 /* "View.MemoryView":886
14123 * else:
14124 * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
14125 * memview.dtype_is_object) # <<<<<<<<<<<<<<
14126 *
14127 *
14128*/
14129 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 885, __pyx_L1_error)
14130 __Pyx_GOTREF(__pyx_t_2);
14131
14132 /* "View.MemoryView":885
14133 * memview.dtype_is_object)
14134 * else:
14135 * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14136 * memview.dtype_is_object)
14137 *
14138*/
14139 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 885, __pyx_L1_error)
14140 {
14141 struct __pyx_memoryview_obj *__pyx_temp;
14142 {
14143 __pyx_temp = __pyx_r;
14144 __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14145 }
14146 __Pyx_XDECREF((PyObject *)__pyx_temp);
14147 }
14148 __pyx_t_2 = 0;
14149 goto __pyx_L0;
14150 }
14151
14152 /* "View.MemoryView":811
14153 *
14154 *
14155 * @cname('__pyx_memview_slice') # <<<<<<<<<<<<<<
14156 * cdef memoryview memview_slice(memoryview memview, tuple indices):
14157 * cdef int new_ndim = 0, suboffset_dim = -1, dim
14158*/
14159
14160 /* function exit code */
14161 __pyx_L1_error:;
14162 __Pyx_XDECREF(__pyx_t_2);
14163 __Pyx_XDECREF(__pyx_t_7);
14164 __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14165 __pyx_r = 0;
14166 __pyx_L0:;
14167
14168
14169
14170
14171
14172
14173 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183 __Pyx_XDECREF(__pyx_v_index);
14184 __Pyx_XGIVEREF((PyObject *)__pyx_r);
14185 __Pyx_RefNannyFinishContext();
14186 return __pyx_r;
14187}
14188
14189/* "View.MemoryView":892
14190 *
14191 *
14192 * @cname('__pyx_pybuffer_index') # <<<<<<<<<<<<<<
14193 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14194 * Py_ssize_t dim) except NULL:
14195*/
14196
14197static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
14198 Py_ssize_t __pyx_v_shape;
14199 Py_ssize_t __pyx_v_stride;
14200 Py_ssize_t __pyx_v_suboffset;
14201 Py_ssize_t __pyx_v_itemsize;
14202 char *__pyx_v_resultp;
14203 char *__pyx_r;
14204 Py_ssize_t __pyx_t_1;
14205 int __pyx_t_2;
14206 int __pyx_t_3;
14207 int __pyx_lineno = 0;
14208 const char *__pyx_filename = NULL;
14209 int __pyx_clineno = 0;
14210
14211
14212 /* "View.MemoryView":895
14213 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14214 * Py_ssize_t dim) except NULL:
14215 * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
14216 * cdef Py_ssize_t itemsize = view.itemsize
14217 * cdef char *resultp
14218*/
14219 __pyx_v_suboffset = -1L;
14220
14221 /* "View.MemoryView":896
14222 * Py_ssize_t dim) except NULL:
14223 * cdef Py_ssize_t shape, stride, suboffset = -1
14224 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
14225 * cdef char *resultp
14226 *
14227*/
14228 __pyx_t_1 = __pyx_v_view->itemsize;
14229
14230 __pyx_v_itemsize = __pyx_t_1;
14231
14232 /* "View.MemoryView":899
14233 * cdef char *resultp
14234 *
14235 * if view.ndim == 0: # <<<<<<<<<<<<<<
14236 * shape = view.len // itemsize
14237 * stride = itemsize
14238*/
14239 __pyx_t_2 = (__pyx_v_view->ndim == 0);
14240
14241 if (__pyx_t_2) {
14242
14243
14244 /* "View.MemoryView":900
14245 *
14246 * if view.ndim == 0:
14247 * shape = view.len // itemsize # <<<<<<<<<<<<<<
14248 * stride = itemsize
14249 * else:
14250*/
14251 if (unlikely(__pyx_v_itemsize == 0)) {
14252 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
14253 __PYX_ERR(1, 900, __pyx_L1_error)
14254 }
14255 else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
14256 PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
14257 __PYX_ERR(1, 900, __pyx_L1_error)
14258 }
14259 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);
14260
14261 /* "View.MemoryView":901
14262 * if view.ndim == 0:
14263 * shape = view.len // itemsize
14264 * stride = itemsize # <<<<<<<<<<<<<<
14265 * else:
14266 * shape = view.shape[dim]
14267*/
14268 __pyx_v_stride = __pyx_v_itemsize;
14269
14270 /* "View.MemoryView":899
14271 * cdef char *resultp
14272 *
14273 * if view.ndim == 0: # <<<<<<<<<<<<<<
14274 * shape = view.len // itemsize
14275 * stride = itemsize
14276*/
14277 goto __pyx_L3;
14278 }
14279
14280 /* "View.MemoryView":903
14281 * stride = itemsize
14282 * else:
14283 * shape = view.shape[dim] # <<<<<<<<<<<<<<
14284 * stride = view.strides[dim]
14285 * if view.suboffsets != NULL:
14286*/
14287 /*else*/ {
14288 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14289
14290 /* "View.MemoryView":904
14291 * else:
14292 * shape = view.shape[dim]
14293 * stride = view.strides[dim] # <<<<<<<<<<<<<<
14294 * if view.suboffsets != NULL:
14295 * suboffset = view.suboffsets[dim]
14296*/
14297 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14298
14299 /* "View.MemoryView":905
14300 * shape = view.shape[dim]
14301 * stride = view.strides[dim]
14302 * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14303 * suboffset = view.suboffsets[dim]
14304 *
14305*/
14306 __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14307
14308 if (__pyx_t_2) {
14309
14310
14311 /* "View.MemoryView":906
14312 * stride = view.strides[dim]
14313 * if view.suboffsets != NULL:
14314 * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
14315 *
14316 * if index < 0:
14317*/
14318 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14319
14320 /* "View.MemoryView":905
14321 * shape = view.shape[dim]
14322 * stride = view.strides[dim]
14323 * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14324 * suboffset = view.suboffsets[dim]
14325 *
14326*/
14327 }
14328 }
14329 __pyx_L3:;
14330
14331 /* "View.MemoryView":908
14332 * suboffset = view.suboffsets[dim]
14333 *
14334 * if index < 0: # <<<<<<<<<<<<<<
14335 * index += view.shape[dim]
14336 * if cython.unlikely(index < 0):
14337*/
14338 __pyx_t_2 = (__pyx_v_index < 0);
14339
14340 if (__pyx_t_2) {
14341
14342
14343 /* "View.MemoryView":909
14344 *
14345 * if index < 0:
14346 * index += view.shape[dim] # <<<<<<<<<<<<<<
14347 * if cython.unlikely(index < 0):
14348 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14349*/
14350 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14351
14352 /* "View.MemoryView":910
14353 * if index < 0:
14354 * index += view.shape[dim]
14355 * if cython.unlikely(index < 0): # <<<<<<<<<<<<<<
14356 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14357 *
14358*/
14359 __pyx_t_2 = (__pyx_v_index < 0);
14360
14361 if (unlikely(__pyx_t_2)) {
14362
14363
14364 /* "View.MemoryView":911
14365 * index += view.shape[dim]
14366 * if cython.unlikely(index < 0):
14367 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim) # <<<<<<<<<<<<<<
14368 *
14369 * if cython.unlikely(index >= shape):
14370*/
14371 __pyx_t_3 = __pyx_memoryview_err_IndexError(__pyx_k_Out_of_bounds_on_buffer_access_a, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 911, __pyx_L1_error)
14372
14373
14374 /* "View.MemoryView":910
14375 * if index < 0:
14376 * index += view.shape[dim]
14377 * if cython.unlikely(index < 0): # <<<<<<<<<<<<<<
14378 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14379 *
14380*/
14381 }
14382
14383 /* "View.MemoryView":908
14384 * suboffset = view.suboffsets[dim]
14385 *
14386 * if index < 0: # <<<<<<<<<<<<<<
14387 * index += view.shape[dim]
14388 * if cython.unlikely(index < 0):
14389*/
14390 }
14391
14392 /* "View.MemoryView":913
14393 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14394 *
14395 * if cython.unlikely(index >= shape): # <<<<<<<<<<<<<<
14396 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14397 *
14398*/
14399 __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14400
14401 if (unlikely(__pyx_t_2)) {
14402
14403
14404 /* "View.MemoryView":914
14405 *
14406 * if cython.unlikely(index >= shape):
14407 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim) # <<<<<<<<<<<<<<
14408 *
14409 * resultp = bufp + index * stride
14410*/
14411 __pyx_t_3 = __pyx_memoryview_err_IndexError(__pyx_k_Out_of_bounds_on_buffer_access_a, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 914, __pyx_L1_error)
14412
14413
14414 /* "View.MemoryView":913
14415 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14416 *
14417 * if cython.unlikely(index >= shape): # <<<<<<<<<<<<<<
14418 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14419 *
14420*/
14421 }
14422
14423 /* "View.MemoryView":916
14424 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14425 *
14426 * resultp = bufp + index * stride # <<<<<<<<<<<<<<
14427 * if suboffset >= 0:
14428 * resultp = (<char **> resultp)[0] + suboffset
14429*/
14430 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14431
14432 /* "View.MemoryView":917
14433 *
14434 * resultp = bufp + index * stride
14435 * if suboffset >= 0: # <<<<<<<<<<<<<<
14436 * resultp = (<char **> resultp)[0] + suboffset
14437 *
14438*/
14439 __pyx_t_2 = (__pyx_v_suboffset >= 0);
14440
14441 if (__pyx_t_2) {
14442
14443
14444 /* "View.MemoryView":918
14445 * resultp = bufp + index * stride
14446 * if suboffset >= 0:
14447 * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
14448 *
14449 * return resultp
14450*/
14451 __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14452
14453 /* "View.MemoryView":917
14454 *
14455 * resultp = bufp + index * stride
14456 * if suboffset >= 0: # <<<<<<<<<<<<<<
14457 * resultp = (<char **> resultp)[0] + suboffset
14458 *
14459*/
14460 }
14461
14462 /* "View.MemoryView":920
14463 * resultp = (<char **> resultp)[0] + suboffset
14464 *
14465 * return resultp # <<<<<<<<<<<<<<
14466 *
14467 *
14468*/
14469 {
14470
14471 __pyx_r = __pyx_v_resultp;
14472 }
14473 goto __pyx_L0;
14474
14475 /* "View.MemoryView":892
14476 *
14477 *
14478 * @cname('__pyx_pybuffer_index') # <<<<<<<<<<<<<<
14479 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14480 * Py_ssize_t dim) except NULL:
14481*/
14482
14483 /* function exit code */
14484 __pyx_L1_error:;
14485 __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14486 __pyx_r = NULL;
14487 __pyx_L0:;
14488
14489
14490
14491
14492
14493
14494
14495 return __pyx_r;
14496}
14497
14498/* "View.MemoryView":925
14499 *
14500 *
14501 * @cname('__pyx_memslice_transpose') # <<<<<<<<<<<<<<
14502 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14503 * cdef int ndim = memslice.memview.view.ndim
14504*/
14505
14506static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14507 int __pyx_v_ndim;
14508 Py_ssize_t *__pyx_v_shape;
14509 Py_ssize_t *__pyx_v_strides;
14510 int __pyx_v_i;
14511 int __pyx_v_j;
14512 int __pyx_r;
14513 int __pyx_t_1;
14514 Py_ssize_t *__pyx_t_2;
14515 long __pyx_t_3;
14516 long __pyx_t_4;
14517 Py_ssize_t __pyx_t_5;
14518 Py_ssize_t __pyx_t_6;
14519 int __pyx_t_7;
14520 int __pyx_t_8;
14521 int __pyx_t_9;
14522 int __pyx_lineno = 0;
14523 const char *__pyx_filename = NULL;
14524 int __pyx_clineno = 0;
14525 PyGILState_STATE __pyx_gilstate_save;
14526
14527 /* "View.MemoryView":927
14528 * @cname('__pyx_memslice_transpose')
14529 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14530 * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
14531 *
14532 * cdef Py_ssize_t *shape = memslice.shape
14533*/
14534 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14535
14536 __pyx_v_ndim = __pyx_t_1;
14537
14538 /* "View.MemoryView":929
14539 * cdef int ndim = memslice.memview.view.ndim
14540 *
14541 * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
14542 * cdef Py_ssize_t *strides = memslice.strides
14543 *
14544*/
14545 __pyx_t_2 = __pyx_v_memslice->shape;
14546
14547 __pyx_v_shape = __pyx_t_2;
14548
14549 /* "View.MemoryView":930
14550 *
14551 * cdef Py_ssize_t *shape = memslice.shape
14552 * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
14553 *
14554 *
14555*/
14556 __pyx_t_2 = __pyx_v_memslice->strides;
14557
14558 __pyx_v_strides = __pyx_t_2;
14559
14560 /* "View.MemoryView":934
14561 *
14562 * cdef int i, j
14563 * for i in range(ndim // 2): # <<<<<<<<<<<<<<
14564 * j = ndim - 1 - i
14565 * strides[i], strides[j] = strides[j], strides[i]
14566*/
14567
14568 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2, 1);
14569 __pyx_t_4 = __pyx_t_3;
14570
14571 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14572 __pyx_v_i = __pyx_t_1;
14573
14574 /* "View.MemoryView":935
14575 * cdef int i, j
14576 * for i in range(ndim // 2):
14577 * j = ndim - 1 - i # <<<<<<<<<<<<<<
14578 * strides[i], strides[j] = strides[j], strides[i]
14579 * shape[i], shape[j] = shape[j], shape[i]
14580*/
14581 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14582
14583 /* "View.MemoryView":936
14584 * for i in range(ndim // 2):
14585 * j = ndim - 1 - i
14586 * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
14587 * shape[i], shape[j] = shape[j], shape[i]
14588 *
14589*/
14590 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14591
14592 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14593
14594 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14595
14596 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14597
14598
14599 /* "View.MemoryView":937
14600 * j = ndim - 1 - i
14601 * strides[i], strides[j] = strides[j], strides[i]
14602 * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
14603 *
14604 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0):
14605*/
14606 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14607
14608 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14609
14610 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14611
14612 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14613
14614
14615 /* "View.MemoryView":939
14616 * shape[i], shape[j] = shape[j], shape[i]
14617 *
14618 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0): # <<<<<<<<<<<<<<
14619 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14620 *
14621*/
14622 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14623
14624 if (!__pyx_t_8) {
14625
14626 } else {
14627
14628 __pyx_t_7 = __pyx_t_8;
14629
14630 goto __pyx_L6_bool_binop_done;
14631 }
14632 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14633
14634
14635 __pyx_t_7 = __pyx_t_8;
14636
14637 __pyx_L6_bool_binop_done:;
14638 if (unlikely(__pyx_t_7)) {
14639
14640
14641 /* "View.MemoryView":940
14642 *
14643 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0):
14644 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
14645 *
14646 * return 0
14647*/
14648 __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 940, __pyx_L1_error)
14649
14650
14651 /* "View.MemoryView":939
14652 * shape[i], shape[j] = shape[j], shape[i]
14653 *
14654 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0): # <<<<<<<<<<<<<<
14655 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14656 *
14657*/
14658 }
14659 }
14660
14661
14662 /* "View.MemoryView":942
14663 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14664 *
14665 * return 0 # <<<<<<<<<<<<<<
14666 *
14667 *
14668*/
14669 {
14670
14671 __pyx_r = 0;
14672 }
14673 goto __pyx_L0;
14674
14675 /* "View.MemoryView":925
14676 *
14677 *
14678 * @cname('__pyx_memslice_transpose') # <<<<<<<<<<<<<<
14679 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14680 * cdef int ndim = memslice.memview.view.ndim
14681*/
14682
14683 /* function exit code */
14684 __pyx_L1_error:;
14685 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14686 __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14687 __pyx_r = -1;
14688 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14689 __pyx_L0:;
14690
14691
14692
14693
14694
14695 return __pyx_r;
14696}
14697
14698/* "View.MemoryView":960
14699 * cdef to_dtype_func_type to_dtype_func
14700 *
14701 * def __dealloc__(self): # <<<<<<<<<<<<<<
14702 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14703 *
14704*/
14705
14706/* Python wrapper */
14707static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
14708static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14709 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14710 __Pyx_RefNannyDeclarations
14711 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14712 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
14713 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14714
14715 /* function exit code */
14716 __Pyx_RefNannyFinishContext();
14717}
14718
14719static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14720
14721 /* "View.MemoryView":961
14722 *
14723 * def __dealloc__(self):
14724 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
14725 *
14726 * cdef convert_item_to_object(self, char *itemp):
14727*/
14728 __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
14729
14730 /* "View.MemoryView":960
14731 * cdef to_dtype_func_type to_dtype_func
14732 *
14733 * def __dealloc__(self): # <<<<<<<<<<<<<<
14734 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14735 *
14736*/
14737
14738 /* function exit code */
14739
14740}
14741
14742/* "View.MemoryView":963
14743 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14744 *
14745 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14746 * if self.to_object_func != NULL:
14747 * return self.to_object_func(itemp)
14748*/
14749
14750static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
14751 PyObject *__pyx_r = NULL;
14752 __Pyx_RefNannyDeclarations
14753 int __pyx_t_1;
14754 PyObject *__pyx_t_2 = NULL;
14755 int __pyx_lineno = 0;
14756 const char *__pyx_filename = NULL;
14757 int __pyx_clineno = 0;
14758 __Pyx_RefNannySetupContext("convert_item_to_object", 0);
14759
14760 /* "View.MemoryView":964
14761 *
14762 * cdef convert_item_to_object(self, char *itemp):
14763 * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14764 * return self.to_object_func(itemp)
14765 * else:
14766*/
14767 __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
14768
14769 if (__pyx_t_1) {
14770
14771
14772 /* "View.MemoryView":965
14773 * cdef convert_item_to_object(self, char *itemp):
14774 * if self.to_object_func != NULL:
14775 * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
14776 * else:
14777 * return memoryview.convert_item_to_object(self, itemp)
14778*/
14779 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 965, __pyx_L1_error)
14780 __Pyx_GOTREF(__pyx_t_2);
14781 {
14782 PyObject *__pyx_temp;
14783 {
14784 __pyx_temp = __pyx_r;
14785 __pyx_r = __pyx_t_2;
14786 }
14787 __Pyx_XDECREF(__pyx_temp);
14788 }
14789 __pyx_t_2 = 0;
14790 goto __pyx_L0;
14791
14792 /* "View.MemoryView":964
14793 *
14794 * cdef convert_item_to_object(self, char *itemp):
14795 * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14796 * return self.to_object_func(itemp)
14797 * else:
14798*/
14799 }
14800
14801 /* "View.MemoryView":967
14802 * return self.to_object_func(itemp)
14803 * else:
14804 * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
14805 *
14806 * cdef assign_item_from_object(self, char *itemp, object value):
14807*/
14808 /*else*/ {
14809 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error)
14810 __Pyx_GOTREF(__pyx_t_2);
14811 {
14812 PyObject *__pyx_temp;
14813 {
14814 __pyx_temp = __pyx_r;
14815 __pyx_r = __pyx_t_2;
14816 }
14817 __Pyx_XDECREF(__pyx_temp);
14818 }
14819 __pyx_t_2 = 0;
14820 goto __pyx_L0;
14821 }
14822
14823 /* "View.MemoryView":963
14824 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14825 *
14826 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14827 * if self.to_object_func != NULL:
14828 * return self.to_object_func(itemp)
14829*/
14830
14831 /* function exit code */
14832 __pyx_L1_error:;
14833 __Pyx_XDECREF(__pyx_t_2);
14834 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14835 __pyx_r = 0;
14836 __pyx_L0:;
14837 __Pyx_XGIVEREF(__pyx_r);
14838 __Pyx_RefNannyFinishContext();
14839 return __pyx_r;
14840}
14841
14842/* "View.MemoryView":969
14843 * return memoryview.convert_item_to_object(self, itemp)
14844 *
14845 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14846 * if self.to_dtype_func != NULL:
14847 * self.to_dtype_func(itemp, value)
14848*/
14849
14850static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14851 PyObject *__pyx_r = NULL;
14852 __Pyx_RefNannyDeclarations
14853 int __pyx_t_1;
14854 int __pyx_t_2;
14855 PyObject *__pyx_t_3 = NULL;
14856 int __pyx_lineno = 0;
14857 const char *__pyx_filename = NULL;
14858 int __pyx_clineno = 0;
14859 __Pyx_RefNannySetupContext("assign_item_from_object", 0);
14860
14861 /* "View.MemoryView":970
14862 *
14863 * cdef assign_item_from_object(self, char *itemp, object value):
14864 * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14865 * self.to_dtype_func(itemp, value)
14866 * else:
14867*/
14868 __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
14869
14870 if (__pyx_t_1) {
14871
14872
14873 /* "View.MemoryView":971
14874 * cdef assign_item_from_object(self, char *itemp, object value):
14875 * if self.to_dtype_func != NULL:
14876 * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
14877 * else:
14878 * memoryview.assign_item_from_object(self, itemp, value)
14879*/
14880 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 971, __pyx_L1_error)
14881
14882
14883 /* "View.MemoryView":970
14884 *
14885 * cdef assign_item_from_object(self, char *itemp, object value):
14886 * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14887 * self.to_dtype_func(itemp, value)
14888 * else:
14889*/
14890 goto __pyx_L3;
14891 }
14892
14893 /* "View.MemoryView":973
14894 * self.to_dtype_func(itemp, value)
14895 * else:
14896 * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
14897 *
14898 * cdef _get_base(self):
14899*/
14900 /*else*/ {
14901 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 973, __pyx_L1_error)
14902 __Pyx_GOTREF(__pyx_t_3);
14903 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14904 }
14905 __pyx_L3:;
14906
14907 /* "View.MemoryView":969
14908 * return memoryview.convert_item_to_object(self, itemp)
14909 *
14910 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14911 * if self.to_dtype_func != NULL:
14912 * self.to_dtype_func(itemp, value)
14913*/
14914
14915 /* function exit code */
14916 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14917 goto __pyx_L0;
14918 __pyx_L1_error:;
14919 __Pyx_XDECREF(__pyx_t_3);
14920 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14921 __pyx_r = 0;
14922 __pyx_L0:;
14923 __Pyx_XGIVEREF(__pyx_r);
14924 __Pyx_RefNannyFinishContext();
14925 return __pyx_r;
14926}
14927
14928/* "View.MemoryView":975
14929 * memoryview.assign_item_from_object(self, itemp, value)
14930 *
14931 * cdef _get_base(self): # <<<<<<<<<<<<<<
14932 * return self.from_object
14933 *
14934*/
14935
14936static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14937 PyObject *__pyx_r = NULL;
14938 __Pyx_RefNannyDeclarations
14939 __Pyx_RefNannySetupContext("_get_base", 0);
14940
14941 /* "View.MemoryView":976
14942 *
14943 * cdef _get_base(self):
14944 * return self.from_object # <<<<<<<<<<<<<<
14945 *
14946 *
14947*/
14948 {
14949 PyObject *__pyx_temp;
14950 {
14951 __pyx_temp = __pyx_r;
14952 __Pyx_INCREF(__pyx_v_self->from_object);
14953 __pyx_r = __pyx_v_self->from_object;
14954 }
14955 __Pyx_XDECREF(__pyx_temp);
14956 }
14957 goto __pyx_L0;
14958
14959 /* "View.MemoryView":975
14960 * memoryview.assign_item_from_object(self, itemp, value)
14961 *
14962 * cdef _get_base(self): # <<<<<<<<<<<<<<
14963 * return self.from_object
14964 *
14965*/
14966
14967 /* function exit code */
14968 __pyx_L0:;
14969 __Pyx_XGIVEREF(__pyx_r);
14970 __Pyx_RefNannyFinishContext();
14971 return __pyx_r;
14972}
14973
14974/* "(tree fragment)":1
14975 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14976 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14977 * def __setstate_cython__(self, __pyx_state):
14978*/
14979
14980/* Python wrapper */
14981static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14982#if CYTHON_VECTORCALL
14983PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14984#else
14985PyObject *__pyx_args, PyObject *__pyx_kwds
14986#endif
14987); /*proto*/
14988static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14989#if CYTHON_VECTORCALL
14990PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14991#else
14992PyObject *__pyx_args, PyObject *__pyx_kwds
14993#endif
14994) {
14995 #if !CYTHON_VECTORCALL
14996 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14997 #endif
14998 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14999 PyObject *__pyx_r = 0;
15000 __Pyx_RefNannyDeclarations
15001 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15002 #if !CYTHON_VECTORCALL
15003 #if CYTHON_ASSUME_SAFE_SIZE
15004 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
15005 #else
15006 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
15007 #endif
15008 #endif
15009 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
15010 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
15011 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
15012 if (unlikely(__pyx_kwds_len < 0)) return NULL;
15013 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
15014 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15015
15016 /* function exit code */
15017 __Pyx_RefNannyFinishContext();
15018 return __pyx_r;
15019}
15020
15021static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15022 PyObject *__pyx_r = NULL;
15023 __Pyx_RefNannyDeclarations
15024 int __pyx_lineno = 0;
15025 const char *__pyx_filename = NULL;
15026 int __pyx_clineno = 0;
15027 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15028
15029 /* "(tree fragment)":2
15030 * def __reduce_cython__(self):
15031 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
15032 * def __setstate_cython__(self, __pyx_state):
15033 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15034*/
15035 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
15036 __PYX_ERR(1, 2, __pyx_L1_error)
15037
15038 /* "(tree fragment)":1
15039 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15040 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15041 * def __setstate_cython__(self, __pyx_state):
15042*/
15043
15044 /* function exit code */
15045 __pyx_L1_error:;
15046 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15047 __pyx_r = NULL;
15048 __Pyx_XGIVEREF(__pyx_r);
15049 __Pyx_RefNannyFinishContext();
15050 return __pyx_r;
15051}
15052
15053/* "(tree fragment)":3
15054 * def __reduce_cython__(self):
15055 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15056 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15057 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15058*/
15059
15060/* Python wrapper */
15061static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15062#if CYTHON_VECTORCALL
15063PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15064#else
15065PyObject *__pyx_args, PyObject *__pyx_kwds
15066#endif
15067); /*proto*/
15068static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15069#if CYTHON_VECTORCALL
15070PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15071#else
15072PyObject *__pyx_args, PyObject *__pyx_kwds
15073#endif
15074) {
15075 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
15076 #if !CYTHON_VECTORCALL
15077 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
15078 #endif
15079 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
15080 PyObject* values[1] = {0};
15081 int __pyx_lineno = 0;
15082 const char *__pyx_filename = NULL;
15083 int __pyx_clineno = 0;
15084 PyObject *__pyx_r = 0;
15085 __Pyx_RefNannyDeclarations
15086 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15087 #if !CYTHON_VECTORCALL
15088 #if CYTHON_ASSUME_SAFE_SIZE
15089 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
15090 #else
15091 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
15092 #endif
15093 #endif
15094 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
15095 {
15096 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
15097 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
15098 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
15099 if (__pyx_kwds_len > 0) {
15100 switch (__pyx_nargs) {
15101 case 1:
15102 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
15103 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
15104 CYTHON_FALLTHROUGH;
15105 case 0: break;
15106 default: goto __pyx_L5_argtuple_error;
15107 }
15108 const Py_ssize_t kwd_pos_args = __pyx_nargs;
15109 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
15110 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
15111 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
15112 }
15113 } else if (unlikely(__pyx_nargs != 1)) {
15114 goto __pyx_L5_argtuple_error;
15115 } else {
15116 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
15117 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
15118 }
15119 __pyx_v___pyx_state = values[0];
15120 }
15121 goto __pyx_L6_skip;
15122 __pyx_L5_argtuple_error:;
15123 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
15124 __pyx_L6_skip:;
15125 goto __pyx_L4_argument_unpacking_done;
15126 __pyx_L3_error:;
15127 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
15128 Py_XDECREF(values[__pyx_temp]);
15129 }
15130 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15131 __Pyx_RefNannyFinishContext();
15132 return NULL;
15133 __pyx_L4_argument_unpacking_done:;
15134 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
15135
15136 /* function exit code */
15137 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
15138 Py_XDECREF(values[__pyx_temp]);
15139 }
15140 __Pyx_RefNannyFinishContext();
15141 return __pyx_r;
15142}
15143
15144static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15145 PyObject *__pyx_r = NULL;
15146 __Pyx_RefNannyDeclarations
15147 int __pyx_lineno = 0;
15148 const char *__pyx_filename = NULL;
15149 int __pyx_clineno = 0;
15150 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15151
15152 /* "(tree fragment)":4
15153 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15154 * def __setstate_cython__(self, __pyx_state):
15155 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
15156*/
15157 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
15158 __PYX_ERR(1, 4, __pyx_L1_error)
15159
15160 /* "(tree fragment)":3
15161 * def __reduce_cython__(self):
15162 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15163 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15164 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15165*/
15166
15167 /* function exit code */
15168 __pyx_L1_error:;
15169 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15170 __pyx_r = NULL;
15171 __Pyx_XGIVEREF(__pyx_r);
15172 __Pyx_RefNannyFinishContext();
15173 return __pyx_r;
15174}
15175
15176/* "View.MemoryView":995
15177 * pass # ignore failure, it's a minor issue
15178 *
15179 * @cname('__pyx_memoryview_fromslice') # <<<<<<<<<<<<<<
15180 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
15181 * int ndim,
15182*/
15183
15184static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func, int __pyx_v_dtype_is_object) {
15185 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15186 Py_ssize_t __pyx_v_suboffset;
15187 Py_ssize_t __pyx_v_length;
15188 PyObject *__pyx_r = NULL;
15189 __Pyx_RefNannyDeclarations
15190 int __pyx_t_1;
15191 PyObject *__pyx_t_2 = NULL;
15192 PyObject *__pyx_t_3 = NULL;
15193 __Pyx_TypeInfo const *__pyx_t_4;
15194 Py_buffer __pyx_t_5;
15195 Py_ssize_t *__pyx_t_6;
15196 Py_ssize_t *__pyx_t_7;
15197 Py_ssize_t *__pyx_t_8;
15198 Py_ssize_t __pyx_t_9;
15199 int __pyx_lineno = 0;
15200 const char *__pyx_filename = NULL;
15201 int __pyx_clineno = 0;
15202 __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
15203
15204 /* "View.MemoryView":1004
15205 * cdef _memoryviewslice result
15206 *
15207 * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15208 * return None
15209 *
15210*/
15211 __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
15212
15213 if (__pyx_t_1) {
15214
15215
15216 /* "View.MemoryView":1005
15217 *
15218 * if <PyObject *> memviewslice.memview == Py_None:
15219 * return None # <<<<<<<<<<<<<<
15220 *
15221 *
15222*/
15223 {
15224 PyObject *__pyx_temp;
15225 {
15226 __pyx_temp = __pyx_r;
15227 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15228 }
15229 __Pyx_XDECREF(__pyx_temp);
15230 }
15231 goto __pyx_L0;
15232
15233 /* "View.MemoryView":1004
15234 * cdef _memoryviewslice result
15235 *
15236 * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15237 * return None
15238 *
15239*/
15240 }
15241
15242 /* "View.MemoryView":1010
15243 *
15244 *
15245 * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
15246 *
15247 * result.from_slice = memviewslice
15248*/
15249 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
15250 __Pyx_GOTREF(__pyx_t_2);
15251 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1010, __pyx_L1_error)
15252 __Pyx_GOTREF(__pyx_t_3);
15253 __Pyx_INCREF(Py_None);
15254 __Pyx_GIVEREF(Py_None);
15255 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15256 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
15257 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
15258 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15259 __Pyx_GIVEREF(__pyx_t_2);
15260 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15261 __pyx_t_2 = 0;
15262 __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_mstate_global->__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
15263 __Pyx_GOTREF(__pyx_t_2);
15264 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15265 __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15266 __pyx_t_2 = 0;
15267
15268 /* "View.MemoryView":1012
15269 * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
15270 *
15271 * result.from_slice = memviewslice # <<<<<<<<<<<<<<
15272 * __PYX_INC_MEMVIEW(&memviewslice, 1)
15273 *
15274*/
15275 __pyx_v_result->from_slice = __pyx_v_memviewslice;
15276
15277 /* "View.MemoryView":1013
15278 *
15279 * result.from_slice = memviewslice
15280 * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
15281 *
15282 * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15283*/
15284 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15285
15286 /* "View.MemoryView":1015
15287 * __PYX_INC_MEMVIEW(&memviewslice, 1)
15288 *
15289 * result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
15290 * result.typeinfo = memviewslice.memview.typeinfo
15291 *
15292*/
15293 __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
15294 __Pyx_GOTREF(__pyx_t_2);
15295 __Pyx_GIVEREF(__pyx_t_2);
15296 __Pyx_GOTREF(__pyx_v_result->from_object);
15297 __Pyx_DECREF(__pyx_v_result->from_object);
15298 __pyx_v_result->from_object = __pyx_t_2;
15299 __pyx_t_2 = 0;
15300
15301 /* "View.MemoryView":1016
15302 *
15303 * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15304 * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
15305 *
15306 * result.view = memviewslice.memview.view
15307*/
15308 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15309
15310 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15311
15312 /* "View.MemoryView":1018
15313 * result.typeinfo = memviewslice.memview.typeinfo
15314 *
15315 * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
15316 * result.view.buf = <void *> memviewslice.data
15317 * result.view.ndim = ndim
15318*/
15319 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15320
15321 __pyx_v_result->__pyx_base.view = __pyx_t_5;
15322
15323 /* "View.MemoryView":1019
15324 *
15325 * result.view = memviewslice.memview.view
15326 * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
15327 * result.view.ndim = ndim
15328 * (<__pyx_buffer *> &result.view).obj = Py_None
15329*/
15330 __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
15331
15332 /* "View.MemoryView":1020
15333 * result.view = memviewslice.memview.view
15334 * result.view.buf = <void *> memviewslice.data
15335 * result.view.ndim = ndim # <<<<<<<<<<<<<<
15336 * (<__pyx_buffer *> &result.view).obj = Py_None
15337 * Py_INCREF(Py_None)
15338*/
15339 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15340
15341 /* "View.MemoryView":1021
15342 * result.view.buf = <void *> memviewslice.data
15343 * result.view.ndim = ndim
15344 * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
15345 * Py_INCREF(Py_None)
15346 *
15347*/
15348 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15349
15350 /* "View.MemoryView":1022
15351 * result.view.ndim = ndim
15352 * (<__pyx_buffer *> &result.view).obj = Py_None
15353 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
15354 *
15355 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15356*/
15357 Py_INCREF(Py_None);
15358
15359 /* "View.MemoryView":1024
15360 * Py_INCREF(Py_None)
15361 *
15362 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15363 * result.flags = PyBUF_RECORDS
15364 * else:
15365*/
15366 __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15367
15368 if (__pyx_t_1) {
15369
15370
15371 /* "View.MemoryView":1025
15372 *
15373 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15374 * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
15375 * else:
15376 * result.flags = PyBUF_RECORDS_RO
15377*/
15378 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15379
15380 /* "View.MemoryView":1024
15381 * Py_INCREF(Py_None)
15382 *
15383 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15384 * result.flags = PyBUF_RECORDS
15385 * else:
15386*/
15387 goto __pyx_L4;
15388 }
15389
15390 /* "View.MemoryView":1027
15391 * result.flags = PyBUF_RECORDS
15392 * else:
15393 * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
15394 *
15395 * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15396*/
15397 /*else*/ {
15398 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15399 }
15400 __pyx_L4:;
15401
15402 /* "View.MemoryView":1029
15403 * result.flags = PyBUF_RECORDS_RO
15404 *
15405 * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
15406 * result.view.strides = <Py_ssize_t *> result.from_slice.strides
15407 *
15408*/
15409 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15410
15411 /* "View.MemoryView":1030
15412 *
15413 * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15414 * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
15415 *
15416 *
15417*/
15418 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15419
15420 /* "View.MemoryView":1033
15421 *
15422 *
15423 * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
15424 * for suboffset in result.from_slice.suboffsets[:ndim]:
15425 * if suboffset >= 0:
15426*/
15427 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15428
15429 /* "View.MemoryView":1034
15430 *
15431 * result.view.suboffsets = NULL
15432 * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
15433 * if suboffset >= 0:
15434 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15435*/
15436 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15437
15438 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15439 __pyx_t_6 = __pyx_t_8;
15440 __pyx_v_suboffset = (__pyx_t_6[0]);
15441
15442 /* "View.MemoryView":1035
15443 * result.view.suboffsets = NULL
15444 * for suboffset in result.from_slice.suboffsets[:ndim]:
15445 * if suboffset >= 0: # <<<<<<<<<<<<<<
15446 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15447 * break
15448*/
15449 __pyx_t_1 = (__pyx_v_suboffset >= 0);
15450
15451 if (__pyx_t_1) {
15452
15453
15454 /* "View.MemoryView":1036
15455 * for suboffset in result.from_slice.suboffsets[:ndim]:
15456 * if suboffset >= 0:
15457 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
15458 * break
15459 *
15460*/
15461 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15462
15463 /* "View.MemoryView":1037
15464 * if suboffset >= 0:
15465 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15466 * break # <<<<<<<<<<<<<<
15467 *
15468 * cdef Py_ssize_t length
15469*/
15470 goto __pyx_L6_break;
15471
15472 /* "View.MemoryView":1035
15473 * result.view.suboffsets = NULL
15474 * for suboffset in result.from_slice.suboffsets[:ndim]:
15475 * if suboffset >= 0: # <<<<<<<<<<<<<<
15476 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15477 * break
15478*/
15479 }
15480 }
15481 __pyx_L6_break:;
15482
15483
15484 /* "View.MemoryView":1040
15485 *
15486 * cdef Py_ssize_t length
15487 * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
15488 * for length in result.view.shape[:ndim]:
15489 * result.view.len *= length
15490*/
15491 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15492
15493 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15494
15495 /* "View.MemoryView":1041
15496 * cdef Py_ssize_t length
15497 * result.view.len = result.view.itemsize
15498 * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
15499 * result.view.len *= length
15500 *
15501*/
15502 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15503
15504 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15505 __pyx_t_6 = __pyx_t_8;
15506 __pyx_v_length = (__pyx_t_6[0]);
15507
15508 /* "View.MemoryView":1042
15509 * result.view.len = result.view.itemsize
15510 * for length in result.view.shape[:ndim]:
15511 * result.view.len *= length # <<<<<<<<<<<<<<
15512 *
15513 * result.to_object_func = to_object_func
15514*/
15515 __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * __pyx_v_length);
15516 }
15517
15518
15519 /* "View.MemoryView":1044
15520 * result.view.len *= length
15521 *
15522 * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
15523 * result.to_dtype_func = to_dtype_func
15524 *
15525*/
15526 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15527
15528 /* "View.MemoryView":1045
15529 *
15530 * result.to_object_func = to_object_func
15531 * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
15532 *
15533 * return result
15534*/
15535 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15536
15537 /* "View.MemoryView":1047
15538 * result.to_dtype_func = to_dtype_func
15539 *
15540 * return result # <<<<<<<<<<<<<<
15541 *
15542 * @cname('__pyx_memoryview_get_slice_from_memoryview')
15543*/
15544 {
15545 PyObject *__pyx_temp;
15546 {
15547 __pyx_temp = __pyx_r;
15548 __Pyx_INCREF((PyObject *)__pyx_v_result);
15549 __pyx_r = ((PyObject *)__pyx_v_result);
15550 }
15551 __Pyx_XDECREF(__pyx_temp);
15552 }
15553 goto __pyx_L0;
15554
15555 /* "View.MemoryView":995
15556 * pass # ignore failure, it's a minor issue
15557 *
15558 * @cname('__pyx_memoryview_fromslice') # <<<<<<<<<<<<<<
15559 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
15560 * int ndim,
15561*/
15562
15563 /* function exit code */
15564 __pyx_L1_error:;
15565 __Pyx_XDECREF(__pyx_t_2);
15566 __Pyx_XDECREF(__pyx_t_3);
15567 __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15568 __pyx_r = 0;
15569 __pyx_L0:;
15570 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15571
15572
15573 __Pyx_XGIVEREF(__pyx_r);
15574 __Pyx_RefNannyFinishContext();
15575 return __pyx_r;
15576}
15577
15578/* "View.MemoryView":1049
15579 * return result
15580 *
15581 * @cname('__pyx_memoryview_get_slice_from_memoryview') # <<<<<<<<<<<<<<
15582 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
15583 * __Pyx_memviewslice *mslice) except NULL:
15584*/
15585
15586static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15587 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15588 __Pyx_memviewslice *__pyx_r;
15589 __Pyx_RefNannyDeclarations
15590 int __pyx_t_1;
15591 PyObject *__pyx_t_2 = NULL;
15592 int __pyx_lineno = 0;
15593 const char *__pyx_filename = NULL;
15594 int __pyx_clineno = 0;
15595 __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
15596
15597 /* "View.MemoryView":1053
15598 * __Pyx_memviewslice *mslice) except NULL:
15599 * cdef _memoryviewslice obj
15600 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15601 * obj = memview
15602 * return &obj.from_slice
15603*/
15604 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15605 if (__pyx_t_1) {
15606
15607
15608 /* "View.MemoryView":1054
15609 * cdef _memoryviewslice obj
15610 * if isinstance(memview, _memoryviewslice):
15611 * obj = memview # <<<<<<<<<<<<<<
15612 * return &obj.from_slice
15613 * else:
15614*/
15615 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
15616 __Pyx_INCREF(__pyx_t_2);
15617 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 1054, __pyx_L1_error)
15618 __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15619 __pyx_t_2 = 0;
15620
15621 /* "View.MemoryView":1055
15622 * if isinstance(memview, _memoryviewslice):
15623 * obj = memview
15624 * return &obj.from_slice # <<<<<<<<<<<<<<
15625 * else:
15626 * slice_copy(memview, mslice)
15627*/
15628 {
15629
15630 __pyx_r = (&__pyx_v_obj->from_slice);
15631 }
15632 goto __pyx_L0;
15633
15634 /* "View.MemoryView":1053
15635 * __Pyx_memviewslice *mslice) except NULL:
15636 * cdef _memoryviewslice obj
15637 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15638 * obj = memview
15639 * return &obj.from_slice
15640*/
15641 }
15642
15643 /* "View.MemoryView":1057
15644 * return &obj.from_slice
15645 * else:
15646 * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
15647 * return mslice
15648 *
15649*/
15650 /*else*/ {
15651 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15652
15653 /* "View.MemoryView":1058
15654 * else:
15655 * slice_copy(memview, mslice)
15656 * return mslice # <<<<<<<<<<<<<<
15657 *
15658 * @cname('__pyx_memoryview_slice_copy')
15659*/
15660 {
15661
15662 __pyx_r = __pyx_v_mslice;
15663 }
15664 goto __pyx_L0;
15665 }
15666
15667 /* "View.MemoryView":1049
15668 * return result
15669 *
15670 * @cname('__pyx_memoryview_get_slice_from_memoryview') # <<<<<<<<<<<<<<
15671 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
15672 * __Pyx_memviewslice *mslice) except NULL:
15673*/
15674
15675 /* function exit code */
15676 __pyx_L1_error:;
15677 __Pyx_XDECREF(__pyx_t_2);
15678 __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15679 __pyx_r = NULL;
15680 __pyx_L0:;
15681 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15682
15683 __Pyx_RefNannyFinishContext();
15684 return __pyx_r;
15685}
15686
15687/* "View.MemoryView":1060
15688 * return mslice
15689 *
15690 * @cname('__pyx_memoryview_slice_copy') # <<<<<<<<<<<<<<
15691 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
15692 * cdef int dim
15693*/
15694
15695static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15696 int __pyx_v_dim;
15697 Py_ssize_t *__pyx_v_shape;
15698 Py_ssize_t *__pyx_v_strides;
15699 Py_ssize_t *__pyx_v_suboffsets;
15700 Py_ssize_t *__pyx_t_1;
15701 int __pyx_t_2;
15702 int __pyx_t_3;
15703 int __pyx_t_4;
15704 Py_ssize_t __pyx_t_5;
15705 int __pyx_t_6;
15706
15707 /* "View.MemoryView":1065
15708 * cdef (Py_ssize_t*) shape, strides, suboffsets
15709 *
15710 * shape = memview.view.shape # <<<<<<<<<<<<<<
15711 * strides = memview.view.strides
15712 * suboffsets = memview.view.suboffsets
15713*/
15714 __pyx_t_1 = __pyx_v_memview->view.shape;
15715
15716 __pyx_v_shape = __pyx_t_1;
15717
15718 /* "View.MemoryView":1066
15719 *
15720 * shape = memview.view.shape
15721 * strides = memview.view.strides # <<<<<<<<<<<<<<
15722 * suboffsets = memview.view.suboffsets
15723 *
15724*/
15725 __pyx_t_1 = __pyx_v_memview->view.strides;
15726
15727 __pyx_v_strides = __pyx_t_1;
15728
15729 /* "View.MemoryView":1067
15730 * shape = memview.view.shape
15731 * strides = memview.view.strides
15732 * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
15733 *
15734 * dst.memview = <__pyx_memoryview *> memview
15735*/
15736 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15737
15738 __pyx_v_suboffsets = __pyx_t_1;
15739
15740 /* "View.MemoryView":1069
15741 * suboffsets = memview.view.suboffsets
15742 *
15743 * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
15744 * dst.data = <char *> memview.view.buf
15745 *
15746*/
15747 __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
15748
15749 /* "View.MemoryView":1070
15750 *
15751 * dst.memview = <__pyx_memoryview *> memview
15752 * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
15753 *
15754 * for dim in range(memview.view.ndim):
15755*/
15756 __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
15757
15758 /* "View.MemoryView":1072
15759 * dst.data = <char *> memview.view.buf
15760 *
15761 * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
15762 * dst.shape[dim] = shape[dim]
15763 * dst.strides[dim] = strides[dim]
15764*/
15765
15766 __pyx_t_2 = __pyx_v_memview->view.ndim;
15767 __pyx_t_3 = __pyx_t_2;
15768
15769 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15770 __pyx_v_dim = __pyx_t_4;
15771
15772 /* "View.MemoryView":1073
15773 *
15774 * for dim in range(memview.view.ndim):
15775 * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
15776 * dst.strides[dim] = strides[dim]
15777 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15778*/
15779 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15780
15781 /* "View.MemoryView":1074
15782 * for dim in range(memview.view.ndim):
15783 * dst.shape[dim] = shape[dim]
15784 * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
15785 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15786 *
15787*/
15788 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15789
15790 /* "View.MemoryView":1075
15791 * dst.shape[dim] = shape[dim]
15792 * dst.strides[dim] = strides[dim]
15793 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
15794 *
15795 * @cname('__pyx_memoryview_copy_object')
15796*/
15797 __pyx_t_6 = (__pyx_v_suboffsets != 0);
15798
15799 if (__pyx_t_6) {
15800
15801 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15802 } else {
15803
15804 __pyx_t_5 = -1L;
15805 }
15806
15807 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15808
15809 }
15810
15811
15812 /* "View.MemoryView":1060
15813 * return mslice
15814 *
15815 * @cname('__pyx_memoryview_slice_copy') # <<<<<<<<<<<<<<
15816 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
15817 * cdef int dim
15818*/
15819
15820 /* function exit code */
15821
15822
15823
15824
15825
15826}
15827
15828/* "View.MemoryView":1077
15829 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15830 *
15831 * @cname('__pyx_memoryview_copy_object') # <<<<<<<<<<<<<<
15832 * cdef memoryview_copy(memoryview memview):
15833 * "Create a new memoryview object"
15834*/
15835
15836static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
15837 __Pyx_memviewslice __pyx_v_memviewslice;
15838 PyObject *__pyx_r = NULL;
15839 __Pyx_RefNannyDeclarations
15840 PyObject *__pyx_t_1 = NULL;
15841 int __pyx_lineno = 0;
15842 const char *__pyx_filename = NULL;
15843 int __pyx_clineno = 0;
15844 __Pyx_RefNannySetupContext("memoryview_copy", 0);
15845
15846 /* "View.MemoryView":1081
15847 * "Create a new memoryview object"
15848 * cdef __Pyx_memviewslice memviewslice
15849 * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
15850 * return memoryview_copy_from_slice(memview, &memviewslice)
15851 *
15852*/
15853 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15854
15855 /* "View.MemoryView":1082
15856 * cdef __Pyx_memviewslice memviewslice
15857 * slice_copy(memview, &memviewslice)
15858 * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
15859 *
15860 * @cname('__pyx_memoryview_copy_object_from_slice')
15861*/
15862 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1082, __pyx_L1_error)
15863 __Pyx_GOTREF(__pyx_t_1);
15864 {
15865 PyObject *__pyx_temp;
15866 {
15867 __pyx_temp = __pyx_r;
15868 __pyx_r = __pyx_t_1;
15869 }
15870 __Pyx_XDECREF(__pyx_temp);
15871 }
15872 __pyx_t_1 = 0;
15873 goto __pyx_L0;
15874
15875 /* "View.MemoryView":1077
15876 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15877 *
15878 * @cname('__pyx_memoryview_copy_object') # <<<<<<<<<<<<<<
15879 * cdef memoryview_copy(memoryview memview):
15880 * "Create a new memoryview object"
15881*/
15882
15883 /* function exit code */
15884 __pyx_L1_error:;
15885 __Pyx_XDECREF(__pyx_t_1);
15886 __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15887 __pyx_r = 0;
15888 __pyx_L0:;
15889
15890 __Pyx_XGIVEREF(__pyx_r);
15891 __Pyx_RefNannyFinishContext();
15892 return __pyx_r;
15893}
15894
15895/* "View.MemoryView":1084
15896 * return memoryview_copy_from_slice(memview, &memviewslice)
15897 *
15898 * @cname('__pyx_memoryview_copy_object_from_slice') # <<<<<<<<<<<<<<
15899 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
15900 * """
15901*/
15902
15903static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15904 PyObject *(*__pyx_v_to_object_func)(char *);
15905 __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func;
15906 PyObject *__pyx_r = NULL;
15907 __Pyx_RefNannyDeclarations
15908 int __pyx_t_1;
15909 PyObject *(*__pyx_t_2)(char *);
15910 __pyx_memoryview_to_dtype_func_type __pyx_t_3;
15911 PyObject *__pyx_t_4 = NULL;
15912 int __pyx_lineno = 0;
15913 const char *__pyx_filename = NULL;
15914 int __pyx_clineno = 0;
15915 __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
15916
15917 /* "View.MemoryView":1092
15918 * cdef to_dtype_func_type to_dtype_func
15919 *
15920 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15921 * to_object_func = (<_memoryviewslice> memview).to_object_func
15922 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15923*/
15924 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15925 if (__pyx_t_1) {
15926
15927
15928 /* "View.MemoryView":1093
15929 *
15930 * if isinstance(memview, _memoryviewslice):
15931 * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
15932 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15933 * else:
15934*/
15935 __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15936
15937 __pyx_v_to_object_func = __pyx_t_2;
15938
15939 /* "View.MemoryView":1094
15940 * if isinstance(memview, _memoryviewslice):
15941 * to_object_func = (<_memoryviewslice> memview).to_object_func
15942 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
15943 * else:
15944 * to_object_func = NULL
15945*/
15946 __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15947
15948 __pyx_v_to_dtype_func = __pyx_t_3;
15949
15950 /* "View.MemoryView":1092
15951 * cdef to_dtype_func_type to_dtype_func
15952 *
15953 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15954 * to_object_func = (<_memoryviewslice> memview).to_object_func
15955 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15956*/
15957 goto __pyx_L3;
15958 }
15959
15960 /* "View.MemoryView":1096
15961 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15962 * else:
15963 * to_object_func = NULL # <<<<<<<<<<<<<<
15964 * to_dtype_func = NULL
15965 *
15966*/
15967 /*else*/ {
15968 __pyx_v_to_object_func = NULL;
15969
15970 /* "View.MemoryView":1097
15971 * else:
15972 * to_object_func = NULL
15973 * to_dtype_func = NULL # <<<<<<<<<<<<<<
15974 *
15975 * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15976*/
15977 __pyx_v_to_dtype_func = NULL;
15978 }
15979 __pyx_L3:;
15980
15981 /* "View.MemoryView":1099
15982 * to_dtype_func = NULL
15983 *
15984 * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
15985 * to_object_func, to_dtype_func,
15986 * memview.dtype_is_object)
15987*/
15988 __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1099, __pyx_L1_error)
15989 __Pyx_GOTREF(__pyx_t_4);
15990 {
15991 PyObject *__pyx_temp;
15992 {
15993 __pyx_temp = __pyx_r;
15994 __pyx_r = __pyx_t_4;
15995 }
15996 __Pyx_XDECREF(__pyx_temp);
15997 }
15998 __pyx_t_4 = 0;
15999 goto __pyx_L0;
16000
16001 /* "View.MemoryView":1084
16002 * return memoryview_copy_from_slice(memview, &memviewslice)
16003 *
16004 * @cname('__pyx_memoryview_copy_object_from_slice') # <<<<<<<<<<<<<<
16005 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
16006 * """
16007*/
16008
16009 /* function exit code */
16010 __pyx_L1_error:;
16011 __Pyx_XDECREF(__pyx_t_4);
16012 __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16013 __pyx_r = 0;
16014 __pyx_L0:;
16015
16016
16017 __Pyx_XGIVEREF(__pyx_r);
16018 __Pyx_RefNannyFinishContext();
16019 return __pyx_r;
16020}
16021
16022/* "View.MemoryView":1107
16023 *
16024 *
16025 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
16026 * return -arg if arg < 0 else arg
16027 *
16028*/
16029
16030static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
16031 Py_ssize_t __pyx_r;
16032 Py_ssize_t __pyx_t_1;
16033 int __pyx_t_2;
16034
16035 /* "View.MemoryView":1108
16036 *
16037 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
16038 * return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
16039 *
16040 * @cname('__pyx_get_best_slice_order')
16041*/
16042 __pyx_t_2 = (__pyx_v_arg < 0);
16043
16044 if (__pyx_t_2) {
16045
16046 __pyx_t_1 = (-__pyx_v_arg);
16047 } else {
16048
16049 __pyx_t_1 = __pyx_v_arg;
16050 }
16051
16052 {
16053 __pyx_r = __pyx_t_1;
16054 }
16055 goto __pyx_L0;
16056
16057 /* "View.MemoryView":1107
16058 *
16059 *
16060 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
16061 * return -arg if arg < 0 else arg
16062 *
16063*/
16064
16065 /* function exit code */
16066 __pyx_L0:;
16067 return __pyx_r;
16068}
16069
16070/* "View.MemoryView":1110
16071 * return -arg if arg < 0 else arg
16072 *
16073 * @cname('__pyx_get_best_slice_order') # <<<<<<<<<<<<<<
16074 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
16075 * """
16076*/
16077
16078static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
16079 int __pyx_v_i;
16080 Py_ssize_t __pyx_v_c_stride;
16081 Py_ssize_t __pyx_v_f_stride;
16082 char __pyx_r;
16083 int __pyx_t_1;
16084 int __pyx_t_2;
16085 int __pyx_t_3;
16086 int __pyx_t_4;
16087
16088 /* "View.MemoryView":1116
16089 * """
16090 * cdef int i
16091 * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
16092 * cdef Py_ssize_t f_stride = 0
16093 *
16094*/
16095 __pyx_v_c_stride = 0;
16096
16097 /* "View.MemoryView":1117
16098 * cdef int i
16099 * cdef Py_ssize_t c_stride = 0
16100 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
16101 *
16102 * for i in range(ndim - 1, -1, -1):
16103*/
16104 __pyx_v_f_stride = 0;
16105
16106 /* "View.MemoryView":1119
16107 * cdef Py_ssize_t f_stride = 0
16108 *
16109 * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16110 * if mslice.shape[i] > 1:
16111 * c_stride = mslice.strides[i]
16112*/
16113 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
16114 __pyx_v_i = __pyx_t_1;
16115
16116 /* "View.MemoryView":1120
16117 *
16118 * for i in range(ndim - 1, -1, -1):
16119 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16120 * c_stride = mslice.strides[i]
16121 * break
16122*/
16123 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16124
16125 if (__pyx_t_2) {
16126
16127
16128 /* "View.MemoryView":1121
16129 * for i in range(ndim - 1, -1, -1):
16130 * if mslice.shape[i] > 1:
16131 * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
16132 * break
16133 *
16134*/
16135 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16136
16137 /* "View.MemoryView":1122
16138 * if mslice.shape[i] > 1:
16139 * c_stride = mslice.strides[i]
16140 * break # <<<<<<<<<<<<<<
16141 *
16142 * for i in range(ndim):
16143*/
16144 goto __pyx_L4_break;
16145
16146 /* "View.MemoryView":1120
16147 *
16148 * for i in range(ndim - 1, -1, -1):
16149 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16150 * c_stride = mslice.strides[i]
16151 * break
16152*/
16153 }
16154 }
16155 __pyx_L4_break:;
16156
16157 /* "View.MemoryView":1124
16158 * break
16159 *
16160 * for i in range(ndim): # <<<<<<<<<<<<<<
16161 * if mslice.shape[i] > 1:
16162 * f_stride = mslice.strides[i]
16163*/
16164
16165 __pyx_t_1 = __pyx_v_ndim;
16166 __pyx_t_3 = __pyx_t_1;
16167
16168 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16169 __pyx_v_i = __pyx_t_4;
16170
16171 /* "View.MemoryView":1125
16172 *
16173 * for i in range(ndim):
16174 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16175 * f_stride = mslice.strides[i]
16176 * break
16177*/
16178 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16179
16180 if (__pyx_t_2) {
16181
16182
16183 /* "View.MemoryView":1126
16184 * for i in range(ndim):
16185 * if mslice.shape[i] > 1:
16186 * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
16187 * break
16188 *
16189*/
16190 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16191
16192 /* "View.MemoryView":1127
16193 * if mslice.shape[i] > 1:
16194 * f_stride = mslice.strides[i]
16195 * break # <<<<<<<<<<<<<<
16196 *
16197 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16198*/
16199 goto __pyx_L7_break;
16200
16201 /* "View.MemoryView":1125
16202 *
16203 * for i in range(ndim):
16204 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16205 * f_stride = mslice.strides[i]
16206 * break
16207*/
16208 }
16209 }
16210 __pyx_L7_break:;
16211
16212
16213 /* "View.MemoryView":1129
16214 * break
16215 *
16216 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16217 * return 'C'
16218 * else:
16219*/
16220 __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
16221
16222 if (__pyx_t_2) {
16223
16224
16225 /* "View.MemoryView":1130
16226 *
16227 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16228 * return 'C' # <<<<<<<<<<<<<<
16229 * else:
16230 * return 'F'
16231*/
16232 {
16233
16234 __pyx_r = 'C';
16235 }
16236 goto __pyx_L0;
16237
16238 /* "View.MemoryView":1129
16239 * break
16240 *
16241 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16242 * return 'C'
16243 * else:
16244*/
16245 }
16246
16247 /* "View.MemoryView":1132
16248 * return 'C'
16249 * else:
16250 * return 'F' # <<<<<<<<<<<<<<
16251 *
16252 * @cython.cdivision(True)
16253*/
16254 /*else*/ {
16255 {
16256
16257 __pyx_r = 'F';
16258 }
16259 goto __pyx_L0;
16260 }
16261
16262 /* "View.MemoryView":1110
16263 * return -arg if arg < 0 else arg
16264 *
16265 * @cname('__pyx_get_best_slice_order') # <<<<<<<<<<<<<<
16266 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
16267 * """
16268*/
16269
16270 /* function exit code */
16271 __pyx_L0:;
16272
16273
16274
16275 return __pyx_r;
16276}
16277
16278/* "View.MemoryView":1134
16279 * return 'F'
16280 *
16281 * @cython.cdivision(True) # <<<<<<<<<<<<<<
16282 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
16283 * char *dst_data, Py_ssize_t *dst_strides,
16284*/
16285
16286static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16287 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16288 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16289 Py_ssize_t __pyx_v_dst_extent;
16290 Py_ssize_t __pyx_v_src_stride;
16291 Py_ssize_t __pyx_v_dst_stride;
16292 int __pyx_t_1;
16293 int __pyx_t_2;
16294 Py_ssize_t __pyx_t_3;
16295 Py_ssize_t __pyx_t_4;
16296 Py_ssize_t __pyx_t_5;
16297
16298
16299
16300 /* "View.MemoryView":1142
16301 *
16302 * cdef Py_ssize_t i
16303 * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
16304 * cdef Py_ssize_t dst_extent = dst_shape[0]
16305 * cdef Py_ssize_t src_stride = src_strides[0]
16306*/
16307 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16308
16309 /* "View.MemoryView":1143
16310 * cdef Py_ssize_t i
16311 * cdef Py_ssize_t src_extent = src_shape[0]
16312 * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
16313 * cdef Py_ssize_t src_stride = src_strides[0]
16314 * cdef Py_ssize_t dst_stride = dst_strides[0]
16315*/
16316 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16317
16318 /* "View.MemoryView":1144
16319 * cdef Py_ssize_t src_extent = src_shape[0]
16320 * cdef Py_ssize_t dst_extent = dst_shape[0]
16321 * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
16322 * cdef Py_ssize_t dst_stride = dst_strides[0]
16323 *
16324*/
16325 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16326
16327 /* "View.MemoryView":1145
16328 * cdef Py_ssize_t dst_extent = dst_shape[0]
16329 * cdef Py_ssize_t src_stride = src_strides[0]
16330 * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
16331 *
16332 * if ndim == 1:
16333*/
16334 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16335
16336 /* "View.MemoryView":1147
16337 * cdef Py_ssize_t dst_stride = dst_strides[0]
16338 *
16339 * if ndim == 1: # <<<<<<<<<<<<<<
16340 * if (src_stride > 0 and dst_stride > 0 and
16341 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16342*/
16343 __pyx_t_1 = (__pyx_v_ndim == 1);
16344
16345 if (__pyx_t_1) {
16346
16347
16348 /* "View.MemoryView":1148
16349 *
16350 * if ndim == 1:
16351 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16352 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16353 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16354*/
16355 __pyx_t_2 = (__pyx_v_src_stride > 0);
16356
16357 if (__pyx_t_2) {
16358
16359 } else {
16360
16361 __pyx_t_1 = __pyx_t_2;
16362
16363 goto __pyx_L5_bool_binop_done;
16364 }
16365 __pyx_t_2 = (__pyx_v_dst_stride > 0);
16366
16367 if (__pyx_t_2) {
16368
16369 } else {
16370
16371 __pyx_t_1 = __pyx_t_2;
16372
16373 goto __pyx_L5_bool_binop_done;
16374 }
16375
16376 /* "View.MemoryView":1149
16377 * if ndim == 1:
16378 * if (src_stride > 0 and dst_stride > 0 and
16379 * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
16380 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16381 * else:
16382*/
16383 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16384 if (__pyx_t_2) {
16385 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16386 }
16387
16388 __pyx_t_1 = __pyx_t_2;
16389
16390 __pyx_L5_bool_binop_done:;
16391
16392 /* "View.MemoryView":1148
16393 *
16394 * if ndim == 1:
16395 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16396 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16397 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16398*/
16399 if (__pyx_t_1) {
16400
16401
16402 /* "View.MemoryView":1150
16403 * if (src_stride > 0 and dst_stride > 0 and
16404 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16405 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent) # <<<<<<<<<<<<<<
16406 * else:
16407 * for i in range(dst_extent):
16408*/
16409 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * ((size_t)__pyx_v_dst_extent))));
16410
16411 /* "View.MemoryView":1148
16412 *
16413 * if ndim == 1:
16414 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16415 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16416 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16417*/
16418 goto __pyx_L4;
16419 }
16420
16421 /* "View.MemoryView":1152
16422 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16423 * else:
16424 * for i in range(dst_extent): # <<<<<<<<<<<<<<
16425 * memcpy(dst_data, src_data, itemsize)
16426 * src_data += src_stride
16427*/
16428 /*else*/ {
16429
16430 __pyx_t_3 = __pyx_v_dst_extent;
16431 __pyx_t_4 = __pyx_t_3;
16432
16433 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16434 __pyx_v_i = __pyx_t_5;
16435
16436 /* "View.MemoryView":1153
16437 * else:
16438 * for i in range(dst_extent):
16439 * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
16440 * src_data += src_stride
16441 * dst_data += dst_stride
16442*/
16443 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16444
16445 /* "View.MemoryView":1154
16446 * for i in range(dst_extent):
16447 * memcpy(dst_data, src_data, itemsize)
16448 * src_data += src_stride # <<<<<<<<<<<<<<
16449 * dst_data += dst_stride
16450 * else:
16451*/
16452 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16453
16454 /* "View.MemoryView":1155
16455 * memcpy(dst_data, src_data, itemsize)
16456 * src_data += src_stride
16457 * dst_data += dst_stride # <<<<<<<<<<<<<<
16458 * else:
16459 * for i in range(dst_extent):
16460*/
16461 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16462 }
16463
16464 }
16465 __pyx_L4:;
16466
16467 /* "View.MemoryView":1147
16468 * cdef Py_ssize_t dst_stride = dst_strides[0]
16469 *
16470 * if ndim == 1: # <<<<<<<<<<<<<<
16471 * if (src_stride > 0 and dst_stride > 0 and
16472 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16473*/
16474 goto __pyx_L3;
16475 }
16476
16477 /* "View.MemoryView":1157
16478 * dst_data += dst_stride
16479 * else:
16480 * for i in range(dst_extent): # <<<<<<<<<<<<<<
16481 * _copy_strided_to_strided(src_data, src_strides + 1,
16482 * dst_data, dst_strides + 1,
16483*/
16484 /*else*/ {
16485
16486 __pyx_t_3 = __pyx_v_dst_extent;
16487 __pyx_t_4 = __pyx_t_3;
16488
16489 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16490 __pyx_v_i = __pyx_t_5;
16491
16492 /* "View.MemoryView":1158
16493 * else:
16494 * for i in range(dst_extent):
16495 * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
16496 * dst_data, dst_strides + 1,
16497 * src_shape + 1, dst_shape + 1,
16498*/
16499 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
16500
16501 /* "View.MemoryView":1162
16502 * src_shape + 1, dst_shape + 1,
16503 * ndim - 1, itemsize)
16504 * src_data += src_stride # <<<<<<<<<<<<<<
16505 * dst_data += dst_stride
16506 *
16507*/
16508 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16509
16510 /* "View.MemoryView":1163
16511 * ndim - 1, itemsize)
16512 * src_data += src_stride
16513 * dst_data += dst_stride # <<<<<<<<<<<<<<
16514 *
16515 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
16516*/
16517 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16518 }
16519
16520 }
16521 __pyx_L3:;
16522
16523 /* "View.MemoryView":1134
16524 * return 'F'
16525 *
16526 * @cython.cdivision(True) # <<<<<<<<<<<<<<
16527 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
16528 * char *dst_data, Py_ssize_t *dst_strides,
16529*/
16530
16531 /* function exit code */
16532
16533
16534
16535
16536
16537
16538
16539}
16540
16541/* "View.MemoryView":1165
16542 * dst_data += dst_stride
16543 *
16544 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16545 * __Pyx_memviewslice *dst,
16546 * int ndim, size_t itemsize) noexcept nogil:
16547*/
16548
16549static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16550
16551 /* "View.MemoryView":1168
16552 * __Pyx_memviewslice *dst,
16553 * int ndim, size_t itemsize) noexcept nogil:
16554 * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
16555 * src.shape, dst.shape, ndim, itemsize)
16556 *
16557*/
16558 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
16559
16560 /* "View.MemoryView":1165
16561 * dst_data += dst_stride
16562 *
16563 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16564 * __Pyx_memviewslice *dst,
16565 * int ndim, size_t itemsize) noexcept nogil:
16566*/
16567
16568 /* function exit code */
16569}
16570
16571/* "View.MemoryView":1171
16572 * src.shape, dst.shape, ndim, itemsize)
16573 *
16574 * @cname('__pyx_memoryview_slice_get_size') # <<<<<<<<<<<<<<
16575 * cdef size_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16576 * "Return the size of the memory occupied by the slice in number of bytes"
16577*/
16578
16579static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
16580 Py_ssize_t __pyx_v_shape;
16581 size_t __pyx_v_size;
16582 size_t __pyx_r;
16583 Py_ssize_t *__pyx_t_1;
16584 Py_ssize_t *__pyx_t_2;
16585 Py_ssize_t *__pyx_t_3;
16586
16587 /* "View.MemoryView":1175
16588 * "Return the size of the memory occupied by the slice in number of bytes"
16589 * cdef Py_ssize_t shape
16590 * cdef size_t size = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
16591 *
16592 * for shape in src.shape[:ndim]:
16593*/
16594 __pyx_v_size = ((size_t)__pyx_v_src->memview->view.itemsize);
16595
16596 /* "View.MemoryView":1177
16597 * cdef size_t size = <size_t> src.memview.view.itemsize
16598 *
16599 * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
16600 * size *= <size_t> shape
16601 *
16602*/
16603 __pyx_t_2 = (__pyx_v_src->shape + __pyx_v_ndim);
16604
16605 for (__pyx_t_3 = __pyx_v_src->shape; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16606 __pyx_t_1 = __pyx_t_3;
16607 __pyx_v_shape = (__pyx_t_1[0]);
16608
16609 /* "View.MemoryView":1178
16610 *
16611 * for shape in src.shape[:ndim]:
16612 * size *= <size_t> shape # <<<<<<<<<<<<<<
16613 *
16614 * return size
16615*/
16616 __pyx_v_size = (__pyx_v_size * ((size_t)__pyx_v_shape));
16617 }
16618
16619
16620 /* "View.MemoryView":1180
16621 * size *= <size_t> shape
16622 *
16623 * return size # <<<<<<<<<<<<<<
16624 *
16625 * @cname('__pyx_fill_contig_strides_array')
16626*/
16627 {
16628
16629 __pyx_r = __pyx_v_size;
16630 }
16631 goto __pyx_L0;
16632
16633 /* "View.MemoryView":1171
16634 * src.shape, dst.shape, ndim, itemsize)
16635 *
16636 * @cname('__pyx_memoryview_slice_get_size') # <<<<<<<<<<<<<<
16637 * cdef size_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16638 * "Return the size of the memory occupied by the slice in number of bytes"
16639*/
16640
16641 /* function exit code */
16642 __pyx_L0:;
16643
16644
16645 return __pyx_r;
16646}
16647
16648/* "View.MemoryView":1182
16649 * return size
16650 *
16651 * @cname('__pyx_fill_contig_strides_array') # <<<<<<<<<<<<<<
16652 * cdef Py_ssize_t fill_contig_strides_array(
16653 * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16654*/
16655
16656static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
16657 int __pyx_v_idx;
16658 Py_ssize_t __pyx_r;
16659 int __pyx_t_1;
16660 int __pyx_t_2;
16661 int __pyx_t_3;
16662 int __pyx_t_4;
16663
16664
16665 /* "View.MemoryView":1192
16666 * cdef int idx
16667 *
16668 * if order == 'F': # <<<<<<<<<<<<<<
16669 * for idx in range(ndim):
16670 * strides[idx] = stride
16671*/
16672 __pyx_t_1 = (__pyx_v_order == 'F');
16673
16674 if (__pyx_t_1) {
16675
16676
16677 /* "View.MemoryView":1193
16678 *
16679 * if order == 'F':
16680 * for idx in range(ndim): # <<<<<<<<<<<<<<
16681 * strides[idx] = stride
16682 * stride *= shape[idx]
16683*/
16684
16685 __pyx_t_2 = __pyx_v_ndim;
16686 __pyx_t_3 = __pyx_t_2;
16687
16688 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16689 __pyx_v_idx = __pyx_t_4;
16690
16691 /* "View.MemoryView":1194
16692 * if order == 'F':
16693 * for idx in range(ndim):
16694 * strides[idx] = stride # <<<<<<<<<<<<<<
16695 * stride *= shape[idx]
16696 * else:
16697*/
16698 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16699
16700 /* "View.MemoryView":1195
16701 * for idx in range(ndim):
16702 * strides[idx] = stride
16703 * stride *= shape[idx] # <<<<<<<<<<<<<<
16704 * else:
16705 * for idx in range(ndim - 1, -1, -1):
16706*/
16707 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16708 }
16709
16710
16711 /* "View.MemoryView":1192
16712 * cdef int idx
16713 *
16714 * if order == 'F': # <<<<<<<<<<<<<<
16715 * for idx in range(ndim):
16716 * strides[idx] = stride
16717*/
16718 goto __pyx_L3;
16719 }
16720
16721 /* "View.MemoryView":1197
16722 * stride *= shape[idx]
16723 * else:
16724 * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16725 * strides[idx] = stride
16726 * stride *= shape[idx]
16727*/
16728 /*else*/ {
16729 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16730 __pyx_v_idx = __pyx_t_2;
16731
16732 /* "View.MemoryView":1198
16733 * else:
16734 * for idx in range(ndim - 1, -1, -1):
16735 * strides[idx] = stride # <<<<<<<<<<<<<<
16736 * stride *= shape[idx]
16737 *
16738*/
16739 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16740
16741 /* "View.MemoryView":1199
16742 * for idx in range(ndim - 1, -1, -1):
16743 * strides[idx] = stride
16744 * stride *= shape[idx] # <<<<<<<<<<<<<<
16745 *
16746 * return stride
16747*/
16748 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16749 }
16750 }
16751 __pyx_L3:;
16752
16753 /* "View.MemoryView":1201
16754 * stride *= shape[idx]
16755 *
16756 * return stride # <<<<<<<<<<<<<<
16757 *
16758 * @cname('__pyx_memoryview_copy_data_to_temp')
16759*/
16760 {
16761
16762 __pyx_r = __pyx_v_stride;
16763 }
16764 goto __pyx_L0;
16765
16766 /* "View.MemoryView":1182
16767 * return size
16768 *
16769 * @cname('__pyx_fill_contig_strides_array') # <<<<<<<<<<<<<<
16770 * cdef Py_ssize_t fill_contig_strides_array(
16771 * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16772*/
16773
16774 /* function exit code */
16775 __pyx_L0:;
16776
16777
16778 return __pyx_r;
16779}
16780
16781/* "View.MemoryView":1203
16782 * return stride
16783 *
16784 * @cname('__pyx_memoryview_copy_data_to_temp') # <<<<<<<<<<<<<<
16785 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
16786 * __Pyx_memviewslice *tmpslice,
16787*/
16788
16789static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
16790 int __pyx_v_i;
16791 void *__pyx_v_result;
16792 size_t __pyx_v_itemsize;
16793 size_t __pyx_v_size;
16794 void *__pyx_r;
16795 int __pyx_t_1;
16796 int __pyx_t_2;
16797 struct __pyx_memoryview_obj *__pyx_t_3;
16798 int __pyx_t_4;
16799 int __pyx_t_5;
16800 int __pyx_lineno = 0;
16801 const char *__pyx_filename = NULL;
16802 int __pyx_clineno = 0;
16803 PyGILState_STATE __pyx_gilstate_save;
16804
16805 /* "View.MemoryView":1215
16806 * cdef void *result
16807 *
16808 * cdef size_t itemsize = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
16809 * cdef size_t size = slice_get_size(src, ndim)
16810 *
16811*/
16812 __pyx_v_itemsize = ((size_t)__pyx_v_src->memview->view.itemsize);
16813
16814 /* "View.MemoryView":1216
16815 *
16816 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
16817 * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
16818 *
16819 * result = malloc(size)
16820*/
16821 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16822
16823 /* "View.MemoryView":1218
16824 * cdef size_t size = slice_get_size(src, ndim)
16825 *
16826 * result = malloc(size) # <<<<<<<<<<<<<<
16827 * if cython.unlikely(not result):
16828 * _err_no_memory()
16829*/
16830 __pyx_v_result = malloc(__pyx_v_size);
16831
16832 /* "View.MemoryView":1219
16833 *
16834 * result = malloc(size)
16835 * if cython.unlikely(not result): # <<<<<<<<<<<<<<
16836 * _err_no_memory()
16837 *
16838*/
16839 __pyx_t_1 = (!(__pyx_v_result != 0));
16840
16841 if (unlikely(__pyx_t_1)) {
16842
16843
16844 /* "View.MemoryView":1220
16845 * result = malloc(size)
16846 * if cython.unlikely(not result):
16847 * _err_no_memory() # <<<<<<<<<<<<<<
16848 *
16849 *
16850*/
16851 __pyx_t_2 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
16852
16853
16854 /* "View.MemoryView":1219
16855 *
16856 * result = malloc(size)
16857 * if cython.unlikely(not result): # <<<<<<<<<<<<<<
16858 * _err_no_memory()
16859 *
16860*/
16861 }
16862
16863 /* "View.MemoryView":1223
16864 *
16865 *
16866 * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
16867 * tmpslice.memview = src.memview
16868 * for i in range(ndim):
16869*/
16870 __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
16871
16872 /* "View.MemoryView":1224
16873 *
16874 * tmpslice.data = <char *> result
16875 * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
16876 * for i in range(ndim):
16877 * tmpslice.shape[i] = src.shape[i]
16878*/
16879 __pyx_t_3 = __pyx_v_src->memview;
16880
16881 __pyx_v_tmpslice->memview = __pyx_t_3;
16882
16883 /* "View.MemoryView":1225
16884 * tmpslice.data = <char *> result
16885 * tmpslice.memview = src.memview
16886 * for i in range(ndim): # <<<<<<<<<<<<<<
16887 * tmpslice.shape[i] = src.shape[i]
16888 * tmpslice.suboffsets[i] = -1
16889*/
16890
16891 __pyx_t_2 = __pyx_v_ndim;
16892 __pyx_t_4 = __pyx_t_2;
16893
16894 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16895 __pyx_v_i = __pyx_t_5;
16896
16897 /* "View.MemoryView":1226
16898 * tmpslice.memview = src.memview
16899 * for i in range(ndim):
16900 * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
16901 * tmpslice.suboffsets[i] = -1
16902 *
16903*/
16904 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16905
16906 /* "View.MemoryView":1227
16907 * for i in range(ndim):
16908 * tmpslice.shape[i] = src.shape[i]
16909 * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
16910 *
16911 * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], <Py_ssize_t> itemsize, ndim, order)
16912*/
16913 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16914 }
16915
16916
16917 /* "View.MemoryView":1229
16918 * tmpslice.suboffsets[i] = -1
16919 *
16920 * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], <Py_ssize_t> itemsize, ndim, order) # <<<<<<<<<<<<<<
16921 *
16922 *
16923*/
16924 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), ((Py_ssize_t)__pyx_v_itemsize), __pyx_v_ndim, __pyx_v_order));
16925
16926 /* "View.MemoryView":1232
16927 *
16928 *
16929 * for i in range(ndim): # <<<<<<<<<<<<<<
16930 * if tmpslice.shape[i] == 1:
16931 * tmpslice.strides[i] = 0
16932*/
16933
16934 __pyx_t_2 = __pyx_v_ndim;
16935 __pyx_t_4 = __pyx_t_2;
16936
16937 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16938 __pyx_v_i = __pyx_t_5;
16939
16940 /* "View.MemoryView":1233
16941 *
16942 * for i in range(ndim):
16943 * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16944 * tmpslice.strides[i] = 0
16945 *
16946*/
16947 __pyx_t_1 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
16948
16949 if (__pyx_t_1) {
16950
16951
16952 /* "View.MemoryView":1234
16953 * for i in range(ndim):
16954 * if tmpslice.shape[i] == 1:
16955 * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
16956 *
16957 * if slice_is_contig(src[0], order, ndim):
16958*/
16959 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16960
16961 /* "View.MemoryView":1233
16962 *
16963 * for i in range(ndim):
16964 * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16965 * tmpslice.strides[i] = 0
16966 *
16967*/
16968 }
16969 }
16970
16971
16972 /* "View.MemoryView":1236
16973 * tmpslice.strides[i] = 0
16974 *
16975 * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16976 * memcpy(result, src.data, size)
16977 * else:
16978*/
16979 __pyx_t_1 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
16980
16981 if (__pyx_t_1) {
16982
16983
16984 /* "View.MemoryView":1237
16985 *
16986 * if slice_is_contig(src[0], order, ndim):
16987 * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
16988 * else:
16989 * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16990*/
16991 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16992
16993 /* "View.MemoryView":1236
16994 * tmpslice.strides[i] = 0
16995 *
16996 * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16997 * memcpy(result, src.data, size)
16998 * else:
16999*/
17000 goto __pyx_L9;
17001 }
17002
17003 /* "View.MemoryView":1239
17004 * memcpy(result, src.data, size)
17005 * else:
17006 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
17007 *
17008 * return result
17009*/
17010 /*else*/ {
17011 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
17012 }
17013 __pyx_L9:;
17014
17015 /* "View.MemoryView":1241
17016 * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
17017 *
17018 * return result # <<<<<<<<<<<<<<
17019 *
17020 *
17021*/
17022 {
17023
17024 __pyx_r = __pyx_v_result;
17025 }
17026 goto __pyx_L0;
17027
17028 /* "View.MemoryView":1203
17029 * return stride
17030 *
17031 * @cname('__pyx_memoryview_copy_data_to_temp') # <<<<<<<<<<<<<<
17032 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
17033 * __Pyx_memviewslice *tmpslice,
17034*/
17035
17036 /* function exit code */
17037 __pyx_L1_error:;
17038 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17039 __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
17040 __pyx_r = NULL;
17041 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17042 __pyx_L0:;
17043
17044
17045
17046
17047 return __pyx_r;
17048}
17049
17050/* "View.MemoryView":1246
17051 *
17052 *
17053 * @cname('__pyx_memoryview_err_extents') # <<<<<<<<<<<<<<
17054 * cdef int _err_extents(int i, Py_ssize_t extent1,
17055 * Py_ssize_t extent2) except -1 with gil:
17056*/
17057
17058static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
17059 int __pyx_r;
17060 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17061
17062
17063
17064
17065 /* "View.MemoryView":1249
17066 * cdef int _err_extents(int i, Py_ssize_t extent1,
17067 * Py_ssize_t extent2) except -1 with gil:
17068 * PyErr_Format( # <<<<<<<<<<<<<<
17069 * PyExc_ValueError,
17070 * "got differing extents in dimension %d (got %zd and %zd)",
17071*/
17072 (void)(PyErr_Format(PyExc_ValueError, __pyx_k_got_differing_extents_in_dimensi, __pyx_v_i, __pyx_v_extent1, __pyx_v_extent2));
17073
17074 /* "View.MemoryView":1253
17075 * "got differing extents in dimension %d (got %zd and %zd)",
17076 * i, extent1, extent2)
17077 * return -1 # <<<<<<<<<<<<<<
17078 *
17079 * @cname('__pyx_memoryview_err_dim')
17080*/
17081 {
17082
17083 __pyx_r = -1;
17084 }
17085 goto __pyx_L0;
17086
17087 /* "View.MemoryView":1246
17088 *
17089 *
17090 * @cname('__pyx_memoryview_err_extents') # <<<<<<<<<<<<<<
17091 * cdef int _err_extents(int i, Py_ssize_t extent1,
17092 * Py_ssize_t extent2) except -1 with gil:
17093*/
17094
17095 /* function exit code */
17096 __pyx_L0:;
17097
17098
17099
17100
17101 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17102 return __pyx_r;
17103}
17104
17105/* "View.MemoryView":1255
17106 * return -1
17107 *
17108 * @cname('__pyx_memoryview_err_dim') # <<<<<<<<<<<<<<
17109 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
17110 * PyErr_Format(error, msg, dim)
17111*/
17112
17113static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char const *__pyx_v_msg, int __pyx_v_dim) {
17114 int __pyx_r;
17115 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17116
17117
17118
17119
17120 /* "View.MemoryView":1257
17121 * @cname('__pyx_memoryview_err_dim')
17122 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
17123 * PyErr_Format(error, msg, dim) # <<<<<<<<<<<<<<
17124 * return -1
17125 *
17126*/
17127 (void)(PyErr_Format(__pyx_v_error, __pyx_v_msg, __pyx_v_dim));
17128
17129 /* "View.MemoryView":1258
17130 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
17131 * PyErr_Format(error, msg, dim)
17132 * return -1 # <<<<<<<<<<<<<<
17133 *
17134 * @cname('__pyx_memoryview_err')
17135*/
17136 {
17137
17138 __pyx_r = -1;
17139 }
17140 goto __pyx_L0;
17141
17142 /* "View.MemoryView":1255
17143 * return -1
17144 *
17145 * @cname('__pyx_memoryview_err_dim') # <<<<<<<<<<<<<<
17146 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
17147 * PyErr_Format(error, msg, dim)
17148*/
17149
17150 /* function exit code */
17151 __pyx_L0:;
17152
17153
17154
17155
17156 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17157 return __pyx_r;
17158}
17159
17160/* "View.MemoryView":1260
17161 * return -1
17162 *
17163 * @cname('__pyx_memoryview_err') # <<<<<<<<<<<<<<
17164 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
17165 * PyErr_SetString(error, msg)
17166*/
17167
17168static int __pyx_memoryview_err(PyObject *__pyx_v_error, char const *__pyx_v_msg) {
17169 int __pyx_r;
17170 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17171
17172
17173
17174 /* "View.MemoryView":1262
17175 * @cname('__pyx_memoryview_err')
17176 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
17177 * PyErr_SetString(error, msg) # <<<<<<<<<<<<<<
17178 * return -1
17179 *
17180*/
17181 (void)(PyErr_SetString(__pyx_v_error, __pyx_v_msg));
17182
17183 /* "View.MemoryView":1263
17184 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
17185 * PyErr_SetString(error, msg)
17186 * return -1 # <<<<<<<<<<<<<<
17187 *
17188 * @cname('__pyx_memoryview_err_no_memory')
17189*/
17190 {
17191
17192 __pyx_r = -1;
17193 }
17194 goto __pyx_L0;
17195
17196 /* "View.MemoryView":1260
17197 * return -1
17198 *
17199 * @cname('__pyx_memoryview_err') # <<<<<<<<<<<<<<
17200 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
17201 * PyErr_SetString(error, msg)
17202*/
17203
17204 /* function exit code */
17205 __pyx_L0:;
17206
17207
17208
17209 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17210 return __pyx_r;
17211}
17212
17213/* "View.MemoryView":1265
17214 * return -1
17215 *
17216 * @cname('__pyx_memoryview_err_no_memory') # <<<<<<<<<<<<<<
17217 * cdef int _err_no_memory() except -1 with gil:
17218 * raise MemoryError
17219*/
17220
17221static int __pyx_memoryview_err_no_memory(void) {
17222 int __pyx_r;
17223 int __pyx_lineno = 0;
17224 const char *__pyx_filename = NULL;
17225 int __pyx_clineno = 0;
17226 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17227
17228 /* "View.MemoryView":1267
17229 * @cname('__pyx_memoryview_err_no_memory')
17230 * cdef int _err_no_memory() except -1 with gil:
17231 * raise MemoryError # <<<<<<<<<<<<<<
17232 *
17233 *
17234*/
17235 PyErr_NoMemory(); __PYX_ERR(1, 1267, __pyx_L1_error)
17236
17237 /* "View.MemoryView":1265
17238 * return -1
17239 *
17240 * @cname('__pyx_memoryview_err_no_memory') # <<<<<<<<<<<<<<
17241 * cdef int _err_no_memory() except -1 with gil:
17242 * raise MemoryError
17243*/
17244
17245 /* function exit code */
17246 __pyx_L1_error:;
17247 __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
17248 __pyx_r = -1;
17249
17250 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17251 return __pyx_r;
17252}
17253
17254/* "View.MemoryView":1271
17255 *
17256 *
17257 * @cname('__pyx_memoryview_err_ValueError') # <<<<<<<<<<<<<<
17258 * cdef int _err_ValueError(const char* msg) except -1:
17259 * PyErr_SetString(PyExc_ValueError, msg)
17260*/
17261
17262static int __pyx_memoryview_err_ValueError(char const *__pyx_v_msg) {
17263 int __pyx_r;
17264
17265 /* "View.MemoryView":1273
17266 * @cname('__pyx_memoryview_err_ValueError')
17267 * cdef int _err_ValueError(const char* msg) except -1:
17268 * PyErr_SetString(PyExc_ValueError, msg) # <<<<<<<<<<<<<<
17269 * return -1
17270 *
17271*/
17272 (void)(PyErr_SetString(PyExc_ValueError, __pyx_v_msg));
17273
17274 /* "View.MemoryView":1274
17275 * cdef int _err_ValueError(const char* msg) except -1:
17276 * PyErr_SetString(PyExc_ValueError, msg)
17277 * return -1 # <<<<<<<<<<<<<<
17278 *
17279 * @cname('__pyx_memoryview_err_IndexError')
17280*/
17281 {
17282
17283 __pyx_r = -1;
17284 }
17285 goto __pyx_L0;
17286
17287 /* "View.MemoryView":1271
17288 *
17289 *
17290 * @cname('__pyx_memoryview_err_ValueError') # <<<<<<<<<<<<<<
17291 * cdef int _err_ValueError(const char* msg) except -1:
17292 * PyErr_SetString(PyExc_ValueError, msg)
17293*/
17294
17295 /* function exit code */
17296 __pyx_L0:;
17297
17298 return __pyx_r;
17299}
17300
17301/* "View.MemoryView":1276
17302 * return -1
17303 *
17304 * @cname('__pyx_memoryview_err_IndexError') # <<<<<<<<<<<<<<
17305 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17306 * PyErr_Format(PyExc_IndexError, msg, index)
17307*/
17308
17309static int __pyx_memoryview_err_IndexError(char const *__pyx_v_msg, Py_ssize_t __pyx_v_index) {
17310 int __pyx_r;
17311
17312 /* "View.MemoryView":1278
17313 * @cname('__pyx_memoryview_err_IndexError')
17314 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17315 * PyErr_Format(PyExc_IndexError, msg, index) # <<<<<<<<<<<<<<
17316 * return -1
17317 *
17318*/
17319 (void)(PyErr_Format(PyExc_IndexError, __pyx_v_msg, __pyx_v_index));
17320
17321 /* "View.MemoryView":1279
17322 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17323 * PyErr_Format(PyExc_IndexError, msg, index)
17324 * return -1 # <<<<<<<<<<<<<<
17325 *
17326 *
17327*/
17328 {
17329
17330 __pyx_r = -1;
17331 }
17332 goto __pyx_L0;
17333
17334 /* "View.MemoryView":1276
17335 * return -1
17336 *
17337 * @cname('__pyx_memoryview_err_IndexError') # <<<<<<<<<<<<<<
17338 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17339 * PyErr_Format(PyExc_IndexError, msg, index)
17340*/
17341
17342 /* function exit code */
17343 __pyx_L0:;
17344
17345 return __pyx_r;
17346}
17347
17348/* "View.MemoryView":1282
17349 *
17350 *
17351 * @cname('__pyx_memoryview_copy_contents') # <<<<<<<<<<<<<<
17352 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
17353 * __Pyx_memviewslice dst,
17354*/
17355
17356static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
17357 void *__pyx_v_tmpdata;
17358 size_t __pyx_v_itemsize;
17359 int __pyx_v_i;
17360 char __pyx_v_order;
17361 int __pyx_v_broadcasting;
17362 int __pyx_v_direct_copy;
17363 __Pyx_memviewslice __pyx_v_tmp;
17364 int __pyx_v_ndim;
17365 int __pyx_r;
17366 int __pyx_t_1;
17367 int __pyx_t_2;
17368 int __pyx_t_3;
17369 int __pyx_t_4;
17370 int __pyx_t_5;
17371 void *__pyx_t_6;
17372 int __pyx_lineno = 0;
17373 const char *__pyx_filename = NULL;
17374 int __pyx_clineno = 0;
17375 PyGILState_STATE __pyx_gilstate_save;
17376
17377
17378 /* "View.MemoryView":1291
17379 * Check for overlapping memory and verify the shapes.
17380 * """
17381 * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
17382 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
17383 * cdef int i
17384*/
17385 __pyx_v_tmpdata = NULL;
17386
17387 /* "View.MemoryView":1292
17388 * """
17389 * cdef void *tmpdata = NULL
17390 * cdef size_t itemsize = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
17391 * cdef int i
17392 * cdef char order = get_best_order(&src, src_ndim)
17393*/
17394 __pyx_v_itemsize = ((size_t)__pyx_v_src.memview->view.itemsize);
17395
17396 /* "View.MemoryView":1294
17397 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
17398 * cdef int i
17399 * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
17400 * cdef bint broadcasting = False
17401 * cdef bint direct_copy = False
17402*/
17403 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17404
17405 /* "View.MemoryView":1295
17406 * cdef int i
17407 * cdef char order = get_best_order(&src, src_ndim)
17408 * cdef bint broadcasting = False # <<<<<<<<<<<<<<
17409 * cdef bint direct_copy = False
17410 * cdef __Pyx_memviewslice tmp
17411*/
17412 __pyx_v_broadcasting = 0;
17413
17414 /* "View.MemoryView":1296
17415 * cdef char order = get_best_order(&src, src_ndim)
17416 * cdef bint broadcasting = False
17417 * cdef bint direct_copy = False # <<<<<<<<<<<<<<
17418 * cdef __Pyx_memviewslice tmp
17419 *
17420*/
17421 __pyx_v_direct_copy = 0;
17422
17423 /* "View.MemoryView":1299
17424 * cdef __Pyx_memviewslice tmp
17425 *
17426 * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17427 * broadcast_leading(&src, src_ndim, dst_ndim)
17428 * elif dst_ndim < src_ndim:
17429*/
17430 __pyx_t_1 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17431
17432 if (__pyx_t_1) {
17433
17434
17435 /* "View.MemoryView":1300
17436 *
17437 * if src_ndim < dst_ndim:
17438 * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17439 * elif dst_ndim < src_ndim:
17440 * broadcast_leading(&dst, dst_ndim, src_ndim)
17441*/
17442 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17443
17444 /* "View.MemoryView":1299
17445 * cdef __Pyx_memviewslice tmp
17446 *
17447 * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17448 * broadcast_leading(&src, src_ndim, dst_ndim)
17449 * elif dst_ndim < src_ndim:
17450*/
17451 goto __pyx_L3;
17452 }
17453
17454 /* "View.MemoryView":1301
17455 * if src_ndim < dst_ndim:
17456 * broadcast_leading(&src, src_ndim, dst_ndim)
17457 * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17458 * broadcast_leading(&dst, dst_ndim, src_ndim)
17459 *
17460*/
17461 __pyx_t_1 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17462
17463 if (__pyx_t_1) {
17464
17465
17466 /* "View.MemoryView":1302
17467 * broadcast_leading(&src, src_ndim, dst_ndim)
17468 * elif dst_ndim < src_ndim:
17469 * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
17470 *
17471 * cdef int ndim = max(src_ndim, dst_ndim)
17472*/
17473 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17474
17475 /* "View.MemoryView":1301
17476 * if src_ndim < dst_ndim:
17477 * broadcast_leading(&src, src_ndim, dst_ndim)
17478 * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17479 * broadcast_leading(&dst, dst_ndim, src_ndim)
17480 *
17481*/
17482 }
17483 __pyx_L3:;
17484
17485 /* "View.MemoryView":1304
17486 * broadcast_leading(&dst, dst_ndim, src_ndim)
17487 *
17488 * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17489 *
17490 * for i in range(ndim):
17491*/
17492
17493 __pyx_t_2 = __pyx_v_dst_ndim;
17494
17495 __pyx_t_3 = __pyx_v_src_ndim;
17496 __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
17497
17498 if (__pyx_t_1) {
17499
17500 __pyx_t_4 = __pyx_t_2;
17501 } else {
17502
17503 __pyx_t_4 = __pyx_t_3;
17504 }
17505
17506 __pyx_v_ndim = __pyx_t_4;
17507
17508
17509 /* "View.MemoryView":1306
17510 * cdef int ndim = max(src_ndim, dst_ndim)
17511 *
17512 * for i in range(ndim): # <<<<<<<<<<<<<<
17513 * if src.shape[i] != dst.shape[i]:
17514 * if cython.likely(src.shape[i] == 1):
17515*/
17516
17517 __pyx_t_4 = __pyx_v_ndim;
17518 __pyx_t_2 = __pyx_t_4;
17519
17520 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17521 __pyx_v_i = __pyx_t_3;
17522
17523 /* "View.MemoryView":1307
17524 *
17525 * for i in range(ndim):
17526 * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17527 * if cython.likely(src.shape[i] == 1):
17528 * broadcasting = True
17529*/
17530 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17531
17532 if (__pyx_t_1) {
17533
17534
17535 /* "View.MemoryView":1308
17536 * for i in range(ndim):
17537 * if src.shape[i] != dst.shape[i]:
17538 * if cython.likely(src.shape[i] == 1): # <<<<<<<<<<<<<<
17539 * broadcasting = True
17540 * src.strides[i] = 0
17541*/
17542 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17543
17544 if (likely(__pyx_t_1)) {
17545
17546
17547 /* "View.MemoryView":1309
17548 * if src.shape[i] != dst.shape[i]:
17549 * if cython.likely(src.shape[i] == 1):
17550 * broadcasting = True # <<<<<<<<<<<<<<
17551 * src.strides[i] = 0
17552 * else:
17553*/
17554 __pyx_v_broadcasting = 1;
17555
17556 /* "View.MemoryView":1310
17557 * if cython.likely(src.shape[i] == 1):
17558 * broadcasting = True
17559 * src.strides[i] = 0 # <<<<<<<<<<<<<<
17560 * else:
17561 * _err_extents(i, dst.shape[i], src.shape[i])
17562*/
17563 (__pyx_v_src.strides[__pyx_v_i]) = 0;
17564
17565 /* "View.MemoryView":1308
17566 * for i in range(ndim):
17567 * if src.shape[i] != dst.shape[i]:
17568 * if cython.likely(src.shape[i] == 1): # <<<<<<<<<<<<<<
17569 * broadcasting = True
17570 * src.strides[i] = 0
17571*/
17572 goto __pyx_L7;
17573 }
17574
17575 /* "View.MemoryView":1312
17576 * src.strides[i] = 0
17577 * else:
17578 * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
17579 *
17580 * if cython.unlikely(src.suboffsets[i] >= 0):
17581*/
17582 /*else*/ {
17583 __pyx_t_5 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1312, __pyx_L1_error)
17584
17585 }
17586 __pyx_L7:;
17587
17588 /* "View.MemoryView":1307
17589 *
17590 * for i in range(ndim):
17591 * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17592 * if cython.likely(src.shape[i] == 1):
17593 * broadcasting = True
17594*/
17595 }
17596
17597 /* "View.MemoryView":1314
17598 * _err_extents(i, dst.shape[i], src.shape[i])
17599 *
17600 * if cython.unlikely(src.suboffsets[i] >= 0): # <<<<<<<<<<<<<<
17601 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17602 *
17603*/
17604 __pyx_t_1 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17605
17606 if (unlikely(__pyx_t_1)) {
17607
17608
17609 /* "View.MemoryView":1315
17610 *
17611 * if cython.unlikely(src.suboffsets[i] >= 0):
17612 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
17613 *
17614 * if slices_overlap(&src, &dst, ndim, itemsize):
17615*/
17616 __pyx_t_5 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1315, __pyx_L1_error)
17617
17618
17619 /* "View.MemoryView":1314
17620 * _err_extents(i, dst.shape[i], src.shape[i])
17621 *
17622 * if cython.unlikely(src.suboffsets[i] >= 0): # <<<<<<<<<<<<<<
17623 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17624 *
17625*/
17626 }
17627 }
17628
17629
17630 /* "View.MemoryView":1317
17631 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17632 *
17633 * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17634 *
17635 * if not slice_is_contig(src, order, ndim):
17636*/
17637 __pyx_t_1 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17638
17639 if (__pyx_t_1) {
17640
17641
17642 /* "View.MemoryView":1319
17643 * if slices_overlap(&src, &dst, ndim, itemsize):
17644 *
17645 * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17646 * order = get_best_order(&dst, ndim)
17647 *
17648*/
17649 __pyx_t_1 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17650
17651 if (__pyx_t_1) {
17652
17653
17654 /* "View.MemoryView":1320
17655 *
17656 * if not slice_is_contig(src, order, ndim):
17657 * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
17658 *
17659 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17660*/
17661 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17662
17663 /* "View.MemoryView":1319
17664 * if slices_overlap(&src, &dst, ndim, itemsize):
17665 *
17666 * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17667 * order = get_best_order(&dst, ndim)
17668 *
17669*/
17670 }
17671
17672 /* "View.MemoryView":1322
17673 * order = get_best_order(&dst, ndim)
17674 *
17675 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
17676 * src = tmp
17677 *
17678*/
17679 __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == ((void *)NULL))) __PYX_ERR(1, 1322, __pyx_L1_error)
17680 __pyx_v_tmpdata = __pyx_t_6;
17681
17682 /* "View.MemoryView":1323
17683 *
17684 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17685 * src = tmp # <<<<<<<<<<<<<<
17686 *
17687 * if not broadcasting:
17688*/
17689 __pyx_v_src = __pyx_v_tmp;
17690
17691 /* "View.MemoryView":1317
17692 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17693 *
17694 * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17695 *
17696 * if not slice_is_contig(src, order, ndim):
17697*/
17698 }
17699
17700 /* "View.MemoryView":1325
17701 * src = tmp
17702 *
17703 * if not broadcasting: # <<<<<<<<<<<<<<
17704 *
17705 *
17706*/
17707 __pyx_t_1 = (!__pyx_v_broadcasting);
17708
17709 if (__pyx_t_1) {
17710
17711
17712 /* "View.MemoryView":1328
17713 *
17714 *
17715 * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17716 * direct_copy = slice_is_contig(dst, 'C', ndim)
17717 * elif slice_is_contig(src, 'F', ndim):
17718*/
17719 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
17720
17721 if (__pyx_t_1) {
17722
17723
17724 /* "View.MemoryView":1329
17725 *
17726 * if slice_is_contig(src, 'C', ndim):
17727 * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
17728 * elif slice_is_contig(src, 'F', ndim):
17729 * direct_copy = slice_is_contig(dst, 'F', ndim)
17730*/
17731 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
17732
17733 /* "View.MemoryView":1328
17734 *
17735 *
17736 * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17737 * direct_copy = slice_is_contig(dst, 'C', ndim)
17738 * elif slice_is_contig(src, 'F', ndim):
17739*/
17740 goto __pyx_L12;
17741 }
17742
17743 /* "View.MemoryView":1330
17744 * if slice_is_contig(src, 'C', ndim):
17745 * direct_copy = slice_is_contig(dst, 'C', ndim)
17746 * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17747 * direct_copy = slice_is_contig(dst, 'F', ndim)
17748 *
17749*/
17750 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
17751
17752 if (__pyx_t_1) {
17753
17754
17755 /* "View.MemoryView":1331
17756 * direct_copy = slice_is_contig(dst, 'C', ndim)
17757 * elif slice_is_contig(src, 'F', ndim):
17758 * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
17759 *
17760 * if direct_copy:
17761*/
17762 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
17763
17764 /* "View.MemoryView":1330
17765 * if slice_is_contig(src, 'C', ndim):
17766 * direct_copy = slice_is_contig(dst, 'C', ndim)
17767 * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17768 * direct_copy = slice_is_contig(dst, 'F', ndim)
17769 *
17770*/
17771 }
17772 __pyx_L12:;
17773
17774 /* "View.MemoryView":1333
17775 * direct_copy = slice_is_contig(dst, 'F', ndim)
17776 *
17777 * if direct_copy: # <<<<<<<<<<<<<<
17778 *
17779 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17780*/
17781 if (__pyx_v_direct_copy) {
17782
17783 /* "View.MemoryView":1335
17784 * if direct_copy:
17785 *
17786 * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17787 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17788 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17789*/
17790 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17791
17792 /* "View.MemoryView":1336
17793 *
17794 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17795 * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
17796 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17797 * free(tmpdata)
17798*/
17799 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17800
17801 /* "View.MemoryView":1337
17802 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17803 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17804 * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17805 * free(tmpdata)
17806 * return 0
17807*/
17808 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17809
17810 /* "View.MemoryView":1338
17811 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17812 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17813 * free(tmpdata) # <<<<<<<<<<<<<<
17814 * return 0
17815 *
17816*/
17817 free(__pyx_v_tmpdata);
17818
17819 /* "View.MemoryView":1339
17820 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17821 * free(tmpdata)
17822 * return 0 # <<<<<<<<<<<<<<
17823 *
17824 * if order == 'F' == get_best_order(&dst, ndim):
17825*/
17826 {
17827
17828 __pyx_r = 0;
17829 }
17830 goto __pyx_L0;
17831
17832 /* "View.MemoryView":1333
17833 * direct_copy = slice_is_contig(dst, 'F', ndim)
17834 *
17835 * if direct_copy: # <<<<<<<<<<<<<<
17836 *
17837 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17838*/
17839 }
17840
17841 /* "View.MemoryView":1325
17842 * src = tmp
17843 *
17844 * if not broadcasting: # <<<<<<<<<<<<<<
17845 *
17846 *
17847*/
17848 }
17849
17850 /* "View.MemoryView":1341
17851 * return 0
17852 *
17853 * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17854 *
17855 *
17856*/
17857 __pyx_t_1 = (__pyx_v_order == 'F');
17858 if (__pyx_t_1) {
17859 __pyx_t_1 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17860 }
17861 if (__pyx_t_1) {
17862
17863
17864 /* "View.MemoryView":1344
17865 *
17866 *
17867 * transpose_memslice(&src) # <<<<<<<<<<<<<<
17868 * transpose_memslice(&dst)
17869 *
17870*/
17871 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1344, __pyx_L1_error)
17872
17873
17874 /* "View.MemoryView":1345
17875 *
17876 * transpose_memslice(&src)
17877 * transpose_memslice(&dst) # <<<<<<<<<<<<<<
17878 *
17879 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17880*/
17881 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1345, __pyx_L1_error)
17882
17883
17884 /* "View.MemoryView":1341
17885 * return 0
17886 *
17887 * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17888 *
17889 *
17890*/
17891 }
17892
17893 /* "View.MemoryView":1347
17894 * transpose_memslice(&dst)
17895 *
17896 * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17897 * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17898 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17899*/
17900 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17901
17902 /* "View.MemoryView":1348
17903 *
17904 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17905 * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
17906 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17907 *
17908*/
17909 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17910
17911 /* "View.MemoryView":1349
17912 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17913 * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17914 * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17915 *
17916 * free(tmpdata)
17917*/
17918 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17919
17920 /* "View.MemoryView":1351
17921 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17922 *
17923 * free(tmpdata) # <<<<<<<<<<<<<<
17924 * return 0
17925 *
17926*/
17927 free(__pyx_v_tmpdata);
17928
17929 /* "View.MemoryView":1352
17930 *
17931 * free(tmpdata)
17932 * return 0 # <<<<<<<<<<<<<<
17933 *
17934 * @cname('__pyx_memoryview_broadcast_leading')
17935*/
17936 {
17937
17938 __pyx_r = 0;
17939 }
17940 goto __pyx_L0;
17941
17942 /* "View.MemoryView":1282
17943 *
17944 *
17945 * @cname('__pyx_memoryview_copy_contents') # <<<<<<<<<<<<<<
17946 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
17947 * __Pyx_memviewslice dst,
17948*/
17949
17950 /* function exit code */
17951 __pyx_L1_error:;
17952 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17953 __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17954 __pyx_r = -1;
17955 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17956 __pyx_L0:;
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966 return __pyx_r;
17967}
17968
17969/* "View.MemoryView":1354
17970 * return 0
17971 *
17972 * @cname('__pyx_memoryview_broadcast_leading') # <<<<<<<<<<<<<<
17973 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
17974 * int ndim,
17975*/
17976
17977static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
17978 int __pyx_v_i;
17979 int __pyx_v_offset;
17980 int __pyx_t_1;
17981 int __pyx_t_2;
17982 int __pyx_t_3;
17983
17984 /* "View.MemoryView":1359
17985 * int ndim_other) noexcept nogil:
17986 * cdef int i
17987 * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
17988 *
17989 * for i in range(ndim - 1, -1, -1):
17990*/
17991 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17992
17993 /* "View.MemoryView":1361
17994 * cdef int offset = ndim_other - ndim
17995 *
17996 * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17997 * mslice.shape[i + offset] = mslice.shape[i]
17998 * mslice.strides[i + offset] = mslice.strides[i]
17999*/
18000 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18001 __pyx_v_i = __pyx_t_1;
18002
18003 /* "View.MemoryView":1362
18004 *
18005 * for i in range(ndim - 1, -1, -1):
18006 * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
18007 * mslice.strides[i + offset] = mslice.strides[i]
18008 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18009*/
18010 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
18011
18012 /* "View.MemoryView":1363
18013 * for i in range(ndim - 1, -1, -1):
18014 * mslice.shape[i + offset] = mslice.shape[i]
18015 * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
18016 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18017 *
18018*/
18019 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
18020
18021 /* "View.MemoryView":1364
18022 * mslice.shape[i + offset] = mslice.shape[i]
18023 * mslice.strides[i + offset] = mslice.strides[i]
18024 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
18025 *
18026 * for i in range(offset):
18027*/
18028 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
18029 }
18030
18031 /* "View.MemoryView":1366
18032 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18033 *
18034 * for i in range(offset): # <<<<<<<<<<<<<<
18035 * mslice.shape[i] = 1
18036 * mslice.strides[i] = mslice.strides[0]
18037*/
18038
18039 __pyx_t_1 = __pyx_v_offset;
18040 __pyx_t_2 = __pyx_t_1;
18041
18042 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18043 __pyx_v_i = __pyx_t_3;
18044
18045 /* "View.MemoryView":1367
18046 *
18047 * for i in range(offset):
18048 * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
18049 * mslice.strides[i] = mslice.strides[0]
18050 * mslice.suboffsets[i] = -1
18051*/
18052 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
18053
18054 /* "View.MemoryView":1368
18055 * for i in range(offset):
18056 * mslice.shape[i] = 1
18057 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
18058 * mslice.suboffsets[i] = -1
18059 *
18060*/
18061 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
18062
18063 /* "View.MemoryView":1369
18064 * mslice.shape[i] = 1
18065 * mslice.strides[i] = mslice.strides[0]
18066 * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18067 *
18068 *
18069*/
18070 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
18071 }
18072
18073
18074 /* "View.MemoryView":1354
18075 * return 0
18076 *
18077 * @cname('__pyx_memoryview_broadcast_leading') # <<<<<<<<<<<<<<
18078 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
18079 * int ndim,
18080*/
18081
18082 /* function exit code */
18083
18084
18085}
18086
18087/* "View.MemoryView":1376
18088 *
18089 *
18090 * @cname('__pyx_memoryview_refcount_copying') # <<<<<<<<<<<<<<
18091 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18092 *
18093*/
18094
18095static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
18096
18097 /* "View.MemoryView":1379
18098 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18099 *
18100 * if dtype_is_object: # <<<<<<<<<<<<<<
18101 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18102 *
18103*/
18104 if (__pyx_v_dtype_is_object) {
18105
18106 /* "View.MemoryView":1380
18107 *
18108 * if dtype_is_object:
18109 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
18110 *
18111 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18112*/
18113 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
18114
18115 /* "View.MemoryView":1379
18116 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18117 *
18118 * if dtype_is_object: # <<<<<<<<<<<<<<
18119 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18120 *
18121*/
18122 }
18123
18124 /* "View.MemoryView":1376
18125 *
18126 *
18127 * @cname('__pyx_memoryview_refcount_copying') # <<<<<<<<<<<<<<
18128 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18129 *
18130*/
18131
18132 /* function exit code */
18133}
18134
18135/* "View.MemoryView":1382
18136 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18137 *
18138 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') # <<<<<<<<<<<<<<
18139 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
18140 * Py_ssize_t *strides, int ndim,
18141*/
18142
18143static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
18144 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18145
18146
18147
18148
18149
18150
18151 /* "View.MemoryView":1386
18152 * Py_ssize_t *strides, int ndim,
18153 * bint inc) noexcept with gil:
18154 * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
18155 *
18156 * @cname('__pyx_memoryview_refcount_objects_in_slice')
18157*/
18158 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
18159
18160 /* "View.MemoryView":1382
18161 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18162 *
18163 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') # <<<<<<<<<<<<<<
18164 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
18165 * Py_ssize_t *strides, int ndim,
18166*/
18167
18168 /* function exit code */
18169
18170
18171
18172
18173
18174
18175 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18176}
18177
18178/* "View.MemoryView":1388
18179 * refcount_objects_in_slice(data, shape, strides, ndim, inc)
18180 *
18181 * @cname('__pyx_memoryview_refcount_objects_in_slice') # <<<<<<<<<<<<<<
18182 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
18183 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18184*/
18185
18186static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
18187 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18188 Py_ssize_t __pyx_v_stride;
18189 Py_ssize_t __pyx_t_1;
18190 Py_ssize_t __pyx_t_2;
18191 Py_ssize_t __pyx_t_3;
18192 int __pyx_t_4;
18193
18194
18195 /* "View.MemoryView":1392
18196 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18197 * cdef Py_ssize_t i
18198 * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18199 *
18200 * for i in range(shape[0]):
18201*/
18202 __pyx_v_stride = (__pyx_v_strides[0]);
18203
18204 /* "View.MemoryView":1394
18205 * cdef Py_ssize_t stride = strides[0]
18206 *
18207 * for i in range(shape[0]): # <<<<<<<<<<<<<<
18208 * if ndim == 1:
18209 * if inc:
18210*/
18211
18212 __pyx_t_1 = (__pyx_v_shape[0]);
18213 __pyx_t_2 = __pyx_t_1;
18214
18215 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18216 __pyx_v_i = __pyx_t_3;
18217
18218 /* "View.MemoryView":1395
18219 *
18220 * for i in range(shape[0]):
18221 * if ndim == 1: # <<<<<<<<<<<<<<
18222 * if inc:
18223 * Py_INCREF((<PyObject **> data)[0])
18224*/
18225 __pyx_t_4 = (__pyx_v_ndim == 1);
18226
18227 if (__pyx_t_4) {
18228
18229
18230 /* "View.MemoryView":1396
18231 * for i in range(shape[0]):
18232 * if ndim == 1:
18233 * if inc: # <<<<<<<<<<<<<<
18234 * Py_INCREF((<PyObject **> data)[0])
18235 * else:
18236*/
18237 if (__pyx_v_inc) {
18238
18239 /* "View.MemoryView":1397
18240 * if ndim == 1:
18241 * if inc:
18242 * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
18243 * else:
18244 * Py_DECREF((<PyObject **> data)[0])
18245*/
18246 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
18247
18248 /* "View.MemoryView":1396
18249 * for i in range(shape[0]):
18250 * if ndim == 1:
18251 * if inc: # <<<<<<<<<<<<<<
18252 * Py_INCREF((<PyObject **> data)[0])
18253 * else:
18254*/
18255 goto __pyx_L6;
18256 }
18257
18258 /* "View.MemoryView":1399
18259 * Py_INCREF((<PyObject **> data)[0])
18260 * else:
18261 * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
18262 * else:
18263 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
18264*/
18265 /*else*/ {
18266 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
18267 }
18268 __pyx_L6:;
18269
18270 /* "View.MemoryView":1395
18271 *
18272 * for i in range(shape[0]):
18273 * if ndim == 1: # <<<<<<<<<<<<<<
18274 * if inc:
18275 * Py_INCREF((<PyObject **> data)[0])
18276*/
18277 goto __pyx_L5;
18278 }
18279
18280 /* "View.MemoryView":1401
18281 * Py_DECREF((<PyObject **> data)[0])
18282 * else:
18283 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
18284 *
18285 * data += stride
18286*/
18287 /*else*/ {
18288 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18289 }
18290 __pyx_L5:;
18291
18292 /* "View.MemoryView":1403
18293 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
18294 *
18295 * data += stride # <<<<<<<<<<<<<<
18296 *
18297 *
18298*/
18299 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18300 }
18301
18302
18303 /* "View.MemoryView":1388
18304 * refcount_objects_in_slice(data, shape, strides, ndim, inc)
18305 *
18306 * @cname('__pyx_memoryview_refcount_objects_in_slice') # <<<<<<<<<<<<<<
18307 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
18308 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18309*/
18310
18311 /* function exit code */
18312
18313
18314
18315
18316}
18317
18318/* "View.MemoryView":1408
18319 *
18320 *
18321 * @cname('__pyx_memoryview_slice_assign_scalar') # <<<<<<<<<<<<<<
18322 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
18323 * size_t itemsize, void *item,
18324*/
18325
18326static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
18327
18328 /* "View.MemoryView":1412
18329 * size_t itemsize, void *item,
18330 * bint dtype_is_object) noexcept nogil:
18331 * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18332 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18333 * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18334*/
18335 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18336
18337 /* "View.MemoryView":1413
18338 * bint dtype_is_object) noexcept nogil:
18339 * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18340 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
18341 * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18342 *
18343*/
18344 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
18345
18346 /* "View.MemoryView":1414
18347 * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18348 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18349 * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18350 *
18351 *
18352*/
18353 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18354
18355 /* "View.MemoryView":1408
18356 *
18357 *
18358 * @cname('__pyx_memoryview_slice_assign_scalar') # <<<<<<<<<<<<<<
18359 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
18360 * size_t itemsize, void *item,
18361*/
18362
18363 /* function exit code */
18364}
18365
18366/* "View.MemoryView":1417
18367 *
18368 *
18369 * @cname('__pyx_memoryview__slice_assign_scalar') # <<<<<<<<<<<<<<
18370 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
18371 * Py_ssize_t *strides, int ndim,
18372*/
18373
18374static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
18375 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18376 Py_ssize_t __pyx_v_stride;
18377 Py_ssize_t __pyx_v_extent;
18378 int __pyx_t_1;
18379 Py_ssize_t __pyx_t_2;
18380 Py_ssize_t __pyx_t_3;
18381 Py_ssize_t __pyx_t_4;
18382
18383
18384 /* "View.MemoryView":1422
18385 * size_t itemsize, void *item) noexcept nogil:
18386 * cdef Py_ssize_t i
18387 * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18388 * cdef Py_ssize_t extent = shape[0]
18389 *
18390*/
18391 __pyx_v_stride = (__pyx_v_strides[0]);
18392
18393 /* "View.MemoryView":1423
18394 * cdef Py_ssize_t i
18395 * cdef Py_ssize_t stride = strides[0]
18396 * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
18397 *
18398 * if ndim == 1:
18399*/
18400 __pyx_v_extent = (__pyx_v_shape[0]);
18401
18402 /* "View.MemoryView":1425
18403 * cdef Py_ssize_t extent = shape[0]
18404 *
18405 * if ndim == 1: # <<<<<<<<<<<<<<
18406 * for i in range(extent):
18407 * memcpy(data, item, itemsize)
18408*/
18409 __pyx_t_1 = (__pyx_v_ndim == 1);
18410
18411 if (__pyx_t_1) {
18412
18413
18414 /* "View.MemoryView":1426
18415 *
18416 * if ndim == 1:
18417 * for i in range(extent): # <<<<<<<<<<<<<<
18418 * memcpy(data, item, itemsize)
18419 * data += stride
18420*/
18421
18422 __pyx_t_2 = __pyx_v_extent;
18423 __pyx_t_3 = __pyx_t_2;
18424
18425 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18426 __pyx_v_i = __pyx_t_4;
18427
18428 /* "View.MemoryView":1427
18429 * if ndim == 1:
18430 * for i in range(extent):
18431 * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
18432 * data += stride
18433 * else:
18434*/
18435 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18436
18437 /* "View.MemoryView":1428
18438 * for i in range(extent):
18439 * memcpy(data, item, itemsize)
18440 * data += stride # <<<<<<<<<<<<<<
18441 * else:
18442 * for i in range(extent):
18443*/
18444 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18445 }
18446
18447
18448 /* "View.MemoryView":1425
18449 * cdef Py_ssize_t extent = shape[0]
18450 *
18451 * if ndim == 1: # <<<<<<<<<<<<<<
18452 * for i in range(extent):
18453 * memcpy(data, item, itemsize)
18454*/
18455 goto __pyx_L3;
18456 }
18457
18458 /* "View.MemoryView":1430
18459 * data += stride
18460 * else:
18461 * for i in range(extent): # <<<<<<<<<<<<<<
18462 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18463 * data += stride
18464*/
18465 /*else*/ {
18466
18467 __pyx_t_2 = __pyx_v_extent;
18468 __pyx_t_3 = __pyx_t_2;
18469
18470 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18471 __pyx_v_i = __pyx_t_4;
18472
18473 /* "View.MemoryView":1431
18474 * else:
18475 * for i in range(extent):
18476 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
18477 * data += stride
18478 *
18479*/
18480 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
18481
18482 /* "View.MemoryView":1432
18483 * for i in range(extent):
18484 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18485 * data += stride # <<<<<<<<<<<<<<
18486 *
18487*/
18488 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18489 }
18490
18491 }
18492 __pyx_L3:;
18493
18494 /* "View.MemoryView":1417
18495 *
18496 *
18497 * @cname('__pyx_memoryview__slice_assign_scalar') # <<<<<<<<<<<<<<
18498 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
18499 * Py_ssize_t *strides, int ndim,
18500*/
18501
18502 /* function exit code */
18503
18504
18505
18506
18507}
18508
18509/* "(tree fragment)":4
18510 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
18511 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
18512 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
18513 * cdef object __pyx_result
18514 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18515*/
18516
18517/* Python wrapper */
18518static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18519#if CYTHON_VECTORCALL
18520PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18521#else
18522PyObject *__pyx_args, PyObject *__pyx_kwds
18523#endif
18524); /*proto*/
18525static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
18526static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18527#if CYTHON_VECTORCALL
18528PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18529#else
18530PyObject *__pyx_args, PyObject *__pyx_kwds
18531#endif
18532) {
18533 PyObject *__pyx_v___pyx_type = 0;
18534 long __pyx_v___pyx_checksum;
18535 PyObject *__pyx_v___pyx_state = 0;
18536 #if !CYTHON_VECTORCALL
18537 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18538 #endif
18539 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
18540 PyObject* values[3] = {0,0,0};
18541 int __pyx_lineno = 0;
18542 const char *__pyx_filename = NULL;
18543 int __pyx_clineno = 0;
18544 PyObject *__pyx_r = 0;
18545 __Pyx_RefNannyDeclarations
18546 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
18547 #if !CYTHON_VECTORCALL
18548 #if CYTHON_ASSUME_SAFE_SIZE
18549 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18550 #else
18551 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
18552 #endif
18553 #endif
18554 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18555 {
18556 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
18557 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
18558 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 4, __pyx_L3_error)
18559 if (__pyx_kwds_len > 0) {
18560 switch (__pyx_nargs) {
18561 case 3:
18562 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18563 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18564 CYTHON_FALLTHROUGH;
18565 case 2:
18566 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18567 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18568 CYTHON_FALLTHROUGH;
18569 case 1:
18570 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18571 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18572 CYTHON_FALLTHROUGH;
18573 case 0: break;
18574 default: goto __pyx_L5_argtuple_error;
18575 }
18576 const Py_ssize_t kwd_pos_args = __pyx_nargs;
18577 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_Enum", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
18578 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
18579 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
18580 }
18581 } else if (unlikely(__pyx_nargs != 3)) {
18582 goto __pyx_L5_argtuple_error;
18583 } else {
18584 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18585 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18586 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18587 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18588 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18589 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18590 }
18591 __pyx_v___pyx_type = values[0];
18592 __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
18593 __pyx_v___pyx_state = ((PyObject*)values[2]);
18594 }
18595 goto __pyx_L6_skip;
18596 __pyx_L5_argtuple_error:;
18597 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __pyx_L3_error)
18598 __pyx_L6_skip:;
18599 goto __pyx_L4_argument_unpacking_done;
18600 __pyx_L3_error:;
18601 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18602 Py_XDECREF(values[__pyx_temp]);
18603 }
18604 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18605 __Pyx_RefNannyFinishContext();
18606 return NULL;
18607 __pyx_L4_argument_unpacking_done:;
18608 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
18609 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18610
18611 /* function exit code */
18612 goto __pyx_L0;
18613 __pyx_L1_error:;
18614 __pyx_r = NULL;
18615 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18616 Py_XDECREF(values[__pyx_temp]);
18617 }
18618 goto __pyx_L7_cleaned_up;
18619 __pyx_L0:;
18620 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18621 Py_XDECREF(values[__pyx_temp]);
18622 }
18623 __pyx_L7_cleaned_up:;
18624
18625 __Pyx_RefNannyFinishContext();
18626 return __pyx_r;
18627}
18628
18629static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18630 PyObject *__pyx_v___pyx_result = 0;
18631 PyObject *__pyx_r = NULL;
18632 __Pyx_RefNannyDeclarations
18633 int __pyx_t_1;
18634 PyObject *__pyx_t_2 = NULL;
18635 PyObject *__pyx_t_3 = NULL;
18636 size_t __pyx_t_4;
18637 int __pyx_t_5;
18638 int __pyx_lineno = 0;
18639 const char *__pyx_filename = NULL;
18640 int __pyx_clineno = 0;
18641 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
18642
18643 /* "(tree fragment)":6
18644 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):
18645 * cdef object __pyx_result
18646 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name') # <<<<<<<<<<<<<<
18647 * __pyx_result = Enum.__new__(__pyx_type)
18648 * if __pyx_state is not None:
18649*/
18650 __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, __pyx_k_name); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)
18651
18652
18653 /* "(tree fragment)":7
18654 * cdef object __pyx_result
18655 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18656 * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
18657 * if __pyx_state is not None:
18658 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18659*/
18660 __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
18661 __Pyx_INCREF(__pyx_t_3);
18662 __pyx_t_4 = 0;
18663 {
18664 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
18665 __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
18666 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18667 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
18668 __Pyx_GOTREF(__pyx_t_2);
18669 }
18670 __pyx_v___pyx_result = __pyx_t_2;
18671 __pyx_t_2 = 0;
18672
18673 /* "(tree fragment)":8
18674 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18675 * __pyx_result = Enum.__new__(__pyx_type)
18676 * if __pyx_state is not None: # <<<<<<<<<<<<<<
18677 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18678 * return __pyx_result
18679*/
18680 __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
18681 if (__pyx_t_5) {
18682
18683
18684 /* "(tree fragment)":9
18685 * __pyx_result = Enum.__new__(__pyx_type)
18686 * if __pyx_state is not None:
18687 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
18688 * return __pyx_result
18689 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18690*/
18691 if (unlikely(__pyx_v___pyx_state == Py_None)) {
18692 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
18693 __PYX_ERR(1, 9, __pyx_L1_error)
18694 }
18695 __pyx_t_2 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
18696 __Pyx_GOTREF(__pyx_t_2);
18697 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18698
18699 /* "(tree fragment)":8
18700 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18701 * __pyx_result = Enum.__new__(__pyx_type)
18702 * if __pyx_state is not None: # <<<<<<<<<<<<<<
18703 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18704 * return __pyx_result
18705*/
18706 }
18707
18708 /* "(tree fragment)":10
18709 * if __pyx_state is not None:
18710 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18711 * return __pyx_result # <<<<<<<<<<<<<<
18712 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18713 * __pyx_result.name = __pyx_state[0]
18714*/
18715 {
18716 PyObject *__pyx_temp;
18717 {
18718 __pyx_temp = __pyx_r;
18719 __Pyx_INCREF(__pyx_v___pyx_result);
18720 __pyx_r = __pyx_v___pyx_result;
18721 }
18722 __Pyx_XDECREF(__pyx_temp);
18723 }
18724 goto __pyx_L0;
18725
18726 /* "(tree fragment)":4
18727 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
18728 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
18729 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
18730 * cdef object __pyx_result
18731 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18732*/
18733
18734 /* function exit code */
18735 __pyx_L1_error:;
18736 __Pyx_XDECREF(__pyx_t_2);
18737 __Pyx_XDECREF(__pyx_t_3);
18738 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18739 __pyx_r = NULL;
18740 __pyx_L0:;
18741 __Pyx_XDECREF(__pyx_v___pyx_result);
18742 __Pyx_XGIVEREF(__pyx_r);
18743 __Pyx_RefNannyFinishContext();
18744 return __pyx_r;
18745}
18746
18747/* "(tree fragment)":11
18748 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18749 * return __pyx_result
18750 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<<
18751 * __pyx_result.name = __pyx_state[0]
18752 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
18753*/
18754
18755static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18756 PyObject *__pyx_r = NULL;
18757 __Pyx_RefNannyDeclarations
18758 PyObject *__pyx_t_1 = NULL;
18759 int __pyx_t_2;
18760 int __pyx_lineno = 0;
18761 const char *__pyx_filename = NULL;
18762 int __pyx_clineno = 0;
18763 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
18764
18765 /* "(tree fragment)":12
18766 * return __pyx_result
18767 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18768 * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
18769 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
18770*/
18771 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18772 __Pyx_GOTREF(__pyx_t_1);
18773 __Pyx_GIVEREF(__pyx_t_1);
18774 __Pyx_GOTREF(__pyx_v___pyx_result->name);
18775 __Pyx_DECREF(__pyx_v___pyx_result->name);
18776 __pyx_v___pyx_result->name = __pyx_t_1;
18777 __pyx_t_1 = 0;
18778
18779 /* "(tree fragment)":13
18780 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18781 * __pyx_result.name = __pyx_state[0]
18782 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1) # <<<<<<<<<<<<<<
18783*/
18784 __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18785
18786
18787 /* "(tree fragment)":11
18788 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18789 * return __pyx_result
18790 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<<
18791 * __pyx_result.name = __pyx_state[0]
18792 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
18793*/
18794
18795 /* function exit code */
18796 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18797 goto __pyx_L0;
18798 __pyx_L1_error:;
18799 __Pyx_XDECREF(__pyx_t_1);
18800 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18801 __pyx_r = 0;
18802 __pyx_L0:;
18803 __Pyx_XGIVEREF(__pyx_r);
18804 __Pyx_RefNannyFinishContext();
18805 return __pyx_r;
18806}
18807
18808/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
18809 *
18810 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
18811 * @property # <<<<<<<<<<<<<<
18812 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
18813 * return PyDataType_TYPEOBJ(self)
18814*/
18815
18816static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
18817 PyTypeObject *__pyx_r;
18818
18819 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":232
18820 * @property
18821 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
18822 * return PyDataType_TYPEOBJ(self) # <<<<<<<<<<<<<<
18823 *
18824 * @property
18825*/
18826 {
18827
18828 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
18829 }
18830 goto __pyx_L0;
18831
18832 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
18833 *
18834 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
18835 * @property # <<<<<<<<<<<<<<
18836 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
18837 * return PyDataType_TYPEOBJ(self)
18838*/
18839
18840 /* function exit code */
18841 __pyx_L0:;
18842 return __pyx_r;
18843}
18844
18845/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
18846 * return PyDataType_TYPEOBJ(self)
18847 *
18848 * @property # <<<<<<<<<<<<<<
18849 * cdef inline char kind(self) noexcept nogil:
18850 * return PyDataType_KIND(self)
18851*/
18852
18853static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
18854 char __pyx_r;
18855
18856 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":236
18857 * @property
18858 * cdef inline char kind(self) noexcept nogil:
18859 * return PyDataType_KIND(self) # <<<<<<<<<<<<<<
18860 *
18861 * @property
18862*/
18863 {
18864
18865 __pyx_r = PyDataType_KIND(__pyx_v_self);
18866 }
18867 goto __pyx_L0;
18868
18869 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
18870 * return PyDataType_TYPEOBJ(self)
18871 *
18872 * @property # <<<<<<<<<<<<<<
18873 * cdef inline char kind(self) noexcept nogil:
18874 * return PyDataType_KIND(self)
18875*/
18876
18877 /* function exit code */
18878 __pyx_L0:;
18879 return __pyx_r;
18880}
18881
18882/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
18883 * return PyDataType_KIND(self)
18884 *
18885 * @property # <<<<<<<<<<<<<<
18886 * cdef inline char type(self) noexcept nogil:
18887 * return PyDataType_TYPE(self)
18888*/
18889
18890static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
18891 char __pyx_r;
18892
18893 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":240
18894 * @property
18895 * cdef inline char type(self) noexcept nogil:
18896 * return PyDataType_TYPE(self) # <<<<<<<<<<<<<<
18897 *
18898 * # Numpy sometimes mutates this without warning (e.g. it'll
18899*/
18900 {
18901
18902 __pyx_r = PyDataType_TYPE(__pyx_v_self);
18903 }
18904 goto __pyx_L0;
18905
18906 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
18907 * return PyDataType_KIND(self)
18908 *
18909 * @property # <<<<<<<<<<<<<<
18910 * cdef inline char type(self) noexcept nogil:
18911 * return PyDataType_TYPE(self)
18912*/
18913
18914 /* function exit code */
18915 __pyx_L0:;
18916 return __pyx_r;
18917}
18918
18919/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
18920 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
18921 * # directly accessing this field.
18922 * @property # <<<<<<<<<<<<<<
18923 * cdef inline char byteorder(self) noexcept nogil:
18924 * return PyDataType_BYTEORDER(self)
18925*/
18926
18927static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
18928 char __pyx_r;
18929
18930 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":249
18931 * @property
18932 * cdef inline char byteorder(self) noexcept nogil:
18933 * return PyDataType_BYTEORDER(self) # <<<<<<<<<<<<<<
18934 *
18935 * @property
18936*/
18937 {
18938
18939 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
18940 }
18941 goto __pyx_L0;
18942
18943 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
18944 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
18945 * # directly accessing this field.
18946 * @property # <<<<<<<<<<<<<<
18947 * cdef inline char byteorder(self) noexcept nogil:
18948 * return PyDataType_BYTEORDER(self)
18949*/
18950
18951 /* function exit code */
18952 __pyx_L0:;
18953 return __pyx_r;
18954}
18955
18956/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
18957 * return PyDataType_BYTEORDER(self)
18958 *
18959 * @property # <<<<<<<<<<<<<<
18960 * cdef inline int type_num(self) noexcept nogil:
18961 * return PyDataType_TYPENUM(self)
18962*/
18963
18964static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
18965 int __pyx_r;
18966
18967 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":253
18968 * @property
18969 * cdef inline int type_num(self) noexcept nogil:
18970 * return PyDataType_TYPENUM(self) # <<<<<<<<<<<<<<
18971 *
18972 * @property
18973*/
18974 {
18975
18976 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
18977 }
18978 goto __pyx_L0;
18979
18980 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
18981 * return PyDataType_BYTEORDER(self)
18982 *
18983 * @property # <<<<<<<<<<<<<<
18984 * cdef inline int type_num(self) noexcept nogil:
18985 * return PyDataType_TYPENUM(self)
18986*/
18987
18988 /* function exit code */
18989 __pyx_L0:;
18990 return __pyx_r;
18991}
18992
18993/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
18994 * return PyDataType_TYPENUM(self)
18995 *
18996 * @property # <<<<<<<<<<<<<<
18997 * cdef inline npy_intp itemsize(self) noexcept nogil:
18998 * return PyDataType_ELSIZE(self)
18999*/
19000
19001static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
19002 npy_intp __pyx_r;
19003
19004 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":257
19005 * @property
19006 * cdef inline npy_intp itemsize(self) noexcept nogil:
19007 * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
19008 *
19009 * @property
19010*/
19011 {
19012
19013 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
19014 }
19015 goto __pyx_L0;
19016
19017 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
19018 * return PyDataType_TYPENUM(self)
19019 *
19020 * @property # <<<<<<<<<<<<<<
19021 * cdef inline npy_intp itemsize(self) noexcept nogil:
19022 * return PyDataType_ELSIZE(self)
19023*/
19024
19025 /* function exit code */
19026 __pyx_L0:;
19027 return __pyx_r;
19028}
19029
19030/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
19031 * return PyDataType_ELSIZE(self)
19032 *
19033 * @property # <<<<<<<<<<<<<<
19034 * cdef inline npy_intp alignment(self) noexcept nogil:
19035 * return PyDataType_ALIGNMENT(self)
19036*/
19037
19038static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
19039 npy_intp __pyx_r;
19040
19041 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":261
19042 * @property
19043 * cdef inline npy_intp alignment(self) noexcept nogil:
19044 * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
19045 *
19046 * # Use fields/names with care as they may be NULL. You must check
19047*/
19048 {
19049
19050 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
19051 }
19052 goto __pyx_L0;
19053
19054 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
19055 * return PyDataType_ELSIZE(self)
19056 *
19057 * @property # <<<<<<<<<<<<<<
19058 * cdef inline npy_intp alignment(self) noexcept nogil:
19059 * return PyDataType_ALIGNMENT(self)
19060*/
19061
19062 /* function exit code */
19063 __pyx_L0:;
19064 return __pyx_r;
19065}
19066
19067/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
19068 * # Use fields/names with care as they may be NULL. You must check
19069 * # for this using PyDataType_HASFIELDS.
19070 * @property # <<<<<<<<<<<<<<
19071 * cdef inline object fields(self):
19072 * return <object>PyDataType_FIELDS(self)
19073*/
19074
19075static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
19076 PyObject *__pyx_r = NULL;
19077 __Pyx_RefNannyDeclarations
19078 PyObject *__pyx_t_1;
19079 __Pyx_RefNannySetupContext("__get__", 0);
19080
19081 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":267
19082 * @property
19083 * cdef inline object fields(self):
19084 * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
19085 *
19086 * @property
19087*/
19088 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
19089
19090 {
19091 PyObject *__pyx_temp;
19092 {
19093 __pyx_temp = __pyx_r;
19094 __Pyx_INCREF(((PyObject *)__pyx_t_1));
19095 __pyx_r = ((PyObject *)__pyx_t_1);
19096 }
19097 __Pyx_XDECREF(__pyx_temp);
19098 }
19099
19100 goto __pyx_L0;
19101
19102 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
19103 * # Use fields/names with care as they may be NULL. You must check
19104 * # for this using PyDataType_HASFIELDS.
19105 * @property # <<<<<<<<<<<<<<
19106 * cdef inline object fields(self):
19107 * return <object>PyDataType_FIELDS(self)
19108*/
19109
19110 /* function exit code */
19111 __pyx_L0:;
19112 __Pyx_XGIVEREF(__pyx_r);
19113 __Pyx_RefNannyFinishContext();
19114 return __pyx_r;
19115}
19116
19117/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
19118 * return <object>PyDataType_FIELDS(self)
19119 *
19120 * @property # <<<<<<<<<<<<<<
19121 * cdef inline tuple names(self):
19122 * return <tuple>PyDataType_NAMES(self)
19123*/
19124
19125static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
19126 PyObject *__pyx_r = NULL;
19127 __Pyx_RefNannyDeclarations
19128 PyObject *__pyx_t_1;
19129 __Pyx_RefNannySetupContext("__get__", 0);
19130
19131 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":271
19132 * @property
19133 * cdef inline tuple names(self):
19134 * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
19135 *
19136 * # Use PyDataType_HASSUBARRAY to test whether this field is
19137*/
19138 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
19139
19140 {
19141 PyObject *__pyx_temp;
19142 {
19143 __pyx_temp = __pyx_r;
19144 __Pyx_INCREF(((PyObject*)__pyx_t_1));
19145 __pyx_r = ((PyObject*)__pyx_t_1);
19146 }
19147 __Pyx_XDECREF(__pyx_temp);
19148 }
19149
19150 goto __pyx_L0;
19151
19152 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
19153 * return <object>PyDataType_FIELDS(self)
19154 *
19155 * @property # <<<<<<<<<<<<<<
19156 * cdef inline tuple names(self):
19157 * return <tuple>PyDataType_NAMES(self)
19158*/
19159
19160 /* function exit code */
19161 __pyx_L0:;
19162 __Pyx_XGIVEREF(__pyx_r);
19163 __Pyx_RefNannyFinishContext();
19164 return __pyx_r;
19165}
19166
19167/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
19168 * # valid (the pointer can be NULL). Most users should access
19169 * # this field via the inline helper method PyDataType_SHAPE.
19170 * @property # <<<<<<<<<<<<<<
19171 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19172 * return PyDataType_SUBARRAY(self)
19173*/
19174
19175static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
19176 PyArray_ArrayDescr *__pyx_r;
19177
19178 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":278
19179 * @property
19180 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19181 * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
19182 *
19183 * @property
19184*/
19185 {
19186
19187 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
19188 }
19189 goto __pyx_L0;
19190
19191 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
19192 * # valid (the pointer can be NULL). Most users should access
19193 * # this field via the inline helper method PyDataType_SHAPE.
19194 * @property # <<<<<<<<<<<<<<
19195 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19196 * return PyDataType_SUBARRAY(self)
19197*/
19198
19199 /* function exit code */
19200 __pyx_L0:;
19201 return __pyx_r;
19202}
19203
19204/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
19205 * return PyDataType_SUBARRAY(self)
19206 *
19207 * @property # <<<<<<<<<<<<<<
19208 * cdef inline npy_uint64 flags(self) noexcept nogil:
19209 * """The data types flags."""
19210*/
19211
19212static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
19213 npy_uint64 __pyx_r;
19214
19215 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":283
19216 * cdef inline npy_uint64 flags(self) noexcept nogil:
19217 * """The data types flags."""
19218 * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
19219 *
19220 *
19221*/
19222 {
19223
19224 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
19225 }
19226 goto __pyx_L0;
19227
19228 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
19229 * return PyDataType_SUBARRAY(self)
19230 *
19231 * @property # <<<<<<<<<<<<<<
19232 * cdef inline npy_uint64 flags(self) noexcept nogil:
19233 * """The data types flags."""
19234*/
19235
19236 /* function exit code */
19237 __pyx_L0:;
19238 return __pyx_r;
19239}
19240
19241/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
19242 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
19243 *
19244 * @property # <<<<<<<<<<<<<<
19245 * cdef inline int numiter(self) noexcept nogil:
19246 * """The number of arrays that need to be broadcast to the same shape."""
19247*/
19248
19249static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
19250 int __pyx_r;
19251
19252 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":295
19253 * cdef inline int numiter(self) noexcept nogil:
19254 * """The number of arrays that need to be broadcast to the same shape."""
19255 * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
19256 *
19257 * @property
19258*/
19259 {
19260
19261 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
19262 }
19263 goto __pyx_L0;
19264
19265 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
19266 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
19267 *
19268 * @property # <<<<<<<<<<<<<<
19269 * cdef inline int numiter(self) noexcept nogil:
19270 * """The number of arrays that need to be broadcast to the same shape."""
19271*/
19272
19273 /* function exit code */
19274 __pyx_L0:;
19275 return __pyx_r;
19276}
19277
19278/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
19279 * return PyArray_MultiIter_NUMITER(self)
19280 *
19281 * @property # <<<<<<<<<<<<<<
19282 * cdef inline npy_intp size(self) noexcept nogil:
19283 * """The total broadcasted size."""
19284*/
19285
19286static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
19287 npy_intp __pyx_r;
19288
19289 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":300
19290 * cdef inline npy_intp size(self) noexcept nogil:
19291 * """The total broadcasted size."""
19292 * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
19293 *
19294 * @property
19295*/
19296 {
19297
19298 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
19299 }
19300 goto __pyx_L0;
19301
19302 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
19303 * return PyArray_MultiIter_NUMITER(self)
19304 *
19305 * @property # <<<<<<<<<<<<<<
19306 * cdef inline npy_intp size(self) noexcept nogil:
19307 * """The total broadcasted size."""
19308*/
19309
19310 /* function exit code */
19311 __pyx_L0:;
19312 return __pyx_r;
19313}
19314
19315/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
19316 * return PyArray_MultiIter_SIZE(self)
19317 *
19318 * @property # <<<<<<<<<<<<<<
19319 * cdef inline npy_intp index(self) noexcept nogil:
19320 * """The current (1-d) index into the broadcasted result."""
19321*/
19322
19323static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
19324 npy_intp __pyx_r;
19325
19326 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":305
19327 * cdef inline npy_intp index(self) noexcept nogil:
19328 * """The current (1-d) index into the broadcasted result."""
19329 * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
19330 *
19331 * @property
19332*/
19333 {
19334
19335 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
19336 }
19337 goto __pyx_L0;
19338
19339 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
19340 * return PyArray_MultiIter_SIZE(self)
19341 *
19342 * @property # <<<<<<<<<<<<<<
19343 * cdef inline npy_intp index(self) noexcept nogil:
19344 * """The current (1-d) index into the broadcasted result."""
19345*/
19346
19347 /* function exit code */
19348 __pyx_L0:;
19349 return __pyx_r;
19350}
19351
19352/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
19353 * return PyArray_MultiIter_INDEX(self)
19354 *
19355 * @property # <<<<<<<<<<<<<<
19356 * cdef inline int nd(self) noexcept nogil:
19357 * """The number of dimensions in the broadcasted result."""
19358*/
19359
19360static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
19361 int __pyx_r;
19362
19363 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":310
19364 * cdef inline int nd(self) noexcept nogil:
19365 * """The number of dimensions in the broadcasted result."""
19366 * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
19367 *
19368 * @property
19369*/
19370 {
19371
19372 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
19373 }
19374 goto __pyx_L0;
19375
19376 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
19377 * return PyArray_MultiIter_INDEX(self)
19378 *
19379 * @property # <<<<<<<<<<<<<<
19380 * cdef inline int nd(self) noexcept nogil:
19381 * """The number of dimensions in the broadcasted result."""
19382*/
19383
19384 /* function exit code */
19385 __pyx_L0:;
19386 return __pyx_r;
19387}
19388
19389/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
19390 * return PyArray_MultiIter_NDIM(self)
19391 *
19392 * @property # <<<<<<<<<<<<<<
19393 * cdef inline npy_intp* dimensions(self) noexcept nogil:
19394 * """The shape of the broadcasted result."""
19395*/
19396
19397static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
19398 npy_intp *__pyx_r;
19399
19400 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":315
19401 * cdef inline npy_intp* dimensions(self) noexcept nogil:
19402 * """The shape of the broadcasted result."""
19403 * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
19404 *
19405 * @property
19406*/
19407 {
19408
19409 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
19410 }
19411 goto __pyx_L0;
19412
19413 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
19414 * return PyArray_MultiIter_NDIM(self)
19415 *
19416 * @property # <<<<<<<<<<<<<<
19417 * cdef inline npy_intp* dimensions(self) noexcept nogil:
19418 * """The shape of the broadcasted result."""
19419*/
19420
19421 /* function exit code */
19422 __pyx_L0:;
19423 return __pyx_r;
19424}
19425
19426/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
19427 * return PyArray_MultiIter_DIMS(self)
19428 *
19429 * @property # <<<<<<<<<<<<<<
19430 * cdef inline void** iters(self) noexcept nogil:
19431 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19432*/
19433
19434static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
19435 void **__pyx_r;
19436
19437 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":321
19438 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19439 * On return, the iterators are adjusted for broadcasting."""
19440 * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
19441 *
19442 *
19443*/
19444 {
19445
19446 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
19447 }
19448 goto __pyx_L0;
19449
19450 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
19451 * return PyArray_MultiIter_DIMS(self)
19452 *
19453 * @property # <<<<<<<<<<<<<<
19454 * cdef inline void** iters(self) noexcept nogil:
19455 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19456*/
19457
19458 /* function exit code */
19459 __pyx_L0:;
19460 return __pyx_r;
19461}
19462
19463/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
19464 * # Instead, we use properties that map to the corresponding C-API functions.
19465 *
19466 * @property # <<<<<<<<<<<<<<
19467 * cdef inline PyObject* base(self) noexcept nogil:
19468 * """Returns a borrowed reference to the object owning the data/memory.
19469*/
19470
19471static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
19472 PyObject *__pyx_r;
19473
19474 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":339
19475 * """Returns a borrowed reference to the object owning the data/memory.
19476 * """
19477 * return PyArray_BASE(self) # <<<<<<<<<<<<<<
19478 *
19479 * @property
19480*/
19481 {
19482
19483 __pyx_r = PyArray_BASE(__pyx_v_self);
19484 }
19485 goto __pyx_L0;
19486
19487 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
19488 * # Instead, we use properties that map to the corresponding C-API functions.
19489 *
19490 * @property # <<<<<<<<<<<<<<
19491 * cdef inline PyObject* base(self) noexcept nogil:
19492 * """Returns a borrowed reference to the object owning the data/memory.
19493*/
19494
19495 /* function exit code */
19496 __pyx_L0:;
19497 return __pyx_r;
19498}
19499
19500/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
19501 * return PyArray_BASE(self)
19502 *
19503 * @property # <<<<<<<<<<<<<<
19504 * cdef inline dtype descr(self):
19505 * """Returns an owned reference to the dtype of the array.
19506*/
19507
19508static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
19509 PyArray_Descr *__pyx_r = NULL;
19510 __Pyx_RefNannyDeclarations
19511 PyArray_Descr *__pyx_t_1;
19512 __Pyx_RefNannySetupContext("__get__", 0);
19513
19514 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":345
19515 * """Returns an owned reference to the dtype of the array.
19516 * """
19517 * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
19518 *
19519 * @property
19520*/
19521 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
19522
19523 {
19524 PyArray_Descr *__pyx_temp;
19525 {
19526 __pyx_temp = __pyx_r;
19527 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
19528 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19529 }
19530 __Pyx_XDECREF((PyObject *)__pyx_temp);
19531 }
19532
19533 goto __pyx_L0;
19534
19535 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
19536 * return PyArray_BASE(self)
19537 *
19538 * @property # <<<<<<<<<<<<<<
19539 * cdef inline dtype descr(self):
19540 * """Returns an owned reference to the dtype of the array.
19541*/
19542
19543 /* function exit code */
19544 __pyx_L0:;
19545 __Pyx_XGIVEREF((PyObject *)__pyx_r);
19546 __Pyx_RefNannyFinishContext();
19547 return __pyx_r;
19548}
19549
19550/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
19551 * return <dtype>PyArray_DESCR(self)
19552 *
19553 * @property # <<<<<<<<<<<<<<
19554 * cdef inline int ndim(self) noexcept nogil:
19555 * """Returns the number of dimensions in the array.
19556*/
19557
19558static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
19559 int __pyx_r;
19560
19561 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":351
19562 * """Returns the number of dimensions in the array.
19563 * """
19564 * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
19565 *
19566 * @property
19567*/
19568 {
19569
19570 __pyx_r = PyArray_NDIM(__pyx_v_self);
19571 }
19572 goto __pyx_L0;
19573
19574 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
19575 * return <dtype>PyArray_DESCR(self)
19576 *
19577 * @property # <<<<<<<<<<<<<<
19578 * cdef inline int ndim(self) noexcept nogil:
19579 * """Returns the number of dimensions in the array.
19580*/
19581
19582 /* function exit code */
19583 __pyx_L0:;
19584 return __pyx_r;
19585}
19586
19587/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
19588 * return PyArray_NDIM(self)
19589 *
19590 * @property # <<<<<<<<<<<<<<
19591 * cdef inline npy_intp *shape(self) noexcept nogil:
19592 * """Returns a pointer to the dimensions/shape of the array.
19593*/
19594
19595static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
19596 npy_intp *__pyx_r;
19597
19598 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":359
19599 * Can return NULL for 0-dimensional arrays.
19600 * """
19601 * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
19602 *
19603 * @property
19604*/
19605 {
19606
19607 __pyx_r = PyArray_DIMS(__pyx_v_self);
19608 }
19609 goto __pyx_L0;
19610
19611 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
19612 * return PyArray_NDIM(self)
19613 *
19614 * @property # <<<<<<<<<<<<<<
19615 * cdef inline npy_intp *shape(self) noexcept nogil:
19616 * """Returns a pointer to the dimensions/shape of the array.
19617*/
19618
19619 /* function exit code */
19620 __pyx_L0:;
19621 return __pyx_r;
19622}
19623
19624/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
19625 * return PyArray_DIMS(self)
19626 *
19627 * @property # <<<<<<<<<<<<<<
19628 * cdef inline npy_intp *strides(self) noexcept nogil:
19629 * """Returns a pointer to the strides of the array.
19630*/
19631
19632static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
19633 npy_intp *__pyx_r;
19634
19635 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":366
19636 * The number of elements matches the number of dimensions of the array (ndim).
19637 * """
19638 * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
19639 *
19640 * @property
19641*/
19642 {
19643
19644 __pyx_r = PyArray_STRIDES(__pyx_v_self);
19645 }
19646 goto __pyx_L0;
19647
19648 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
19649 * return PyArray_DIMS(self)
19650 *
19651 * @property # <<<<<<<<<<<<<<
19652 * cdef inline npy_intp *strides(self) noexcept nogil:
19653 * """Returns a pointer to the strides of the array.
19654*/
19655
19656 /* function exit code */
19657 __pyx_L0:;
19658 return __pyx_r;
19659}
19660
19661/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
19662 * return PyArray_STRIDES(self)
19663 *
19664 * @property # <<<<<<<<<<<<<<
19665 * cdef inline npy_intp size(self) noexcept nogil:
19666 * """Returns the total size (in number of elements) of the array.
19667*/
19668
19669static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
19670 npy_intp __pyx_r;
19671
19672 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":372
19673 * """Returns the total size (in number of elements) of the array.
19674 * """
19675 * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
19676 *
19677 * @property
19678*/
19679 {
19680
19681 __pyx_r = PyArray_SIZE(__pyx_v_self);
19682 }
19683 goto __pyx_L0;
19684
19685 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
19686 * return PyArray_STRIDES(self)
19687 *
19688 * @property # <<<<<<<<<<<<<<
19689 * cdef inline npy_intp size(self) noexcept nogil:
19690 * """Returns the total size (in number of elements) of the array.
19691*/
19692
19693 /* function exit code */
19694 __pyx_L0:;
19695 return __pyx_r;
19696}
19697
19698/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
19699 * return PyArray_SIZE(self)
19700 *
19701 * @property # <<<<<<<<<<<<<<
19702 * cdef inline char* data(self) noexcept nogil:
19703 * """The pointer to the data buffer as a char*.
19704*/
19705
19706static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
19707 char *__pyx_r;
19708
19709 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":381
19710 * of `PyArray_DATA()` instead, which returns a 'void*'.
19711 * """
19712 * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
19713 *
19714 *
19715*/
19716 {
19717
19718 __pyx_r = PyArray_BYTES(__pyx_v_self);
19719 }
19720 goto __pyx_L0;
19721
19722 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
19723 * return PyArray_SIZE(self)
19724 *
19725 * @property # <<<<<<<<<<<<<<
19726 * cdef inline char* data(self) noexcept nogil:
19727 * """The pointer to the data buffer as a char*.
19728*/
19729
19730 /* function exit code */
19731 __pyx_L0:;
19732 return __pyx_r;
19733}
19734
19735/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
19736 * ctypedef long double complex clongdouble_t
19737 *
19738 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19739 * return PyArray_MultiIterNew(1, <void*>a)
19740 *
19741*/
19742
19743static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19744 PyObject *__pyx_r = NULL;
19745 __Pyx_RefNannyDeclarations
19746 PyObject *__pyx_t_1 = NULL;
19747 int __pyx_lineno = 0;
19748 const char *__pyx_filename = NULL;
19749 int __pyx_clineno = 0;
19750 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
19751
19752 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":795
19753 *
19754 * cdef inline object PyArray_MultiIterNew1(a):
19755 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
19756 *
19757 * cdef inline object PyArray_MultiIterNew2(a, b):
19758*/
19759 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 795, __pyx_L1_error)
19760 __Pyx_GOTREF(__pyx_t_1);
19761 {
19762 PyObject *__pyx_temp;
19763 {
19764 __pyx_temp = __pyx_r;
19765 __pyx_r = __pyx_t_1;
19766 }
19767 __Pyx_XDECREF(__pyx_temp);
19768 }
19769 __pyx_t_1 = 0;
19770 goto __pyx_L0;
19771
19772 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
19773 * ctypedef long double complex clongdouble_t
19774 *
19775 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19776 * return PyArray_MultiIterNew(1, <void*>a)
19777 *
19778*/
19779
19780 /* function exit code */
19781 __pyx_L1_error:;
19782 __Pyx_XDECREF(__pyx_t_1);
19783 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19784 __pyx_r = 0;
19785 __pyx_L0:;
19786 __Pyx_XGIVEREF(__pyx_r);
19787 __Pyx_RefNannyFinishContext();
19788 return __pyx_r;
19789}
19790
19791/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
19792 * return PyArray_MultiIterNew(1, <void*>a)
19793 *
19794 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19795 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19796 *
19797*/
19798
19799static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19800 PyObject *__pyx_r = NULL;
19801 __Pyx_RefNannyDeclarations
19802 PyObject *__pyx_t_1 = NULL;
19803 int __pyx_lineno = 0;
19804 const char *__pyx_filename = NULL;
19805 int __pyx_clineno = 0;
19806 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
19807
19808 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":798
19809 *
19810 * cdef inline object PyArray_MultiIterNew2(a, b):
19811 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
19812 *
19813 * cdef inline object PyArray_MultiIterNew3(a, b, c):
19814*/
19815 __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 798, __pyx_L1_error)
19816 __Pyx_GOTREF(__pyx_t_1);
19817 {
19818 PyObject *__pyx_temp;
19819 {
19820 __pyx_temp = __pyx_r;
19821 __pyx_r = __pyx_t_1;
19822 }
19823 __Pyx_XDECREF(__pyx_temp);
19824 }
19825 __pyx_t_1 = 0;
19826 goto __pyx_L0;
19827
19828 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
19829 * return PyArray_MultiIterNew(1, <void*>a)
19830 *
19831 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19832 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19833 *
19834*/
19835
19836 /* function exit code */
19837 __pyx_L1_error:;
19838 __Pyx_XDECREF(__pyx_t_1);
19839 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19840 __pyx_r = 0;
19841 __pyx_L0:;
19842 __Pyx_XGIVEREF(__pyx_r);
19843 __Pyx_RefNannyFinishContext();
19844 return __pyx_r;
19845}
19846
19847/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
19848 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19849 *
19850 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19851 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19852 *
19853*/
19854
19855static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19856 PyObject *__pyx_r = NULL;
19857 __Pyx_RefNannyDeclarations
19858 PyObject *__pyx_t_1 = NULL;
19859 int __pyx_lineno = 0;
19860 const char *__pyx_filename = NULL;
19861 int __pyx_clineno = 0;
19862 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
19863
19864 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":801
19865 *
19866 * cdef inline object PyArray_MultiIterNew3(a, b, c):
19867 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
19868 *
19869 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19870*/
19871 __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 801, __pyx_L1_error)
19872 __Pyx_GOTREF(__pyx_t_1);
19873 {
19874 PyObject *__pyx_temp;
19875 {
19876 __pyx_temp = __pyx_r;
19877 __pyx_r = __pyx_t_1;
19878 }
19879 __Pyx_XDECREF(__pyx_temp);
19880 }
19881 __pyx_t_1 = 0;
19882 goto __pyx_L0;
19883
19884 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
19885 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19886 *
19887 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19888 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19889 *
19890*/
19891
19892 /* function exit code */
19893 __pyx_L1_error:;
19894 __Pyx_XDECREF(__pyx_t_1);
19895 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19896 __pyx_r = 0;
19897 __pyx_L0:;
19898 __Pyx_XGIVEREF(__pyx_r);
19899 __Pyx_RefNannyFinishContext();
19900 return __pyx_r;
19901}
19902
19903/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
19904 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19905 *
19906 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19907 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19908 *
19909*/
19910
19911static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
19912 PyObject *__pyx_r = NULL;
19913 __Pyx_RefNannyDeclarations
19914 PyObject *__pyx_t_1 = NULL;
19915 int __pyx_lineno = 0;
19916 const char *__pyx_filename = NULL;
19917 int __pyx_clineno = 0;
19918 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
19919
19920 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":804
19921 *
19922 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19923 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
19924 *
19925 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19926*/
19927 __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 804, __pyx_L1_error)
19928 __Pyx_GOTREF(__pyx_t_1);
19929 {
19930 PyObject *__pyx_temp;
19931 {
19932 __pyx_temp = __pyx_r;
19933 __pyx_r = __pyx_t_1;
19934 }
19935 __Pyx_XDECREF(__pyx_temp);
19936 }
19937 __pyx_t_1 = 0;
19938 goto __pyx_L0;
19939
19940 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
19941 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19942 *
19943 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19944 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19945 *
19946*/
19947
19948 /* function exit code */
19949 __pyx_L1_error:;
19950 __Pyx_XDECREF(__pyx_t_1);
19951 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19952 __pyx_r = 0;
19953 __pyx_L0:;
19954 __Pyx_XGIVEREF(__pyx_r);
19955 __Pyx_RefNannyFinishContext();
19956 return __pyx_r;
19957}
19958
19959/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
19960 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19961 *
19962 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19963 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19964 *
19965*/
19966
19967static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
19968 PyObject *__pyx_r = NULL;
19969 __Pyx_RefNannyDeclarations
19970 PyObject *__pyx_t_1 = NULL;
19971 int __pyx_lineno = 0;
19972 const char *__pyx_filename = NULL;
19973 int __pyx_clineno = 0;
19974 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
19975
19976 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":807
19977 *
19978 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19979 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
19980 *
19981 * cdef inline tuple PyDataType_SHAPE(dtype d):
19982*/
19983 __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 807, __pyx_L1_error)
19984 __Pyx_GOTREF(__pyx_t_1);
19985 {
19986 PyObject *__pyx_temp;
19987 {
19988 __pyx_temp = __pyx_r;
19989 __pyx_r = __pyx_t_1;
19990 }
19991 __Pyx_XDECREF(__pyx_temp);
19992 }
19993 __pyx_t_1 = 0;
19994 goto __pyx_L0;
19995
19996 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
19997 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19998 *
19999 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
20000 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20001 *
20002*/
20003
20004 /* function exit code */
20005 __pyx_L1_error:;
20006 __Pyx_XDECREF(__pyx_t_1);
20007 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
20008 __pyx_r = 0;
20009 __pyx_L0:;
20010 __Pyx_XGIVEREF(__pyx_r);
20011 __Pyx_RefNannyFinishContext();
20012 return __pyx_r;
20013}
20014
20015/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
20016 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20017 *
20018 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20019 * if PyDataType_HASSUBARRAY(d):
20020 * return <tuple>d.subarray.shape
20021*/
20022
20023static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
20024 PyObject *__pyx_r = NULL;
20025 __Pyx_RefNannyDeclarations
20026 int __pyx_t_1;
20027 PyObject *__pyx_t_2;
20028 __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
20029
20030 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
20031 *
20032 * cdef inline tuple PyDataType_SHAPE(dtype d):
20033 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20034 * return <tuple>d.subarray.shape
20035 * else:
20036*/
20037 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
20038
20039 if (__pyx_t_1) {
20040
20041
20042 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":811
20043 * cdef inline tuple PyDataType_SHAPE(dtype d):
20044 * if PyDataType_HASSUBARRAY(d):
20045 * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
20046 * else:
20047 * return ()
20048*/
20049 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
20050
20051 {
20052 PyObject *__pyx_temp;
20053 {
20054 __pyx_temp = __pyx_r;
20055 __Pyx_INCREF(((PyObject*)__pyx_t_2));
20056 __pyx_r = ((PyObject*)__pyx_t_2);
20057 }
20058 __Pyx_XDECREF(__pyx_temp);
20059 }
20060
20061 goto __pyx_L0;
20062
20063 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
20064 *
20065 * cdef inline tuple PyDataType_SHAPE(dtype d):
20066 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20067 * return <tuple>d.subarray.shape
20068 * else:
20069*/
20070 }
20071
20072 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":813
20073 * return <tuple>d.subarray.shape
20074 * else:
20075 * return () # <<<<<<<<<<<<<<
20076 *
20077 *
20078*/
20079 /*else*/ {
20080 {
20081 PyObject *__pyx_temp;
20082 {
20083 __pyx_temp = __pyx_r;
20084 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
20085 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
20086 }
20087 __Pyx_XDECREF(__pyx_temp);
20088 }
20089 goto __pyx_L0;
20090 }
20091
20092 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
20093 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20094 *
20095 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20096 * if PyDataType_HASSUBARRAY(d):
20097 * return <tuple>d.subarray.shape
20098*/
20099
20100 /* function exit code */
20101 __pyx_L0:;
20102 __Pyx_XGIVEREF(__pyx_r);
20103 __Pyx_RefNannyFinishContext();
20104 return __pyx_r;
20105}
20106
20107/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
20108 *
20109 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
20110 * @property # <<<<<<<<<<<<<<
20111 * cdef inline int nin(self) noexcept nogil:
20112 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20113*/
20114
20115static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
20116 int __pyx_r;
20117
20118 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":949
20119 * @property
20120 * cdef inline int nin(self) noexcept nogil:
20121 * return _PyUFuncObject_GET_ITEM_DATA(self).nin # <<<<<<<<<<<<<<
20122 *
20123 * @property
20124*/
20125 {
20126
20127 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
20128 }
20129 goto __pyx_L0;
20130
20131 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
20132 *
20133 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
20134 * @property # <<<<<<<<<<<<<<
20135 * cdef inline int nin(self) noexcept nogil:
20136 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20137*/
20138
20139 /* function exit code */
20140 __pyx_L0:;
20141 return __pyx_r;
20142}
20143
20144/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
20145 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20146 *
20147 * @property # <<<<<<<<<<<<<<
20148 * cdef inline int nout(self) noexcept nogil:
20149 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20150*/
20151
20152static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
20153 int __pyx_r;
20154
20155 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":953
20156 * @property
20157 * cdef inline int nout(self) noexcept nogil:
20158 * return _PyUFuncObject_GET_ITEM_DATA(self).nout # <<<<<<<<<<<<<<
20159 *
20160 * @property
20161*/
20162 {
20163
20164 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
20165 }
20166 goto __pyx_L0;
20167
20168 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
20169 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20170 *
20171 * @property # <<<<<<<<<<<<<<
20172 * cdef inline int nout(self) noexcept nogil:
20173 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20174*/
20175
20176 /* function exit code */
20177 __pyx_L0:;
20178 return __pyx_r;
20179}
20180
20181/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
20182 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20183 *
20184 * @property # <<<<<<<<<<<<<<
20185 * cdef inline int nargs(self) noexcept nogil:
20186 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20187*/
20188
20189static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
20190 int __pyx_r;
20191
20192 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":957
20193 * @property
20194 * cdef inline int nargs(self) noexcept nogil:
20195 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs # <<<<<<<<<<<<<<
20196 *
20197 * @property
20198*/
20199 {
20200
20201 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
20202 }
20203 goto __pyx_L0;
20204
20205 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
20206 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20207 *
20208 * @property # <<<<<<<<<<<<<<
20209 * cdef inline int nargs(self) noexcept nogil:
20210 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20211*/
20212
20213 /* function exit code */
20214 __pyx_L0:;
20215 return __pyx_r;
20216}
20217
20218/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
20219 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20220 *
20221 * @property # <<<<<<<<<<<<<<
20222 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20223 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20224*/
20225
20226static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
20227 PyUFuncGenericFunction *__pyx_r;
20228
20229 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":961
20230 * @property
20231 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20232 * return _PyUFuncObject_GET_ITEM_DATA(self).functions # <<<<<<<<<<<<<<
20233 *
20234 * @property
20235*/
20236 {
20237
20238 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
20239 }
20240 goto __pyx_L0;
20241
20242 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
20243 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20244 *
20245 * @property # <<<<<<<<<<<<<<
20246 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20247 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20248*/
20249
20250 /* function exit code */
20251 __pyx_L0:;
20252 return __pyx_r;
20253}
20254
20255/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
20256 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20257 *
20258 * @property # <<<<<<<<<<<<<<
20259 * cdef inline void ** data(self) noexcept nogil:
20260 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20261*/
20262
20263static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
20264 void **__pyx_r;
20265
20266 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":965
20267 * @property
20268 * cdef inline void ** data(self) noexcept nogil:
20269 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data # <<<<<<<<<<<<<<
20270 *
20271 * @property
20272*/
20273 {
20274
20275 __pyx_r = ((void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
20276 }
20277 goto __pyx_L0;
20278
20279 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
20280 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20281 *
20282 * @property # <<<<<<<<<<<<<<
20283 * cdef inline void ** data(self) noexcept nogil:
20284 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20285*/
20286
20287 /* function exit code */
20288 __pyx_L0:;
20289 return __pyx_r;
20290}
20291
20292/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
20293 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20294 *
20295 * @property # <<<<<<<<<<<<<<
20296 * cdef inline int ntypes(self) noexcept nogil:
20297 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20298*/
20299
20300static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
20301 int __pyx_r;
20302
20303 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":969
20304 * @property
20305 * cdef inline int ntypes(self) noexcept nogil:
20306 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes # <<<<<<<<<<<<<<
20307 *
20308 * @property
20309*/
20310 {
20311
20312 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
20313 }
20314 goto __pyx_L0;
20315
20316 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
20317 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20318 *
20319 * @property # <<<<<<<<<<<<<<
20320 * cdef inline int ntypes(self) noexcept nogil:
20321 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20322*/
20323
20324 /* function exit code */
20325 __pyx_L0:;
20326 return __pyx_r;
20327}
20328
20329/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
20330 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20331 *
20332 * @property # <<<<<<<<<<<<<<
20333 * cdef inline const char* name(self) noexcept nogil:
20334 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20335*/
20336
20337static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
20338 char const *__pyx_r;
20339
20340 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":973
20341 * @property
20342 * cdef inline const char* name(self) noexcept nogil:
20343 * return _PyUFuncObject_GET_ITEM_DATA(self).name # <<<<<<<<<<<<<<
20344 *
20345 * @property
20346*/
20347 {
20348
20349 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
20350 }
20351 goto __pyx_L0;
20352
20353 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
20354 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20355 *
20356 * @property # <<<<<<<<<<<<<<
20357 * cdef inline const char* name(self) noexcept nogil:
20358 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20359*/
20360
20361 /* function exit code */
20362 __pyx_L0:;
20363 return __pyx_r;
20364}
20365
20366/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
20367 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20368 *
20369 * @property # <<<<<<<<<<<<<<
20370 * cdef inline const char* doc(self) noexcept nogil:
20371 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20372*/
20373
20374static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
20375 char const *__pyx_r;
20376
20377 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":977
20378 * @property
20379 * cdef inline const char* doc(self) noexcept nogil:
20380 * return _PyUFuncObject_GET_ITEM_DATA(self).doc # <<<<<<<<<<<<<<
20381 *
20382 * @property
20383*/
20384 {
20385
20386 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
20387 }
20388 goto __pyx_L0;
20389
20390 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
20391 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20392 *
20393 * @property # <<<<<<<<<<<<<<
20394 * cdef inline const char* doc(self) noexcept nogil:
20395 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20396*/
20397
20398 /* function exit code */
20399 __pyx_L0:;
20400 return __pyx_r;
20401}
20402
20403/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
20404 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20405 *
20406 * @property # <<<<<<<<<<<<<<
20407 * cdef inline void* ptr(self) noexcept nogil:
20408 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20409*/
20410
20411static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
20412 void *__pyx_r;
20413
20414 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":981
20415 * @property
20416 * cdef inline void* ptr(self) noexcept nogil:
20417 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr # <<<<<<<<<<<<<<
20418 *
20419 * @property
20420*/
20421 {
20422
20423 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
20424 }
20425 goto __pyx_L0;
20426
20427 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
20428 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20429 *
20430 * @property # <<<<<<<<<<<<<<
20431 * cdef inline void* ptr(self) noexcept nogil:
20432 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20433*/
20434
20435 /* function exit code */
20436 __pyx_L0:;
20437 return __pyx_r;
20438}
20439
20440/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
20441 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20442 *
20443 * @property # <<<<<<<<<<<<<<
20444 * cdef inline PyObject* obj(self) noexcept nogil:
20445 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20446*/
20447
20448static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
20449 PyObject *__pyx_r;
20450
20451 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":985
20452 * @property
20453 * cdef inline PyObject* obj(self) noexcept nogil:
20454 * return _PyUFuncObject_GET_ITEM_DATA(self).obj # <<<<<<<<<<<<<<
20455 *
20456 * @property
20457*/
20458 {
20459
20460 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
20461 }
20462 goto __pyx_L0;
20463
20464 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
20465 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20466 *
20467 * @property # <<<<<<<<<<<<<<
20468 * cdef inline PyObject* obj(self) noexcept nogil:
20469 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20470*/
20471
20472 /* function exit code */
20473 __pyx_L0:;
20474 return __pyx_r;
20475}
20476
20477/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
20478 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20479 *
20480 * @property # <<<<<<<<<<<<<<
20481 * cdef inline PyObject* userloops(self) noexcept nogil:
20482 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
20483*/
20484
20485static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
20486 PyObject *__pyx_r;
20487
20488 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":989
20489 * @property
20490 * cdef inline PyObject* userloops(self) noexcept nogil:
20491 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops # <<<<<<<<<<<<<<
20492 *
20493 * PyUFuncObject_fields *_PyUFuncObject_GET_ITEM_DATA(ufunc) nogil
20494*/
20495 {
20496
20497 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
20498 }
20499 goto __pyx_L0;
20500
20501 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
20502 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20503 *
20504 * @property # <<<<<<<<<<<<<<
20505 * cdef inline PyObject* userloops(self) noexcept nogil:
20506 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
20507*/
20508
20509 /* function exit code */
20510 __pyx_L0:;
20511 return __pyx_r;
20512}
20513
20514/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
20515 * int _import_umath() except -1
20516 *
20517 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20518 * Py_INCREF(base) # important to do this before stealing the reference below!
20519 * PyArray_SetBaseObject(arr, base)
20520*/
20521
20522static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
20523 int __pyx_t_1;
20524 int __pyx_lineno = 0;
20525 const char *__pyx_filename = NULL;
20526 int __pyx_clineno = 0;
20527
20528 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1066
20529 *
20530 * cdef inline void set_array_base(ndarray arr, object base) except *:
20531 * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
20532 * PyArray_SetBaseObject(arr, base)
20533 *
20534*/
20535 Py_INCREF(__pyx_v_base);
20536
20537 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1067
20538 * cdef inline void set_array_base(ndarray arr, object base) except *:
20539 * Py_INCREF(base) # important to do this before stealing the reference below!
20540 * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
20541 *
20542 * cdef inline object get_array_base(ndarray arr):
20543*/
20544 __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1067, __pyx_L1_error)
20545
20546
20547 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
20548 * int _import_umath() except -1
20549 *
20550 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20551 * Py_INCREF(base) # important to do this before stealing the reference below!
20552 * PyArray_SetBaseObject(arr, base)
20553*/
20554
20555 /* function exit code */
20556 goto __pyx_L0;
20557 __pyx_L1_error:;
20558 __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
20559 __pyx_L0:;
20560
20561}
20562
20563/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
20564 * PyArray_SetBaseObject(arr, base)
20565 *
20566 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20567 * base = PyArray_BASE(arr)
20568 * if base is NULL:
20569*/
20570
20571static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
20572 PyObject *__pyx_v_base;
20573 PyObject *__pyx_r = NULL;
20574 __Pyx_RefNannyDeclarations
20575 int __pyx_t_1;
20576 __Pyx_RefNannySetupContext("get_array_base", 0);
20577
20578 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1070
20579 *
20580 * cdef inline object get_array_base(ndarray arr):
20581 * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
20582 * if base is NULL:
20583 * return None
20584*/
20585 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20586
20587 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
20588 * cdef inline object get_array_base(ndarray arr):
20589 * base = PyArray_BASE(arr)
20590 * if base is NULL: # <<<<<<<<<<<<<<
20591 * return None
20592 * return <object>base
20593*/
20594 __pyx_t_1 = (__pyx_v_base == NULL);
20595
20596 if (__pyx_t_1) {
20597
20598
20599 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1072
20600 * base = PyArray_BASE(arr)
20601 * if base is NULL:
20602 * return None # <<<<<<<<<<<<<<
20603 * return <object>base
20604 *
20605*/
20606 {
20607 PyObject *__pyx_temp;
20608 {
20609 __pyx_temp = __pyx_r;
20610 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20611 }
20612 __Pyx_XDECREF(__pyx_temp);
20613 }
20614 goto __pyx_L0;
20615
20616 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
20617 * cdef inline object get_array_base(ndarray arr):
20618 * base = PyArray_BASE(arr)
20619 * if base is NULL: # <<<<<<<<<<<<<<
20620 * return None
20621 * return <object>base
20622*/
20623 }
20624
20625 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1073
20626 * if base is NULL:
20627 * return None
20628 * return <object>base # <<<<<<<<<<<<<<
20629 *
20630 * # Versions of the import_* functions which are more suitable for
20631*/
20632 {
20633 PyObject *__pyx_temp;
20634 {
20635 __pyx_temp = __pyx_r;
20636 __Pyx_INCREF(((PyObject *)__pyx_v_base));
20637 __pyx_r = ((PyObject *)__pyx_v_base);
20638 }
20639 __Pyx_XDECREF(__pyx_temp);
20640 }
20641 goto __pyx_L0;
20642
20643 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
20644 * PyArray_SetBaseObject(arr, base)
20645 *
20646 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20647 * base = PyArray_BASE(arr)
20648 * if base is NULL:
20649*/
20650
20651 /* function exit code */
20652 __pyx_L0:;
20653
20654 __Pyx_XGIVEREF(__pyx_r);
20655 __Pyx_RefNannyFinishContext();
20656 return __pyx_r;
20657}
20658
20659/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
20660 * # Versions of the import_* functions which are more suitable for
20661 * # Cython code.
20662 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20663 * try:
20664 * __pyx_import_array()
20665*/
20666
20667static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20668 int __pyx_r;
20669 __Pyx_RefNannyDeclarations
20670 PyObject *__pyx_t_1 = NULL;
20671 PyObject *__pyx_t_2 = NULL;
20672 PyObject *__pyx_t_3 = NULL;
20673 int __pyx_t_4;
20674 PyObject *__pyx_t_5 = NULL;
20675 PyObject *__pyx_t_6 = NULL;
20676 PyObject *__pyx_t_7 = NULL;
20677 PyObject *__pyx_t_8 = NULL;
20678 PyObject *__pyx_t_9 = NULL;
20679 size_t __pyx_t_10;
20680 int __pyx_lineno = 0;
20681 const char *__pyx_filename = NULL;
20682 int __pyx_clineno = 0;
20683 __Pyx_RefNannySetupContext("import_array", 0);
20684
20685 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
20686 * # Cython code.
20687 * cdef inline int import_array() except -1:
20688 * try: # <<<<<<<<<<<<<<
20689 * __pyx_import_array()
20690 * except Exception:
20691*/
20692 {
20693 __Pyx_PyThreadState_declare
20694 __Pyx_PyThreadState_assign
20695 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20696 __Pyx_XGOTREF(__pyx_t_1);
20697 __Pyx_XGOTREF(__pyx_t_2);
20698 __Pyx_XGOTREF(__pyx_t_3);
20699 /*try:*/ {
20700
20701 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1079
20702 * cdef inline int import_array() except -1:
20703 * try:
20704 * __pyx_import_array() # <<<<<<<<<<<<<<
20705 * except Exception:
20706 * raise ImportError("numpy._core.multiarray failed to import")
20707*/
20708 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1079, __pyx_L3_error)
20709
20710
20711 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
20712 * # Cython code.
20713 * cdef inline int import_array() except -1:
20714 * try: # <<<<<<<<<<<<<<
20715 * __pyx_import_array()
20716 * except Exception:
20717*/
20718 }
20719 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20720 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20721 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20722 goto __pyx_L8_try_end;
20723 __pyx_L3_error:;
20724
20725 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1080
20726 * try:
20727 * __pyx_import_array()
20728 * except Exception: # <<<<<<<<<<<<<<
20729 * raise ImportError("numpy._core.multiarray failed to import")
20730 *
20731*/
20732 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20733 if (__pyx_t_4) {
20734 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20735 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1080, __pyx_L5_except_error)
20736 __Pyx_XGOTREF(__pyx_t_5);
20737 __Pyx_XGOTREF(__pyx_t_6);
20738 __Pyx_XGOTREF(__pyx_t_7);
20739
20740 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1081
20741 * __pyx_import_array()
20742 * except Exception:
20743 * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
20744 *
20745 * cdef inline int import_umath() except -1:
20746*/
20747 __pyx_t_9 = NULL;
20748 __pyx_t_10 = 1;
20749 {
20750 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
20751 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
20752 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20753 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1081, __pyx_L5_except_error)
20754 __Pyx_GOTREF(__pyx_t_8);
20755 }
20756 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20757 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20758 __PYX_ERR(2, 1081, __pyx_L5_except_error)
20759 }
20760 goto __pyx_L5_except_error;
20761
20762 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
20763 * # Cython code.
20764 * cdef inline int import_array() except -1:
20765 * try: # <<<<<<<<<<<<<<
20766 * __pyx_import_array()
20767 * except Exception:
20768*/
20769 __pyx_L5_except_error:;
20770 __Pyx_XGIVEREF(__pyx_t_1);
20771 __Pyx_XGIVEREF(__pyx_t_2);
20772 __Pyx_XGIVEREF(__pyx_t_3);
20773 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20774 goto __pyx_L1_error;
20775 __pyx_L8_try_end:;
20776 }
20777
20778 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
20779 * # Versions of the import_* functions which are more suitable for
20780 * # Cython code.
20781 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20782 * try:
20783 * __pyx_import_array()
20784*/
20785
20786 /* function exit code */
20787 __pyx_r = 0;
20788 goto __pyx_L0;
20789 __pyx_L1_error:;
20790 __Pyx_XDECREF(__pyx_t_5);
20791 __Pyx_XDECREF(__pyx_t_6);
20792 __Pyx_XDECREF(__pyx_t_7);
20793 __Pyx_XDECREF(__pyx_t_8);
20794 __Pyx_XDECREF(__pyx_t_9);
20795 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20796 __pyx_r = -1;
20797 __pyx_L0:;
20798
20799 __Pyx_RefNannyFinishContext();
20800 return __pyx_r;
20801}
20802
20803/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
20804 * raise ImportError("numpy._core.multiarray failed to import")
20805 *
20806 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
20807 * try:
20808 * _import_umath()
20809*/
20810
20811static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20812 int __pyx_r;
20813 __Pyx_RefNannyDeclarations
20814 PyObject *__pyx_t_1 = NULL;
20815 PyObject *__pyx_t_2 = NULL;
20816 PyObject *__pyx_t_3 = NULL;
20817 int __pyx_t_4;
20818 PyObject *__pyx_t_5 = NULL;
20819 PyObject *__pyx_t_6 = NULL;
20820 PyObject *__pyx_t_7 = NULL;
20821 PyObject *__pyx_t_8 = NULL;
20822 PyObject *__pyx_t_9 = NULL;
20823 size_t __pyx_t_10;
20824 int __pyx_lineno = 0;
20825 const char *__pyx_filename = NULL;
20826 int __pyx_clineno = 0;
20827 __Pyx_RefNannySetupContext("import_umath", 0);
20828
20829 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
20830 *
20831 * cdef inline int import_umath() except -1:
20832 * try: # <<<<<<<<<<<<<<
20833 * _import_umath()
20834 * except Exception:
20835*/
20836 {
20837 __Pyx_PyThreadState_declare
20838 __Pyx_PyThreadState_assign
20839 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20840 __Pyx_XGOTREF(__pyx_t_1);
20841 __Pyx_XGOTREF(__pyx_t_2);
20842 __Pyx_XGOTREF(__pyx_t_3);
20843 /*try:*/ {
20844
20845 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1085
20846 * cdef inline int import_umath() except -1:
20847 * try:
20848 * _import_umath() # <<<<<<<<<<<<<<
20849 * except Exception:
20850 * raise ImportError("numpy._core.umath failed to import")
20851*/
20852 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1085, __pyx_L3_error)
20853
20854
20855 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
20856 *
20857 * cdef inline int import_umath() except -1:
20858 * try: # <<<<<<<<<<<<<<
20859 * _import_umath()
20860 * except Exception:
20861*/
20862 }
20863 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20864 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20865 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20866 goto __pyx_L8_try_end;
20867 __pyx_L3_error:;
20868
20869 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1086
20870 * try:
20871 * _import_umath()
20872 * except Exception: # <<<<<<<<<<<<<<
20873 * raise ImportError("numpy._core.umath failed to import")
20874 *
20875*/
20876 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20877 if (__pyx_t_4) {
20878 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20879 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1086, __pyx_L5_except_error)
20880 __Pyx_XGOTREF(__pyx_t_5);
20881 __Pyx_XGOTREF(__pyx_t_6);
20882 __Pyx_XGOTREF(__pyx_t_7);
20883
20884 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1087
20885 * _import_umath()
20886 * except Exception:
20887 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
20888 *
20889 * cdef inline int import_ufunc() except -1:
20890*/
20891 __pyx_t_9 = NULL;
20892 __pyx_t_10 = 1;
20893 {
20894 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
20895 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
20896 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20897 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1087, __pyx_L5_except_error)
20898 __Pyx_GOTREF(__pyx_t_8);
20899 }
20900 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20901 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20902 __PYX_ERR(2, 1087, __pyx_L5_except_error)
20903 }
20904 goto __pyx_L5_except_error;
20905
20906 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
20907 *
20908 * cdef inline int import_umath() except -1:
20909 * try: # <<<<<<<<<<<<<<
20910 * _import_umath()
20911 * except Exception:
20912*/
20913 __pyx_L5_except_error:;
20914 __Pyx_XGIVEREF(__pyx_t_1);
20915 __Pyx_XGIVEREF(__pyx_t_2);
20916 __Pyx_XGIVEREF(__pyx_t_3);
20917 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20918 goto __pyx_L1_error;
20919 __pyx_L8_try_end:;
20920 }
20921
20922 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
20923 * raise ImportError("numpy._core.multiarray failed to import")
20924 *
20925 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
20926 * try:
20927 * _import_umath()
20928*/
20929
20930 /* function exit code */
20931 __pyx_r = 0;
20932 goto __pyx_L0;
20933 __pyx_L1_error:;
20934 __Pyx_XDECREF(__pyx_t_5);
20935 __Pyx_XDECREF(__pyx_t_6);
20936 __Pyx_XDECREF(__pyx_t_7);
20937 __Pyx_XDECREF(__pyx_t_8);
20938 __Pyx_XDECREF(__pyx_t_9);
20939 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20940 __pyx_r = -1;
20941 __pyx_L0:;
20942
20943 __Pyx_RefNannyFinishContext();
20944 return __pyx_r;
20945}
20946
20947/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
20948 * raise ImportError("numpy._core.umath failed to import")
20949 *
20950 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
20951 * try:
20952 * _import_umath()
20953*/
20954
20955static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20956 int __pyx_r;
20957 __Pyx_RefNannyDeclarations
20958 PyObject *__pyx_t_1 = NULL;
20959 PyObject *__pyx_t_2 = NULL;
20960 PyObject *__pyx_t_3 = NULL;
20961 int __pyx_t_4;
20962 PyObject *__pyx_t_5 = NULL;
20963 PyObject *__pyx_t_6 = NULL;
20964 PyObject *__pyx_t_7 = NULL;
20965 PyObject *__pyx_t_8 = NULL;
20966 PyObject *__pyx_t_9 = NULL;
20967 size_t __pyx_t_10;
20968 int __pyx_lineno = 0;
20969 const char *__pyx_filename = NULL;
20970 int __pyx_clineno = 0;
20971 __Pyx_RefNannySetupContext("import_ufunc", 0);
20972
20973 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
20974 *
20975 * cdef inline int import_ufunc() except -1:
20976 * try: # <<<<<<<<<<<<<<
20977 * _import_umath()
20978 * except Exception:
20979*/
20980 {
20981 __Pyx_PyThreadState_declare
20982 __Pyx_PyThreadState_assign
20983 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20984 __Pyx_XGOTREF(__pyx_t_1);
20985 __Pyx_XGOTREF(__pyx_t_2);
20986 __Pyx_XGOTREF(__pyx_t_3);
20987 /*try:*/ {
20988
20989 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1091
20990 * cdef inline int import_ufunc() except -1:
20991 * try:
20992 * _import_umath() # <<<<<<<<<<<<<<
20993 * except Exception:
20994 * raise ImportError("numpy._core.umath failed to import")
20995*/
20996 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1091, __pyx_L3_error)
20997
20998
20999 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
21000 *
21001 * cdef inline int import_ufunc() except -1:
21002 * try: # <<<<<<<<<<<<<<
21003 * _import_umath()
21004 * except Exception:
21005*/
21006 }
21007 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21008 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21009 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21010 goto __pyx_L8_try_end;
21011 __pyx_L3_error:;
21012
21013 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1092
21014 * try:
21015 * _import_umath()
21016 * except Exception: # <<<<<<<<<<<<<<
21017 * raise ImportError("numpy._core.umath failed to import")
21018 *
21019*/
21020 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
21021 if (__pyx_t_4) {
21022 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21023 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1092, __pyx_L5_except_error)
21024 __Pyx_XGOTREF(__pyx_t_5);
21025 __Pyx_XGOTREF(__pyx_t_6);
21026 __Pyx_XGOTREF(__pyx_t_7);
21027
21028 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1093
21029 * _import_umath()
21030 * except Exception:
21031 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
21032 *
21033 *
21034*/
21035 __pyx_t_9 = NULL;
21036 __pyx_t_10 = 1;
21037 {
21038 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
21039 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21040 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21041 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1093, __pyx_L5_except_error)
21042 __Pyx_GOTREF(__pyx_t_8);
21043 }
21044 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21045 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21046 __PYX_ERR(2, 1093, __pyx_L5_except_error)
21047 }
21048 goto __pyx_L5_except_error;
21049
21050 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
21051 *
21052 * cdef inline int import_ufunc() except -1:
21053 * try: # <<<<<<<<<<<<<<
21054 * _import_umath()
21055 * except Exception:
21056*/
21057 __pyx_L5_except_error:;
21058 __Pyx_XGIVEREF(__pyx_t_1);
21059 __Pyx_XGIVEREF(__pyx_t_2);
21060 __Pyx_XGIVEREF(__pyx_t_3);
21061 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21062 goto __pyx_L1_error;
21063 __pyx_L8_try_end:;
21064 }
21065
21066 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
21067 * raise ImportError("numpy._core.umath failed to import")
21068 *
21069 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
21070 * try:
21071 * _import_umath()
21072*/
21073
21074 /* function exit code */
21075 __pyx_r = 0;
21076 goto __pyx_L0;
21077 __pyx_L1_error:;
21078 __Pyx_XDECREF(__pyx_t_5);
21079 __Pyx_XDECREF(__pyx_t_6);
21080 __Pyx_XDECREF(__pyx_t_7);
21081 __Pyx_XDECREF(__pyx_t_8);
21082 __Pyx_XDECREF(__pyx_t_9);
21083 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21084 __pyx_r = -1;
21085 __pyx_L0:;
21086
21087 __Pyx_RefNannyFinishContext();
21088 return __pyx_r;
21089}
21090
21091/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
21092 *
21093 *
21094 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21095 * """
21096 * Cython equivalent of `isinstance(obj, np.timedelta64)`
21097*/
21098
21099static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
21100 int __pyx_r;
21101
21102 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1108
21103 * bool
21104 * """
21105 * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
21106 *
21107 *
21108*/
21109 {
21110
21111 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
21112 }
21113 goto __pyx_L0;
21114
21115 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
21116 *
21117 *
21118 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21119 * """
21120 * Cython equivalent of `isinstance(obj, np.timedelta64)`
21121*/
21122
21123 /* function exit code */
21124 __pyx_L0:;
21125
21126 return __pyx_r;
21127}
21128
21129/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
21130 *
21131 *
21132 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21133 * """
21134 * Cython equivalent of `isinstance(obj, np.datetime64)`
21135*/
21136
21137static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
21138 int __pyx_r;
21139
21140 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1123
21141 * bool
21142 * """
21143 * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
21144 *
21145 *
21146*/
21147 {
21148
21149 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
21150 }
21151 goto __pyx_L0;
21152
21153 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
21154 *
21155 *
21156 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21157 * """
21158 * Cython equivalent of `isinstance(obj, np.datetime64)`
21159*/
21160
21161 /* function exit code */
21162 __pyx_L0:;
21163
21164 return __pyx_r;
21165}
21166
21167/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
21168 *
21169 *
21170 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21171 * """
21172 * returns the int64 value underlying scalar numpy datetime64 object
21173*/
21174
21175static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
21176 npy_datetime __pyx_r;
21177
21178 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1133
21179 * also needed. That can be found using `get_datetime64_unit`.
21180 * """
21181 * return _PyDatetimeScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
21182 *
21183 *
21184*/
21185 {
21186
21187 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
21188 }
21189 goto __pyx_L0;
21190
21191 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
21192 *
21193 *
21194 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21195 * """
21196 * returns the int64 value underlying scalar numpy datetime64 object
21197*/
21198
21199 /* function exit code */
21200 __pyx_L0:;
21201 return __pyx_r;
21202}
21203
21204/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
21205 *
21206 *
21207 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21208 * """
21209 * returns the int64 value underlying scalar numpy timedelta64 object
21210*/
21211
21212static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
21213 npy_timedelta __pyx_r;
21214
21215 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1140
21216 * returns the int64 value underlying scalar numpy timedelta64 object
21217 * """
21218 * return _PyTimedeltaScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
21219 *
21220 *
21221*/
21222 {
21223
21224 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
21225 }
21226 goto __pyx_L0;
21227
21228 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
21229 *
21230 *
21231 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21232 * """
21233 * returns the int64 value underlying scalar numpy timedelta64 object
21234*/
21235
21236 /* function exit code */
21237 __pyx_L0:;
21238 return __pyx_r;
21239}
21240
21241/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
21242 *
21243 *
21244 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21245 * """
21246 * returns the unit part of the dtype for a numpy datetime64 object.
21247*/
21248
21249static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
21250 NPY_DATETIMEUNIT __pyx_r;
21251
21252 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1147
21253 * returns the unit part of the dtype for a numpy datetime64 object.
21254 * """
21255 * return _PyDatetimeScalarObject_GetMetadata(obj).base # <<<<<<<<<<<<<<
21256 *
21257 *
21258*/
21259 {
21260
21261 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
21262 }
21263 goto __pyx_L0;
21264
21265 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
21266 *
21267 *
21268 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21269 * """
21270 * returns the unit part of the dtype for a numpy datetime64 object.
21271*/
21272
21273 /* function exit code */
21274 __pyx_L0:;
21275 return __pyx_r;
21276}
21277
21278/* "superluWrappers.pyx":15
21279 * class SparseMatrix(object):
21280 *
21281 * def __init__(self, # <<<<<<<<<<<<<<
21282 * nr,
21283 * nc,
21284*/
21285
21286/* Python wrapper */
21287static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self,
21288#if CYTHON_VECTORCALL
21289PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21290#else
21291PyObject *__pyx_args, PyObject *__pyx_kwds
21292#endif
21293); /*proto*/
21294static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21295static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self,
21296#if CYTHON_VECTORCALL
21297PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21298#else
21299PyObject *__pyx_args, PyObject *__pyx_kwds
21300#endif
21301) {
21302 PyObject *__pyx_v_self = 0;
21303 PyObject *__pyx_v_nr = 0;
21304 PyObject *__pyx_v_nc = 0;
21305 PyObject *__pyx_v_nnz = 0;
21306 PyObject *__pyx_v_nzvals = 0;
21307 PyObject *__pyx_v_colind = 0;
21308 PyObject *__pyx_v_rowptr = 0;
21309 #if !CYTHON_VECTORCALL
21310 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21311 #endif
21312 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21313 PyObject* values[7] = {0,0,0,0,0,0,0};
21314 int __pyx_lineno = 0;
21315 const char *__pyx_filename = NULL;
21316 int __pyx_clineno = 0;
21317 PyObject *__pyx_r = 0;
21318 __Pyx_RefNannyDeclarations
21319 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
21320 #if !CYTHON_VECTORCALL
21321 #if CYTHON_ASSUME_SAFE_SIZE
21322 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21323 #else
21324 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21325 #endif
21326 #endif
21327 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21328 {
21329 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_nr,&__pyx_mstate_global->__pyx_n_u_nc,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_nzvals,&__pyx_mstate_global->__pyx_n_u_colind,&__pyx_mstate_global->__pyx_n_u_rowptr,0};
21330 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21331 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 15, __pyx_L3_error)
21332 if (__pyx_kwds_len > 0) {
21333 switch (__pyx_nargs) {
21334 case 7:
21335 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
21336 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 15, __pyx_L3_error)
21337 CYTHON_FALLTHROUGH;
21338 case 6:
21339 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
21340 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 15, __pyx_L3_error)
21341 CYTHON_FALLTHROUGH;
21342 case 5:
21343 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21344 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 15, __pyx_L3_error)
21345 CYTHON_FALLTHROUGH;
21346 case 4:
21347 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21348 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 15, __pyx_L3_error)
21349 CYTHON_FALLTHROUGH;
21350 case 3:
21351 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21352 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 15, __pyx_L3_error)
21353 CYTHON_FALLTHROUGH;
21354 case 2:
21355 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21356 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 15, __pyx_L3_error)
21357 CYTHON_FALLTHROUGH;
21358 case 1:
21359 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21360 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 15, __pyx_L3_error)
21361 CYTHON_FALLTHROUGH;
21362 case 0: break;
21363 default: goto __pyx_L5_argtuple_error;
21364 }
21365 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21366 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 15, __pyx_L3_error)
21367 for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
21368 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, i); __PYX_ERR(0, 15, __pyx_L3_error) }
21369 }
21370 } else if (unlikely(__pyx_nargs != 7)) {
21371 goto __pyx_L5_argtuple_error;
21372 } else {
21373 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21374 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 15, __pyx_L3_error)
21375 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21376 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 15, __pyx_L3_error)
21377 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21378 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 15, __pyx_L3_error)
21379 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21380 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 15, __pyx_L3_error)
21381 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21382 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 15, __pyx_L3_error)
21383 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
21384 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 15, __pyx_L3_error)
21385 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
21386 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 15, __pyx_L3_error)
21387 }
21388 __pyx_v_self = values[0];
21389 __pyx_v_nr = values[1];
21390 __pyx_v_nc = values[2];
21391 __pyx_v_nnz = values[3];
21392 __pyx_v_nzvals = values[4];
21393 __pyx_v_colind = values[5];
21394 __pyx_v_rowptr = values[6];
21395 }
21396 goto __pyx_L6_skip;
21397 __pyx_L5_argtuple_error:;
21398 __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 15, __pyx_L3_error)
21399 __pyx_L6_skip:;
21400 goto __pyx_L4_argument_unpacking_done;
21401 __pyx_L3_error:;
21402 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21403 Py_XDECREF(values[__pyx_temp]);
21404 }
21405 __Pyx_AddTraceback("superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21406 __Pyx_RefNannyFinishContext();
21407 return NULL;
21408 __pyx_L4_argument_unpacking_done:;
21409 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix___init__(__pyx_self, __pyx_v_self, __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzvals, __pyx_v_colind, __pyx_v_rowptr);
21410
21411 /* function exit code */
21412 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21413 Py_XDECREF(values[__pyx_temp]);
21414 }
21415 __Pyx_RefNannyFinishContext();
21416 return __pyx_r;
21417}
21418
21419static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr) {
21420 PyObject *__pyx_r = NULL;
21421 __Pyx_RefNannyDeclarations
21422 PyObject *__pyx_t_1 = NULL;
21423 PyObject *__pyx_t_2 = NULL;
21424 PyObject *__pyx_t_3 = NULL;
21425 PyObject *__pyx_t_4 = NULL;
21426 PyObject *__pyx_t_5 = NULL;
21427 size_t __pyx_t_6;
21428 int __pyx_lineno = 0;
21429 const char *__pyx_filename = NULL;
21430 int __pyx_clineno = 0;
21431 __Pyx_RefNannySetupContext("__init__", 0);
21432
21433 /* "superluWrappers.pyx":22
21434 * colind,
21435 * rowptr):
21436 * self.nr = nr ; self.nc = nc # <<<<<<<<<<<<<<
21437 * self.nnz = nnz
21438 * self.shape = [self.nr, self.nc]
21439*/
21440 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr, __pyx_v_nr) < (0)) __PYX_ERR(0, 22, __pyx_L1_error)
21441 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nc, __pyx_v_nc) < (0)) __PYX_ERR(0, 22, __pyx_L1_error)
21442
21443 /* "superluWrappers.pyx":23
21444 * rowptr):
21445 * self.nr = nr ; self.nc = nc
21446 * self.nnz = nnz # <<<<<<<<<<<<<<
21447 * self.shape = [self.nr, self.nc]
21448 * self.nzvals = nzvals
21449*/
21450 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nnz, __pyx_v_nnz) < (0)) __PYX_ERR(0, 23, __pyx_L1_error)
21451
21452 /* "superluWrappers.pyx":24
21453 * self.nr = nr ; self.nc = nc
21454 * self.nnz = nnz
21455 * self.shape = [self.nr, self.nc] # <<<<<<<<<<<<<<
21456 * self.nzvals = nzvals
21457 * self.colind = colind
21458*/
21459 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
21460 __Pyx_GOTREF(__pyx_t_1);
21461 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
21462 __Pyx_GOTREF(__pyx_t_2);
21463 __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
21464 __Pyx_GOTREF(__pyx_t_3);
21465 __Pyx_GIVEREF(__pyx_t_1);
21466 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 24, __pyx_L1_error);
21467 __Pyx_GIVEREF(__pyx_t_2);
21468 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 24, __pyx_L1_error);
21469 __pyx_t_1 = 0;
21470 __pyx_t_2 = 0;
21471 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_shape, __pyx_t_3) < (0)) __PYX_ERR(0, 24, __pyx_L1_error)
21472 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21473
21474 /* "superluWrappers.pyx":25
21475 * self.nnz = nnz
21476 * self.shape = [self.nr, self.nc]
21477 * self.nzvals = nzvals # <<<<<<<<<<<<<<
21478 * self.colind = colind
21479 * self.rowptr = rowptr
21480*/
21481 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nzvals, __pyx_v_nzvals) < (0)) __PYX_ERR(0, 25, __pyx_L1_error)
21482
21483 /* "superluWrappers.pyx":26
21484 * self.shape = [self.nr, self.nc]
21485 * self.nzvals = nzvals
21486 * self.colind = colind # <<<<<<<<<<<<<<
21487 * self.rowptr = rowptr
21488 * self._cSparseMatrix = cSparseMatrix(nr,
21489*/
21490 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_colind, __pyx_v_colind) < (0)) __PYX_ERR(0, 26, __pyx_L1_error)
21491
21492 /* "superluWrappers.pyx":27
21493 * self.nzvals = nzvals
21494 * self.colind = colind
21495 * self.rowptr = rowptr # <<<<<<<<<<<<<<
21496 * self._cSparseMatrix = cSparseMatrix(nr,
21497 * nc,
21498*/
21499 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr, __pyx_v_rowptr) < (0)) __PYX_ERR(0, 27, __pyx_L1_error)
21500
21501 /* "superluWrappers.pyx":28
21502 * self.colind = colind
21503 * self.rowptr = rowptr
21504 * self._cSparseMatrix = cSparseMatrix(nr, # <<<<<<<<<<<<<<
21505 * nc,
21506 * nnz,
21507*/
21508 __pyx_t_2 = NULL;
21509
21510 /* "superluWrappers.pyx":31
21511 * nc,
21512 * nnz,
21513 * self.nzvals, # <<<<<<<<<<<<<<
21514 * self.colind,
21515 * self.rowptr)
21516*/
21517 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nzvals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
21518 __Pyx_GOTREF(__pyx_t_1);
21519
21520 /* "superluWrappers.pyx":32
21521 * nnz,
21522 * self.nzvals,
21523 * self.colind, # <<<<<<<<<<<<<<
21524 * self.rowptr)
21525 *
21526*/
21527 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_colind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error)
21528 __Pyx_GOTREF(__pyx_t_4);
21529
21530 /* "superluWrappers.pyx":33
21531 * self.nzvals,
21532 * self.colind,
21533 * self.rowptr) # <<<<<<<<<<<<<<
21534 *
21535 * def matvec(self, x, y):
21536*/
21537 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error)
21538 __Pyx_GOTREF(__pyx_t_5);
21539 __pyx_t_6 = 1;
21540 {
21541 PyObject *__pyx_callargs[7] = {__pyx_t_2, __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_t_1, __pyx_t_4, __pyx_t_5};
21542 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_15superluWrappers_cSparseMatrix, __pyx_callargs+__pyx_t_6, (7-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21543 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21544 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21545 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21546 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21547 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
21548 __Pyx_GOTREF((PyObject *)__pyx_t_3);
21549 }
21550
21551 /* "superluWrappers.pyx":28
21552 * self.colind = colind
21553 * self.rowptr = rowptr
21554 * self._cSparseMatrix = cSparseMatrix(nr, # <<<<<<<<<<<<<<
21555 * nc,
21556 * nnz,
21557*/
21558 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_cSparseMatrix, ((PyObject *)__pyx_t_3)) < (0)) __PYX_ERR(0, 28, __pyx_L1_error)
21559 __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
21560
21561 /* "superluWrappers.pyx":15
21562 * class SparseMatrix(object):
21563 *
21564 * def __init__(self, # <<<<<<<<<<<<<<
21565 * nr,
21566 * nc,
21567*/
21568
21569 /* function exit code */
21570 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21571 goto __pyx_L0;
21572 __pyx_L1_error:;
21573 __Pyx_XDECREF(__pyx_t_1);
21574 __Pyx_XDECREF(__pyx_t_2);
21575 __Pyx_XDECREF(__pyx_t_3);
21576 __Pyx_XDECREF(__pyx_t_4);
21577 __Pyx_XDECREF(__pyx_t_5);
21578 __Pyx_AddTraceback("superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21579 __pyx_r = NULL;
21580 __pyx_L0:;
21581 __Pyx_XGIVEREF(__pyx_r);
21582 __Pyx_RefNannyFinishContext();
21583 return __pyx_r;
21584}
21585
21586/* "superluWrappers.pyx":35
21587 * self.rowptr)
21588 *
21589 * def matvec(self, x, y): # <<<<<<<<<<<<<<
21590 * """
21591 * Compute the sparse matrix-vector product y = Ax
21592*/
21593
21594/* Python wrapper */
21595static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self,
21596#if CYTHON_VECTORCALL
21597PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21598#else
21599PyObject *__pyx_args, PyObject *__pyx_kwds
21600#endif
21601); /*proto*/
21602PyDoc_STRVAR(__pyx_doc_15superluWrappers_12SparseMatrix_2matvec, "\n Compute the sparse matrix-vector product y = Ax\n\n Arguments\n ---------\n x (input) : numpy array\n y (output) : numpy array\n ");
21603static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_3matvec = {"matvec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_3matvec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_2matvec};
21604static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self,
21605#if CYTHON_VECTORCALL
21606PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21607#else
21608PyObject *__pyx_args, PyObject *__pyx_kwds
21609#endif
21610) {
21611 PyObject *__pyx_v_self = 0;
21612 PyObject *__pyx_v_x = 0;
21613 PyObject *__pyx_v_y = 0;
21614 #if !CYTHON_VECTORCALL
21615 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21616 #endif
21617 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21618 PyObject* values[3] = {0,0,0};
21619 int __pyx_lineno = 0;
21620 const char *__pyx_filename = NULL;
21621 int __pyx_clineno = 0;
21622 PyObject *__pyx_r = 0;
21623 __Pyx_RefNannyDeclarations
21624 __Pyx_RefNannySetupContext("matvec (wrapper)", 0);
21625 #if !CYTHON_VECTORCALL
21626 #if CYTHON_ASSUME_SAFE_SIZE
21627 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21628 #else
21629 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21630 #endif
21631 #endif
21632 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21633 {
21634 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
21635 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21636 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
21637 if (__pyx_kwds_len > 0) {
21638 switch (__pyx_nargs) {
21639 case 3:
21640 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21641 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 35, __pyx_L3_error)
21642 CYTHON_FALLTHROUGH;
21643 case 2:
21644 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21645 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 35, __pyx_L3_error)
21646 CYTHON_FALLTHROUGH;
21647 case 1:
21648 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21649 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 35, __pyx_L3_error)
21650 CYTHON_FALLTHROUGH;
21651 case 0: break;
21652 default: goto __pyx_L5_argtuple_error;
21653 }
21654 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21655 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "matvec", 0) < (0)) __PYX_ERR(0, 35, __pyx_L3_error)
21656 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
21657 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, i); __PYX_ERR(0, 35, __pyx_L3_error) }
21658 }
21659 } else if (unlikely(__pyx_nargs != 3)) {
21660 goto __pyx_L5_argtuple_error;
21661 } else {
21662 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21663 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 35, __pyx_L3_error)
21664 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21665 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 35, __pyx_L3_error)
21666 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21667 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 35, __pyx_L3_error)
21668 }
21669 __pyx_v_self = values[0];
21670 __pyx_v_x = values[1];
21671 __pyx_v_y = values[2];
21672 }
21673 goto __pyx_L6_skip;
21674 __pyx_L5_argtuple_error:;
21675 __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 35, __pyx_L3_error)
21676 __pyx_L6_skip:;
21677 goto __pyx_L4_argument_unpacking_done;
21678 __pyx_L3_error:;
21679 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21680 Py_XDECREF(values[__pyx_temp]);
21681 }
21682 __Pyx_AddTraceback("superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
21683 __Pyx_RefNannyFinishContext();
21684 return NULL;
21685 __pyx_L4_argument_unpacking_done:;
21686 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_2matvec(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);
21687
21688 /* function exit code */
21689 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21690 Py_XDECREF(values[__pyx_temp]);
21691 }
21692 __Pyx_RefNannyFinishContext();
21693 return __pyx_r;
21694}
21695
21696static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
21697 PyObject *__pyx_r = NULL;
21698 __Pyx_RefNannyDeclarations
21699 PyObject *__pyx_t_1 = NULL;
21700 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
21701 __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
21702 int __pyx_lineno = 0;
21703 const char *__pyx_filename = NULL;
21704 int __pyx_clineno = 0;
21705 __Pyx_RefNannySetupContext("matvec", 0);
21706
21707 /* "superluWrappers.pyx":44
21708 * y (output) : numpy array
21709 * """
21710 * SparseMatrix_matvec(self._cSparseMatrix, x, y) # <<<<<<<<<<<<<<
21711 *
21712 * def fwrite(self, filename, base):
21713*/
21714 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
21715 __Pyx_GOTREF(__pyx_t_1);
21716 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 44, __pyx_L1_error)
21717 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
21718 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_y, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
21719 __pyx_f_15superluWrappers_SparseMatrix_matvec(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error)
21720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21721 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);; __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
21722 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL;
21723
21724 /* "superluWrappers.pyx":35
21725 * self.rowptr)
21726 *
21727 * def matvec(self, x, y): # <<<<<<<<<<<<<<
21728 * """
21729 * Compute the sparse matrix-vector product y = Ax
21730*/
21731
21732 /* function exit code */
21733 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21734 goto __pyx_L0;
21735 __pyx_L1_error:;
21736 __Pyx_XDECREF(__pyx_t_1);
21737 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
21738 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
21739 __Pyx_AddTraceback("superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
21740 __pyx_r = NULL;
21741 __pyx_L0:;
21742 __Pyx_XGIVEREF(__pyx_r);
21743 __Pyx_RefNannyFinishContext();
21744 return __pyx_r;
21745}
21746
21747/* "superluWrappers.pyx":46
21748 * SparseMatrix_matvec(self._cSparseMatrix, x, y)
21749 *
21750 * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
21751 * """ Write the sparse matrix to a file
21752 *
21753*/
21754
21755/* Python wrapper */
21756static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self,
21757#if CYTHON_VECTORCALL
21758PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21759#else
21760PyObject *__pyx_args, PyObject *__pyx_kwds
21761#endif
21762); /*proto*/
21763PyDoc_STRVAR(__pyx_doc_15superluWrappers_12SparseMatrix_4fwrite, " Write the sparse matrix to a file\n\n Arguments\n ---------\n filename : str\n The output filename\n base : int\n ?!Possibly something to do with parallel?!\n ");
21764static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite = {"fwrite", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite};
21765static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self,
21766#if CYTHON_VECTORCALL
21767PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21768#else
21769PyObject *__pyx_args, PyObject *__pyx_kwds
21770#endif
21771) {
21772 PyObject *__pyx_v_self = 0;
21773 PyObject *__pyx_v_filename = 0;
21774 PyObject *__pyx_v_base = 0;
21775 #if !CYTHON_VECTORCALL
21776 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21777 #endif
21778 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21779 PyObject* values[3] = {0,0,0};
21780 int __pyx_lineno = 0;
21781 const char *__pyx_filename = NULL;
21782 int __pyx_clineno = 0;
21783 PyObject *__pyx_r = 0;
21784 __Pyx_RefNannyDeclarations
21785 __Pyx_RefNannySetupContext("fwrite (wrapper)", 0);
21786 #if !CYTHON_VECTORCALL
21787 #if CYTHON_ASSUME_SAFE_SIZE
21788 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21789 #else
21790 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21791 #endif
21792 #endif
21793 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21794 {
21795 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_filename,&__pyx_mstate_global->__pyx_n_u_base,0};
21796 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21797 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 46, __pyx_L3_error)
21798 if (__pyx_kwds_len > 0) {
21799 switch (__pyx_nargs) {
21800 case 3:
21801 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21802 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 46, __pyx_L3_error)
21803 CYTHON_FALLTHROUGH;
21804 case 2:
21805 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21806 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 46, __pyx_L3_error)
21807 CYTHON_FALLTHROUGH;
21808 case 1:
21809 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21810 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 46, __pyx_L3_error)
21811 CYTHON_FALLTHROUGH;
21812 case 0: break;
21813 default: goto __pyx_L5_argtuple_error;
21814 }
21815 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21816 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "fwrite", 0) < (0)) __PYX_ERR(0, 46, __pyx_L3_error)
21817 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
21818 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, i); __PYX_ERR(0, 46, __pyx_L3_error) }
21819 }
21820 } else if (unlikely(__pyx_nargs != 3)) {
21821 goto __pyx_L5_argtuple_error;
21822 } else {
21823 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21824 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 46, __pyx_L3_error)
21825 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21826 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 46, __pyx_L3_error)
21827 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21828 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 46, __pyx_L3_error)
21829 }
21830 __pyx_v_self = values[0];
21831 __pyx_v_filename = values[1];
21832 __pyx_v_base = values[2];
21833 }
21834 goto __pyx_L6_skip;
21835 __pyx_L5_argtuple_error:;
21836 __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 46, __pyx_L3_error)
21837 __pyx_L6_skip:;
21838 goto __pyx_L4_argument_unpacking_done;
21839 __pyx_L3_error:;
21840 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21841 Py_XDECREF(values[__pyx_temp]);
21842 }
21843 __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
21844 __Pyx_RefNannyFinishContext();
21845 return NULL;
21846 __pyx_L4_argument_unpacking_done:;
21847 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(__pyx_self, __pyx_v_self, __pyx_v_filename, __pyx_v_base);
21848
21849 /* function exit code */
21850 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21851 Py_XDECREF(values[__pyx_temp]);
21852 }
21853 __Pyx_RefNannyFinishContext();
21854 return __pyx_r;
21855}
21856
21857static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base) {
21858 PyObject *__pyx_v_output_file = NULL;
21859 PyObject *__pyx_v_i = NULL;
21860 PyObject *__pyx_v_k = NULL;
21861 PyObject *__pyx_r = NULL;
21862 __Pyx_RefNannyDeclarations
21863 PyObject *__pyx_t_1 = NULL;
21864 PyObject *__pyx_t_2 = NULL;
21865 size_t __pyx_t_3;
21866 PyObject *__pyx_t_4 = NULL;
21867 PyObject *__pyx_t_5 = NULL;
21868 PyObject *__pyx_t_6 = NULL;
21869 PyObject *__pyx_t_7 = NULL;
21870 PyObject *__pyx_t_8 = NULL;
21871 PyObject *__pyx_t_9 = NULL;
21872 PyObject *__pyx_t_10 = NULL;
21873 PyObject *__pyx_t_11 = NULL;
21874 PyObject *__pyx_t_12 = NULL;
21875 PyObject *(*__pyx_t_13)(PyObject *);
21876 PyObject *(*__pyx_t_14)(PyObject *);
21877 PyObject *__pyx_t_15 = NULL;
21878 PyObject *__pyx_t_16 = NULL;
21879 int __pyx_t_17;
21880 int __pyx_t_18;
21881 int __pyx_lineno = 0;
21882 const char *__pyx_filename = NULL;
21883 int __pyx_clineno = 0;
21884 __Pyx_RefNannySetupContext("fwrite", 0);
21885
21886 /* "superluWrappers.pyx":56
21887 * ?!Possibly something to do with parallel?!
21888 * """
21889 * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
21890 * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
21891 * for i in range(self.nr):
21892*/
21893 /*with:*/ {
21894 __pyx_t_2 = NULL;
21895 __pyx_t_3 = 1;
21896 {
21897 PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_w};
21898 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21899 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21900 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
21901 __Pyx_GOTREF(__pyx_t_1);
21902 }
21903 __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error)
21904 __Pyx_GOTREF(__pyx_t_4);
21905 __pyx_t_5 = NULL;
21906 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L3_error)
21907 __Pyx_GOTREF(__pyx_t_6);
21908 __pyx_t_3 = 1;
21909 #if CYTHON_UNPACK_METHODS
21910 if (likely(PyMethod_Check(__pyx_t_6))) {
21911 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
21912 assert(__pyx_t_5);
21913 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
21914 __Pyx_INCREF(__pyx_t_5);
21915 __Pyx_INCREF(__pyx__function);
21916 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
21917 __pyx_t_3 = 0;
21918 }
21919 #endif
21920 {
21921 PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
21922 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21923 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21924 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21925 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L3_error)
21926 __Pyx_GOTREF(__pyx_t_2);
21927 }
21928 __pyx_t_6 = __pyx_t_2;
21929 __pyx_t_2 = 0;
21930 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21931 /*try:*/ {
21932 {
21933 __Pyx_PyThreadState_declare
21934 __Pyx_PyThreadState_assign
21935 __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
21936 __Pyx_XGOTREF(__pyx_t_7);
21937 __Pyx_XGOTREF(__pyx_t_8);
21938 __Pyx_XGOTREF(__pyx_t_9);
21939 /*try:*/ {
21940 __pyx_v_output_file = __pyx_t_6;
21941 __pyx_t_6 = 0;
21942
21943 /* "superluWrappers.pyx":57
21944 * """
21945 * with open(filename, 'w') as output_file:
21946 * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) ) # <<<<<<<<<<<<<<
21947 * for i in range(self.nr):
21948 * for k in range(self.rowptr[i], self.rowptr[i+1]):
21949*/
21950 __pyx_t_1 = __pyx_v_output_file;
21951 __Pyx_INCREF(__pyx_t_1);
21952 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L7_error)
21953 __Pyx_GOTREF(__pyx_t_2);
21954 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L7_error)
21955 __Pyx_GOTREF(__pyx_t_5);
21956 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
21957 __Pyx_GOTREF(__pyx_t_10);
21958 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
21959 __Pyx_GOTREF(__pyx_t_11);
21960 __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 57, __pyx_L7_error)
21961 __Pyx_GOTREF(__pyx_t_12);
21962 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21963 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
21964 __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
21965 __Pyx_GOTREF(__pyx_t_11);
21966 __Pyx_GIVEREF(__pyx_t_2);
21967 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 57, __pyx_L7_error);
21968 __Pyx_GIVEREF(__pyx_t_5);
21969 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 57, __pyx_L7_error);
21970 __Pyx_GIVEREF(__pyx_t_12);
21971 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_12) != (0)) __PYX_ERR(0, 57, __pyx_L7_error);
21972 __pyx_t_2 = 0;
21973 __pyx_t_5 = 0;
21974 __pyx_t_12 = 0;
21975 __pyx_t_12 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_i_i_i, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 57, __pyx_L7_error)
21976 __Pyx_GOTREF(__pyx_t_12);
21977 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
21978 __pyx_t_3 = 0;
21979 {
21980 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_12};
21981 __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21982 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21983 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21984 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 57, __pyx_L7_error)
21985 __Pyx_GOTREF(__pyx_t_6);
21986 }
21987 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21988
21989 /* "superluWrappers.pyx":58
21990 * with open(filename, 'w') as output_file:
21991 * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
21992 * for i in range(self.nr): # <<<<<<<<<<<<<<
21993 * for k in range(self.rowptr[i], self.rowptr[i+1]):
21994 * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
21995*/
21996 __pyx_t_12 = NULL;
21997 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L7_error)
21998 __Pyx_GOTREF(__pyx_t_1);
21999 __pyx_t_3 = 1;
22000 {
22001 PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_1};
22002 __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22003 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22004 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22005 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L7_error)
22006 __Pyx_GOTREF(__pyx_t_6);
22007 }
22008 __pyx_t_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L7_error)
22009 __Pyx_GOTREF(__pyx_t_1);
22010 __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 58, __pyx_L7_error)
22011 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22012 for (;;) {
22013 {
22014 __pyx_t_6 = __pyx_t_13(__pyx_t_1);
22015 if (unlikely(!__pyx_t_6)) {
22016 PyObject* exc_type = PyErr_Occurred();
22017 if (exc_type) {
22018 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 58, __pyx_L7_error)
22019 PyErr_Clear();
22020 }
22021 break;
22022 }
22023 }
22024 __Pyx_GOTREF(__pyx_t_6);
22025 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
22026 __pyx_t_6 = 0;
22027
22028 /* "superluWrappers.pyx":59
22029 * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
22030 * for i in range(self.nr):
22031 * for k in range(self.rowptr[i], self.rowptr[i+1]): # <<<<<<<<<<<<<<
22032 * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
22033 *
22034*/
22035 __pyx_t_12 = NULL;
22036 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
22037 __Pyx_GOTREF(__pyx_t_11);
22038 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
22039 __Pyx_GOTREF(__pyx_t_5);
22040 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22041 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
22042 __Pyx_GOTREF(__pyx_t_11);
22043 __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
22044 __Pyx_GOTREF(__pyx_t_2);
22045 __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
22046 __Pyx_GOTREF(__pyx_t_10);
22047 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22048 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22049 __pyx_t_3 = 1;
22050 {
22051 PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_5, __pyx_t_10};
22052 __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22053 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22054 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22055 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22056 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 59, __pyx_L7_error)
22057 __Pyx_GOTREF(__pyx_t_6);
22058 }
22059 __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
22060 __Pyx_GOTREF(__pyx_t_10);
22061 __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 59, __pyx_L7_error)
22062 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22063 for (;;) {
22064 {
22065 __pyx_t_6 = __pyx_t_14(__pyx_t_10);
22066 if (unlikely(!__pyx_t_6)) {
22067 PyObject* exc_type = PyErr_Occurred();
22068 if (exc_type) {
22069 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 59, __pyx_L7_error)
22070 PyErr_Clear();
22071 }
22072 break;
22073 }
22074 }
22075 __Pyx_GOTREF(__pyx_t_6);
22076 __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6);
22077 __pyx_t_6 = 0;
22078
22079 /* "superluWrappers.pyx":60
22080 * for i in range(self.nr):
22081 * for k in range(self.rowptr[i], self.rowptr[i+1]):
22082 * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) ) # <<<<<<<<<<<<<<
22083 *
22084 * def getCSRrepresentation(self):
22085*/
22086 __pyx_t_5 = __pyx_v_output_file;
22087 __Pyx_INCREF(__pyx_t_5);
22088 __pyx_t_12 = __Pyx_PyNumber_Add_object_object(__pyx_v_i, __pyx_v_base); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 60, __pyx_L7_error)
22089 __Pyx_GOTREF(__pyx_t_12);
22090 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_colind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L7_error)
22091 __Pyx_GOTREF(__pyx_t_2);
22092 __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_k); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L7_error)
22093 __Pyx_GOTREF(__pyx_t_11);
22094 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22095 __pyx_t_2 = __Pyx_PyNumber_Add_object_object(__pyx_t_11, __pyx_v_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L7_error)
22096 __Pyx_GOTREF(__pyx_t_2);
22097 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22098 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nzvals); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L7_error)
22099 __Pyx_GOTREF(__pyx_t_11);
22100 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_v_k); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 60, __pyx_L7_error)
22101 __Pyx_GOTREF(__pyx_t_15);
22102 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22103 __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L7_error)
22104 __Pyx_GOTREF(__pyx_t_11);
22105 __Pyx_GIVEREF(__pyx_t_12);
22106 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12) != (0)) __PYX_ERR(0, 60, __pyx_L7_error);
22107 __Pyx_GIVEREF(__pyx_t_2);
22108 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 60, __pyx_L7_error);
22109 __Pyx_GIVEREF(__pyx_t_15);
22110 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_15) != (0)) __PYX_ERR(0, 60, __pyx_L7_error);
22111 __pyx_t_12 = 0;
22112 __pyx_t_2 = 0;
22113 __pyx_t_15 = 0;
22114 __pyx_t_15 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_d_d_13_8e, __pyx_t_11); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 60, __pyx_L7_error)
22115 __Pyx_GOTREF(__pyx_t_15);
22116 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22117 __pyx_t_3 = 0;
22118 {
22119 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_15};
22120 __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22121 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22122 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
22123 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 60, __pyx_L7_error)
22124 __Pyx_GOTREF(__pyx_t_6);
22125 }
22126 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22127
22128 /* "superluWrappers.pyx":59
22129 * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
22130 * for i in range(self.nr):
22131 * for k in range(self.rowptr[i], self.rowptr[i+1]): # <<<<<<<<<<<<<<
22132 * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
22133 *
22134*/
22135 }
22136 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22137
22138 /* "superluWrappers.pyx":58
22139 * with open(filename, 'w') as output_file:
22140 * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
22141 * for i in range(self.nr): # <<<<<<<<<<<<<<
22142 * for k in range(self.rowptr[i], self.rowptr[i+1]):
22143 * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
22144*/
22145 }
22146 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22147
22148 /* "superluWrappers.pyx":56
22149 * ?!Possibly something to do with parallel?!
22150 * """
22151 * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
22152 * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
22153 * for i in range(self.nr):
22154*/
22155 }
22156 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22157 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22158 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
22159 goto __pyx_L12_try_end;
22160 __pyx_L7_error:;
22161 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22162 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22163 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
22164 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22165 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
22166 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22167 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22168 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
22169 /*except:*/ {
22170 __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
22171 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_10, &__pyx_t_6) < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
22172 __Pyx_XGOTREF(__pyx_t_1);
22173 __Pyx_XGOTREF(__pyx_t_10);
22174 __Pyx_XGOTREF(__pyx_t_6);
22175 {
22176 PyObject* __pyx_temp[3] = {__pyx_t_1, __pyx_t_10, __pyx_t_6};
22177 __pyx_t_15 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 56, __pyx_L9_except_error)
22178 __Pyx_GOTREF(__pyx_t_15);
22179 }
22180 __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL);
22181 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22182 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
22183 if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 56, __pyx_L9_except_error)
22184 __Pyx_GOTREF(__pyx_t_16);
22185 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_16);
22186 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
22187 if (__pyx_t_17 < (0)) __PYX_ERR(0, 56, __pyx_L9_except_error)
22188 __pyx_t_18 = (!__pyx_t_17);
22189
22190
22191 if (unlikely(__pyx_t_18)) {
22192
22193 __Pyx_GIVEREF(__pyx_t_1);
22194 __Pyx_GIVEREF(__pyx_t_10);
22195 __Pyx_XGIVEREF(__pyx_t_6);
22196 __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_10, __pyx_t_6);
22197 __pyx_t_1 = 0; __pyx_t_10 = 0; __pyx_t_6 = 0;
22198 __PYX_ERR(0, 56, __pyx_L9_except_error)
22199 }
22200 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22201 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22202 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
22203 goto __pyx_L8_exception_handled;
22204 }
22205 __pyx_L9_except_error:;
22206 __Pyx_XGIVEREF(__pyx_t_7);
22207 __Pyx_XGIVEREF(__pyx_t_8);
22208 __Pyx_XGIVEREF(__pyx_t_9);
22209 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
22210 goto __pyx_L1_error;
22211 __pyx_L8_exception_handled:;
22212 __Pyx_XGIVEREF(__pyx_t_7);
22213 __Pyx_XGIVEREF(__pyx_t_8);
22214 __Pyx_XGIVEREF(__pyx_t_9);
22215 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
22216 __pyx_L12_try_end:;
22217 }
22218 }
22219 /*finally:*/ {
22220 /*normal exit:*/{
22221 if (__pyx_t_4) {
22222 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[2], NULL);
22223 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22224 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 56, __pyx_L1_error)
22225 __Pyx_GOTREF(__pyx_t_9);
22226 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22227 }
22228 goto __pyx_L6;
22229 }
22230 __pyx_L6:;
22231 }
22232 goto __pyx_L22;
22233 __pyx_L3_error:;
22234 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22235 goto __pyx_L1_error;
22236 __pyx_L22:;
22237 }
22238
22239 /* "superluWrappers.pyx":46
22240 * SparseMatrix_matvec(self._cSparseMatrix, x, y)
22241 *
22242 * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
22243 * """ Write the sparse matrix to a file
22244 *
22245*/
22246
22247 /* function exit code */
22248 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22249 goto __pyx_L0;
22250 __pyx_L1_error:;
22251 __Pyx_XDECREF(__pyx_t_1);
22252 __Pyx_XDECREF(__pyx_t_2);
22253 __Pyx_XDECREF(__pyx_t_5);
22254 __Pyx_XDECREF(__pyx_t_6);
22255 __Pyx_XDECREF(__pyx_t_10);
22256 __Pyx_XDECREF(__pyx_t_11);
22257 __Pyx_XDECREF(__pyx_t_12);
22258 __Pyx_XDECREF(__pyx_t_15);
22259 __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
22260 __pyx_r = NULL;
22261 __pyx_L0:;
22262 __Pyx_XDECREF(__pyx_v_output_file);
22263 __Pyx_XDECREF(__pyx_v_i);
22264 __Pyx_XDECREF(__pyx_v_k);
22265 __Pyx_XGIVEREF(__pyx_r);
22266 __Pyx_RefNannyFinishContext();
22267 return __pyx_r;
22268}
22269
22270/* "superluWrappers.pyx":62
22271 * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
22272 *
22273 * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
22274 * """ Get the CSR representation of the sparse matrix.
22275 *
22276*/
22277
22278/* Python wrapper */
22279static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self,
22280#if CYTHON_VECTORCALL
22281PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22282#else
22283PyObject *__pyx_args, PyObject *__pyx_kwds
22284#endif
22285); /*proto*/
22286PyDoc_STRVAR(__pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation, " Get the CSR representation of the sparse matrix.\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colptr, vals)\n ");
22287static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation = {"getCSRrepresentation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation};
22288static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self,
22289#if CYTHON_VECTORCALL
22290PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22291#else
22292PyObject *__pyx_args, PyObject *__pyx_kwds
22293#endif
22294) {
22295 PyObject *__pyx_v_self = 0;
22296 #if !CYTHON_VECTORCALL
22297 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22298 #endif
22299 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22300 PyObject* values[1] = {0};
22301 int __pyx_lineno = 0;
22302 const char *__pyx_filename = NULL;
22303 int __pyx_clineno = 0;
22304 PyObject *__pyx_r = 0;
22305 __Pyx_RefNannyDeclarations
22306 __Pyx_RefNannySetupContext("getCSRrepresentation (wrapper)", 0);
22307 #if !CYTHON_VECTORCALL
22308 #if CYTHON_ASSUME_SAFE_SIZE
22309 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22310 #else
22311 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22312 #endif
22313 #endif
22314 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22315 {
22316 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
22317 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22318 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 62, __pyx_L3_error)
22319 if (__pyx_kwds_len > 0) {
22320 switch (__pyx_nargs) {
22321 case 1:
22322 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22323 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 62, __pyx_L3_error)
22324 CYTHON_FALLTHROUGH;
22325 case 0: break;
22326 default: goto __pyx_L5_argtuple_error;
22327 }
22328 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22329 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getCSRrepresentation", 0) < (0)) __PYX_ERR(0, 62, __pyx_L3_error)
22330 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
22331 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getCSRrepresentation", 1, 1, 1, i); __PYX_ERR(0, 62, __pyx_L3_error) }
22332 }
22333 } else if (unlikely(__pyx_nargs != 1)) {
22334 goto __pyx_L5_argtuple_error;
22335 } else {
22336 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22337 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 62, __pyx_L3_error)
22338 }
22339 __pyx_v_self = values[0];
22340 }
22341 goto __pyx_L6_skip;
22342 __pyx_L5_argtuple_error:;
22343 __Pyx_RaiseArgtupleInvalid("getCSRrepresentation", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 62, __pyx_L3_error)
22344 __pyx_L6_skip:;
22345 goto __pyx_L4_argument_unpacking_done;
22346 __pyx_L3_error:;
22347 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22348 Py_XDECREF(values[__pyx_temp]);
22349 }
22350 __Pyx_AddTraceback("superluWrappers.SparseMatrix.getCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
22351 __Pyx_RefNannyFinishContext();
22352 return NULL;
22353 __pyx_L4_argument_unpacking_done:;
22354 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(__pyx_self, __pyx_v_self);
22355
22356 /* function exit code */
22357 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22358 Py_XDECREF(values[__pyx_temp]);
22359 }
22360 __Pyx_RefNannyFinishContext();
22361 return __pyx_r;
22362}
22363
22364static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
22365 PyObject *__pyx_r = NULL;
22366 __Pyx_RefNannyDeclarations
22367 PyObject *__pyx_t_1 = NULL;
22368 PyObject *__pyx_t_2 = NULL;
22369 PyObject *__pyx_t_3 = NULL;
22370 PyObject *__pyx_t_4 = NULL;
22371 int __pyx_lineno = 0;
22372 const char *__pyx_filename = NULL;
22373 int __pyx_clineno = 0;
22374 __Pyx_RefNannySetupContext("getCSRrepresentation", 0);
22375
22376 /* "superluWrappers.pyx":70
22377 * (rowptr, colptr, vals)
22378 * """
22379 * return (self.rowptr, self.colind, self.nzvals) # <<<<<<<<<<<<<<
22380 *
22381 * def getSubMatCSRrepresentation(self,
22382*/
22383 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
22384 __Pyx_GOTREF(__pyx_t_1);
22385 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_colind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
22386 __Pyx_GOTREF(__pyx_t_2);
22387 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nzvals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
22388 __Pyx_GOTREF(__pyx_t_3);
22389 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
22390 __Pyx_GOTREF(__pyx_t_4);
22391 __Pyx_GIVEREF(__pyx_t_1);
22392 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 70, __pyx_L1_error);
22393 __Pyx_GIVEREF(__pyx_t_2);
22394 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 70, __pyx_L1_error);
22395 __Pyx_GIVEREF(__pyx_t_3);
22396 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 70, __pyx_L1_error);
22397 __pyx_t_1 = 0;
22398 __pyx_t_2 = 0;
22399 __pyx_t_3 = 0;
22400 {
22401 PyObject *__pyx_temp;
22402 {
22403 __pyx_temp = __pyx_r;
22404 __pyx_r = __pyx_t_4;
22405 }
22406 __Pyx_XDECREF(__pyx_temp);
22407 }
22408 __pyx_t_4 = 0;
22409 goto __pyx_L0;
22410
22411 /* "superluWrappers.pyx":62
22412 * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
22413 *
22414 * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
22415 * """ Get the CSR representation of the sparse matrix.
22416 *
22417*/
22418
22419 /* function exit code */
22420 __pyx_L1_error:;
22421 __Pyx_XDECREF(__pyx_t_1);
22422 __Pyx_XDECREF(__pyx_t_2);
22423 __Pyx_XDECREF(__pyx_t_3);
22424 __Pyx_XDECREF(__pyx_t_4);
22425 __Pyx_AddTraceback("superluWrappers.SparseMatrix.getCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
22426 __pyx_r = NULL;
22427 __pyx_L0:;
22428 __Pyx_XGIVEREF(__pyx_r);
22429 __Pyx_RefNannyFinishContext();
22430 return __pyx_r;
22431}
22432
22433/* "superluWrappers.pyx":72
22434 * return (self.rowptr, self.colind, self.nzvals)
22435 *
22436 * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
22437 * range_start,
22438 * range_end):
22439*/
22440
22441/* Python wrapper */
22442static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self,
22443#if CYTHON_VECTORCALL
22444PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22445#else
22446PyObject *__pyx_args, PyObject *__pyx_kwds
22447#endif
22448); /*proto*/
22449PyDoc_STRVAR(__pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation, " Get the CSR representation for a submatrix.\n\n Arguments\n ---------\n range_start : int\n range_end : int\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colind, nzvals)\n ");
22450static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation = {"getSubMatCSRrepresentation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation};
22451static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self,
22452#if CYTHON_VECTORCALL
22453PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22454#else
22455PyObject *__pyx_args, PyObject *__pyx_kwds
22456#endif
22457) {
22458 PyObject *__pyx_v_self = 0;
22459 PyObject *__pyx_v_range_start = 0;
22460 PyObject *__pyx_v_range_end = 0;
22461 #if !CYTHON_VECTORCALL
22462 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22463 #endif
22464 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22465 PyObject* values[3] = {0,0,0};
22466 int __pyx_lineno = 0;
22467 const char *__pyx_filename = NULL;
22468 int __pyx_clineno = 0;
22469 PyObject *__pyx_r = 0;
22470 __Pyx_RefNannyDeclarations
22471 __Pyx_RefNannySetupContext("getSubMatCSRrepresentation (wrapper)", 0);
22472 #if !CYTHON_VECTORCALL
22473 #if CYTHON_ASSUME_SAFE_SIZE
22474 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22475 #else
22476 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22477 #endif
22478 #endif
22479 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22480 {
22481 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_range_start,&__pyx_mstate_global->__pyx_n_u_range_end,0};
22482 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22483 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 72, __pyx_L3_error)
22484 if (__pyx_kwds_len > 0) {
22485 switch (__pyx_nargs) {
22486 case 3:
22487 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22488 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 72, __pyx_L3_error)
22489 CYTHON_FALLTHROUGH;
22490 case 2:
22491 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22492 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 72, __pyx_L3_error)
22493 CYTHON_FALLTHROUGH;
22494 case 1:
22495 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22496 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 72, __pyx_L3_error)
22497 CYTHON_FALLTHROUGH;
22498 case 0: break;
22499 default: goto __pyx_L5_argtuple_error;
22500 }
22501 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22502 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSubMatCSRrepresentation", 0) < (0)) __PYX_ERR(0, 72, __pyx_L3_error)
22503 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
22504 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, i); __PYX_ERR(0, 72, __pyx_L3_error) }
22505 }
22506 } else if (unlikely(__pyx_nargs != 3)) {
22507 goto __pyx_L5_argtuple_error;
22508 } else {
22509 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22510 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 72, __pyx_L3_error)
22511 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22512 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 72, __pyx_L3_error)
22513 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22514 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 72, __pyx_L3_error)
22515 }
22516 __pyx_v_self = values[0];
22517 __pyx_v_range_start = values[1];
22518 __pyx_v_range_end = values[2];
22519 }
22520 goto __pyx_L6_skip;
22521 __pyx_L5_argtuple_error:;
22522 __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 72, __pyx_L3_error)
22523 __pyx_L6_skip:;
22524 goto __pyx_L4_argument_unpacking_done;
22525 __pyx_L3_error:;
22526 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22527 Py_XDECREF(values[__pyx_temp]);
22528 }
22529 __Pyx_AddTraceback("superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
22530 __Pyx_RefNannyFinishContext();
22531 return NULL;
22532 __pyx_L4_argument_unpacking_done:;
22533 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(__pyx_self, __pyx_v_self, __pyx_v_range_start, __pyx_v_range_end);
22534
22535 /* function exit code */
22536 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22537 Py_XDECREF(values[__pyx_temp]);
22538 }
22539 __Pyx_RefNannyFinishContext();
22540 return __pyx_r;
22541}
22542
22543static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end) {
22544 PyObject *__pyx_v__rows = NULL;
22545 PyObject *__pyx_v_nnz = NULL;
22546 PyObject *__pyx_v_rowptr = NULL;
22547 PyObject *__pyx_v_colind = NULL;
22548 PyObject *__pyx_v_nzvals = NULL;
22549 PyObject *__pyx_r = NULL;
22550 __Pyx_RefNannyDeclarations
22551 int __pyx_t_1;
22552 PyObject *__pyx_t_2 = NULL;
22553 PyObject *__pyx_t_3 = NULL;
22554 PyObject *__pyx_t_4 = NULL;
22555 PyObject *__pyx_t_5 = NULL;
22556 int __pyx_lineno = 0;
22557 const char *__pyx_filename = NULL;
22558 int __pyx_clineno = 0;
22559 __Pyx_RefNannySetupContext("getSubMatCSRrepresentation", 0);
22560
22561 /* "superluWrappers.pyx":87
22562 * (rowptr, colind, nzvals)
22563 * """
22564 * assert range_start >= 0 ; assert range_end <= self.nr # <<<<<<<<<<<<<<
22565 * assert range_end > range_start
22566 * _rows = range_end - range_start
22567*/
22568 #ifndef CYTHON_WITHOUT_ASSERTIONS
22569 if (unlikely(__pyx_assertions_enabled())) {
22570 __pyx_t_1 = __Pyx_PyObject_CompareBoolGe_object_int(__pyx_v_range_start, __pyx_mstate_global->__pyx_int_0, Py_GE); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 87, __pyx_L1_error)
22571 if (unlikely(!__pyx_t_1)) {
22572 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
22573 __PYX_ERR(0, 87, __pyx_L1_error)
22574 }
22575
22576 }
22577 #else
22578 if ((1)); else __PYX_ERR(0, 87, __pyx_L1_error)
22579 #endif
22580 #ifndef CYTHON_WITHOUT_ASSERTIONS
22581 if (unlikely(__pyx_assertions_enabled())) {
22582 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
22583 __Pyx_GOTREF(__pyx_t_2);
22584 __pyx_t_1 = __Pyx_PyObject_CompareBoolLe_object_object(__pyx_v_range_end, __pyx_t_2, Py_LE); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 87, __pyx_L1_error)
22585 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22586 if (unlikely(!__pyx_t_1)) {
22587 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
22588 __PYX_ERR(0, 87, __pyx_L1_error)
22589 }
22590
22591 }
22592 #else
22593 if ((1)); else __PYX_ERR(0, 87, __pyx_L1_error)
22594 #endif
22595
22596 /* "superluWrappers.pyx":88
22597 * """
22598 * assert range_start >= 0 ; assert range_end <= self.nr
22599 * assert range_end > range_start # <<<<<<<<<<<<<<
22600 * _rows = range_end - range_start
22601 * assert _rows <= self.nr
22602*/
22603 #ifndef CYTHON_WITHOUT_ASSERTIONS
22604 if (unlikely(__pyx_assertions_enabled())) {
22605 __pyx_t_1 = __Pyx_PyObject_CompareBoolGt_object_object(__pyx_v_range_end, __pyx_v_range_start, Py_GT); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 88, __pyx_L1_error)
22606 if (unlikely(!__pyx_t_1)) {
22607 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
22608 __PYX_ERR(0, 88, __pyx_L1_error)
22609 }
22610
22611 }
22612 #else
22613 if ((1)); else __PYX_ERR(0, 88, __pyx_L1_error)
22614 #endif
22615
22616 /* "superluWrappers.pyx":89
22617 * assert range_start >= 0 ; assert range_end <= self.nr
22618 * assert range_end > range_start
22619 * _rows = range_end - range_start # <<<<<<<<<<<<<<
22620 * assert _rows <= self.nr
22621 *
22622*/
22623 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_v_range_end, __pyx_v_range_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
22624 __Pyx_GOTREF(__pyx_t_2);
22625 __pyx_v__rows = __pyx_t_2;
22626 __pyx_t_2 = 0;
22627
22628 /* "superluWrappers.pyx":90
22629 * assert range_end > range_start
22630 * _rows = range_end - range_start
22631 * assert _rows <= self.nr # <<<<<<<<<<<<<<
22632 *
22633 * nnz = self.rowptr[range_end] - self.rowptr[range_start]
22634*/
22635 #ifndef CYTHON_WITHOUT_ASSERTIONS
22636 if (unlikely(__pyx_assertions_enabled())) {
22637 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
22638 __Pyx_GOTREF(__pyx_t_2);
22639 __pyx_t_1 = __Pyx_PyObject_CompareBoolLe_object_object(__pyx_v__rows, __pyx_t_2, Py_LE); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 90, __pyx_L1_error)
22640 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22641 if (unlikely(!__pyx_t_1)) {
22642 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
22643 __PYX_ERR(0, 90, __pyx_L1_error)
22644 }
22645
22646 }
22647 #else
22648 if ((1)); else __PYX_ERR(0, 90, __pyx_L1_error)
22649 #endif
22650
22651 /* "superluWrappers.pyx":92
22652 * assert _rows <= self.nr
22653 *
22654 * nnz = self.rowptr[range_end] - self.rowptr[range_start] # <<<<<<<<<<<<<<
22655 *
22656 * rowptr = self.rowptr[range_start : range_start + _rows + 1]
22657*/
22658 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
22659 __Pyx_GOTREF(__pyx_t_2);
22660 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_range_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
22661 __Pyx_GOTREF(__pyx_t_3);
22662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22663 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
22664 __Pyx_GOTREF(__pyx_t_2);
22665 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_range_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
22666 __Pyx_GOTREF(__pyx_t_4);
22667 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22668 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
22669 __Pyx_GOTREF(__pyx_t_2);
22670 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22671 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22672 __pyx_v_nnz = __pyx_t_2;
22673 __pyx_t_2 = 0;
22674
22675 /* "superluWrappers.pyx":94
22676 * nnz = self.rowptr[range_end] - self.rowptr[range_start]
22677 *
22678 * rowptr = self.rowptr[range_start : range_start + _rows + 1] # <<<<<<<<<<<<<<
22679 * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
22680 * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
22681*/
22682 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
22683 __Pyx_GOTREF(__pyx_t_2);
22684 __pyx_t_4 = __Pyx_PyNumber_Add_object_object(__pyx_v_range_start, __pyx_v__rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
22685 __Pyx_GOTREF(__pyx_t_4);
22686 __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
22687 __Pyx_GOTREF(__pyx_t_3);
22688 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22689 __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, &__pyx_v_range_start, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
22690 __Pyx_GOTREF(__pyx_t_4);
22691 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22692 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22693 __pyx_v_rowptr = __pyx_t_4;
22694 __pyx_t_4 = 0;
22695
22696 /* "superluWrappers.pyx":95
22697 *
22698 * rowptr = self.rowptr[range_start : range_start + _rows + 1]
22699 * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz] # <<<<<<<<<<<<<<
22700 * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
22701 *
22702*/
22703 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_colind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
22704 __Pyx_GOTREF(__pyx_t_4);
22705 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
22706 __Pyx_GOTREF(__pyx_t_3);
22707 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
22708 __Pyx_GOTREF(__pyx_t_2);
22709 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22710 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
22711 __Pyx_GOTREF(__pyx_t_3);
22712 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
22713 __Pyx_GOTREF(__pyx_t_5);
22714 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22715 __pyx_t_3 = __Pyx_PyNumber_Add_object_object(__pyx_t_5, __pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
22716 __Pyx_GOTREF(__pyx_t_3);
22717 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22718 __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, &__pyx_t_2, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
22719 __Pyx_GOTREF(__pyx_t_5);
22720 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22721 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22722 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22723 __pyx_v_colind = __pyx_t_5;
22724 __pyx_t_5 = 0;
22725
22726 /* "superluWrappers.pyx":96
22727 * rowptr = self.rowptr[range_start : range_start + _rows + 1]
22728 * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
22729 * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz] # <<<<<<<<<<<<<<
22730 *
22731 * return rowptr, colind, nzvals
22732*/
22733 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nzvals); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
22734 __Pyx_GOTREF(__pyx_t_5);
22735 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
22736 __Pyx_GOTREF(__pyx_t_3);
22737 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
22738 __Pyx_GOTREF(__pyx_t_2);
22739 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22740 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
22741 __Pyx_GOTREF(__pyx_t_3);
22742 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
22743 __Pyx_GOTREF(__pyx_t_4);
22744 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22745 __pyx_t_3 = __Pyx_PyNumber_Add_object_object(__pyx_t_4, __pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
22746 __Pyx_GOTREF(__pyx_t_3);
22747 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22748 __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_t_2, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
22749 __Pyx_GOTREF(__pyx_t_4);
22750 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22751 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22752 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22753 __pyx_v_nzvals = __pyx_t_4;
22754 __pyx_t_4 = 0;
22755
22756 /* "superluWrappers.pyx":98
22757 * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
22758 *
22759 * return rowptr, colind, nzvals # <<<<<<<<<<<<<<
22760 *
22761 * cdef class cSparseMatrix(object):
22762*/
22763 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
22764 __Pyx_GOTREF(__pyx_t_4);
22765 __Pyx_INCREF(__pyx_v_rowptr);
22766 __Pyx_GIVEREF(__pyx_v_rowptr);
22767 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rowptr) != (0)) __PYX_ERR(0, 98, __pyx_L1_error);
22768 __Pyx_INCREF(__pyx_v_colind);
22769 __Pyx_GIVEREF(__pyx_v_colind);
22770 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_colind) != (0)) __PYX_ERR(0, 98, __pyx_L1_error);
22771 __Pyx_INCREF(__pyx_v_nzvals);
22772 __Pyx_GIVEREF(__pyx_v_nzvals);
22773 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nzvals) != (0)) __PYX_ERR(0, 98, __pyx_L1_error);
22774 {
22775 PyObject *__pyx_temp;
22776 {
22777 __pyx_temp = __pyx_r;
22778 __pyx_r = __pyx_t_4;
22779 }
22780 __Pyx_XDECREF(__pyx_temp);
22781 }
22782 __pyx_t_4 = 0;
22783 goto __pyx_L0;
22784
22785 /* "superluWrappers.pyx":72
22786 * return (self.rowptr, self.colind, self.nzvals)
22787 *
22788 * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
22789 * range_start,
22790 * range_end):
22791*/
22792
22793 /* function exit code */
22794 __pyx_L1_error:;
22795 __Pyx_XDECREF(__pyx_t_2);
22796 __Pyx_XDECREF(__pyx_t_3);
22797 __Pyx_XDECREF(__pyx_t_4);
22798 __Pyx_XDECREF(__pyx_t_5);
22799 __Pyx_AddTraceback("superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
22800 __pyx_r = NULL;
22801 __pyx_L0:;
22802 __Pyx_XDECREF(__pyx_v__rows);
22803 __Pyx_XDECREF(__pyx_v_nnz);
22804 __Pyx_XDECREF(__pyx_v_rowptr);
22805 __Pyx_XDECREF(__pyx_v_colind);
22806 __Pyx_XDECREF(__pyx_v_nzvals);
22807 __Pyx_XGIVEREF(__pyx_r);
22808 __Pyx_RefNannyFinishContext();
22809 return __pyx_r;
22810}
22811
22812/* "superluWrappers.pyx":102
22813 * cdef class cSparseMatrix(object):
22814 *
22815 * def __cinit__(self, # <<<<<<<<<<<<<<
22816 * int nr,
22817 * int nc,
22818*/
22819
22820/* Python wrapper */
22821static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self,
22822#if CYTHON_VECTORCALL_TPNEW
22823PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22824#else
22825PyObject *__pyx_args, PyObject *__pyx_kwds
22826#endif
22827); /*proto*/
22828static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self,
22829#if CYTHON_VECTORCALL_TPNEW
22830PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22831#else
22832PyObject *__pyx_args, PyObject *__pyx_kwds
22833#endif
22834) {
22835 int __pyx_v_nr;
22836 int __pyx_v_nc;
22837 int __pyx_v_nnz;
22838 __Pyx_memviewslice __pyx_v_nzval = { 0, 0, { 0 }, { 0 }, { 0 } };
22839 __Pyx_memviewslice __pyx_v_colind = { 0, 0, { 0 }, { 0 }, { 0 } };
22840 __Pyx_memviewslice __pyx_v_rowptr = { 0, 0, { 0 }, { 0 }, { 0 } };
22841 #if !CYTHON_VECTORCALL_TPNEW
22842 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22843 #endif
22844 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22845 PyObject* values[6] = {0,0,0,0,0,0};
22846 int __pyx_lineno = 0;
22847 const char *__pyx_filename = NULL;
22848 int __pyx_clineno = 0;
22849 int __pyx_r;
22850 __Pyx_RefNannyDeclarations
22851 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
22852 #if !CYTHON_VECTORCALL_TPNEW
22853 #if CYTHON_ASSUME_SAFE_SIZE
22854 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22855 #else
22856 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
22857 #endif
22858 #endif
22859 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
22860 {
22861 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nr,&__pyx_mstate_global->__pyx_n_u_nc,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_nzval,&__pyx_mstate_global->__pyx_n_u_colind,&__pyx_mstate_global->__pyx_n_u_rowptr,0};
22862 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
22863 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
22864 if (__pyx_kwds_len > 0) {
22865 switch (__pyx_nargs) {
22866 case 6:
22867 values[5] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 5);
22868 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 102, __pyx_L3_error)
22869 CYTHON_FALLTHROUGH;
22870 case 5:
22871 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
22872 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 102, __pyx_L3_error)
22873 CYTHON_FALLTHROUGH;
22874 case 4:
22875 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
22876 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 102, __pyx_L3_error)
22877 CYTHON_FALLTHROUGH;
22878 case 3:
22879 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
22880 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 102, __pyx_L3_error)
22881 CYTHON_FALLTHROUGH;
22882 case 2:
22883 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
22884 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 102, __pyx_L3_error)
22885 CYTHON_FALLTHROUGH;
22886 case 1:
22887 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
22888 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 102, __pyx_L3_error)
22889 CYTHON_FALLTHROUGH;
22890 case 0: break;
22891 default: goto __pyx_L5_argtuple_error;
22892 }
22893 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22894 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(0, 102, __pyx_L3_error)
22895 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
22896 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, i); __PYX_ERR(0, 102, __pyx_L3_error) }
22897 }
22898 } else if (unlikely(__pyx_nargs != 6)) {
22899 goto __pyx_L5_argtuple_error;
22900 } else {
22901 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
22902 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 102, __pyx_L3_error)
22903 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
22904 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 102, __pyx_L3_error)
22905 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
22906 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 102, __pyx_L3_error)
22907 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
22908 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 102, __pyx_L3_error)
22909 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
22910 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 102, __pyx_L3_error)
22911 values[5] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 5);
22912 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 102, __pyx_L3_error)
22913 }
22914 __pyx_v_nr = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_nr == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
22915 __pyx_v_nc = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_nc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
22916 __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error)
22917 __pyx_v_nzval = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_nzval.memview)) __PYX_ERR(0, 106, __pyx_L3_error)
22918 __pyx_v_colind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_colind.memview)) __PYX_ERR(0, 107, __pyx_L3_error)
22919 __pyx_v_rowptr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_rowptr.memview)) __PYX_ERR(0, 108, __pyx_L3_error)
22920 }
22921 goto __pyx_L6_skip;
22922 __pyx_L5_argtuple_error:;
22923 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 102, __pyx_L3_error)
22924 __pyx_L6_skip:;
22925 goto __pyx_L4_argument_unpacking_done;
22926 __pyx_L3_error:;
22927 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22928 Py_XDECREF(values[__pyx_temp]);
22929 }
22930 __PYX_XCLEAR_MEMVIEW(&__pyx_v_nzval, 1);
22931 __PYX_XCLEAR_MEMVIEW(&__pyx_v_colind, 1);
22932 __PYX_XCLEAR_MEMVIEW(&__pyx_v_rowptr, 1);
22933 __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22934 __Pyx_RefNannyFinishContext();
22935 return -1;
22936 __pyx_L4_argument_unpacking_done:;
22937 __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzval, __pyx_v_colind, __pyx_v_rowptr);
22938
22939 /* function exit code */
22940 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22941 Py_XDECREF(values[__pyx_temp]);
22942 }
22943
22944
22945
22946 __PYX_XCLEAR_MEMVIEW(&__pyx_v_nzval, 1);
22947 __PYX_XCLEAR_MEMVIEW(&__pyx_v_colind, 1);
22948 __PYX_XCLEAR_MEMVIEW(&__pyx_v_rowptr, 1);
22949 __Pyx_RefNannyFinishContext();
22950 return __pyx_r;
22951}
22952
22953static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, int __pyx_v_nr, int __pyx_v_nc, int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr) {
22954 int __pyx_r;
22955 Py_ssize_t __pyx_t_1;
22956
22957 /* "superluWrappers.pyx":109
22958 * np.int32_t [:] colind,
22959 * np.int32_t [:] rowptr):
22960 * self.dim[0] = nr ; self.dim[1] = nc # <<<<<<<<<<<<<<
22961 * self.A.nnz = nnz
22962 * #ARB - should memory for these ptrs need be allocated?
22963*/
22964 (__pyx_v_self->dim[0]) = __pyx_v_nr;
22965 (__pyx_v_self->dim[1]) = __pyx_v_nc;
22966
22967 /* "superluWrappers.pyx":110
22968 * np.int32_t [:] rowptr):
22969 * self.dim[0] = nr ; self.dim[1] = nc
22970 * self.A.nnz = nnz # <<<<<<<<<<<<<<
22971 * #ARB - should memory for these ptrs need be allocated?
22972 * self.A.nzval = &nzval[0]
22973*/
22974 __pyx_v_self->A.nnz = __pyx_v_nnz;
22975
22976 /* "superluWrappers.pyx":112
22977 * self.A.nnz = nnz
22978 * #ARB - should memory for these ptrs need be allocated?
22979 * self.A.nzval = &nzval[0] # <<<<<<<<<<<<<<
22980 * self.A.colind = &colind[0]
22981 * self.A.rowptr = &rowptr[0]
22982*/
22983 __pyx_t_1 = 0;
22984 __pyx_v_self->A.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_nzval.data + __pyx_t_1 * __pyx_v_nzval.strides[0]) ))));
22985
22986 /* "superluWrappers.pyx":113
22987 * #ARB - should memory for these ptrs need be allocated?
22988 * self.A.nzval = &nzval[0]
22989 * self.A.colind = &colind[0] # <<<<<<<<<<<<<<
22990 * self.A.rowptr = &rowptr[0]
22991 *
22992*/
22993 __pyx_t_1 = 0;
22994 __pyx_v_self->A.colind = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_colind.data + __pyx_t_1 * __pyx_v_colind.strides[0]) ))));
22995
22996 /* "superluWrappers.pyx":114
22997 * self.A.nzval = &nzval[0]
22998 * self.A.colind = &colind[0]
22999 * self.A.rowptr = &rowptr[0] # <<<<<<<<<<<<<<
23000 *
23001 * cdef void SparseMatrix_matvec(cSparseMatrix sm,
23002*/
23003 __pyx_t_1 = 0;
23004 __pyx_v_self->A.rowptr = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_rowptr.data + __pyx_t_1 * __pyx_v_rowptr.strides[0]) ))));
23005
23006 /* "superluWrappers.pyx":102
23007 * cdef class cSparseMatrix(object):
23008 *
23009 * def __cinit__(self, # <<<<<<<<<<<<<<
23010 * int nr,
23011 * int nc,
23012*/
23013
23014 /* function exit code */
23015 __pyx_r = 0;
23016
23017 return __pyx_r;
23018}
23019
23020/* "(tree fragment)":1
23021 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23022 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
23023 * def __setstate_cython__(self, __pyx_state):
23024*/
23025
23026/* Python wrapper */
23027static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self,
23028#if CYTHON_VECTORCALL
23029PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23030#else
23031PyObject *__pyx_args, PyObject *__pyx_kwds
23032#endif
23033); /*proto*/
23034static PyMethodDef __pyx_mdef_15superluWrappers_13cSparseMatrix_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
23035static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self,
23036#if CYTHON_VECTORCALL
23037PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23038#else
23039PyObject *__pyx_args, PyObject *__pyx_kwds
23040#endif
23041) {
23042 #if !CYTHON_VECTORCALL
23043 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23044 #endif
23045 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23046 PyObject *__pyx_r = 0;
23047 __Pyx_RefNannyDeclarations
23048 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
23049 #if !CYTHON_VECTORCALL
23050 #if CYTHON_ASSUME_SAFE_SIZE
23051 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23052 #else
23053 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23054 #endif
23055 #endif
23056 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23057 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
23058 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
23059 if (unlikely(__pyx_kwds_len < 0)) return NULL;
23060 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
23061 __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self));
23062
23063 /* function exit code */
23064 __Pyx_RefNannyFinishContext();
23065 return __pyx_r;
23066}
23067
23068static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self) {
23069 PyObject *__pyx_r = NULL;
23070 __Pyx_RefNannyDeclarations
23071 int __pyx_lineno = 0;
23072 const char *__pyx_filename = NULL;
23073 int __pyx_clineno = 0;
23074 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
23075
23076 /* "(tree fragment)":2
23077 * def __reduce_cython__(self):
23078 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
23079 * def __setstate_cython__(self, __pyx_state):
23080 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
23081*/
23082 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
23083 __PYX_ERR(1, 2, __pyx_L1_error)
23084
23085 /* "(tree fragment)":1
23086 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23087 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
23088 * def __setstate_cython__(self, __pyx_state):
23089*/
23090
23091 /* function exit code */
23092 __pyx_L1_error:;
23093 __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23094 __pyx_r = NULL;
23095 __Pyx_XGIVEREF(__pyx_r);
23096 __Pyx_RefNannyFinishContext();
23097 return __pyx_r;
23098}
23099
23100/* "(tree fragment)":3
23101 * def __reduce_cython__(self):
23102 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
23103 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23104 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
23105*/
23106
23107/* Python wrapper */
23108static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self,
23109#if CYTHON_VECTORCALL
23110PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23111#else
23112PyObject *__pyx_args, PyObject *__pyx_kwds
23113#endif
23114); /*proto*/
23115static PyMethodDef __pyx_mdef_15superluWrappers_13cSparseMatrix_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
23116static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self,
23117#if CYTHON_VECTORCALL
23118PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23119#else
23120PyObject *__pyx_args, PyObject *__pyx_kwds
23121#endif
23122) {
23123 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
23124 #if !CYTHON_VECTORCALL
23125 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23126 #endif
23127 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23128 PyObject* values[1] = {0};
23129 int __pyx_lineno = 0;
23130 const char *__pyx_filename = NULL;
23131 int __pyx_clineno = 0;
23132 PyObject *__pyx_r = 0;
23133 __Pyx_RefNannyDeclarations
23134 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
23135 #if !CYTHON_VECTORCALL
23136 #if CYTHON_ASSUME_SAFE_SIZE
23137 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23138 #else
23139 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23140 #endif
23141 #endif
23142 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23143 {
23144 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
23145 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
23146 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
23147 if (__pyx_kwds_len > 0) {
23148 switch (__pyx_nargs) {
23149 case 1:
23150 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23151 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
23152 CYTHON_FALLTHROUGH;
23153 case 0: break;
23154 default: goto __pyx_L5_argtuple_error;
23155 }
23156 const Py_ssize_t kwd_pos_args = __pyx_nargs;
23157 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
23158 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
23159 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
23160 }
23161 } else if (unlikely(__pyx_nargs != 1)) {
23162 goto __pyx_L5_argtuple_error;
23163 } else {
23164 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23165 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
23166 }
23167 __pyx_v___pyx_state = values[0];
23168 }
23169 goto __pyx_L6_skip;
23170 __pyx_L5_argtuple_error:;
23171 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
23172 __pyx_L6_skip:;
23173 goto __pyx_L4_argument_unpacking_done;
23174 __pyx_L3_error:;
23175 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23176 Py_XDECREF(values[__pyx_temp]);
23177 }
23178 __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23179 __Pyx_RefNannyFinishContext();
23180 return NULL;
23181 __pyx_L4_argument_unpacking_done:;
23182 __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), __pyx_v___pyx_state);
23183
23184 /* function exit code */
23185 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23186 Py_XDECREF(values[__pyx_temp]);
23187 }
23188 __Pyx_RefNannyFinishContext();
23189 return __pyx_r;
23190}
23191
23192static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
23193 PyObject *__pyx_r = NULL;
23194 __Pyx_RefNannyDeclarations
23195 int __pyx_lineno = 0;
23196 const char *__pyx_filename = NULL;
23197 int __pyx_clineno = 0;
23198 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
23199
23200 /* "(tree fragment)":4
23201 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
23202 * def __setstate_cython__(self, __pyx_state):
23203 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
23204*/
23205 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
23206 __PYX_ERR(1, 4, __pyx_L1_error)
23207
23208 /* "(tree fragment)":3
23209 * def __reduce_cython__(self):
23210 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
23211 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23212 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
23213*/
23214
23215 /* function exit code */
23216 __pyx_L1_error:;
23217 __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23218 __pyx_r = NULL;
23219 __Pyx_XGIVEREF(__pyx_r);
23220 __Pyx_RefNannyFinishContext();
23221 return __pyx_r;
23222}
23223
23224/* "superluWrappers.pyx":116
23225 * self.A.rowptr = &rowptr[0]
23226 *
23227 * cdef void SparseMatrix_matvec(cSparseMatrix sm, # <<<<<<<<<<<<<<
23228 * np.float64_t [:] xp,
23229 * np.float64_t [:] yp):
23230*/
23231
23232static void __pyx_f_15superluWrappers_SparseMatrix_matvec(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, __Pyx_memviewslice __pyx_v_xp, __Pyx_memviewslice __pyx_v_yp) {
23233 __pyx_t_5numpy_float64_t __pyx_v_tmp;
23234 int __pyx_v_i;
23235 int __pyx_v_k;
23236 int __pyx_v_k_lo;
23237 int __pyx_v_k_hi;
23238 __pyx_t_5numpy_int32_t __pyx_t_1;
23239 __pyx_t_5numpy_int32_t __pyx_t_2;
23240 int __pyx_t_3;
23241 int __pyx_t_4;
23242 int __pyx_t_5;
23243 int __pyx_t_6;
23244 Py_ssize_t __pyx_t_7;
23245
23246 /* "superluWrappers.pyx":119
23247 * np.float64_t [:] xp,
23248 * np.float64_t [:] yp):
23249 * cdef np.float64_t tmp = 0. # <<<<<<<<<<<<<<
23250 * cdef int i, k
23251 * cdef int k_lo, k_hi
23252*/
23253 __pyx_v_tmp = 0.;
23254
23255 /* "superluWrappers.pyx":123
23256 * cdef int k_lo, k_hi
23257 *
23258 * for i in range(sm.dim[0]): # <<<<<<<<<<<<<<
23259 * tmp = 0.
23260 * k_lo = sm.A.rowptr[i]
23261*/
23262
23263 __pyx_t_1 = (__pyx_v_sm->dim[0]);
23264 __pyx_t_2 = __pyx_t_1;
23265
23266 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
23267 __pyx_v_i = __pyx_t_3;
23268
23269 /* "superluWrappers.pyx":124
23270 *
23271 * for i in range(sm.dim[0]):
23272 * tmp = 0. # <<<<<<<<<<<<<<
23273 * k_lo = sm.A.rowptr[i]
23274 * k_hi = sm.A.rowptr[i+1]
23275*/
23276 __pyx_v_tmp = 0.;
23277
23278 /* "superluWrappers.pyx":125
23279 * for i in range(sm.dim[0]):
23280 * tmp = 0.
23281 * k_lo = sm.A.rowptr[i] # <<<<<<<<<<<<<<
23282 * k_hi = sm.A.rowptr[i+1]
23283 * for k in range(k_lo, k_hi):
23284*/
23285 __pyx_v_k_lo = (__pyx_v_sm->A.rowptr[__pyx_v_i]);
23286
23287 /* "superluWrappers.pyx":126
23288 * tmp = 0.
23289 * k_lo = sm.A.rowptr[i]
23290 * k_hi = sm.A.rowptr[i+1] # <<<<<<<<<<<<<<
23291 * for k in range(k_lo, k_hi):
23292 * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
23293*/
23294 __pyx_v_k_hi = (__pyx_v_sm->A.rowptr[(__pyx_v_i + 1)]);
23295
23296 /* "superluWrappers.pyx":127
23297 * k_lo = sm.A.rowptr[i]
23298 * k_hi = sm.A.rowptr[i+1]
23299 * for k in range(k_lo, k_hi): # <<<<<<<<<<<<<<
23300 * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
23301 * yp[i] = tmp
23302*/
23303
23304 __pyx_t_4 = __pyx_v_k_hi;
23305 __pyx_t_5 = __pyx_t_4;
23306
23307 for (__pyx_t_6 = __pyx_v_k_lo; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23308 __pyx_v_k = __pyx_t_6;
23309
23310 /* "superluWrappers.pyx":128
23311 * k_hi = sm.A.rowptr[i+1]
23312 * for k in range(k_lo, k_hi):
23313 * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]] # <<<<<<<<<<<<<<
23314 * yp[i] = tmp
23315 *
23316*/
23317 __pyx_t_7 = (__pyx_v_sm->A.colind[__pyx_v_k]);
23318 __pyx_v_tmp = (__pyx_v_tmp + ((__pyx_v_sm->A.nzval[__pyx_v_k]) * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_xp.data + __pyx_t_7 * __pyx_v_xp.strides[0]) )))));
23319 }
23320
23321
23322 /* "superluWrappers.pyx":129
23323 * for k in range(k_lo, k_hi):
23324 * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
23325 * yp[i] = tmp # <<<<<<<<<<<<<<
23326 *
23327 * cdef struct _NCformat:
23328*/
23329 __pyx_t_7 = __pyx_v_i;
23330 *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_yp.data + __pyx_t_7 * __pyx_v_yp.strides[0]) )) = __pyx_v_tmp;
23331 }
23332
23333
23334 /* "superluWrappers.pyx":116
23335 * self.A.rowptr = &rowptr[0]
23336 *
23337 * cdef void SparseMatrix_matvec(cSparseMatrix sm, # <<<<<<<<<<<<<<
23338 * np.float64_t [:] xp,
23339 * np.float64_t [:] yp):
23340*/
23341
23342 /* function exit code */
23343
23344
23345
23346
23347
23348
23349}
23350
23351/* "superluWrappers.pyx":173
23352 * cdef public int dim
23353 *
23354 * def __init__(self, dim): # <<<<<<<<<<<<<<
23355 * """
23356 * Arguments
23357*/
23358
23359/* Python wrapper */
23360static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self,
23361#if CYTHON_VECTORCALL_TPNEW
23362PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23363#else
23364PyObject *__pyx_args, PyObject *__pyx_kwds
23365#endif
23366); /*proto*/
23367PyDoc_STRVAR(__pyx_doc_15superluWrappers_12SparseFactor___init__, "\n Arguments\n ---------\n dim : int\n Dimension of the sparse factor.\n ");
23368#if CYTHON_UPDATE_DESCRIPTOR_DOC
23369struct wrapperbase __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
23370#endif
23371static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self,
23372#if CYTHON_VECTORCALL_TPNEW
23373PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23374#else
23375PyObject *__pyx_args, PyObject *__pyx_kwds
23376#endif
23377) {
23378 PyObject *__pyx_v_dim = 0;
23379 #if !CYTHON_VECTORCALL_TPNEW
23380 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23381 #endif
23382 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23383 PyObject* values[1] = {0};
23384 int __pyx_lineno = 0;
23385 const char *__pyx_filename = NULL;
23386 int __pyx_clineno = 0;
23387 int __pyx_r;
23388 __Pyx_RefNannyDeclarations
23389 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
23390 #if !CYTHON_VECTORCALL_TPNEW
23391 #if CYTHON_ASSUME_SAFE_SIZE
23392 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23393 #else
23394 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
23395 #endif
23396 #endif
23397 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
23398 {
23399 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,0};
23400 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
23401 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 173, __pyx_L3_error)
23402 if (__pyx_kwds_len > 0) {
23403 switch (__pyx_nargs) {
23404 case 1:
23405 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
23406 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 173, __pyx_L3_error)
23407 CYTHON_FALLTHROUGH;
23408 case 0: break;
23409 default: goto __pyx_L5_argtuple_error;
23410 }
23411 const Py_ssize_t kwd_pos_args = __pyx_nargs;
23412 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 173, __pyx_L3_error)
23413 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
23414 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 173, __pyx_L3_error) }
23415 }
23416 } else if (unlikely(__pyx_nargs != 1)) {
23417 goto __pyx_L5_argtuple_error;
23418 } else {
23419 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
23420 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 173, __pyx_L3_error)
23421 }
23422 __pyx_v_dim = values[0];
23423 }
23424 goto __pyx_L6_skip;
23425 __pyx_L5_argtuple_error:;
23426 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 173, __pyx_L3_error)
23427 __pyx_L6_skip:;
23428 goto __pyx_L4_argument_unpacking_done;
23429 __pyx_L3_error:;
23430 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23431 Py_XDECREF(values[__pyx_temp]);
23432 }
23433 __Pyx_AddTraceback("superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23434 __Pyx_RefNannyFinishContext();
23435 return -1;
23436 __pyx_L4_argument_unpacking_done:;
23437 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor___init__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), __pyx_v_dim);
23438
23439 /* function exit code */
23440 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23441 Py_XDECREF(values[__pyx_temp]);
23442 }
23443 __Pyx_RefNannyFinishContext();
23444 return __pyx_r;
23445}
23446
23447static int __pyx_pf_15superluWrappers_12SparseFactor___init__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim) {
23448 int __pyx_r;
23449 __Pyx_RefNannyDeclarations
23450 PyObject *__pyx_t_1 = NULL;
23451 int __pyx_t_2;
23452 __pyx_t_5numpy_int32_t __pyx_t_3;
23453 PyObject *__pyx_t_4 = NULL;
23454 size_t __pyx_t_5;
23455 int __pyx_lineno = 0;
23456 const char *__pyx_filename = NULL;
23457 int __pyx_clineno = 0;
23458 __Pyx_RefNannySetupContext("__init__", 0);
23459
23460 /* "superluWrappers.pyx":180
23461 * Dimension of the sparse factor.
23462 * """
23463 * cStatInit(&self.stat) # <<<<<<<<<<<<<<
23464 * cset_default_options(&self.options)
23465 * self._set_mat_types()
23466*/
23467 StatInit((&__pyx_v_self->stat));
23468
23469 /* "superluWrappers.pyx":181
23470 * """
23471 * cStatInit(&self.stat)
23472 * cset_default_options(&self.options) # <<<<<<<<<<<<<<
23473 * self._set_mat_types()
23474 * self.dim = dim
23475*/
23476 set_default_options((&__pyx_v_self->options));
23477
23478 /* "superluWrappers.pyx":182
23479 * cStatInit(&self.stat)
23480 * cset_default_options(&self.options)
23481 * self._set_mat_types() # <<<<<<<<<<<<<<
23482 * self.dim = dim
23483 * self.A.nrow = dim ; self.A.ncol = dim
23484*/
23485 __pyx_t_1 = ((struct __pyx_vtabstruct_15superluWrappers_SparseFactor *)__pyx_v_self->__pyx_vtab)->_set_mat_types(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
23486 __Pyx_GOTREF(__pyx_t_1);
23487 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23488
23489 /* "superluWrappers.pyx":183
23490 * cset_default_options(&self.options)
23491 * self._set_mat_types()
23492 * self.dim = dim # <<<<<<<<<<<<<<
23493 * self.A.nrow = dim ; self.A.ncol = dim
23494 * self.AC.nrow = dim ; self.AC.ncol = dim
23495*/
23496 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
23497 __pyx_v_self->dim = __pyx_t_2;
23498
23499 /* "superluWrappers.pyx":184
23500 * self._set_mat_types()
23501 * self.dim = dim
23502 * self.A.nrow = dim ; self.A.ncol = dim # <<<<<<<<<<<<<<
23503 * self.AC.nrow = dim ; self.AC.ncol = dim
23504 * self.L.nrow = dim ; self.L.ncol = dim
23505*/
23506 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
23507 __pyx_v_self->A.nrow = __pyx_t_2;
23508 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
23509 __pyx_v_self->A.ncol = __pyx_t_2;
23510
23511 /* "superluWrappers.pyx":185
23512 * self.dim = dim
23513 * self.A.nrow = dim ; self.A.ncol = dim
23514 * self.AC.nrow = dim ; self.AC.ncol = dim # <<<<<<<<<<<<<<
23515 * self.L.nrow = dim ; self.L.ncol = dim
23516 * self.U.nrow = dim ; self.U.ncol = dim
23517*/
23518 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
23519 __pyx_v_self->AC.nrow = __pyx_t_2;
23520 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
23521 __pyx_v_self->AC.ncol = __pyx_t_2;
23522
23523 /* "superluWrappers.pyx":186
23524 * self.A.nrow = dim ; self.A.ncol = dim
23525 * self.AC.nrow = dim ; self.AC.ncol = dim
23526 * self.L.nrow = dim ; self.L.ncol = dim # <<<<<<<<<<<<<<
23527 * self.U.nrow = dim ; self.U.ncol = dim
23528 * self.X.nrow = dim ; self.X.ncol = 1
23529*/
23530 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
23531 __pyx_v_self->L.nrow = __pyx_t_2;
23532 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
23533 __pyx_v_self->L.ncol = __pyx_t_2;
23534
23535 /* "superluWrappers.pyx":187
23536 * self.AC.nrow = dim ; self.AC.ncol = dim
23537 * self.L.nrow = dim ; self.L.ncol = dim
23538 * self.U.nrow = dim ; self.U.ncol = dim # <<<<<<<<<<<<<<
23539 * self.X.nrow = dim ; self.X.ncol = 1
23540 * self.storeX.lda = dim
23541*/
23542 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L1_error)
23543 __pyx_v_self->U.nrow = __pyx_t_2;
23544 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L1_error)
23545 __pyx_v_self->U.ncol = __pyx_t_2;
23546
23547 /* "superluWrappers.pyx":188
23548 * self.L.nrow = dim ; self.L.ncol = dim
23549 * self.U.nrow = dim ; self.U.ncol = dim
23550 * self.X.nrow = dim ; self.X.ncol = 1 # <<<<<<<<<<<<<<
23551 * self.storeX.lda = dim
23552 * self.use_same_perm_c = 0
23553*/
23554 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error)
23555 __pyx_v_self->X.nrow = __pyx_t_2;
23556 __pyx_v_self->X.ncol = 1;
23557
23558 /* "superluWrappers.pyx":189
23559 * self.U.nrow = dim ; self.U.ncol = dim
23560 * self.X.nrow = dim ; self.X.ncol = 1
23561 * self.storeX.lda = dim # <<<<<<<<<<<<<<
23562 * self.use_same_perm_c = 0
23563 * self.use_same_sparsity = 0
23564*/
23565 __pyx_t_3 = __Pyx_PyLong_As_npy_int32(__pyx_v_dim); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
23566 __pyx_v_self->storeX.lda = __pyx_t_3;
23567
23568 /* "superluWrappers.pyx":190
23569 * self.X.nrow = dim ; self.X.ncol = 1
23570 * self.storeX.lda = dim
23571 * self.use_same_perm_c = 0 # <<<<<<<<<<<<<<
23572 * self.use_same_sparsity = 0
23573 * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
23574*/
23575 __pyx_v_self->use_same_perm_c = 0;
23576
23577 /* "superluWrappers.pyx":191
23578 * self.storeX.lda = dim
23579 * self.use_same_perm_c = 0
23580 * self.use_same_sparsity = 0 # <<<<<<<<<<<<<<
23581 * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
23582 * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
23583*/
23584 __pyx_v_self->use_same_sparsity = 0;
23585
23586 /* "superluWrappers.pyx":192
23587 * self.use_same_perm_c = 0
23588 * self.use_same_sparsity = 0
23589 * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
23590 * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
23591 * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
23592*/
23593 __pyx_t_1 = __Pyx_PyLong_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
23594 __Pyx_GOTREF(__pyx_t_1);
23595 __pyx_t_4 = __Pyx_PyNumber_Multiply_object_int(__pyx_v_dim, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
23596 __Pyx_GOTREF(__pyx_t_4);
23597 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23598 __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L1_error)
23599 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23600 __pyx_v_self->perm_c = ((int *)malloc(__pyx_t_5));
23601
23602
23603 /* "superluWrappers.pyx":193
23604 * self.use_same_sparsity = 0
23605 * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
23606 * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
23607 * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
23608 *
23609*/
23610 __pyx_t_4 = __Pyx_PyLong_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
23611 __Pyx_GOTREF(__pyx_t_4);
23612 __pyx_t_1 = __Pyx_PyNumber_Multiply_object_int(__pyx_v_dim, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
23613 __Pyx_GOTREF(__pyx_t_1);
23614 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23615 __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L1_error)
23616 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23617 __pyx_v_self->perm_r = ((int *)malloc(__pyx_t_5));
23618
23619
23620 /* "superluWrappers.pyx":194
23621 * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
23622 * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
23623 * self.etree = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
23624 *
23625 * cdef _set_mat_types(self):
23626*/
23627 __pyx_t_1 = __Pyx_PyLong_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
23628 __Pyx_GOTREF(__pyx_t_1);
23629 __pyx_t_4 = __Pyx_PyNumber_Multiply_object_int(__pyx_v_dim, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
23630 __Pyx_GOTREF(__pyx_t_4);
23631 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23632 __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error)
23633 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23634 __pyx_v_self->etree = ((int *)malloc(__pyx_t_5));
23635
23636
23637 /* "superluWrappers.pyx":173
23638 * cdef public int dim
23639 *
23640 * def __init__(self, dim): # <<<<<<<<<<<<<<
23641 * """
23642 * Arguments
23643*/
23644
23645 /* function exit code */
23646 __pyx_r = 0;
23647 goto __pyx_L0;
23648 __pyx_L1_error:;
23649 __Pyx_XDECREF(__pyx_t_1);
23650 __Pyx_XDECREF(__pyx_t_4);
23651 __Pyx_AddTraceback("superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23652 __pyx_r = -1;
23653 __pyx_L0:;
23654
23655 __Pyx_RefNannyFinishContext();
23656 return __pyx_r;
23657}
23658
23659/* "superluWrappers.pyx":196
23660 * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
23661 *
23662 * cdef _set_mat_types(self): # <<<<<<<<<<<<<<
23663 * self.A.Stype = _SLU_NC
23664 * self.A.Dtype = _SLU_D
23665*/
23666
23667static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
23668 PyObject *__pyx_r = NULL;
23669 __Pyx_RefNannyDeclarations
23670 __Pyx_RefNannySetupContext("_set_mat_types", 0);
23671
23672 /* "superluWrappers.pyx":197
23673 *
23674 * cdef _set_mat_types(self):
23675 * self.A.Stype = _SLU_NC # <<<<<<<<<<<<<<
23676 * self.A.Dtype = _SLU_D
23677 * self.A.Mtype = _SLU_GE
23678*/
23679 __pyx_v_self->A.Stype = SLU_NC;
23680
23681 /* "superluWrappers.pyx":198
23682 * cdef _set_mat_types(self):
23683 * self.A.Stype = _SLU_NC
23684 * self.A.Dtype = _SLU_D # <<<<<<<<<<<<<<
23685 * self.A.Mtype = _SLU_GE
23686 * self.A.Store = &self.storeA
23687*/
23688 __pyx_v_self->A.Dtype = SLU_D;
23689
23690 /* "superluWrappers.pyx":199
23691 * self.A.Stype = _SLU_NC
23692 * self.A.Dtype = _SLU_D
23693 * self.A.Mtype = _SLU_GE # <<<<<<<<<<<<<<
23694 * self.A.Store = &self.storeA
23695 *
23696*/
23697 __pyx_v_self->A.Mtype = SLU_GE;
23698
23699 /* "superluWrappers.pyx":200
23700 * self.A.Dtype = _SLU_D
23701 * self.A.Mtype = _SLU_GE
23702 * self.A.Store = &self.storeA # <<<<<<<<<<<<<<
23703 *
23704 * self.AC.Stype = _SLU_NCP
23705*/
23706 __pyx_v_self->A.Store = (&__pyx_v_self->storeA);
23707
23708 /* "superluWrappers.pyx":202
23709 * self.A.Store = &self.storeA
23710 *
23711 * self.AC.Stype = _SLU_NCP # <<<<<<<<<<<<<<
23712 * self.AC.Dtype = _SLU_D
23713 * self.AC.Mtype = _SLU_GE
23714*/
23715 __pyx_v_self->AC.Stype = SLU_NCP;
23716
23717 /* "superluWrappers.pyx":203
23718 *
23719 * self.AC.Stype = _SLU_NCP
23720 * self.AC.Dtype = _SLU_D # <<<<<<<<<<<<<<
23721 * self.AC.Mtype = _SLU_GE
23722 * self.AC.Store = NULL
23723*/
23724 __pyx_v_self->AC.Dtype = SLU_D;
23725
23726 /* "superluWrappers.pyx":204
23727 * self.AC.Stype = _SLU_NCP
23728 * self.AC.Dtype = _SLU_D
23729 * self.AC.Mtype = _SLU_GE # <<<<<<<<<<<<<<
23730 * self.AC.Store = NULL
23731 *
23732*/
23733 __pyx_v_self->AC.Mtype = SLU_GE;
23734
23735 /* "superluWrappers.pyx":205
23736 * self.AC.Dtype = _SLU_D
23737 * self.AC.Mtype = _SLU_GE
23738 * self.AC.Store = NULL # <<<<<<<<<<<<<<
23739 *
23740 * self.L.Stype = _SLU_NC
23741*/
23742 __pyx_v_self->AC.Store = NULL;
23743
23744 /* "superluWrappers.pyx":207
23745 * self.AC.Store = NULL
23746 *
23747 * self.L.Stype = _SLU_NC # <<<<<<<<<<<<<<
23748 * self.L.Dtype = _SLU_D
23749 * self.L.Mtype = _SLU_TRLU
23750*/
23751 __pyx_v_self->L.Stype = SLU_NC;
23752
23753 /* "superluWrappers.pyx":208
23754 *
23755 * self.L.Stype = _SLU_NC
23756 * self.L.Dtype = _SLU_D # <<<<<<<<<<<<<<
23757 * self.L.Mtype = _SLU_TRLU
23758 * self.L.Store = NULL
23759*/
23760 __pyx_v_self->L.Dtype = SLU_D;
23761
23762 /* "superluWrappers.pyx":209
23763 * self.L.Stype = _SLU_NC
23764 * self.L.Dtype = _SLU_D
23765 * self.L.Mtype = _SLU_TRLU # <<<<<<<<<<<<<<
23766 * self.L.Store = NULL
23767 *
23768*/
23769 __pyx_v_self->L.Mtype = SLU_TRLU;
23770
23771 /* "superluWrappers.pyx":210
23772 * self.L.Dtype = _SLU_D
23773 * self.L.Mtype = _SLU_TRLU
23774 * self.L.Store = NULL # <<<<<<<<<<<<<<
23775 *
23776 * self.U.Stype = _SLU_NC
23777*/
23778 __pyx_v_self->L.Store = NULL;
23779
23780 /* "superluWrappers.pyx":212
23781 * self.L.Store = NULL
23782 *
23783 * self.U.Stype = _SLU_NC # <<<<<<<<<<<<<<
23784 * self.U.Dtype = _SLU_D
23785 * self.U.Mtype = _SLU_TRU
23786*/
23787 __pyx_v_self->U.Stype = SLU_NC;
23788
23789 /* "superluWrappers.pyx":213
23790 *
23791 * self.U.Stype = _SLU_NC
23792 * self.U.Dtype = _SLU_D # <<<<<<<<<<<<<<
23793 * self.U.Mtype = _SLU_TRU
23794 * self.U.Store = NULL
23795*/
23796 __pyx_v_self->U.Dtype = SLU_D;
23797
23798 /* "superluWrappers.pyx":214
23799 * self.U.Stype = _SLU_NC
23800 * self.U.Dtype = _SLU_D
23801 * self.U.Mtype = _SLU_TRU # <<<<<<<<<<<<<<
23802 * self.U.Store = NULL
23803 *
23804*/
23805 __pyx_v_self->U.Mtype = SLU_TRU;
23806
23807 /* "superluWrappers.pyx":215
23808 * self.U.Dtype = _SLU_D
23809 * self.U.Mtype = _SLU_TRU
23810 * self.U.Store = NULL # <<<<<<<<<<<<<<
23811 *
23812 * self.X.Stype = _SLU_DN
23813*/
23814 __pyx_v_self->U.Store = NULL;
23815
23816 /* "superluWrappers.pyx":217
23817 * self.U.Store = NULL
23818 *
23819 * self.X.Stype = _SLU_DN # <<<<<<<<<<<<<<
23820 * self.X.Dtype = _SLU_D
23821 * self.X.Mtype = _SLU_GE
23822*/
23823 __pyx_v_self->X.Stype = SLU_DN;
23824
23825 /* "superluWrappers.pyx":218
23826 *
23827 * self.X.Stype = _SLU_DN
23828 * self.X.Dtype = _SLU_D # <<<<<<<<<<<<<<
23829 * self.X.Mtype = _SLU_GE
23830 * self.X.Store = &self.storeX
23831*/
23832 __pyx_v_self->X.Dtype = SLU_D;
23833
23834 /* "superluWrappers.pyx":219
23835 * self.X.Stype = _SLU_DN
23836 * self.X.Dtype = _SLU_D
23837 * self.X.Mtype = _SLU_GE # <<<<<<<<<<<<<<
23838 * self.X.Store = &self.storeX
23839 *
23840*/
23841 __pyx_v_self->X.Mtype = SLU_GE;
23842
23843 /* "superluWrappers.pyx":220
23844 * self.X.Dtype = _SLU_D
23845 * self.X.Mtype = _SLU_GE
23846 * self.X.Store = &self.storeX # <<<<<<<<<<<<<<
23847 *
23848 * def sparseFactorPrepare(sparse_matrix,
23849*/
23850 __pyx_v_self->X.Store = (&__pyx_v_self->storeX);
23851
23852 /* "superluWrappers.pyx":196
23853 * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
23854 *
23855 * cdef _set_mat_types(self): # <<<<<<<<<<<<<<
23856 * self.A.Stype = _SLU_NC
23857 * self.A.Dtype = _SLU_D
23858*/
23859
23860 /* function exit code */
23861 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23862 __Pyx_XGIVEREF(__pyx_r);
23863 __Pyx_RefNannyFinishContext();
23864 return __pyx_r;
23865}
23866
23867/* "superluWrappers.pyx":171
23868 * cdef unsigned int use_same_sparsity
23869 *
23870 * cdef public int dim # <<<<<<<<<<<<<<
23871 *
23872 * def __init__(self, dim):
23873*/
23874
23875/* Python wrapper */
23876static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self); /*proto*/
23877static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self) {
23878 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23879 PyObject *__pyx_r = 0;
23880 __Pyx_RefNannyDeclarations
23881 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
23882 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
23883 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
23884
23885 /* function exit code */
23886 __Pyx_RefNannyFinishContext();
23887 return __pyx_r;
23888}
23889
23890static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
23891 PyObject *__pyx_r = NULL;
23892 __Pyx_RefNannyDeclarations
23893 PyObject *__pyx_t_1 = NULL;
23894 PyObject *__pyx_t_2 = NULL;
23895 PyObject *__pyx_t_3 = NULL;
23896 int __pyx_lineno = 0;
23897 const char *__pyx_filename = NULL;
23898 int __pyx_clineno = 0;
23899 __Pyx_RefNannySetupContext("__get__", 0);
23900 {
23901 __Pyx_PyCriticalSection __pyx_cs;
23902 __pyx_t_1 = ((PyObject *)__pyx_v_self);
23903 __Pyx_INCREF(__pyx_t_1);
23904 __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
23905 /*try:*/ {
23906 __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->dim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L4_error)
23907 __Pyx_GOTREF(__pyx_t_2);
23908 {
23909 PyObject *__pyx_temp;
23910 {
23911 __pyx_temp = __pyx_r;
23912 __pyx_r = __pyx_t_2;
23913 }
23914 __Pyx_XDECREF(__pyx_temp);
23915 }
23916 __pyx_t_2 = 0;
23917 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23918 goto __pyx_L3_return;
23919 }
23920 /*finally:*/ {
23921 __pyx_L3_return: {
23922 __pyx_t_3 = __pyx_r;
23923 __pyx_r = 0;
23924 __Pyx_PyCriticalSection_End(&__pyx_cs);
23925 __pyx_r = __pyx_t_3;
23926 __pyx_t_3 = 0;
23927 goto __pyx_L0;
23928 }
23929 __pyx_L4_error: {
23930 __Pyx_PyCriticalSection_End(&__pyx_cs);
23931 goto __pyx_L1_error;
23932 }
23933 }
23934 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23935 }
23936
23937 /* function exit code */
23938 __pyx_L1_error:;
23939 __Pyx_XDECREF(__pyx_t_1);
23940 __Pyx_XDECREF(__pyx_t_2);
23941 __Pyx_AddTraceback("superluWrappers.SparseFactor.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23942 __pyx_r = NULL;
23943 __pyx_L0:;
23944 __Pyx_XGIVEREF(__pyx_r);
23945 __Pyx_RefNannyFinishContext();
23946 return __pyx_r;
23947}
23948
23949/* Python wrapper */
23950static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
23951static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
23952 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23953 int __pyx_r;
23954 __Pyx_RefNannyDeclarations
23955 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
23956 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
23957 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v_value));
23958
23959 /* function exit code */
23960 __Pyx_RefNannyFinishContext();
23961 return __pyx_r;
23962}
23963
23964static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value) {
23965 int __pyx_r;
23966 __Pyx_RefNannyDeclarations
23967 PyObject *__pyx_t_1 = NULL;
23968 int __pyx_t_2;
23969 int __pyx_lineno = 0;
23970 const char *__pyx_filename = NULL;
23971 int __pyx_clineno = 0;
23972 __Pyx_RefNannySetupContext("__set__", 0);
23973 {
23974 __Pyx_PyCriticalSection __pyx_cs;
23975 __pyx_t_1 = ((PyObject *)__pyx_v_self);
23976 __Pyx_INCREF(__pyx_t_1);
23977 __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
23978 /*try:*/ {
23979 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_value); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L4_error)
23980 __pyx_v_self->dim = __pyx_t_2;
23981 }
23982 /*finally:*/ {
23983 /*normal exit:*/{
23984 __Pyx_PyCriticalSection_End(&__pyx_cs);
23985 goto __pyx_L5;
23986 }
23987 __pyx_L4_error: {
23988 __Pyx_PyCriticalSection_End(&__pyx_cs);
23989 goto __pyx_L1_error;
23990 }
23991 __pyx_L5:;
23992 }
23993 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23994 }
23995
23996 /* function exit code */
23997 __pyx_r = 0;
23998 goto __pyx_L0;
23999 __pyx_L1_error:;
24000 __Pyx_XDECREF(__pyx_t_1);
24001 __Pyx_AddTraceback("superluWrappers.SparseFactor.dim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24002 __pyx_r = -1;
24003 __pyx_L0:;
24004
24005 __Pyx_RefNannyFinishContext();
24006 return __pyx_r;
24007}
24008
24009/* "(tree fragment)":1
24010 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
24011 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling"
24012 * def __setstate_cython__(self, __pyx_state):
24013*/
24014
24015/* Python wrapper */
24016static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self,
24017#if CYTHON_VECTORCALL
24018PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24019#else
24020PyObject *__pyx_args, PyObject *__pyx_kwds
24021#endif
24022); /*proto*/
24023static PyMethodDef __pyx_mdef_15superluWrappers_12SparseFactor_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
24024static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self,
24025#if CYTHON_VECTORCALL
24026PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24027#else
24028PyObject *__pyx_args, PyObject *__pyx_kwds
24029#endif
24030) {
24031 #if !CYTHON_VECTORCALL
24032 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24033 #endif
24034 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24035 PyObject *__pyx_r = 0;
24036 __Pyx_RefNannyDeclarations
24037 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
24038 #if !CYTHON_VECTORCALL
24039 #if CYTHON_ASSUME_SAFE_SIZE
24040 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24041 #else
24042 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24043 #endif
24044 #endif
24045 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24046 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
24047 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24048 if (unlikely(__pyx_kwds_len < 0)) return NULL;
24049 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
24050 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
24051
24052 /* function exit code */
24053 __Pyx_RefNannyFinishContext();
24054 return __pyx_r;
24055}
24056
24057static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
24058 PyObject *__pyx_r = NULL;
24059 __Pyx_RefNannyDeclarations
24060 int __pyx_lineno = 0;
24061 const char *__pyx_filename = NULL;
24062 int __pyx_clineno = 0;
24063 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
24064
24065 /* "(tree fragment)":2
24066 * def __reduce_cython__(self):
24067 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<<
24068 * def __setstate_cython__(self, __pyx_state):
24069 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling"
24070*/
24071 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_A_self_AC_self_L_self_U_sel, 0, 0);
24072 __PYX_ERR(1, 2, __pyx_L1_error)
24073
24074 /* "(tree fragment)":1
24075 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
24076 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling"
24077 * def __setstate_cython__(self, __pyx_state):
24078*/
24079
24080 /* function exit code */
24081 __pyx_L1_error:;
24082 __Pyx_AddTraceback("superluWrappers.SparseFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24083 __pyx_r = NULL;
24084 __Pyx_XGIVEREF(__pyx_r);
24085 __Pyx_RefNannyFinishContext();
24086 return __pyx_r;
24087}
24088
24089/* "(tree fragment)":3
24090 * def __reduce_cython__(self):
24091 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling"
24092 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
24093 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling"
24094*/
24095
24096/* Python wrapper */
24097static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self,
24098#if CYTHON_VECTORCALL
24099PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24100#else
24101PyObject *__pyx_args, PyObject *__pyx_kwds
24102#endif
24103); /*proto*/
24104static PyMethodDef __pyx_mdef_15superluWrappers_12SparseFactor_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
24105static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self,
24106#if CYTHON_VECTORCALL
24107PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24108#else
24109PyObject *__pyx_args, PyObject *__pyx_kwds
24110#endif
24111) {
24112 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
24113 #if !CYTHON_VECTORCALL
24114 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24115 #endif
24116 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24117 PyObject* values[1] = {0};
24118 int __pyx_lineno = 0;
24119 const char *__pyx_filename = NULL;
24120 int __pyx_clineno = 0;
24121 PyObject *__pyx_r = 0;
24122 __Pyx_RefNannyDeclarations
24123 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
24124 #if !CYTHON_VECTORCALL
24125 #if CYTHON_ASSUME_SAFE_SIZE
24126 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24127 #else
24128 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24129 #endif
24130 #endif
24131 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24132 {
24133 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
24134 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24135 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
24136 if (__pyx_kwds_len > 0) {
24137 switch (__pyx_nargs) {
24138 case 1:
24139 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24140 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
24141 CYTHON_FALLTHROUGH;
24142 case 0: break;
24143 default: goto __pyx_L5_argtuple_error;
24144 }
24145 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24146 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
24147 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
24148 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
24149 }
24150 } else if (unlikely(__pyx_nargs != 1)) {
24151 goto __pyx_L5_argtuple_error;
24152 } else {
24153 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24154 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
24155 }
24156 __pyx_v___pyx_state = values[0];
24157 }
24158 goto __pyx_L6_skip;
24159 __pyx_L5_argtuple_error:;
24160 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
24161 __pyx_L6_skip:;
24162 goto __pyx_L4_argument_unpacking_done;
24163 __pyx_L3_error:;
24164 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24165 Py_XDECREF(values[__pyx_temp]);
24166 }
24167 __Pyx_AddTraceback("superluWrappers.SparseFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24168 __Pyx_RefNannyFinishContext();
24169 return NULL;
24170 __pyx_L4_argument_unpacking_done:;
24171 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), __pyx_v___pyx_state);
24172
24173 /* function exit code */
24174 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24175 Py_XDECREF(values[__pyx_temp]);
24176 }
24177 __Pyx_RefNannyFinishContext();
24178 return __pyx_r;
24179}
24180
24181static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
24182 PyObject *__pyx_r = NULL;
24183 __Pyx_RefNannyDeclarations
24184 int __pyx_lineno = 0;
24185 const char *__pyx_filename = NULL;
24186 int __pyx_clineno = 0;
24187 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
24188
24189 /* "(tree fragment)":4
24190 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling"
24191 * def __setstate_cython__(self, __pyx_state):
24192 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<<
24193*/
24194 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_A_self_AC_self_L_self_U_sel, 0, 0);
24195 __PYX_ERR(1, 4, __pyx_L1_error)
24196
24197 /* "(tree fragment)":3
24198 * def __reduce_cython__(self):
24199 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling"
24200 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
24201 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling"
24202*/
24203
24204 /* function exit code */
24205 __pyx_L1_error:;
24206 __Pyx_AddTraceback("superluWrappers.SparseFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24207 __pyx_r = NULL;
24208 __Pyx_XGIVEREF(__pyx_r);
24209 __Pyx_RefNannyFinishContext();
24210 return __pyx_r;
24211}
24212
24213/* "superluWrappers.pyx":222
24214 * self.X.Store = &self.storeX
24215 *
24216 * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
24217 * sparseFactor):
24218 * """ Python wrapper for superlu Sparse Factor Prepare function.
24219*/
24220
24221/* Python wrapper */
24222static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self,
24223#if CYTHON_VECTORCALL
24224PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24225#else
24226PyObject *__pyx_args, PyObject *__pyx_kwds
24227#endif
24228); /*proto*/
24229PyDoc_STRVAR(__pyx_doc_15superluWrappers_sparseFactorPrepare, " Python wrapper for superlu Sparse Factor Prepare function.\n\n Arguments\n ---------\n sparse_matrix : superluWrappers.SparseMatrix\n sparseFactor: superluWrappers.SparseFactor\n\n ");
24230static PyMethodDef __pyx_mdef_15superluWrappers_1sparseFactorPrepare = {"sparseFactorPrepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_1sparseFactorPrepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_15superluWrappers_sparseFactorPrepare};
24231static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self,
24232#if CYTHON_VECTORCALL
24233PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24234#else
24235PyObject *__pyx_args, PyObject *__pyx_kwds
24236#endif
24237) {
24238 PyObject *__pyx_v_sparse_matrix = 0;
24239 PyObject *__pyx_v_sparseFactor = 0;
24240 #if !CYTHON_VECTORCALL
24241 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24242 #endif
24243 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24244 PyObject* values[2] = {0,0};
24245 int __pyx_lineno = 0;
24246 const char *__pyx_filename = NULL;
24247 int __pyx_clineno = 0;
24248 PyObject *__pyx_r = 0;
24249 __Pyx_RefNannyDeclarations
24250 __Pyx_RefNannySetupContext("sparseFactorPrepare (wrapper)", 0);
24251 #if !CYTHON_VECTORCALL
24252 #if CYTHON_ASSUME_SAFE_SIZE
24253 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24254 #else
24255 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24256 #endif
24257 #endif
24258 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24259 {
24260 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sparse_matrix,&__pyx_mstate_global->__pyx_n_u_sparseFactor,0};
24261 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24262 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 222, __pyx_L3_error)
24263 if (__pyx_kwds_len > 0) {
24264 switch (__pyx_nargs) {
24265 case 2:
24266 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24267 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 222, __pyx_L3_error)
24268 CYTHON_FALLTHROUGH;
24269 case 1:
24270 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24271 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 222, __pyx_L3_error)
24272 CYTHON_FALLTHROUGH;
24273 case 0: break;
24274 default: goto __pyx_L5_argtuple_error;
24275 }
24276 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24277 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sparseFactorPrepare", 0) < (0)) __PYX_ERR(0, 222, __pyx_L3_error)
24278 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
24279 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sparseFactorPrepare", 1, 2, 2, i); __PYX_ERR(0, 222, __pyx_L3_error) }
24280 }
24281 } else if (unlikely(__pyx_nargs != 2)) {
24282 goto __pyx_L5_argtuple_error;
24283 } else {
24284 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24285 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 222, __pyx_L3_error)
24286 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24287 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 222, __pyx_L3_error)
24288 }
24289 __pyx_v_sparse_matrix = values[0];
24290 __pyx_v_sparseFactor = values[1];
24291 }
24292 goto __pyx_L6_skip;
24293 __pyx_L5_argtuple_error:;
24294 __Pyx_RaiseArgtupleInvalid("sparseFactorPrepare", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 222, __pyx_L3_error)
24295 __pyx_L6_skip:;
24296 goto __pyx_L4_argument_unpacking_done;
24297 __pyx_L3_error:;
24298 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24299 Py_XDECREF(values[__pyx_temp]);
24300 }
24301 __Pyx_AddTraceback("superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
24302 __Pyx_RefNannyFinishContext();
24303 return NULL;
24304 __pyx_L4_argument_unpacking_done:;
24305 __pyx_r = __pyx_pf_15superluWrappers_sparseFactorPrepare(__pyx_self, __pyx_v_sparse_matrix, __pyx_v_sparseFactor);
24306
24307 /* function exit code */
24308 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24309 Py_XDECREF(values[__pyx_temp]);
24310 }
24311 __Pyx_RefNannyFinishContext();
24312 return __pyx_r;
24313}
24314
24315static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor) {
24316 PyObject *__pyx_r = NULL;
24317 __Pyx_RefNannyDeclarations
24318 PyObject *__pyx_t_1 = NULL;
24319 int __pyx_lineno = 0;
24320 const char *__pyx_filename = NULL;
24321 int __pyx_clineno = 0;
24322 __Pyx_RefNannySetupContext("sparseFactorPrepare", 0);
24323
24324 /* "superluWrappers.pyx":232
24325 *
24326 * """
24327 * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix, # <<<<<<<<<<<<<<
24328 * sparseFactor)
24329 *
24330*/
24331 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sparse_matrix, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
24332 __Pyx_GOTREF(__pyx_t_1);
24333 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 232, __pyx_L1_error)
24334
24335 /* "superluWrappers.pyx":233
24336 * """
24337 * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix,
24338 * sparseFactor) # <<<<<<<<<<<<<<
24339 *
24340 * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm,
24341*/
24342 if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_mstate_global->__pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 233, __pyx_L1_error)
24343
24344 /* "superluWrappers.pyx":232
24345 *
24346 * """
24347 * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix, # <<<<<<<<<<<<<<
24348 * sparseFactor)
24349 *
24350*/
24351 __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
24352 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24353
24354 /* "superluWrappers.pyx":222
24355 * self.X.Store = &self.storeX
24356 *
24357 * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
24358 * sparseFactor):
24359 * """ Python wrapper for superlu Sparse Factor Prepare function.
24360*/
24361
24362 /* function exit code */
24363 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24364 goto __pyx_L0;
24365 __pyx_L1_error:;
24366 __Pyx_XDECREF(__pyx_t_1);
24367 __Pyx_AddTraceback("superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
24368 __pyx_r = NULL;
24369 __pyx_L0:;
24370 __Pyx_XGIVEREF(__pyx_r);
24371 __Pyx_RefNannyFinishContext();
24372 return __pyx_r;
24373}
24374
24375/* "superluWrappers.pyx":235
24376 * sparseFactor)
24377 *
24378 * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm, # <<<<<<<<<<<<<<
24379 * SparseFactor sparseFactor):
24380 *
24381*/
24382
24383static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor) {
24384 int __pyx_v_permc_spec;
24385 int __pyx_v_n;
24386 int __pyx_v_relax;
24387 int __pyx_v_panel_size;
24388 int __pyx_v_lwork;
24389 int __pyx_v_info;
24390 void *__pyx_v_work;
24391 PyObject *__pyx_v_i = NULL;
24392 __Pyx_RefNannyDeclarations
24393 __pyx_t_5numpy_int32_t __pyx_t_1;
24394 int __pyx_t_2;
24395 int __pyx_t_3;
24396 PyObject *__pyx_t_4 = NULL;
24397 PyObject *__pyx_t_5 = NULL;
24398 PyObject *__pyx_t_6 = NULL;
24399 size_t __pyx_t_7;
24400 PyObject *(*__pyx_t_8)(PyObject *);
24401 Py_ssize_t __pyx_t_9;
24402 Py_ssize_t __pyx_t_10;
24403 int __pyx_lineno = 0;
24404 const char *__pyx_filename = NULL;
24405 int __pyx_clineno = 0;
24406 __Pyx_RefNannySetupContext("superluWrappersSparseFactorPrepare", 0);
24407
24408 /* "superluWrappers.pyx":238
24409 * SparseFactor sparseFactor):
24410 *
24411 * cdef int permc_spec = 3 # <<<<<<<<<<<<<<
24412 * cdef int n
24413 * cdef int relax=1
24414*/
24415 __pyx_v_permc_spec = 3;
24416
24417 /* "superluWrappers.pyx":240
24418 * cdef int permc_spec = 3
24419 * cdef int n
24420 * cdef int relax=1 # <<<<<<<<<<<<<<
24421 * cdef int panel_size = 10
24422 * cdef int lwork = 0
24423*/
24424 __pyx_v_relax = 1;
24425
24426 /* "superluWrappers.pyx":241
24427 * cdef int n
24428 * cdef int relax=1
24429 * cdef int panel_size = 10 # <<<<<<<<<<<<<<
24430 * cdef int lwork = 0
24431 * cdef int info = 0
24432*/
24433 __pyx_v_panel_size = 10;
24434
24435 /* "superluWrappers.pyx":242
24436 * cdef int relax=1
24437 * cdef int panel_size = 10
24438 * cdef int lwork = 0 # <<<<<<<<<<<<<<
24439 * cdef int info = 0
24440 * cdef void *work = NULL
24441*/
24442 __pyx_v_lwork = 0;
24443
24444 /* "superluWrappers.pyx":243
24445 * cdef int panel_size = 10
24446 * cdef int lwork = 0
24447 * cdef int info = 0 # <<<<<<<<<<<<<<
24448 * cdef void *work = NULL
24449 *
24450*/
24451 __pyx_v_info = 0;
24452
24453 /* "superluWrappers.pyx":244
24454 * cdef int lwork = 0
24455 * cdef int info = 0
24456 * cdef void *work = NULL # <<<<<<<<<<<<<<
24457 *
24458 * sparseFactor.storeA.nnz = sm.A.nnz
24459*/
24460 __pyx_v_work = NULL;
24461
24462 /* "superluWrappers.pyx":246
24463 * cdef void *work = NULL
24464 *
24465 * sparseFactor.storeA.nnz = sm.A.nnz # <<<<<<<<<<<<<<
24466 * sparseFactor.storeA.nzval = &sm.A.nzval[0]
24467 * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
24468*/
24469 __pyx_t_1 = __pyx_v_sm->A.nnz;
24470
24471 __pyx_v_sparseFactor->storeA.nnz = __pyx_t_1;
24472
24473 /* "superluWrappers.pyx":247
24474 *
24475 * sparseFactor.storeA.nnz = sm.A.nnz
24476 * sparseFactor.storeA.nzval = &sm.A.nzval[0] # <<<<<<<<<<<<<<
24477 * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
24478 * sparseFactor.storeA.rowind = &sm.A.colind[0]
24479*/
24480 __pyx_v_sparseFactor->storeA.nzval = (&(__pyx_v_sm->A.nzval[0]));
24481
24482 /* "superluWrappers.pyx":248
24483 * sparseFactor.storeA.nnz = sm.A.nnz
24484 * sparseFactor.storeA.nzval = &sm.A.nzval[0]
24485 * sparseFactor.storeA.colptr = &sm.A.rowptr[0] # <<<<<<<<<<<<<<
24486 * sparseFactor.storeA.rowind = &sm.A.colind[0]
24487 *
24488*/
24489 __pyx_v_sparseFactor->storeA.colptr = (&(__pyx_v_sm->A.rowptr[0]));
24490
24491 /* "superluWrappers.pyx":249
24492 * sparseFactor.storeA.nzval = &sm.A.nzval[0]
24493 * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
24494 * sparseFactor.storeA.rowind = &sm.A.colind[0] # <<<<<<<<<<<<<<
24495 *
24496 * if sparseFactor.use_same_perm_c == 0:
24497*/
24498 __pyx_v_sparseFactor->storeA.rowind = (&(__pyx_v_sm->A.colind[0]));
24499
24500 /* "superluWrappers.pyx":251
24501 * sparseFactor.storeA.rowind = &sm.A.colind[0]
24502 *
24503 * if sparseFactor.use_same_perm_c == 0: # <<<<<<<<<<<<<<
24504 * cget_perm_c(permc_spec,
24505 * &sparseFactor.A,
24506*/
24507 __pyx_t_2 = (__pyx_v_sparseFactor->use_same_perm_c == 0);
24508
24509 if (__pyx_t_2) {
24510
24511
24512 /* "superluWrappers.pyx":252
24513 *
24514 * if sparseFactor.use_same_perm_c == 0:
24515 * cget_perm_c(permc_spec, # <<<<<<<<<<<<<<
24516 * &sparseFactor.A,
24517 * sparseFactor.perm_c)
24518*/
24519 get_perm_c(__pyx_v_permc_spec, (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c);
24520
24521 /* "superluWrappers.pyx":255
24522 * &sparseFactor.A,
24523 * sparseFactor.perm_c)
24524 * sparseFactor.use_same_perm_c = 1 # <<<<<<<<<<<<<<
24525 *
24526 * if sparseFactor.use_same_sparsity == 0:
24527*/
24528 __pyx_v_sparseFactor->use_same_perm_c = 1;
24529
24530 /* "superluWrappers.pyx":251
24531 * sparseFactor.storeA.rowind = &sm.A.colind[0]
24532 *
24533 * if sparseFactor.use_same_perm_c == 0: # <<<<<<<<<<<<<<
24534 * cget_perm_c(permc_spec,
24535 * &sparseFactor.A,
24536*/
24537 }
24538
24539 /* "superluWrappers.pyx":257
24540 * sparseFactor.use_same_perm_c = 1
24541 *
24542 * if sparseFactor.use_same_sparsity == 0: # <<<<<<<<<<<<<<
24543 * if sparseFactor.AC.Store != NULL:
24544 * cDestroy_CompCol_Permuted(&sparseFactor.AC)
24545*/
24546 __pyx_t_2 = (__pyx_v_sparseFactor->use_same_sparsity == 0);
24547
24548 if (__pyx_t_2) {
24549
24550
24551 /* "superluWrappers.pyx":258
24552 *
24553 * if sparseFactor.use_same_sparsity == 0:
24554 * if sparseFactor.AC.Store != NULL: # <<<<<<<<<<<<<<
24555 * cDestroy_CompCol_Permuted(&sparseFactor.AC)
24556 * cDestroy_SuperNode_Matrix(&sparseFactor.L)
24557*/
24558 __pyx_t_2 = (__pyx_v_sparseFactor->AC.Store != NULL);
24559
24560 if (__pyx_t_2) {
24561
24562
24563 /* "superluWrappers.pyx":259
24564 * if sparseFactor.use_same_sparsity == 0:
24565 * if sparseFactor.AC.Store != NULL:
24566 * cDestroy_CompCol_Permuted(&sparseFactor.AC) # <<<<<<<<<<<<<<
24567 * cDestroy_SuperNode_Matrix(&sparseFactor.L)
24568 * cDestroy_CompCol_Matrix(&sparseFactor.U)
24569*/
24570 Destroy_CompCol_Permuted((&__pyx_v_sparseFactor->AC));
24571
24572 /* "superluWrappers.pyx":260
24573 * if sparseFactor.AC.Store != NULL:
24574 * cDestroy_CompCol_Permuted(&sparseFactor.AC)
24575 * cDestroy_SuperNode_Matrix(&sparseFactor.L) # <<<<<<<<<<<<<<
24576 * cDestroy_CompCol_Matrix(&sparseFactor.U)
24577 * csp_preorder(&sparseFactor.options,
24578*/
24579 Destroy_SuperNode_Matrix((&__pyx_v_sparseFactor->L));
24580
24581 /* "superluWrappers.pyx":261
24582 * cDestroy_CompCol_Permuted(&sparseFactor.AC)
24583 * cDestroy_SuperNode_Matrix(&sparseFactor.L)
24584 * cDestroy_CompCol_Matrix(&sparseFactor.U) # <<<<<<<<<<<<<<
24585 * csp_preorder(&sparseFactor.options,
24586 * &sparseFactor.A,
24587*/
24588 Destroy_CompCol_Matrix((&__pyx_v_sparseFactor->U));
24589
24590 /* "superluWrappers.pyx":258
24591 *
24592 * if sparseFactor.use_same_sparsity == 0:
24593 * if sparseFactor.AC.Store != NULL: # <<<<<<<<<<<<<<
24594 * cDestroy_CompCol_Permuted(&sparseFactor.AC)
24595 * cDestroy_SuperNode_Matrix(&sparseFactor.L)
24596*/
24597 }
24598
24599 /* "superluWrappers.pyx":262
24600 * cDestroy_SuperNode_Matrix(&sparseFactor.L)
24601 * cDestroy_CompCol_Matrix(&sparseFactor.U)
24602 * csp_preorder(&sparseFactor.options, # <<<<<<<<<<<<<<
24603 * &sparseFactor.A,
24604 * sparseFactor.perm_c,
24605*/
24606 sp_preorder((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->etree, (&__pyx_v_sparseFactor->AC));
24607
24608 /* "superluWrappers.pyx":267
24609 * sparseFactor.etree,
24610 * &sparseFactor.AC)
24611 * sparseFactor.use_same_sparsity = 1 # <<<<<<<<<<<<<<
24612 * else:
24613 * sparseFactor.options.Fact = _SamePattern_SameRowPerm
24614*/
24615 __pyx_v_sparseFactor->use_same_sparsity = 1;
24616
24617 /* "superluWrappers.pyx":257
24618 * sparseFactor.use_same_perm_c = 1
24619 *
24620 * if sparseFactor.use_same_sparsity == 0: # <<<<<<<<<<<<<<
24621 * if sparseFactor.AC.Store != NULL:
24622 * cDestroy_CompCol_Permuted(&sparseFactor.AC)
24623*/
24624 goto __pyx_L4;
24625 }
24626
24627 /* "superluWrappers.pyx":269
24628 * sparseFactor.use_same_sparsity = 1
24629 * else:
24630 * sparseFactor.options.Fact = _SamePattern_SameRowPerm # <<<<<<<<<<<<<<
24631 * n = sparseFactor.A.ncol
24632 * for i in range(n):
24633*/
24634 /*else*/ {
24635 __pyx_v_sparseFactor->options.Fact = SamePattern_SameRowPerm;
24636
24637 /* "superluWrappers.pyx":270
24638 * else:
24639 * sparseFactor.options.Fact = _SamePattern_SameRowPerm
24640 * n = sparseFactor.A.ncol # <<<<<<<<<<<<<<
24641 * for i in range(n):
24642 * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
24643*/
24644 __pyx_t_3 = __pyx_v_sparseFactor->A.ncol;
24645
24646 __pyx_v_n = __pyx_t_3;
24647
24648 /* "superluWrappers.pyx":271
24649 * sparseFactor.options.Fact = _SamePattern_SameRowPerm
24650 * n = sparseFactor.A.ncol
24651 * for i in range(n): # <<<<<<<<<<<<<<
24652 * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
24653 * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
24654*/
24655 __pyx_t_5 = NULL;
24656 __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error)
24657 __Pyx_GOTREF(__pyx_t_6);
24658 __pyx_t_7 = 1;
24659 {
24660 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
24661 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24662 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24663 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24664 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
24665 __Pyx_GOTREF(__pyx_t_4);
24666 }
24667 __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error)
24668 __Pyx_GOTREF(__pyx_t_6);
24669 __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error)
24670 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24671 for (;;) {
24672 {
24673 __pyx_t_4 = __pyx_t_8(__pyx_t_6);
24674 if (unlikely(!__pyx_t_4)) {
24675 PyObject* exc_type = PyErr_Occurred();
24676 if (exc_type) {
24677 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 271, __pyx_L1_error)
24678 PyErr_Clear();
24679 }
24680 break;
24681 }
24682 }
24683 __Pyx_GOTREF(__pyx_t_4);
24684 if (__Pyx_PyInt_FromNumber(&__pyx_t_4, NULL, 1) < (0)) __PYX_ERR(0, 271, __pyx_L1_error)
24685 __Pyx_XDECREF_SET(__pyx_v_i, ((PyObject*)__pyx_t_4));
24686 __pyx_t_4 = 0;
24687
24688 /* "superluWrappers.pyx":272
24689 * n = sparseFactor.A.ncol
24690 * for i in range(n):
24691 * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i] # <<<<<<<<<<<<<<
24692 * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
24693 * cdgstrf(&sparseFactor.options,
24694*/
24695 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error)
24696 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error)
24697 (((struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colbeg[(__pyx_v_sparseFactor->perm_c[__pyx_t_10])]) = (((struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_9]);
24698
24699
24700
24701 /* "superluWrappers.pyx":273
24702 * for i in range(n):
24703 * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
24704 * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1] # <<<<<<<<<<<<<<
24705 * cdgstrf(&sparseFactor.options,
24706 * &sparseFactor.AC,
24707*/
24708 __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
24709 __Pyx_GOTREF(__pyx_t_4);
24710 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error)
24711 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24712 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error)
24713 (((struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colend[(__pyx_v_sparseFactor->perm_c[__pyx_t_10])]) = (((struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_9]);
24714
24715
24716
24717 /* "superluWrappers.pyx":271
24718 * sparseFactor.options.Fact = _SamePattern_SameRowPerm
24719 * n = sparseFactor.A.ncol
24720 * for i in range(n): # <<<<<<<<<<<<<<
24721 * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
24722 * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
24723*/
24724 }
24725 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24726 }
24727 __pyx_L4:;
24728
24729 /* "superluWrappers.pyx":274
24730 * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
24731 * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
24732 * cdgstrf(&sparseFactor.options, # <<<<<<<<<<<<<<
24733 * &sparseFactor.AC,
24734 * relax,
24735*/
24736 dgstrf((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->AC), __pyx_v_relax, __pyx_v_panel_size, __pyx_v_sparseFactor->etree, __pyx_v_work, __pyx_v_lwork, __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), (&__pyx_v_sparseFactor->Glu), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
24737
24738 /* "superluWrappers.pyx":235
24739 * sparseFactor)
24740 *
24741 * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm, # <<<<<<<<<<<<<<
24742 * SparseFactor sparseFactor):
24743 *
24744*/
24745
24746 /* function exit code */
24747 goto __pyx_L0;
24748 __pyx_L1_error:;
24749 __Pyx_XDECREF(__pyx_t_4);
24750 __Pyx_XDECREF(__pyx_t_5);
24751 __Pyx_XDECREF(__pyx_t_6);
24752 __Pyx_AddTraceback("superluWrappers.superluWrappersSparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
24753 __pyx_L0:;
24754
24755
24756
24757
24758
24759
24760
24761 __Pyx_XDECREF(__pyx_v_i);
24762
24763 __Pyx_RefNannyFinishContext();
24764}
24765
24766/* "superluWrappers.pyx":289
24767 * &info)
24768 *
24769 * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
24770 * x):
24771 * """ Sparse factor solve wrappers
24772*/
24773
24774/* Python wrapper */
24775static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self,
24776#if CYTHON_VECTORCALL
24777PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24778#else
24779PyObject *__pyx_args, PyObject *__pyx_kwds
24780#endif
24781); /*proto*/
24782PyDoc_STRVAR(__pyx_doc_15superluWrappers_2sparseFactorSolve, " Sparse factor solve wrappers\n\n Arguments\n ---------\n sparseFactor : superluWrappers.SparseFactor\n x (input / output) : np.array\n x serves as the right hand side and then becomes the solution\n ");
24783static PyMethodDef __pyx_mdef_15superluWrappers_3sparseFactorSolve = {"sparseFactorSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_3sparseFactorSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_15superluWrappers_2sparseFactorSolve};
24784static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self,
24785#if CYTHON_VECTORCALL
24786PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24787#else
24788PyObject *__pyx_args, PyObject *__pyx_kwds
24789#endif
24790) {
24791 PyObject *__pyx_v_sparseFactor = 0;
24792 PyObject *__pyx_v_x = 0;
24793 #if !CYTHON_VECTORCALL
24794 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24795 #endif
24796 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24797 PyObject* values[2] = {0,0};
24798 int __pyx_lineno = 0;
24799 const char *__pyx_filename = NULL;
24800 int __pyx_clineno = 0;
24801 PyObject *__pyx_r = 0;
24802 __Pyx_RefNannyDeclarations
24803 __Pyx_RefNannySetupContext("sparseFactorSolve (wrapper)", 0);
24804 #if !CYTHON_VECTORCALL
24805 #if CYTHON_ASSUME_SAFE_SIZE
24806 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24807 #else
24808 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24809 #endif
24810 #endif
24811 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24812 {
24813 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sparseFactor,&__pyx_mstate_global->__pyx_n_u_x,0};
24814 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24815 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 289, __pyx_L3_error)
24816 if (__pyx_kwds_len > 0) {
24817 switch (__pyx_nargs) {
24818 case 2:
24819 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24820 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 289, __pyx_L3_error)
24821 CYTHON_FALLTHROUGH;
24822 case 1:
24823 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24824 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 289, __pyx_L3_error)
24825 CYTHON_FALLTHROUGH;
24826 case 0: break;
24827 default: goto __pyx_L5_argtuple_error;
24828 }
24829 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24830 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sparseFactorSolve", 0) < (0)) __PYX_ERR(0, 289, __pyx_L3_error)
24831 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
24832 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sparseFactorSolve", 1, 2, 2, i); __PYX_ERR(0, 289, __pyx_L3_error) }
24833 }
24834 } else if (unlikely(__pyx_nargs != 2)) {
24835 goto __pyx_L5_argtuple_error;
24836 } else {
24837 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24838 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 289, __pyx_L3_error)
24839 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24840 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 289, __pyx_L3_error)
24841 }
24842 __pyx_v_sparseFactor = values[0];
24843 __pyx_v_x = values[1];
24844 }
24845 goto __pyx_L6_skip;
24846 __pyx_L5_argtuple_error:;
24847 __Pyx_RaiseArgtupleInvalid("sparseFactorSolve", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 289, __pyx_L3_error)
24848 __pyx_L6_skip:;
24849 goto __pyx_L4_argument_unpacking_done;
24850 __pyx_L3_error:;
24851 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24852 Py_XDECREF(values[__pyx_temp]);
24853 }
24854 __Pyx_AddTraceback("superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24855 __Pyx_RefNannyFinishContext();
24856 return NULL;
24857 __pyx_L4_argument_unpacking_done:;
24858 __pyx_r = __pyx_pf_15superluWrappers_2sparseFactorSolve(__pyx_self, __pyx_v_sparseFactor, __pyx_v_x);
24859
24860 /* function exit code */
24861 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24862 Py_XDECREF(values[__pyx_temp]);
24863 }
24864 __Pyx_RefNannyFinishContext();
24865 return __pyx_r;
24866}
24867
24868static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x) {
24869 PyObject *__pyx_r = NULL;
24870 __Pyx_RefNannyDeclarations
24871 __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
24872 int __pyx_lineno = 0;
24873 const char *__pyx_filename = NULL;
24874 int __pyx_clineno = 0;
24875 __Pyx_RefNannySetupContext("sparseFactorSolve", 0);
24876
24877 /* "superluWrappers.pyx":299
24878 * x serves as the right hand side and then becomes the solution
24879 * """
24880 * superluWrappersSparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
24881 * x)
24882 *
24883*/
24884 if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_mstate_global->__pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 299, __pyx_L1_error)
24885
24886 /* "superluWrappers.pyx":300
24887 * """
24888 * superluWrappersSparseFactorSolve(sparseFactor,
24889 * x) # <<<<<<<<<<<<<<
24890 *
24891 *
24892*/
24893 __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 300, __pyx_L1_error)
24894
24895 /* "superluWrappers.pyx":299
24896 * x serves as the right hand side and then becomes the solution
24897 * """
24898 * superluWrappersSparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
24899 * x)
24900 *
24901*/
24902 __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor), __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error)
24903 __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL;
24904
24905 /* "superluWrappers.pyx":289
24906 * &info)
24907 *
24908 * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
24909 * x):
24910 * """ Sparse factor solve wrappers
24911*/
24912
24913 /* function exit code */
24914 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24915 goto __pyx_L0;
24916 __pyx_L1_error:;
24917 __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
24918 __Pyx_AddTraceback("superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24919 __pyx_r = NULL;
24920 __pyx_L0:;
24921 __Pyx_XGIVEREF(__pyx_r);
24922 __Pyx_RefNannyFinishContext();
24923 return __pyx_r;
24924}
24925
24926/* "superluWrappers.pyx":303
24927 *
24928 *
24929 * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor, # <<<<<<<<<<<<<<
24930 * np.float64_t [:] x):
24931 * cdef _trans_t trans = _TRANS
24932*/
24933
24934static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor, __Pyx_memviewslice __pyx_v_x) {
24935 trans_t __pyx_v_trans;
24936 int __pyx_v_info;
24937 Py_ssize_t __pyx_t_1;
24938
24939 /* "superluWrappers.pyx":305
24940 * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor,
24941 * np.float64_t [:] x):
24942 * cdef _trans_t trans = _TRANS # <<<<<<<<<<<<<<
24943 * cdef int info = 0
24944 *
24945*/
24946 __pyx_v_trans = TRANS;
24947
24948 /* "superluWrappers.pyx":306
24949 * np.float64_t [:] x):
24950 * cdef _trans_t trans = _TRANS
24951 * cdef int info = 0 # <<<<<<<<<<<<<<
24952 *
24953 * sparseFactor.storeX.nzval = &x[0]
24954*/
24955 __pyx_v_info = 0;
24956
24957 /* "superluWrappers.pyx":308
24958 * cdef int info = 0
24959 *
24960 * sparseFactor.storeX.nzval = &x[0] # <<<<<<<<<<<<<<
24961 *
24962 * cdgstrs(trans,
24963*/
24964 __pyx_t_1 = 0;
24965 __pyx_v_sparseFactor->storeX.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_1 * __pyx_v_x.strides[0]) ))));
24966
24967 /* "superluWrappers.pyx":310
24968 * sparseFactor.storeX.nzval = &x[0]
24969 *
24970 * cdgstrs(trans, # <<<<<<<<<<<<<<
24971 * &sparseFactor.L,
24972 * &sparseFactor.U,
24973*/
24974 dgstrs(__pyx_v_trans, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->X), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
24975
24976 /* "superluWrappers.pyx":303
24977 *
24978 *
24979 * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor, # <<<<<<<<<<<<<<
24980 * np.float64_t [:] x):
24981 * cdef _trans_t trans = _TRANS
24982*/
24983
24984 /* function exit code */
24985
24986
24987
24988}
24989/* #### Code section: module_exttypes ### */
24990
24991static PyObject *__pyx_tp_new__initialisation_15superluWrappers_cSparseMatrix(PyObject *o,
24992#if CYTHON_VECTORCALL_TPNEW
24993 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
24994#else
24995 PyObject *a, PyObject *k
24996#endif
24997) {
24998 {
24999 int cinit_result = __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(o,
25000#if CYTHON_VECTORCALL_TPNEW
25001 args, nargs, kwnames
25002#else
25003 a, k
25004#endif
25005);
25006 if (unlikely(cinit_result)) goto bad;
25007 }
25008 return o;
25009 bad:
25010 Py_DECREF(o); o = 0;
25011 return NULL;
25012}
25013
25014static PyObject *__pyx_tp_new_vectorcall_15superluWrappers_cSparseMatrix(PyTypeObject *t,
25015#if CYTHON_VECTORCALL_TPNEW
25016 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25017#else
25018 PyObject *a, PyObject *k
25019#endif
25020) {
25021 PyObject *o;
25022 o = __Pyx_AllocateExtensionType(t, 0);
25023 if (unlikely(!o)) return 0;
25024 return __pyx_tp_new__initialisation_15superluWrappers_cSparseMatrix(o,
25025#if CYTHON_VECTORCALL_TPNEW
25026 args, nargs, kwnames
25027#else
25028 a, k
25029#endif
25030);
25031}
25032
25033#if CYTHON_VECTORCALL_TPNEW
25034static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
25035 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_15superluWrappers_cSparseMatrix, t, a, k);
25036}
25037#endif
25038
25039#if CYTHON_VECTORCALL_TPNEW
25040static PyObject *__pyx_tp_vectorcall_15superluWrappers_cSparseMatrix(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
25041 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_15superluWrappers_cSparseMatrix || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25042 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25043 }
25044 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25045 PyObject *o = __pyx_tp_new_vectorcall_15superluWrappers_cSparseMatrix((PyTypeObject*)t, args, nargs, kwnames);
25046 return o;
25047}
25048#endif
25049
25050static void __pyx_tp_dealloc_15superluWrappers_cSparseMatrix(PyObject *o) {
25051 #if CYTHON_USE_TP_FINALIZE
25052 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25053 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_15superluWrappers_cSparseMatrix) {
25054 if (PyObject_CallFinalizerFromDealloc(o)) return;
25055 }
25056 }
25057 #endif
25058 PyTypeObject *tp = Py_TYPE(o);
25059 #if CYTHON_USE_TYPE_SLOTS
25060 (*tp->tp_free)(o);
25061 #else
25062 {
25063 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
25064 if (tp_free) tp_free(o);
25065 }
25066 #endif
25067 #if CYTHON_USE_TYPE_SPECS
25068 Py_DECREF(tp);
25069 #endif
25070}
25071
25072static PyMethodDef __pyx_methods_15superluWrappers_cSparseMatrix[] = {
25073 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25074 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25075 {0, 0, 0, 0}
25076};
25077#if CYTHON_USE_TYPE_SPECS
25078static PyType_Slot __pyx_type_15superluWrappers_cSparseMatrix_slots[] = {
25079 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_15superluWrappers_cSparseMatrix},
25080 {Py_tp_methods, (void *)__pyx_methods_15superluWrappers_cSparseMatrix},
25081 {Py_tp_new, (void *)__pyx_tp_new_15superluWrappers_cSparseMatrix},
25082 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25083 #if CYTHON_VECTORCALL_TPNEW
25084 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_15superluWrappers_cSparseMatrix},
25085 #endif
25086 #endif
25087 {0, 0},
25088};
25089static PyType_Spec __pyx_type_15superluWrappers_cSparseMatrix_spec = {
25090 "superluWrappers.cSparseMatrix",
25091 sizeof(struct __pyx_obj_15superluWrappers_cSparseMatrix),
25092 0,
25093 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
25094 __pyx_type_15superluWrappers_cSparseMatrix_slots,
25095};
25096#else
25097
25098static PyTypeObject __pyx_type_15superluWrappers_cSparseMatrix = {
25099 PyVarObject_HEAD_INIT(0, 0)
25100 "superluWrappers.""cSparseMatrix", /*tp_name*/
25101 sizeof(struct __pyx_obj_15superluWrappers_cSparseMatrix), /*tp_basicsize*/
25102 0, /*tp_itemsize*/
25103 __pyx_tp_dealloc_15superluWrappers_cSparseMatrix, /*tp_dealloc*/
25104 0, /*tp_vectorcall_offset*/
25105 0, /*tp_getattr*/
25106 0, /*tp_setattr*/
25107 0, /*tp_as_async*/
25108 0, /*tp_repr*/
25109 0, /*tp_as_number*/
25110 0, /*tp_as_sequence*/
25111 0, /*tp_as_mapping*/
25112 0, /*tp_hash*/
25113 0, /*tp_call*/
25114 0, /*tp_str*/
25115 0, /*tp_getattro*/
25116 0, /*tp_setattro*/
25117 0, /*tp_as_buffer*/
25118 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
25119 0, /*tp_doc*/
25120 0, /*tp_traverse*/
25121 0, /*tp_clear*/
25122 0, /*tp_richcompare*/
25123 0, /*tp_weaklistoffset*/
25124 0, /*tp_iter*/
25125 0, /*tp_iternext*/
25126 __pyx_methods_15superluWrappers_cSparseMatrix, /*tp_methods*/
25127 0, /*tp_members*/
25128 0, /*tp_getset*/
25129 0, /*tp_base*/
25130 0, /*tp_dict*/
25131 0, /*tp_descr_get*/
25132 0, /*tp_descr_set*/
25133 #if !CYTHON_USE_TYPE_SPECS
25134 0, /*tp_dictoffset*/
25135 #endif
25136 0, /*tp_init*/
25137 0, /*tp_alloc*/
25138 __pyx_tp_new_15superluWrappers_cSparseMatrix, /*tp_new*/
25139 0, /*tp_free*/
25140 0, /*tp_is_gc*/
25141 0, /*tp_bases*/
25142 0, /*tp_mro*/
25143 0, /*tp_cache*/
25144 0, /*tp_subclasses*/
25145 0, /*tp_weaklist*/
25146 0, /*tp_del*/
25147 0, /*tp_version_tag*/
25148 #if CYTHON_USE_TP_FINALIZE
25149 0, /*tp_finalize*/
25150 #else
25151 NULL, /*tp_finalize*/
25152 #endif
25153 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25154 #if CYTHON_VECTORCALL_TPNEW
25155 __pyx_tp_vectorcall_15superluWrappers_cSparseMatrix, /*tp_vectorcall*/
25156 #else
25157 NULL, /*tp_vectorcall*/
25158 #endif
25159 #endif
25160 #if __PYX_NEED_TP_PRINT_SLOT == 1
25161 0, /*tp_print*/
25162 #endif
25163 #if PY_VERSION_HEX >= 0x030C0000
25164 0, /*tp_watched*/
25165 #endif
25166 #if PY_VERSION_HEX >= 0x030d00A4
25167 0, /*tp_versions_used*/
25168 #endif
25169 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
25170 0, /*tp_pypy_flags*/
25171 #endif
25172};
25173#endif
25174static struct __pyx_vtabstruct_15superluWrappers_SparseFactor __pyx_vtable_15superluWrappers_SparseFactor;
25175
25176static PyObject *__pyx_tp_new__initialisation_15superluWrappers_SparseFactor(PyObject *o,
25177#if CYTHON_VECTORCALL_TPNEW
25178 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
25179#else
25180 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
25181#endif
25182) {
25183 struct __pyx_obj_15superluWrappers_SparseFactor *p = ((struct __pyx_obj_15superluWrappers_SparseFactor *)o);
25184 p->__pyx_vtab = __pyx_vtabptr_15superluWrappers_SparseFactor;
25185 return o;
25186}
25187
25188static PyObject *__pyx_tp_new_vectorcall_15superluWrappers_SparseFactor(PyTypeObject *t,
25189#if CYTHON_VECTORCALL_TPNEW
25190 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25191#else
25192 PyObject *a, PyObject *k
25193#endif
25194) {
25195 PyObject *o;
25196 o = __Pyx_AllocateExtensionType(t, 0);
25197 if (unlikely(!o)) return 0;
25198 return __pyx_tp_new__initialisation_15superluWrappers_SparseFactor(o,
25199#if CYTHON_VECTORCALL_TPNEW
25200 args, nargs, kwnames
25201#else
25202 a, k
25203#endif
25204);
25205}
25206
25207#if CYTHON_VECTORCALL_TPNEW
25208static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
25209 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_15superluWrappers_SparseFactor, t, a, k);
25210}
25211#endif
25212
25213#if CYTHON_VECTORCALL_TPNEW
25214static PyObject *__pyx_tp_vectorcall_15superluWrappers_SparseFactor(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
25215 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_15superluWrappers_SparseFactor || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25216 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25217 }
25218 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25219 PyObject *o = __pyx_tp_new_vectorcall_15superluWrappers_SparseFactor((PyTypeObject*)t, args, nargs, kwnames);
25220 if (likely(o)) {
25221 assert(Py_TYPE(o) == (PyTypeObject*)t);
25222 if (unlikely(__pyx_pw_15superluWrappers_12SparseFactor_1__init__(o, args, nargs, kwnames) < 0)) {
25223 Py_CLEAR(o);
25224 }
25225 }
25226 return o;
25227}
25228#endif
25229
25230#if CYTHON_VECTORCALL_TPNEW
25231static int __pyx_tp_init_15superluWrappers_SparseFactor(PyObject *o, PyObject *args, PyObject *kwds) {
25232 return __Pyx_CallTpinitAsVectorcall(__pyx_pw_15superluWrappers_12SparseFactor_1__init__, o, args, kwds);
25233}
25234#endif
25235
25236static void __pyx_tp_dealloc_15superluWrappers_SparseFactor(PyObject *o) {
25237 #if CYTHON_USE_TP_FINALIZE
25238 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25239 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_15superluWrappers_SparseFactor) {
25240 if (PyObject_CallFinalizerFromDealloc(o)) return;
25241 }
25242 }
25243 #endif
25244 PyTypeObject *tp = Py_TYPE(o);
25245 #if CYTHON_USE_TYPE_SLOTS
25246 (*tp->tp_free)(o);
25247 #else
25248 {
25249 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
25250 if (tp_free) tp_free(o);
25251 }
25252 #endif
25253 #if CYTHON_USE_TYPE_SPECS
25254 Py_DECREF(tp);
25255 #endif
25256}
25257
25258static PyObject *__pyx_getprop_15superluWrappers_12SparseFactor_dim(PyObject *o, CYTHON_UNUSED void *x) {
25259 return __pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(o);
25260}
25261
25262static int __pyx_setprop_15superluWrappers_12SparseFactor_dim(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
25263 if (v) {
25264 return __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(o, v);
25265 }
25266 else {
25267 PyErr_SetString(PyExc_NotImplementedError, "__del__");
25268 return -1;
25269 }
25270}
25271
25272static PyMethodDef __pyx_methods_15superluWrappers_SparseFactor[] = {
25273 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25274 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25275 {0, 0, 0, 0}
25276};
25277
25278static struct PyGetSetDef __pyx_getsets_15superluWrappers_SparseFactor[] = {
25279 {"dim", __pyx_getprop_15superluWrappers_12SparseFactor_dim, __pyx_setprop_15superluWrappers_12SparseFactor_dim, 0, 0},
25280 {0, 0, 0, 0, 0}
25281};
25282#if CYTHON_USE_TYPE_SPECS
25283static PyType_Slot __pyx_type_15superluWrappers_SparseFactor_slots[] = {
25284 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_15superluWrappers_SparseFactor},
25285 {Py_tp_methods, (void *)__pyx_methods_15superluWrappers_SparseFactor},
25286 {Py_tp_getset, (void *)__pyx_getsets_15superluWrappers_SparseFactor},
25287 {Py_tp_init, (void *)__pyx_tp_init_15superluWrappers_SparseFactor},
25288 {Py_tp_new, (void *)__pyx_tp_new_15superluWrappers_SparseFactor},
25289 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25290 #if CYTHON_VECTORCALL_TPNEW
25291 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_15superluWrappers_SparseFactor},
25292 #endif
25293 #endif
25294 {0, 0},
25295};
25296static PyType_Spec __pyx_type_15superluWrappers_SparseFactor_spec = {
25297 "superluWrappers.SparseFactor",
25298 sizeof(struct __pyx_obj_15superluWrappers_SparseFactor),
25299 0,
25300 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
25301 __pyx_type_15superluWrappers_SparseFactor_slots,
25302};
25303#else
25304
25305static PyTypeObject __pyx_type_15superluWrappers_SparseFactor = {
25306 PyVarObject_HEAD_INIT(0, 0)
25307 "superluWrappers.""SparseFactor", /*tp_name*/
25308 sizeof(struct __pyx_obj_15superluWrappers_SparseFactor), /*tp_basicsize*/
25309 0, /*tp_itemsize*/
25310 __pyx_tp_dealloc_15superluWrappers_SparseFactor, /*tp_dealloc*/
25311 0, /*tp_vectorcall_offset*/
25312 0, /*tp_getattr*/
25313 0, /*tp_setattr*/
25314 0, /*tp_as_async*/
25315 0, /*tp_repr*/
25316 0, /*tp_as_number*/
25317 0, /*tp_as_sequence*/
25318 0, /*tp_as_mapping*/
25319 0, /*tp_hash*/
25320 0, /*tp_call*/
25321 0, /*tp_str*/
25322 0, /*tp_getattro*/
25323 0, /*tp_setattro*/
25324 0, /*tp_as_buffer*/
25325 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
25326 0, /*tp_doc*/
25327 0, /*tp_traverse*/
25328 0, /*tp_clear*/
25329 0, /*tp_richcompare*/
25330 0, /*tp_weaklistoffset*/
25331 0, /*tp_iter*/
25332 0, /*tp_iternext*/
25333 __pyx_methods_15superluWrappers_SparseFactor, /*tp_methods*/
25334 0, /*tp_members*/
25335 __pyx_getsets_15superluWrappers_SparseFactor, /*tp_getset*/
25336 0, /*tp_base*/
25337 0, /*tp_dict*/
25338 0, /*tp_descr_get*/
25339 0, /*tp_descr_set*/
25340 #if !CYTHON_USE_TYPE_SPECS
25341 0, /*tp_dictoffset*/
25342 #endif
25343 __pyx_tp_init_15superluWrappers_SparseFactor, /*tp_init*/
25344 0, /*tp_alloc*/
25345 __pyx_tp_new_15superluWrappers_SparseFactor, /*tp_new*/
25346 0, /*tp_free*/
25347 0, /*tp_is_gc*/
25348 0, /*tp_bases*/
25349 0, /*tp_mro*/
25350 0, /*tp_cache*/
25351 0, /*tp_subclasses*/
25352 0, /*tp_weaklist*/
25353 0, /*tp_del*/
25354 0, /*tp_version_tag*/
25355 #if CYTHON_USE_TP_FINALIZE
25356 0, /*tp_finalize*/
25357 #else
25358 NULL, /*tp_finalize*/
25359 #endif
25360 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25361 #if CYTHON_VECTORCALL_TPNEW
25362 __pyx_tp_vectorcall_15superluWrappers_SparseFactor, /*tp_vectorcall*/
25363 #else
25364 NULL, /*tp_vectorcall*/
25365 #endif
25366 #endif
25367 #if __PYX_NEED_TP_PRINT_SLOT == 1
25368 0, /*tp_print*/
25369 #endif
25370 #if PY_VERSION_HEX >= 0x030C0000
25371 0, /*tp_watched*/
25372 #endif
25373 #if PY_VERSION_HEX >= 0x030d00A4
25374 0, /*tp_versions_used*/
25375 #endif
25376 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
25377 0, /*tp_pypy_flags*/
25378 #endif
25379};
25380#endif
25381static struct __pyx_vtabstruct_array __pyx_vtable_array;
25382
25383static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
25384#if CYTHON_VECTORCALL_TPNEW
25385 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25386#else
25387 PyObject *a, PyObject *k
25388#endif
25389) {
25390 struct __pyx_array_obj *p = ((struct __pyx_array_obj *)o);
25391 p->__pyx_vtab = __pyx_vtabptr_array;
25392 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
25393 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
25394 {
25395 int cinit_result = __pyx_array___cinit__(o,
25396#if CYTHON_VECTORCALL_TPNEW
25397 args, nargs, kwnames
25398#else
25399 a, k
25400#endif
25401);
25402 if (unlikely(cinit_result)) goto bad;
25403 }
25404 return o;
25405 bad:
25406 Py_DECREF(o); o = 0;
25407 return NULL;
25408}
25409
25410static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
25411#if CYTHON_VECTORCALL_TPNEW
25412 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25413#else
25414 PyObject *a, PyObject *k
25415#endif
25416) {
25417 PyObject *o;
25418 o = __Pyx_AllocateExtensionType(t, 0);
25419 if (unlikely(!o)) return 0;
25420 return __pyx_tp_new__initialisation_array(o,
25421#if CYTHON_VECTORCALL_TPNEW
25422 args, nargs, kwnames
25423#else
25424 a, k
25425#endif
25426);
25427}
25428
25429#if CYTHON_VECTORCALL_TPNEW
25430static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
25431 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_array, t, a, k);
25432}
25433#endif
25434
25435#if CYTHON_VECTORCALL_TPNEW
25436static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
25437 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_array_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25438 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25439 }
25440 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25441 PyObject *o = __pyx_tp_new_vectorcall_array((PyTypeObject*)t, args, nargs, kwnames);
25442 return o;
25443}
25444#endif
25445
25446static void __pyx_tp_dealloc_array(PyObject *o) {
25447 struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
25448 #if CYTHON_USE_TP_FINALIZE
25449 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25450 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
25451 if (PyObject_CallFinalizerFromDealloc(o)) return;
25452 }
25453 }
25454 #endif
25455 {
25456 PyObject *etype, *eval, *etb;
25457 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
25458 __Pyx_DeallocKeepAliveBegin(o);
25459 __pyx_array___dealloc__(o);
25460 __Pyx_DeallocKeepAliveEnd(o);
25461 __Pyx_PyErr_RestoreException(etype, eval, etb);
25462 }
25463 Py_CLEAR(p->mode);
25464 Py_CLEAR(p->_format);
25465 PyTypeObject *tp = Py_TYPE(o);
25466 #if CYTHON_USE_TYPE_SLOTS
25467 (*tp->tp_free)(o);
25468 #else
25469 {
25470 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
25471 if (tp_free) tp_free(o);
25472 }
25473 #endif
25474 #if CYTHON_USE_TYPE_SPECS
25475 Py_DECREF(tp);
25476 #endif
25477}
25478
25479static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
25480 PyObject *r;
25481 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return NULL;
25482 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
25483 binaryfunc f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
25484 #else
25485 binaryfunc f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
25486 #endif
25487 r = f(o, x);
25488 Py_DECREF(x);
25489 return r;
25490}
25491
25492static PyObject *__pyx_mp_subscript_array(PyObject *o, PyObject *i) {
25493 return __pyx_array___getitem__(o, i);
25494}
25495
25496static int __pyx_sq_ass_item_array(PyObject *o, Py_ssize_t i, PyObject *v) {
25497 if (likely(v)) {
25498 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return -1;
25499 int r = __pyx_array___setitem__(o, x, v);
25500 Py_DECREF(x);
25501 return r;
25502 } else {
25503 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
25504 return -1;
25505 }
25506}
25507
25508static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
25509 if (likely(v)) {
25510 return __pyx_array___setitem__(o, i, v);
25511 } else {
25512 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
25513 return -1;
25514 }
25515}
25516
25517static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
25518 PyObject *v = PyObject_GenericGetAttr(o, n);
25519 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25520 PyErr_Clear();
25521 v = __pyx_array___getattr__(o, n);
25522 }
25523 return v;
25524}
25525
25526static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
25527 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
25528}
25529
25530static PyMethodDef __pyx_methods_array[] = {
25531 {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
25532 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25533 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25534 {0, 0, 0, 0}
25535};
25536
25537static struct PyGetSetDef __pyx_getsets_array[] = {
25538 {"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
25539 {0, 0, 0, 0, 0}
25540};
25541#if CYTHON_USE_TYPE_SPECS
25542#if !CYTHON_COMPILING_IN_LIMITED_API
25543
25544static PyBufferProcs __pyx_tp_as_buffer_array = {
25545 __pyx_array_getbuffer, /*bf_getbuffer*/
25546 0, /*bf_releasebuffer*/
25547};
25548#endif
25549static PyType_Slot __pyx_type___pyx_array_slots[] = {
25550 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
25551 {Py_sq_length, (void *)__pyx_array___len__},
25552 {Py_sq_item, (void *)__pyx_sq_item_array},
25553 {Py_sq_ass_item, (void *)__pyx_sq_ass_item_array},
25554 {Py_mp_length, (void *)__pyx_array___len__},
25555 {Py_mp_subscript, (void *)__pyx_mp_subscript_array},
25556 {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
25557 {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
25558 #if defined(Py_bf_getbuffer)
25559 {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
25560 #endif
25561 {Py_tp_methods, (void *)__pyx_methods_array},
25562 {Py_tp_getset, (void *)__pyx_getsets_array},
25563 {Py_tp_new, (void *)__pyx_tp_new_array},
25564 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25565 #if CYTHON_VECTORCALL_TPNEW
25566 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_array},
25567 #endif
25568 #endif
25569 {0, 0},
25570};
25571static PyType_Spec __pyx_type___pyx_array_spec = {
25572 "superluWrappers.array",
25573 sizeof(struct __pyx_array_obj),
25574 0,
25575 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
25576 __pyx_type___pyx_array_slots,
25577};
25578#else
25579
25580static PySequenceMethods __pyx_tp_as_sequence_array = {
25581 __pyx_array___len__, /*sq_length*/
25582 0, /*sq_concat*/
25583 0, /*sq_repeat*/
25584 __pyx_sq_item_array, /*sq_item*/
25585 0, /*sq_slice*/
25586 __pyx_sq_ass_item_array, /*sq_ass_item*/
25587 0, /*sq_ass_slice*/
25588 0, /*sq_contains*/
25589 0, /*sq_inplace_concat*/
25590 0, /*sq_inplace_repeat*/
25591};
25592
25593static PyMappingMethods __pyx_tp_as_mapping_array = {
25594 __pyx_array___len__, /*mp_length*/
25595 __pyx_mp_subscript_array, /*mp_subscript*/
25596 __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
25597};
25598
25599static PyBufferProcs __pyx_tp_as_buffer_array = {
25600 __pyx_array_getbuffer, /*bf_getbuffer*/
25601 0, /*bf_releasebuffer*/
25602};
25603
25604static PyTypeObject __pyx_type___pyx_array = {
25605 PyVarObject_HEAD_INIT(0, 0)
25606 "superluWrappers.""array", /*tp_name*/
25607 sizeof(struct __pyx_array_obj), /*tp_basicsize*/
25608 0, /*tp_itemsize*/
25609 __pyx_tp_dealloc_array, /*tp_dealloc*/
25610 0, /*tp_vectorcall_offset*/
25611 0, /*tp_getattr*/
25612 0, /*tp_setattr*/
25613 0, /*tp_as_async*/
25614 0, /*tp_repr*/
25615 0, /*tp_as_number*/
25616 &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
25617 &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
25618 0, /*tp_hash*/
25619 0, /*tp_call*/
25620 0, /*tp_str*/
25621 __pyx_tp_getattro_array, /*tp_getattro*/
25622 0, /*tp_setattro*/
25623 &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
25624 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
25625 0, /*tp_doc*/
25626 0, /*tp_traverse*/
25627 0, /*tp_clear*/
25628 0, /*tp_richcompare*/
25629 0, /*tp_weaklistoffset*/
25630 0, /*tp_iter*/
25631 0, /*tp_iternext*/
25632 __pyx_methods_array, /*tp_methods*/
25633 0, /*tp_members*/
25634 __pyx_getsets_array, /*tp_getset*/
25635 0, /*tp_base*/
25636 0, /*tp_dict*/
25637 0, /*tp_descr_get*/
25638 0, /*tp_descr_set*/
25639 #if !CYTHON_USE_TYPE_SPECS
25640 0, /*tp_dictoffset*/
25641 #endif
25642 0, /*tp_init*/
25643 0, /*tp_alloc*/
25644 __pyx_tp_new_array, /*tp_new*/
25645 0, /*tp_free*/
25646 0, /*tp_is_gc*/
25647 0, /*tp_bases*/
25648 0, /*tp_mro*/
25649 0, /*tp_cache*/
25650 0, /*tp_subclasses*/
25651 0, /*tp_weaklist*/
25652 0, /*tp_del*/
25653 0, /*tp_version_tag*/
25654 #if CYTHON_USE_TP_FINALIZE
25655 0, /*tp_finalize*/
25656 #else
25657 NULL, /*tp_finalize*/
25658 #endif
25659 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25660 #if CYTHON_VECTORCALL_TPNEW
25661 __pyx_tp_vectorcall_array, /*tp_vectorcall*/
25662 #else
25663 NULL, /*tp_vectorcall*/
25664 #endif
25665 #endif
25666 #if __PYX_NEED_TP_PRINT_SLOT == 1
25667 0, /*tp_print*/
25668 #endif
25669 #if PY_VERSION_HEX >= 0x030C0000
25670 0, /*tp_watched*/
25671 #endif
25672 #if PY_VERSION_HEX >= 0x030d00A4
25673 0, /*tp_versions_used*/
25674 #endif
25675 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
25676 0, /*tp_pypy_flags*/
25677 #endif
25678};
25679#endif
25680
25681static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
25682#if CYTHON_VECTORCALL_TPNEW
25683 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
25684#else
25685 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
25686#endif
25687) {
25688 struct __pyx_MemviewEnum_obj *p = ((struct __pyx_MemviewEnum_obj *)o);
25689 p->name = Py_None; Py_INCREF(Py_None);
25690 return o;
25691}
25692
25693static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
25694#if CYTHON_VECTORCALL_TPNEW
25695 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25696#else
25697 PyObject *a, PyObject *k
25698#endif
25699) {
25700 PyObject *o;
25701 o = __Pyx_AllocateExtensionType(t, 0);
25702 if (unlikely(!o)) return 0;
25703 return __pyx_tp_new__initialisation_Enum(o,
25704#if CYTHON_VECTORCALL_TPNEW
25705 args, nargs, kwnames
25706#else
25707 a, k
25708#endif
25709);
25710}
25711
25712#if CYTHON_VECTORCALL_TPNEW
25713static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k) {
25714 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_Enum, t, a, k);
25715}
25716#endif
25717
25718#if CYTHON_VECTORCALL_TPNEW
25719static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
25720 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_MemviewEnum_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25721 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25722 }
25723 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25724 PyObject *o = __pyx_tp_new_vectorcall_Enum((PyTypeObject*)t, args, nargs, kwnames);
25725 if (likely(o)) {
25726 assert(Py_TYPE(o) == (PyTypeObject*)t);
25727 if (unlikely(__pyx_MemviewEnum___init__(o, args, nargs, kwnames) < 0)) {
25728 Py_CLEAR(o);
25729 }
25730 }
25731 return o;
25732}
25733#endif
25734
25735#if CYTHON_VECTORCALL_TPNEW
25736static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds) {
25737 return __Pyx_CallTpinitAsVectorcall(__pyx_MemviewEnum___init__, o, args, kwds);
25738}
25739#endif
25740
25741static void __pyx_tp_dealloc_Enum(PyObject *o) {
25742 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25743 #if CYTHON_USE_TP_FINALIZE
25744 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25745 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
25746 if (PyObject_CallFinalizerFromDealloc(o)) return;
25747 }
25748 }
25749 #endif
25750 PyObject_GC_UnTrack(o);
25751 Py_CLEAR(p->name);
25752 PyTypeObject *tp = Py_TYPE(o);
25753 #if CYTHON_USE_TYPE_SLOTS
25754 (*tp->tp_free)(o);
25755 #else
25756 {
25757 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
25758 if (tp_free) tp_free(o);
25759 }
25760 #endif
25761 #if CYTHON_USE_TYPE_SPECS
25762 Py_DECREF(tp);
25763 #endif
25764}
25765
25766static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
25767 int e;
25768 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25769 {
25770 e = __Pyx_call_type_traverse(o, 1, v, a);
25771 if (e) return e;
25772 }
25773 if (p->name) {
25774 e = (*v)(p->name, a); if (e) return e;
25775 }
25776 return 0;
25777}
25778
25779static int __pyx_tp_clear_Enum(PyObject *o) {
25780 PyObject* tmp;
25781 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25782 tmp = ((PyObject*)p->name);
25783 p->name = Py_None; Py_INCREF(Py_None);
25784 Py_XDECREF(tmp);
25785 return 0;
25786}
25787
25788static PyMethodDef __pyx_methods_Enum[] = {
25789 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25790 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25791 {0, 0, 0, 0}
25792};
25793#if CYTHON_USE_TYPE_SPECS
25794static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
25795 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
25796 {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
25797 {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
25798 {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
25799 {Py_tp_methods, (void *)__pyx_methods_Enum},
25800 {Py_tp_init, (void *)__pyx_tp_init_Enum},
25801 {Py_tp_new, (void *)__pyx_tp_new_Enum},
25802 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25803 #if CYTHON_VECTORCALL_TPNEW
25804 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_Enum},
25805 #endif
25806 #endif
25807 {0, 0},
25808};
25809static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
25810 "superluWrappers.Enum",
25811 sizeof(struct __pyx_MemviewEnum_obj),
25812 0,
25813 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
25814 __pyx_type___pyx_MemviewEnum_slots,
25815};
25816#else
25817
25818static PyTypeObject __pyx_type___pyx_MemviewEnum = {
25819 PyVarObject_HEAD_INIT(0, 0)
25820 "superluWrappers.""Enum", /*tp_name*/
25821 sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
25822 0, /*tp_itemsize*/
25823 __pyx_tp_dealloc_Enum, /*tp_dealloc*/
25824 0, /*tp_vectorcall_offset*/
25825 0, /*tp_getattr*/
25826 0, /*tp_setattr*/
25827 0, /*tp_as_async*/
25828 __pyx_MemviewEnum___repr__, /*tp_repr*/
25829 0, /*tp_as_number*/
25830 0, /*tp_as_sequence*/
25831 0, /*tp_as_mapping*/
25832 0, /*tp_hash*/
25833 0, /*tp_call*/
25834 0, /*tp_str*/
25835 0, /*tp_getattro*/
25836 0, /*tp_setattro*/
25837 0, /*tp_as_buffer*/
25838 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25839 0, /*tp_doc*/
25840 __pyx_tp_traverse_Enum, /*tp_traverse*/
25841 __pyx_tp_clear_Enum, /*tp_clear*/
25842 0, /*tp_richcompare*/
25843 0, /*tp_weaklistoffset*/
25844 0, /*tp_iter*/
25845 0, /*tp_iternext*/
25846 __pyx_methods_Enum, /*tp_methods*/
25847 0, /*tp_members*/
25848 0, /*tp_getset*/
25849 0, /*tp_base*/
25850 0, /*tp_dict*/
25851 0, /*tp_descr_get*/
25852 0, /*tp_descr_set*/
25853 #if !CYTHON_USE_TYPE_SPECS
25854 0, /*tp_dictoffset*/
25855 #endif
25856 __pyx_tp_init_Enum, /*tp_init*/
25857 0, /*tp_alloc*/
25858 __pyx_tp_new_Enum, /*tp_new*/
25859 0, /*tp_free*/
25860 0, /*tp_is_gc*/
25861 0, /*tp_bases*/
25862 0, /*tp_mro*/
25863 0, /*tp_cache*/
25864 0, /*tp_subclasses*/
25865 0, /*tp_weaklist*/
25866 0, /*tp_del*/
25867 0, /*tp_version_tag*/
25868 #if CYTHON_USE_TP_FINALIZE
25869 0, /*tp_finalize*/
25870 #else
25871 NULL, /*tp_finalize*/
25872 #endif
25873 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25874 #if CYTHON_VECTORCALL_TPNEW
25875 __pyx_tp_vectorcall_Enum, /*tp_vectorcall*/
25876 #else
25877 NULL, /*tp_vectorcall*/
25878 #endif
25879 #endif
25880 #if __PYX_NEED_TP_PRINT_SLOT == 1
25881 0, /*tp_print*/
25882 #endif
25883 #if PY_VERSION_HEX >= 0x030C0000
25884 0, /*tp_watched*/
25885 #endif
25886 #if PY_VERSION_HEX >= 0x030d00A4
25887 0, /*tp_versions_used*/
25888 #endif
25889 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
25890 0, /*tp_pypy_flags*/
25891 #endif
25892};
25893#endif
25894static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
25895
25896static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
25897#if CYTHON_VECTORCALL_TPNEW
25898 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25899#else
25900 PyObject *a, PyObject *k
25901#endif
25902) {
25903 struct __pyx_memoryview_obj *p = ((struct __pyx_memoryview_obj *)o);
25904 p->__pyx_vtab = __pyx_vtabptr_memoryview;
25905 p->obj = Py_None; Py_INCREF(Py_None);
25906 p->_size = Py_None; Py_INCREF(Py_None);
25907 p->view.obj = NULL;
25908 {
25909 int cinit_result = __pyx_memoryview___cinit__(o,
25910#if CYTHON_VECTORCALL_TPNEW
25911 args, nargs, kwnames
25912#else
25913 a, k
25914#endif
25915);
25916 if (unlikely(cinit_result)) goto bad;
25917 }
25918 return o;
25919 bad:
25920 Py_DECREF(o); o = 0;
25921 return NULL;
25922}
25923
25924static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
25925#if CYTHON_VECTORCALL_TPNEW
25926 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25927#else
25928 PyObject *a, PyObject *k
25929#endif
25930) {
25931 PyObject *o;
25932 o = __Pyx_AllocateExtensionType(t, 0);
25933 if (unlikely(!o)) return 0;
25934 return __pyx_tp_new__initialisation_memoryview(o,
25935#if CYTHON_VECTORCALL_TPNEW
25936 args, nargs, kwnames
25937#else
25938 a, k
25939#endif
25940);
25941}
25942
25943#if CYTHON_VECTORCALL_TPNEW
25944static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
25945 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_memoryview, t, a, k);
25946}
25947#endif
25948
25949#if CYTHON_VECTORCALL_TPNEW
25950static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
25951 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryview_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25952 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25953 }
25954 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25955 PyObject *o = __pyx_tp_new_vectorcall_memoryview((PyTypeObject*)t, args, nargs, kwnames);
25956 return o;
25957}
25958#endif
25959
25960static void __pyx_tp_dealloc_memoryview(PyObject *o) {
25961 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25962 #if CYTHON_USE_TP_FINALIZE
25963 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25964 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
25965 if (PyObject_CallFinalizerFromDealloc(o)) return;
25966 }
25967 }
25968 #endif
25969 PyObject_GC_UnTrack(o);
25970 {
25971 PyObject *etype, *eval, *etb;
25972 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
25973 __Pyx_DeallocKeepAliveBegin(o);
25974 __pyx_memoryview___dealloc__(o);
25975 __Pyx_DeallocKeepAliveEnd(o);
25976 __Pyx_PyErr_RestoreException(etype, eval, etb);
25977 }
25978 Py_CLEAR(p->obj);
25979 Py_CLEAR(p->_size);
25980 PyTypeObject *tp = Py_TYPE(o);
25981 #if CYTHON_USE_TYPE_SLOTS
25982 (*tp->tp_free)(o);
25983 #else
25984 {
25985 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
25986 if (tp_free) tp_free(o);
25987 }
25988 #endif
25989 #if CYTHON_USE_TYPE_SPECS
25990 Py_DECREF(tp);
25991 #endif
25992}
25993
25994static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
25995 int e;
25996 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25997 {
25998 e = __Pyx_call_type_traverse(o, 1, v, a);
25999 if (e) return e;
26000 }
26001 if (p->obj) {
26002 e = (*v)(p->obj, a); if (e) return e;
26003 }
26004 if (p->_size) {
26005 e = (*v)(p->_size, a); if (e) return e;
26006 }
26007 if (p->view.obj) {
26008 e = (*v)(p->view.obj, a); if (e) return e;
26009 }
26010 return 0;
26011}
26012
26013static int __pyx_tp_clear_memoryview(PyObject *o) {
26014 PyObject* tmp;
26015 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26016 tmp = ((PyObject*)p->obj);
26017 p->obj = Py_None; Py_INCREF(Py_None);
26018 Py_XDECREF(tmp);
26019 tmp = ((PyObject*)p->_size);
26020 p->_size = Py_None; Py_INCREF(Py_None);
26021 Py_XDECREF(tmp);
26022 Py_CLEAR(p->view.obj);
26023 return 0;
26024}
26025
26026static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
26027 PyObject *r;
26028 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return NULL;
26029 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
26030 binaryfunc f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
26031 #else
26032 binaryfunc f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
26033 #endif
26034 r = f(o, x);
26035 Py_DECREF(x);
26036 return r;
26037}
26038
26039static PyObject *__pyx_mp_subscript_memoryview(PyObject *o, PyObject *i) {
26040 return __pyx_memoryview___getitem__(o, i);
26041}
26042
26043static int __pyx_sq_ass_item_memoryview(PyObject *o, Py_ssize_t i, PyObject *v) {
26044 if (likely(v)) {
26045 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return -1;
26046 int r = __pyx_memoryview___setitem__(o, x, v);
26047 Py_DECREF(x);
26048 return r;
26049 } else {
26050 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
26051 return -1;
26052 }
26053}
26054
26055static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
26056 if (likely(v)) {
26057 return __pyx_memoryview___setitem__(o, i, v);
26058 } else {
26059 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
26060 return -1;
26061 }
26062}
26063
26064static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
26065 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
26066}
26067
26068static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
26069 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
26070}
26071
26072static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
26073 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
26074}
26075
26076static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
26077 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
26078}
26079
26080static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
26081 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
26082}
26083
26084static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
26085 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
26086}
26087
26088static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
26089 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
26090}
26091
26092static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
26093 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
26094}
26095
26096static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
26097 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
26098}
26099
26100static PyMethodDef __pyx_methods_memoryview[] = {
26101 {"is_c_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26102 {"is_f_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26103 {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26104 {"copy_fortran", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26105 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26106 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26107 {0, 0, 0, 0}
26108};
26109
26110static struct PyGetSetDef __pyx_getsets_memoryview[] = {
26111 {"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
26112 {"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
26113 {"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
26114 {"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
26115 {"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
26116 {"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
26117 {"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
26118 {"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
26119 {"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
26120 {0, 0, 0, 0, 0}
26121};
26122#if CYTHON_USE_TYPE_SPECS
26123#if !CYTHON_COMPILING_IN_LIMITED_API
26124
26125static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
26126 __pyx_memoryview_getbuffer, /*bf_getbuffer*/
26127 0, /*bf_releasebuffer*/
26128};
26129#endif
26130static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
26131 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
26132 {Py_tp_repr, (void *)__pyx_memoryview___repr__},
26133 {Py_sq_length, (void *)__pyx_memoryview___len__},
26134 {Py_sq_item, (void *)__pyx_sq_item_memoryview},
26135 {Py_sq_ass_item, (void *)__pyx_sq_ass_item_memoryview},
26136 {Py_mp_length, (void *)__pyx_memoryview___len__},
26137 {Py_mp_subscript, (void *)__pyx_mp_subscript_memoryview},
26138 {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
26139 {Py_tp_str, (void *)__pyx_memoryview___str__},
26140 #if defined(Py_bf_getbuffer)
26141 {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
26142 #endif
26143 {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
26144 {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
26145 {Py_tp_methods, (void *)__pyx_methods_memoryview},
26146 {Py_tp_getset, (void *)__pyx_getsets_memoryview},
26147 {Py_tp_new, (void *)__pyx_tp_new_memoryview},
26148 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26149 #if CYTHON_VECTORCALL_TPNEW
26150 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_memoryview},
26151 #endif
26152 #endif
26153 {0, 0},
26154};
26155static PyType_Spec __pyx_type___pyx_memoryview_spec = {
26156 "superluWrappers.memoryview",
26157 sizeof(struct __pyx_memoryview_obj),
26158 0,
26159 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26160 __pyx_type___pyx_memoryview_slots,
26161};
26162#else
26163
26164static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
26165 __pyx_memoryview___len__, /*sq_length*/
26166 0, /*sq_concat*/
26167 0, /*sq_repeat*/
26168 __pyx_sq_item_memoryview, /*sq_item*/
26169 0, /*sq_slice*/
26170 __pyx_sq_ass_item_memoryview, /*sq_ass_item*/
26171 0, /*sq_ass_slice*/
26172 0, /*sq_contains*/
26173 0, /*sq_inplace_concat*/
26174 0, /*sq_inplace_repeat*/
26175};
26176
26177static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
26178 __pyx_memoryview___len__, /*mp_length*/
26179 __pyx_mp_subscript_memoryview, /*mp_subscript*/
26180 __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
26181};
26182
26183static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
26184 __pyx_memoryview_getbuffer, /*bf_getbuffer*/
26185 0, /*bf_releasebuffer*/
26186};
26187
26188static PyTypeObject __pyx_type___pyx_memoryview = {
26189 PyVarObject_HEAD_INIT(0, 0)
26190 "superluWrappers.""memoryview", /*tp_name*/
26191 sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
26192 0, /*tp_itemsize*/
26193 __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
26194 0, /*tp_vectorcall_offset*/
26195 0, /*tp_getattr*/
26196 0, /*tp_setattr*/
26197 0, /*tp_as_async*/
26198 __pyx_memoryview___repr__, /*tp_repr*/
26199 0, /*tp_as_number*/
26200 &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
26201 &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
26202 0, /*tp_hash*/
26203 0, /*tp_call*/
26204 __pyx_memoryview___str__, /*tp_str*/
26205 0, /*tp_getattro*/
26206 0, /*tp_setattro*/
26207 &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
26208 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26209 0, /*tp_doc*/
26210 __pyx_tp_traverse_memoryview, /*tp_traverse*/
26211 __pyx_tp_clear_memoryview, /*tp_clear*/
26212 0, /*tp_richcompare*/
26213 0, /*tp_weaklistoffset*/
26214 0, /*tp_iter*/
26215 0, /*tp_iternext*/
26216 __pyx_methods_memoryview, /*tp_methods*/
26217 0, /*tp_members*/
26218 __pyx_getsets_memoryview, /*tp_getset*/
26219 0, /*tp_base*/
26220 0, /*tp_dict*/
26221 0, /*tp_descr_get*/
26222 0, /*tp_descr_set*/
26223 #if !CYTHON_USE_TYPE_SPECS
26224 0, /*tp_dictoffset*/
26225 #endif
26226 0, /*tp_init*/
26227 0, /*tp_alloc*/
26228 __pyx_tp_new_memoryview, /*tp_new*/
26229 0, /*tp_free*/
26230 0, /*tp_is_gc*/
26231 0, /*tp_bases*/
26232 0, /*tp_mro*/
26233 0, /*tp_cache*/
26234 0, /*tp_subclasses*/
26235 0, /*tp_weaklist*/
26236 0, /*tp_del*/
26237 0, /*tp_version_tag*/
26238 #if CYTHON_USE_TP_FINALIZE
26239 0, /*tp_finalize*/
26240 #else
26241 NULL, /*tp_finalize*/
26242 #endif
26243 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26244 #if CYTHON_VECTORCALL_TPNEW
26245 __pyx_tp_vectorcall_memoryview, /*tp_vectorcall*/
26246 #else
26247 NULL, /*tp_vectorcall*/
26248 #endif
26249 #endif
26250 #if __PYX_NEED_TP_PRINT_SLOT == 1
26251 0, /*tp_print*/
26252 #endif
26253 #if PY_VERSION_HEX >= 0x030C0000
26254 0, /*tp_watched*/
26255 #endif
26256 #if PY_VERSION_HEX >= 0x030d00A4
26257 0, /*tp_versions_used*/
26258 #endif
26259 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26260 0, /*tp_pypy_flags*/
26261 #endif
26262};
26263#endif
26264static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
26265
26266static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
26267#if CYTHON_VECTORCALL_TPNEW
26268 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
26269#else
26270 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
26271#endif
26272) {
26273 struct __pyx_memoryviewslice_obj *p = ((struct __pyx_memoryviewslice_obj *)o);
26274 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
26275 p->from_object = Py_None; Py_INCREF(Py_None);
26276 p->from_slice.memview = NULL;
26277 return o;
26278}
26279
26280static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
26281#if CYTHON_VECTORCALL_TPNEW
26282 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26283#else
26284 PyObject *a, PyObject *k
26285#endif
26286) {
26287 PyObject *o;
26288 o = __pyx_tp_new_vectorcall_memoryview(t,
26289#if CYTHON_VECTORCALL_TPNEW
26290 args, nargs, kwnames
26291#else
26292 a, k
26293#endif
26294);
26295 if (unlikely(!o)) return 0;
26296 return __pyx_tp_new__initialisation__memoryviewslice(o,
26297#if CYTHON_VECTORCALL_TPNEW
26298 args, nargs, kwnames
26299#else
26300 a, k
26301#endif
26302);
26303}
26304
26305#if CYTHON_VECTORCALL_TPNEW
26306static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
26307 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall__memoryviewslice, t, a, k);
26308}
26309#endif
26310
26311#if CYTHON_VECTORCALL_TPNEW
26312static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
26313 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryviewslice_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26314 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26315 }
26316 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26317 PyObject *o = __pyx_tp_new_vectorcall__memoryviewslice((PyTypeObject*)t, args, nargs, kwnames);
26318 return o;
26319}
26320#endif
26321
26322static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
26323 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26324 #if CYTHON_USE_TP_FINALIZE
26325 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26326 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
26327 if (PyObject_CallFinalizerFromDealloc(o)) return;
26328 }
26329 }
26330 #endif
26331 PyObject_GC_UnTrack(o);
26332 {
26333 PyObject *etype, *eval, *etb;
26334 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26335 __Pyx_DeallocKeepAliveBegin(o);
26336 __pyx_memoryviewslice___dealloc__(o);
26337 __Pyx_DeallocKeepAliveEnd(o);
26338 __Pyx_PyErr_RestoreException(etype, eval, etb);
26339 }
26340 Py_CLEAR(p->from_object);
26341 PyObject_GC_Track(o);
26342 __pyx_tp_dealloc_memoryview(o);
26343}
26344
26345static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
26346 int e;
26347 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26348 e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
26349 if (p->from_object) {
26350 e = (*v)(p->from_object, a); if (e) return e;
26351 }
26352 return 0;
26353}
26354
26355static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
26356 PyObject* tmp;
26357 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26358 __pyx_tp_clear_memoryview(o);
26359 tmp = ((PyObject*)p->from_object);
26360 p->from_object = Py_None; Py_INCREF(Py_None);
26361 Py_XDECREF(tmp);
26362 __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
26363 return 0;
26364}
26365
26366static PyMethodDef __pyx_methods__memoryviewslice[] = {
26367 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26368 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26369 {0, 0, 0, 0}
26370};
26371#if CYTHON_USE_TYPE_SPECS
26372static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
26373 {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
26374 {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
26375 {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
26376 {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
26377 {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
26378 {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
26379 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26380 #if CYTHON_VECTORCALL_TPNEW
26381 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall__memoryviewslice},
26382 #endif
26383 #endif
26384 {0, 0},
26385};
26386static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
26387 "superluWrappers._memoryviewslice",
26388 sizeof(struct __pyx_memoryviewslice_obj),
26389 0,
26390 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
26391 __pyx_type___pyx_memoryviewslice_slots,
26392};
26393#else
26394
26395static PyTypeObject __pyx_type___pyx_memoryviewslice = {
26396 PyVarObject_HEAD_INIT(0, 0)
26397 "superluWrappers.""_memoryviewslice", /*tp_name*/
26398 sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
26399 0, /*tp_itemsize*/
26400 __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
26401 0, /*tp_vectorcall_offset*/
26402 0, /*tp_getattr*/
26403 0, /*tp_setattr*/
26404 0, /*tp_as_async*/
26405 #if CYTHON_COMPILING_IN_PYPY || 0
26406 __pyx_memoryview___repr__, /*tp_repr*/
26407 #else
26408 0, /*tp_repr*/
26409 #endif
26410 0, /*tp_as_number*/
26411 0, /*tp_as_sequence*/
26412 0, /*tp_as_mapping*/
26413 0, /*tp_hash*/
26414 0, /*tp_call*/
26415 #if CYTHON_COMPILING_IN_PYPY || 0
26416 __pyx_memoryview___str__, /*tp_str*/
26417 #else
26418 0, /*tp_str*/
26419 #endif
26420 0, /*tp_getattro*/
26421 0, /*tp_setattro*/
26422 0, /*tp_as_buffer*/
26423 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
26424 PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
26425 __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
26426 __pyx_tp_clear__memoryviewslice, /*tp_clear*/
26427 0, /*tp_richcompare*/
26428 0, /*tp_weaklistoffset*/
26429 0, /*tp_iter*/
26430 0, /*tp_iternext*/
26431 __pyx_methods__memoryviewslice, /*tp_methods*/
26432 0, /*tp_members*/
26433 0, /*tp_getset*/
26434 0, /*tp_base*/
26435 0, /*tp_dict*/
26436 0, /*tp_descr_get*/
26437 0, /*tp_descr_set*/
26438 #if !CYTHON_USE_TYPE_SPECS
26439 0, /*tp_dictoffset*/
26440 #endif
26441 0, /*tp_init*/
26442 0, /*tp_alloc*/
26443 __pyx_tp_new__memoryviewslice, /*tp_new*/
26444 0, /*tp_free*/
26445 0, /*tp_is_gc*/
26446 0, /*tp_bases*/
26447 0, /*tp_mro*/
26448 0, /*tp_cache*/
26449 0, /*tp_subclasses*/
26450 0, /*tp_weaklist*/
26451 0, /*tp_del*/
26452 0, /*tp_version_tag*/
26453 #if CYTHON_USE_TP_FINALIZE
26454 0, /*tp_finalize*/
26455 #else
26456 NULL, /*tp_finalize*/
26457 #endif
26458 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26459 #if CYTHON_VECTORCALL_TPNEW
26460 __pyx_tp_vectorcall__memoryviewslice, /*tp_vectorcall*/
26461 #else
26462 NULL, /*tp_vectorcall*/
26463 #endif
26464 #endif
26465 #if __PYX_NEED_TP_PRINT_SLOT == 1
26466 0, /*tp_print*/
26467 #endif
26468 #if PY_VERSION_HEX >= 0x030C0000
26469 0, /*tp_watched*/
26470 #endif
26471 #if PY_VERSION_HEX >= 0x030d00A4
26472 0, /*tp_versions_used*/
26473 #endif
26474 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26475 0, /*tp_pypy_flags*/
26476 #endif
26477};
26478#endif
26479
26480static PyMethodDef __pyx_methods[] = {
26481 {0, 0, 0, 0}
26482};
26483/* #### Code section: initfunc_declarations ### */
26484static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
26485static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
26486static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
26487static CYTHON_SMALL_CODE int __Pyx_InitAfterSharedUtility(void); /*proto*/
26488static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
26489static CYTHON_SMALL_CODE int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26490static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26491static CYTHON_SMALL_CODE int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26492static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_15superluWrappers_cSparseMatrix(__pyx_mstatetype *__pyx_mstate); /*proto*/
26493static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_15superluWrappers_SparseFactor(__pyx_mstatetype *__pyx_mstate); /*proto*/
26494static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
26495static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
26496static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
26497static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
26498static CYTHON_SMALL_CODE int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26499static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26500static CYTHON_SMALL_CODE int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
26501static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
26502/* #### Code section: init_module ### */
26503
26504static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
26505 __Pyx_RefNannyDeclarations
26506 CYTHON_UNUSED_VAR(__pyx_mstate);
26507 __Pyx_RefNannySetupContext("__Pyx_modinit_Global_init_code", 0);
26508 /*--- Global init code ---*/
26509 __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
26510 generic = Py_None; Py_INCREF(Py_None);
26511 strided = Py_None; Py_INCREF(Py_None);
26512 indirect = Py_None; Py_INCREF(Py_None);
26513 contiguous = Py_None; Py_INCREF(Py_None);
26514 indirect_contiguous = Py_None; Py_INCREF(Py_None);
26515 __Pyx_RefNannyFinishContext();
26516 return 0;
26517}
26518
26519static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
26520 __Pyx_RefNannyDeclarations
26521 CYTHON_UNUSED_VAR(__pyx_mstate);
26522 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_export_code", 0);
26523 /*--- Variable export code ---*/
26524 __Pyx_RefNannyFinishContext();
26525 return 0;
26526}
26527
26528static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
26529 __Pyx_RefNannyDeclarations
26530 CYTHON_UNUSED_VAR(__pyx_mstate);
26531 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_export_code", 0);
26532 /*--- Function export code ---*/
26533 __Pyx_RefNannyFinishContext();
26534 return 0;
26535}
26536
26537static int __Pyx_modinit_Exttype___pyx_obj_15superluWrappers_cSparseMatrix(__pyx_mstatetype *__pyx_mstate) {
26538 __Pyx_RefNannyDeclarations
26539 int __pyx_lineno = 0;
26540 const char *__pyx_filename = NULL;
26541 int __pyx_clineno = 0;
26542 CYTHON_UNUSED_VAR(__pyx_mstate);
26543 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_15superluWrappers_cSparseMatrix", 0);
26544 /*--- Exttype __pyx_obj_15superluWrappers_cSparseMatrix ---*/
26545 #if CYTHON_USE_TYPE_SPECS
26546 __pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_15superluWrappers_cSparseMatrix_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix)) __PYX_ERR(0, 100, __pyx_L1_error)
26547 #else
26548 __pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix = &__pyx_type_15superluWrappers_cSparseMatrix;
26549 #endif
26550 #if !CYTHON_COMPILING_IN_LIMITED_API
26551 #endif
26552 #if !CYTHON_USE_TYPE_SPECS
26553 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
26554 #endif
26555 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26556 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix);
26557 #endif
26558 #if !CYTHON_COMPILING_IN_LIMITED_API
26559 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix->tp_dictoffset && __pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix->tp_getattro == PyObject_GenericGetAttr)) {
26560 __pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix->tp_getattro = PyObject_GenericGetAttr;
26561 }
26562 #endif
26563 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_cSparseMatrix_2, (PyObject *) __pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
26564 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
26565 __Pyx_RefNannyFinishContext();
26566 return 0;
26567 __pyx_L1_error:;
26568 __Pyx_RefNannyFinishContext();
26569 return -1;
26570}
26571
26572static int __Pyx_modinit_Exttype___pyx_obj_15superluWrappers_SparseFactor(__pyx_mstatetype *__pyx_mstate) {
26573 __Pyx_RefNannyDeclarations
26574 int __pyx_lineno = 0;
26575 const char *__pyx_filename = NULL;
26576 int __pyx_clineno = 0;
26577 CYTHON_UNUSED_VAR(__pyx_mstate);
26578 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_15superluWrappers_SparseFactor", 0);
26579 /*--- Exttype __pyx_obj_15superluWrappers_SparseFactor ---*/
26580 __pyx_vtabptr_15superluWrappers_SparseFactor = &__pyx_vtable_15superluWrappers_SparseFactor;
26581 __pyx_vtable_15superluWrappers_SparseFactor._set_mat_types = (PyObject *(*)(struct __pyx_obj_15superluWrappers_SparseFactor *))__pyx_f_15superluWrappers_12SparseFactor__set_mat_types;
26582 #if CYTHON_USE_TYPE_SPECS
26583 __pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_15superluWrappers_SparseFactor_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor)) __PYX_ERR(0, 148, __pyx_L1_error)
26584 #else
26585 __pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor = &__pyx_type_15superluWrappers_SparseFactor;
26586 #endif
26587 #if !CYTHON_COMPILING_IN_LIMITED_API
26588 #endif
26589 #if !CYTHON_USE_TYPE_SPECS
26590 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor) < (0)) __PYX_ERR(0, 148, __pyx_L1_error)
26591 #endif
26592 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26593 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor);
26594 #endif
26595 #if !CYTHON_COMPILING_IN_LIMITED_API
26596 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor->tp_dictoffset && __pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor->tp_getattro == PyObject_GenericGetAttr)) {
26597 __pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor->tp_getattro = PyObject_GenericGetAttr;
26598 }
26599 #endif
26600 #if CYTHON_UPDATE_DESCRIPTOR_DOC
26601 {
26602 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 148, __pyx_L1_error)
26603 if (Py_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
26604 __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
26605 __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__.doc = __pyx_doc_15superluWrappers_12SparseFactor___init__;
26606 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
26607 }
26608 }
26609 #endif
26610 if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor, __pyx_vtabptr_15superluWrappers_SparseFactor) < (0)) __PYX_ERR(0, 148, __pyx_L1_error)
26611 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SparseFactor, (PyObject *) __pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor) < (0)) __PYX_ERR(0, 148, __pyx_L1_error)
26612 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor) < (0)) __PYX_ERR(0, 148, __pyx_L1_error)
26613 __Pyx_RefNannyFinishContext();
26614 return 0;
26615 __pyx_L1_error:;
26616 __Pyx_RefNannyFinishContext();
26617 return -1;
26618}
26619
26620static int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate) {
26621 __Pyx_RefNannyDeclarations
26622 int __pyx_lineno = 0;
26623 const char *__pyx_filename = NULL;
26624 int __pyx_clineno = 0;
26625 CYTHON_UNUSED_VAR(__pyx_mstate);
26626 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_array_obj", 0);
26627 /*--- Exttype __pyx_array_obj ---*/
26628 __pyx_vtabptr_array = &__pyx_vtable_array;
26629 __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
26630 #if CYTHON_USE_TYPE_SPECS
26631 __pyx_mstate->__pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_array_type)) __PYX_ERR(1, 128, __pyx_L1_error)
26632 #if !CYTHON_COMPILING_IN_LIMITED_API
26633 __pyx_mstate->__pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
26634 if (!__pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
26635 __pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
26636 }
26637 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
26638 /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
26639 #elif defined(_MSC_VER)
26640 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
26641 #else
26642 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
26643 #endif
26644 #else
26645 __pyx_mstate->__pyx_array_type = &__pyx_type___pyx_array;
26646 #endif
26647 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_array_type, 1) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
26648 #if !CYTHON_COMPILING_IN_LIMITED_API
26649 #endif
26650 #if !CYTHON_USE_TYPE_SPECS
26651 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
26652 #endif
26653 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26654 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_array_type);
26655 #endif
26656 if (__Pyx_SetVtable(__pyx_mstate->__pyx_array_type, __pyx_vtabptr_array) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
26657 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
26658 __Pyx_RefNannyFinishContext();
26659 return 0;
26660 __pyx_L1_error:;
26661 __Pyx_RefNannyFinishContext();
26662 return -1;
26663}
26664
26665static int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate) {
26666 __Pyx_RefNannyDeclarations
26667 int __pyx_lineno = 0;
26668 const char *__pyx_filename = NULL;
26669 int __pyx_clineno = 0;
26670 CYTHON_UNUSED_VAR(__pyx_mstate);
26671 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_MemviewEnum_obj", 0);
26672 /*--- Exttype __pyx_MemviewEnum_obj ---*/
26673 #if CYTHON_USE_TYPE_SPECS
26674 __pyx_mstate->__pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_MemviewEnum_type)) __PYX_ERR(1, 318, __pyx_L1_error)
26675 #else
26676 __pyx_mstate->__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
26677 #endif
26678 #if !CYTHON_COMPILING_IN_LIMITED_API
26679 #endif
26680 #if !CYTHON_USE_TYPE_SPECS
26681 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
26682 #endif
26683 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26684 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_MemviewEnum_type);
26685 #endif
26686 #if !CYTHON_COMPILING_IN_LIMITED_API
26687 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_MemviewEnum_type->tp_dictoffset && __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
26688 __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro = PyObject_GenericGetAttr;
26689 }
26690 #endif
26691 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
26692 __Pyx_RefNannyFinishContext();
26693 return 0;
26694 __pyx_L1_error:;
26695 __Pyx_RefNannyFinishContext();
26696 return -1;
26697}
26698
26699static int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate) {
26700 __Pyx_RefNannyDeclarations
26701 int __pyx_lineno = 0;
26702 const char *__pyx_filename = NULL;
26703 int __pyx_clineno = 0;
26704 CYTHON_UNUSED_VAR(__pyx_mstate);
26705 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_memoryview_obj", 0);
26706 /*--- Exttype __pyx_memoryview_obj ---*/
26707 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
26708 __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
26709 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
26710 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
26711 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
26712 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
26713 __pyx_vtable_memoryview.setitem_indexed1 = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed1;
26714 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
26715 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
26716 __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
26717 #if CYTHON_USE_TYPE_SPECS
26718 __pyx_mstate->__pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_memoryview_type)) __PYX_ERR(1, 353, __pyx_L1_error)
26719 #if !CYTHON_COMPILING_IN_LIMITED_API
26720 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
26721 if (!__pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
26722 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
26723 }
26724 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
26725 /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
26726 #elif defined(_MSC_VER)
26727 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
26728 #else
26729 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
26730 #endif
26731 #else
26732 __pyx_mstate->__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
26733 #endif
26734 #if !CYTHON_COMPILING_IN_LIMITED_API
26735 #endif
26736 #if !CYTHON_USE_TYPE_SPECS
26737 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
26738 #endif
26739 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26740 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryview_type);
26741 #endif
26742 #if !CYTHON_COMPILING_IN_LIMITED_API
26743 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryview_type->tp_dictoffset && __pyx_mstate->__pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
26744 __pyx_mstate->__pyx_memoryview_type->tp_getattro = PyObject_GenericGetAttr;
26745 }
26746 #endif
26747 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryview_type, __pyx_vtabptr_memoryview) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
26748 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
26749 __Pyx_RefNannyFinishContext();
26750 return 0;
26751 __pyx_L1_error:;
26752 __Pyx_RefNannyFinishContext();
26753 return -1;
26754}
26755
26756static int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate) {
26757 __Pyx_RefNannyDeclarations
26758 PyObject *__pyx_t_1 = NULL;
26759 int __pyx_lineno = 0;
26760 const char *__pyx_filename = NULL;
26761 int __pyx_clineno = 0;
26762 CYTHON_UNUSED_VAR(__pyx_mstate);
26763 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_memoryviewslice_obj", 0);
26764 /*--- Exttype __pyx_memoryviewslice_obj ---*/
26765 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
26766 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
26767 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
26768 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
26769 __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
26770 #if CYTHON_USE_TYPE_SPECS
26771 __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 947, __pyx_L1_error)
26772 __Pyx_GOTREF(__pyx_t_1);
26773 __pyx_mstate->__pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
26774 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
26775 if (unlikely(!__pyx_mstate->__pyx_memoryviewslice_type)) __PYX_ERR(1, 947, __pyx_L1_error)
26776 #else
26777 __pyx_mstate->__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
26778 #endif
26779 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_memoryviewslice_type, 1) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
26780 #if !CYTHON_COMPILING_IN_LIMITED_API
26781 __pyx_mstate_global->__pyx_memoryviewslice_type->tp_base = __pyx_mstate_global->__pyx_memoryview_type;
26782 #endif
26783 #if !CYTHON_USE_TYPE_SPECS
26784 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
26785 #endif
26786 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26787 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryviewslice_type);
26788 #endif
26789 #if !CYTHON_COMPILING_IN_LIMITED_API
26790 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryviewslice_type->tp_dictoffset && __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
26791 __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro = PyObject_GenericGetAttr;
26792 }
26793 #endif
26794 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
26795 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
26796 __Pyx_RefNannyFinishContext();
26797 return 0;
26798 __pyx_L1_error:;
26799 __Pyx_XDECREF(__pyx_t_1);
26800 __Pyx_RefNannyFinishContext();
26801 return -1;
26802}
26803
26804static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
26805 __Pyx_RefNannyDeclarations
26806 PyObject *__pyx_t_1 = NULL;
26807 int __pyx_lineno = 0;
26808 const char *__pyx_filename = NULL;
26809 int __pyx_clineno = 0;
26810 CYTHON_UNUSED_VAR(__pyx_mstate);
26811 __Pyx_RefNannySetupContext("__Pyx_modinit_Type_import_code", 0);
26812 /*--- Type import code ---*/
26813 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
26814 __Pyx_GOTREF(__pyx_t_1);
26815 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
26816 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26817 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
26818 #elif CYTHON_COMPILING_IN_LIMITED_API
26819 0, 0,
26820 #else
26821 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
26822 #endif
26823 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
26824 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26825 __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error)
26826 __Pyx_GOTREF(__pyx_t_1);
26827 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "dtype",
26828 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26829 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
26830 #elif CYTHON_COMPILING_IN_LIMITED_API
26831 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
26832 #else
26833 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
26834 #endif
26835 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 229, __pyx_L1_error)
26836 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flatiter",
26837 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26838 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
26839 #elif CYTHON_COMPILING_IN_LIMITED_API
26840 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
26841 #else
26842 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
26843 #endif
26844 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 286, __pyx_L1_error)
26845 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "broadcast",
26846 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26847 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
26848 #elif CYTHON_COMPILING_IN_LIMITED_API
26849 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
26850 #else
26851 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
26852 #endif
26853 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 290, __pyx_L1_error)
26854 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ndarray",
26855 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26856 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
26857 #elif CYTHON_COMPILING_IN_LIMITED_API
26858 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
26859 #else
26860 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
26861 #endif
26862 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 329, __pyx_L1_error)
26863 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "generic",
26864 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26865 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26866 #elif CYTHON_COMPILING_IN_LIMITED_API
26867 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26868 #else
26869 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26870 #endif
26871 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
26872 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "number",
26873 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26874 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26875 #elif CYTHON_COMPILING_IN_LIMITED_API
26876 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26877 #else
26878 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26879 #endif
26880 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
26881 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "integer",
26882 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26883 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26884 #elif CYTHON_COMPILING_IN_LIMITED_API
26885 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26886 #else
26887 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26888 #endif
26889 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
26890 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "signedinteger",
26891 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26892 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26893 #elif CYTHON_COMPILING_IN_LIMITED_API
26894 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26895 #else
26896 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26897 #endif
26898 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
26899 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "unsignedinteger",
26900 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26901 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26902 #elif CYTHON_COMPILING_IN_LIMITED_API
26903 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26904 #else
26905 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26906 #endif
26907 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
26908 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "inexact",
26909 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26910 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26911 #elif CYTHON_COMPILING_IN_LIMITED_API
26912 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26913 #else
26914 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26915 #endif
26916 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
26917 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "floating",
26918 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26919 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26920 #elif CYTHON_COMPILING_IN_LIMITED_API
26921 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26922 #else
26923 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26924 #endif
26925 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
26926 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "complexfloating",
26927 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26928 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26929 #elif CYTHON_COMPILING_IN_LIMITED_API
26930 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26931 #else
26932 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26933 #endif
26934 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
26935 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flexible",
26936 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26937 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26938 #elif CYTHON_COMPILING_IN_LIMITED_API
26939 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26940 #else
26941 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26942 #endif
26943 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
26944 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "character",
26945 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26946 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26947 #elif CYTHON_COMPILING_IN_LIMITED_API
26948 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26949 #else
26950 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26951 #endif
26952 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
26953 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ufunc",
26954 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26955 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
26956 #elif CYTHON_COMPILING_IN_LIMITED_API
26957 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
26958 #else
26959 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
26960 #endif
26961 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 946, __pyx_L1_error)
26962 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26963 __Pyx_RefNannyFinishContext();
26964 return 0;
26965 __pyx_L1_error:;
26966 __Pyx_XDECREF(__pyx_t_1);
26967 __Pyx_RefNannyFinishContext();
26968 return -1;
26969}
26970
26971static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
26972 __Pyx_RefNannyDeclarations
26973 CYTHON_UNUSED_VAR(__pyx_mstate);
26974 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_import_code", 0);
26975 /*--- Variable import code ---*/
26976 __Pyx_RefNannyFinishContext();
26977 return 0;
26978}
26979
26980static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
26981 __Pyx_RefNannyDeclarations
26982 CYTHON_UNUSED_VAR(__pyx_mstate);
26983 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_import_code", 0);
26984 /*--- Function import code ---*/
26985 __Pyx_RefNannyFinishContext();
26986 return 0;
26987}
26988
26989#if CYTHON_PEP489_MULTI_PHASE_INIT
26990static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
26991static int __pyx_pymod_exec_superluWrappers(PyObject* module); /*proto*/
26992static PyModuleDef_Slot __pyx_moduledef_slots[] = {
26993 {Py_mod_create, (void*)__pyx_pymod_create},
26994 {Py_mod_exec, (void*)__pyx_pymod_exec_superluWrappers},
26995 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
26996 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
26997 #endif
26998 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
26999 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
27000 #endif
27001 {0, NULL}
27002};
27003#endif
27004
27005#ifdef __cplusplus
27006namespace {
27007 struct PyModuleDef __pyx_moduledef =
27008 #else
27009 static struct PyModuleDef __pyx_moduledef =
27010 #endif
27011 {
27012 PyModuleDef_HEAD_INIT,
27013 "superluWrappers",
27014 0, /* m_doc */
27015 #if CYTHON_USE_MODULE_STATE
27016 sizeof(__pyx_mstatetype), /* m_size */
27017 #else
27018 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
27019 #endif
27020 __pyx_methods /* m_methods */,
27021 #if CYTHON_PEP489_MULTI_PHASE_INIT
27022 __pyx_moduledef_slots, /* m_slots */
27023 #else
27024 NULL, /* m_reload */
27025 #endif
27026 #if CYTHON_USE_MODULE_STATE
27027 __pyx_m_traverse, /* m_traverse */
27028 __pyx_m_clear, /* m_clear */
27029 NULL /* m_free */
27030 #else
27031 NULL, /* m_traverse */
27032 NULL, /* m_clear */
27033 NULL /* m_free */
27034 #endif
27035 };
27036 #ifdef __cplusplus
27037} /* anonymous namespace */
27038#endif
27039
27040/* PyModInitFuncType */
27041#ifndef CYTHON_NO_PYINIT_EXPORT
27042 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27043#else
27044 #ifdef __cplusplus
27045 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
27046 #else
27047 #define __Pyx_PyMODINIT_FUNC PyObject *
27048 #endif
27049#endif
27050
27051__Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void) CYTHON_SMALL_CODE; /*proto*/
27052__Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void)
27053#if CYTHON_PEP489_MULTI_PHASE_INIT
27054{
27055 return PyModuleDef_Init(&__pyx_moduledef);
27056}
27057/* ModuleCreationPEP489 */
27058#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
27059 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
27060static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
27061 {
27062 PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
27063 if (!module) {
27064 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
27065 goto bad; // BaseException
27066 }
27067 PyErr_Clear(); // just try the 3.8-3.12 version
27068 module = PyImport_ImportModule("_xxsubinterpreters");
27069 if (!module) goto bad;
27070 }
27071 PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
27072 Py_DECREF(module);
27073 if (!current) goto bad;
27074 if (PyTuple_Check(current)) {
27075 PyObject *new_current = PySequence_GetItem(current, 0);
27076 Py_DECREF(current);
27077 current = new_current;
27078 if (!new_current) goto bad;
27079 }
27080 long long as_c_int = PyLong_AsLongLong(current);
27081 Py_DECREF(current);
27082 return as_c_int;
27083 }
27084 bad:
27085 PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
27086 return -1;
27087}
27088#endif
27089#if !CYTHON_USE_MODULE_STATE
27090static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
27091 static PY_INT64_T main_interpreter_id = -1;
27092#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
27093 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
27094#elif CYTHON_COMPILING_IN_GRAAL
27095 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
27096#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
27097 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
27098 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
27099#elif CYTHON_COMPILING_IN_LIMITED_API
27100 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
27101#else
27102 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
27103#endif
27104 if (unlikely(current_id == -1)) {
27105 return -1;
27106 }
27107 if (main_interpreter_id == -1) {
27108 main_interpreter_id = current_id;
27109 return 0;
27110 } else if (unlikely(main_interpreter_id != current_id)) {
27111 PyErr_SetString(
27112 PyExc_ImportError,
27113 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
27114 return -1;
27115 }
27116 return 0;
27117}
27118#endif
27119static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
27120{
27121 PyObject *value = PyObject_GetAttrString(spec, from_name);
27122 int result = 0;
27123 if (likely(value)) {
27124 if (allow_none || value != Py_None) {
27125 result = PyDict_SetItemString(moddict, to_name, value);
27126 }
27127 Py_DECREF(value);
27128 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
27129 PyErr_Clear();
27130 } else {
27131 result = -1;
27132 }
27133 return result;
27134}
27135static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
27136 PyObject *module = NULL, *moddict, *modname;
27137 CYTHON_UNUSED_VAR(def);
27138 #if !CYTHON_USE_MODULE_STATE
27139 if (__Pyx_check_single_interpreter())
27140 return NULL;
27141 #endif
27142 if (__pyx_m)
27143 return __Pyx_NewRef(__pyx_m);
27144 modname = PyObject_GetAttrString(spec, "name");
27145 if (unlikely(!modname)) goto bad;
27146 module = PyModule_NewObject(modname);
27147 Py_DECREF(modname);
27148 if (unlikely(!module)) goto bad;
27149 moddict = PyModule_GetDict(module);
27150 if (unlikely(!moddict)) goto bad;
27151 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
27152 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
27153 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
27154 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
27155 return module;
27156bad:
27157 Py_XDECREF(module);
27158 return NULL;
27159}
27160
27161
27162static CYTHON_SMALL_CODE int __pyx_pymod_exec_superluWrappers(PyObject *__pyx_pyinit_module)
27163#endif
27164{
27165 int stringtab_initialized = 0;
27166 #if CYTHON_USE_MODULE_STATE
27167 int pystate_addmodule_run = 0;
27168 #endif
27169 __pyx_mstatetype *__pyx_mstate = NULL;
27170 PyObject *__pyx_t_1 = NULL;
27171 PyObject *__pyx_t_2 = NULL;
27172 PyObject *__pyx_t_3 = NULL;
27173 PyObject *__pyx_t_4 = NULL;
27174 PyObject *__pyx_t_5 = NULL;
27175 size_t __pyx_t_6;
27176 static PyThread_type_lock __pyx_t_7[8];
27177 int __pyx_t_8;
27178 PyObject *__pyx_t_9 = NULL;
27179 PyObject *__pyx_t_10 = NULL;
27180 int __pyx_lineno = 0;
27181 const char *__pyx_filename = NULL;
27182 int __pyx_clineno = 0;
27183 __Pyx_RefNannyDeclarations
27184 #if CYTHON_PEP489_MULTI_PHASE_INIT
27185 if (__pyx_m) {
27186 if (__pyx_m == __pyx_pyinit_module) return 0;
27187 PyErr_SetString(PyExc_RuntimeError, "Module 'superluWrappers' has already been imported. Re-initialisation is not supported.");
27188 return -1;
27189 }
27190 #else
27191 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
27192 #endif
27193 /*--- Module creation code ---*/
27194 #if CYTHON_PEP489_MULTI_PHASE_INIT
27195 __pyx_t_1 = __pyx_pyinit_module;
27196 Py_INCREF(__pyx_t_1);
27197 #else
27198 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27199 #endif
27200 #if CYTHON_USE_MODULE_STATE
27201 {
27202 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
27203 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "superluWrappers" pseudovariable */
27204 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27205 pystate_addmodule_run = 1;
27206 }
27207 #else
27208 __pyx_m = __pyx_t_1;
27209 #endif
27210 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
27211 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
27212 #endif
27213 __pyx_mstate = __pyx_mstate_global;
27214 CYTHON_UNUSED_VAR(__pyx_t_1);
27215 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
27216 Py_INCREF(__pyx_mstate->__pyx_d);
27217 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
27218 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
27219 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27220 /* ImportRefnannyAPI */
27221 #if CYTHON_REFNANNY
27222 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
27223 if (!__Pyx_RefNanny) {
27224 if (PyErr_ExceptionMatches(PyExc_Exception)) {
27225 PyErr_Clear();
27226 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
27227 }
27228 if (!__Pyx_RefNanny)
27229 Py_FatalError("failed to import 'refnanny' module");
27230 }
27231 #endif
27232
27233__Pyx_RefNannySetupContext("PyInit_superluWrappers", 0);
27234 __Pyx_init_runtime_version();
27235 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27236 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
27237 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
27238 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
27239 /*--- Library function declarations ---*/
27240 /*--- Initialize various global constants etc. ---*/
27241 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27242 stringtab_initialized = 1;
27243 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27244 if (__pyx_module_is_main_superluWrappers) {
27245 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27246 }
27247 {
27248 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
27249 if (!PyDict_GetItemString(modules, "superluWrappers")) {
27250 if (unlikely((PyDict_SetItemString(modules, "superluWrappers", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27251 }
27252 }
27253 /*--- Builtin init code ---*/
27254 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27255 /*--- Constants init code ---*/
27256 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27257 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27258 /*--- Global type/function init code ---*/
27259 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
27260 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
27261 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
27262 /*--- Type init code ---*/
27263 if (unlikely((__Pyx_modinit_Exttype___pyx_obj_15superluWrappers_cSparseMatrix(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27264 if (unlikely((__Pyx_modinit_Exttype___pyx_obj_15superluWrappers_SparseFactor(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27265 if (unlikely((__Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27266 if (unlikely((__Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27267 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27268 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27269 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27270 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
27271 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
27272 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27273 /*--- Execution code ---*/
27274
27275 /* "View.MemoryView":118
27276 *
27277 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27278 * try: # <<<<<<<<<<<<<<
27279 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27280 * except:
27281*/
27282 {
27283 __Pyx_PyThreadState_declare
27284 __Pyx_PyThreadState_assign
27285 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27286 __Pyx_XGOTREF(__pyx_t_1);
27287 __Pyx_XGOTREF(__pyx_t_2);
27288 __Pyx_XGOTREF(__pyx_t_3);
27289 /*try:*/ {
27290
27291 /* "View.MemoryView":119
27292 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27293 * try:
27294 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
27295 * except:
27296 *
27297*/
27298 __pyx_t_5 = NULL;
27299 __pyx_t_6 = 1;
27300 {
27301 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_collections_abc};
27302 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin___import__, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27303 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27304 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
27305 __Pyx_GOTREF(__pyx_t_4);
27306 }
27307 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 119, __pyx_L2_error)
27308 __Pyx_GOTREF(__pyx_t_5);
27309 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27310 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
27311 __Pyx_GOTREF(__pyx_t_4);
27312 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27313 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27314 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
27315 __Pyx_GIVEREF(__pyx_t_4);
27316 __pyx_t_4 = 0;
27317
27318 /* "View.MemoryView":118
27319 *
27320 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27321 * try: # <<<<<<<<<<<<<<
27322 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27323 * except:
27324*/
27325 }
27326 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27327 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27328 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27329 goto __pyx_L7_try_end;
27330 __pyx_L2_error:;
27331 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27332 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27333
27334 /* "View.MemoryView":120
27335 * try:
27336 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27337 * except: # <<<<<<<<<<<<<<
27338 *
27339 * __pyx_collections_abc_Sequence = None
27340*/
27341 /*except:*/ {
27342 __Pyx_ErrRestore(0,0,0);
27343
27344 /* "View.MemoryView":122
27345 * except:
27346 *
27347 * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<<
27348 *
27349 *
27350*/
27351 __Pyx_INCREF(Py_None);
27352 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27353 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
27354 __Pyx_GIVEREF(Py_None);
27355 goto __pyx_L3_exception_handled;
27356 }
27357 __pyx_L3_exception_handled:;
27358 __Pyx_XGIVEREF(__pyx_t_1);
27359 __Pyx_XGIVEREF(__pyx_t_2);
27360 __Pyx_XGIVEREF(__pyx_t_3);
27361 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27362 __pyx_L7_try_end:;
27363 }
27364
27365 /* "View.MemoryView":258
27366 *
27367 *
27368 * try: # <<<<<<<<<<<<<<
27369 * count = __pyx_collections_abc_Sequence.count
27370 * index = __pyx_collections_abc_Sequence.index
27371*/
27372 {
27373 __Pyx_PyThreadState_declare
27374 __Pyx_PyThreadState_assign
27375 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
27376 __Pyx_XGOTREF(__pyx_t_3);
27377 __Pyx_XGOTREF(__pyx_t_2);
27378 __Pyx_XGOTREF(__pyx_t_1);
27379 /*try:*/ {
27380
27381 /* "View.MemoryView":259
27382 *
27383 * try:
27384 * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
27385 * index = __pyx_collections_abc_Sequence.index
27386 * except:
27387*/
27388 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 259, __pyx_L10_error)
27389 __Pyx_GOTREF(__pyx_t_4);
27390 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(1, 259, __pyx_L10_error)
27391 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27392
27393 /* "View.MemoryView":260
27394 * try:
27395 * count = __pyx_collections_abc_Sequence.count
27396 * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
27397 * except:
27398 * pass
27399*/
27400 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 260, __pyx_L10_error)
27401 __Pyx_GOTREF(__pyx_t_4);
27402 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(1, 260, __pyx_L10_error)
27403 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27404
27405 /* "View.MemoryView":258
27406 *
27407 *
27408 * try: # <<<<<<<<<<<<<<
27409 * count = __pyx_collections_abc_Sequence.count
27410 * index = __pyx_collections_abc_Sequence.index
27411*/
27412 }
27413 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27414 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27415 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27416 goto __pyx_L15_try_end;
27417 __pyx_L10_error:;
27418 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27419 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27420
27421 /* "View.MemoryView":261
27422 * count = __pyx_collections_abc_Sequence.count
27423 * index = __pyx_collections_abc_Sequence.index
27424 * except: # <<<<<<<<<<<<<<
27425 * pass
27426 *
27427*/
27428 /*except:*/ {
27429 __Pyx_ErrRestore(0,0,0);
27430 goto __pyx_L11_exception_handled;
27431 }
27432 __pyx_L11_exception_handled:;
27433 __Pyx_XGIVEREF(__pyx_t_3);
27434 __Pyx_XGIVEREF(__pyx_t_2);
27435 __Pyx_XGIVEREF(__pyx_t_1);
27436 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
27437 __pyx_L15_try_end:;
27438 }
27439
27440 /* "View.MemoryView":326
27441 * return self.name
27442 *
27443 * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
27444 * cdef strided = Enum("<strided and direct>") # default
27445 * cdef indirect = Enum("<strided and indirect>")
27446*/
27447 __pyx_t_5 = NULL;
27448 __pyx_t_6 = 1;
27449 {
27450 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct_or_indirect};
27451 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27452 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27453 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 326, __pyx_L1_error)
27454 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27455 }
27456 __Pyx_XGOTREF(generic);
27457 __Pyx_DECREF_SET(generic, ((PyObject *)__pyx_t_4));
27458 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27459 __pyx_t_4 = 0;
27460
27461 /* "View.MemoryView":327
27462 *
27463 * cdef generic = Enum("<strided and direct or indirect>")
27464 * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
27465 * cdef indirect = Enum("<strided and indirect>")
27466 *
27467*/
27468 __pyx_t_5 = NULL;
27469 __pyx_t_6 = 1;
27470 {
27471 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct};
27472 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27473 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27474 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 327, __pyx_L1_error)
27475 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27476 }
27477 __Pyx_XGOTREF(strided);
27478 __Pyx_DECREF_SET(strided, ((PyObject *)__pyx_t_4));
27479 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27480 __pyx_t_4 = 0;
27481
27482 /* "View.MemoryView":328
27483 * cdef generic = Enum("<strided and direct or indirect>")
27484 * cdef strided = Enum("<strided and direct>") # default
27485 * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
27486 *
27487 *
27488*/
27489 __pyx_t_5 = NULL;
27490 __pyx_t_6 = 1;
27491 {
27492 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_indirect};
27493 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27494 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27495 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 328, __pyx_L1_error)
27496 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27497 }
27498 __Pyx_XGOTREF(indirect);
27499 __Pyx_DECREF_SET(indirect, ((PyObject *)__pyx_t_4));
27500 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27501 __pyx_t_4 = 0;
27502
27503 /* "View.MemoryView":331
27504 *
27505 *
27506 * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
27507 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
27508 *
27509*/
27510 __pyx_t_5 = NULL;
27511 __pyx_t_6 = 1;
27512 {
27513 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_direct};
27514 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27515 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27516 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 331, __pyx_L1_error)
27517 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27518 }
27519 __Pyx_XGOTREF(contiguous);
27520 __Pyx_DECREF_SET(contiguous, ((PyObject *)__pyx_t_4));
27521 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27522 __pyx_t_4 = 0;
27523
27524 /* "View.MemoryView":332
27525 *
27526 * cdef contiguous = Enum("<contiguous and direct>")
27527 * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
27528 *
27529 *
27530*/
27531 __pyx_t_5 = NULL;
27532 __pyx_t_6 = 1;
27533 {
27534 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_indirect};
27535 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27536 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27537 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 332, __pyx_L1_error)
27538 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27539 }
27540 __Pyx_XGOTREF(indirect_contiguous);
27541 __Pyx_DECREF_SET(indirect_contiguous, ((PyObject *)__pyx_t_4));
27542 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27543 __pyx_t_4 = 0;
27544
27545 /* "View.MemoryView":340
27546 *
27547 *
27548 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
27549 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
27550 * PyThread_allocate_lock(),
27551*/
27552 __pyx_memoryview_thread_locks_used = 0;
27553
27554 /* "View.MemoryView":341
27555 *
27556 * cdef int __pyx_memoryview_thread_locks_used = 0
27557 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
27558 * PyThread_allocate_lock(),
27559 * PyThread_allocate_lock(),
27560*/
27561 __pyx_t_7[0] = PyThread_allocate_lock();
27562 __pyx_t_7[1] = PyThread_allocate_lock();
27563 __pyx_t_7[2] = PyThread_allocate_lock();
27564 __pyx_t_7[3] = PyThread_allocate_lock();
27565 __pyx_t_7[4] = PyThread_allocate_lock();
27566 __pyx_t_7[5] = PyThread_allocate_lock();
27567 __pyx_t_7[6] = PyThread_allocate_lock();
27568 __pyx_t_7[7] = PyThread_allocate_lock();
27569 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_7, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
27570
27571 /* "View.MemoryView":979
27572 *
27573 *
27574 * try: # <<<<<<<<<<<<<<
27575 * count = __pyx_collections_abc_Sequence.count
27576 * index = __pyx_collections_abc_Sequence.index
27577*/
27578 {
27579 __Pyx_PyThreadState_declare
27580 __Pyx_PyThreadState_assign
27581 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27582 __Pyx_XGOTREF(__pyx_t_1);
27583 __Pyx_XGOTREF(__pyx_t_2);
27584 __Pyx_XGOTREF(__pyx_t_3);
27585 /*try:*/ {
27586
27587 /* "View.MemoryView":980
27588 *
27589 * try:
27590 * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
27591 * index = __pyx_collections_abc_Sequence.index
27592 * except:
27593*/
27594 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 980, __pyx_L18_error)
27595 __Pyx_GOTREF(__pyx_t_4);
27596 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(1, 980, __pyx_L18_error)
27597 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27598
27599 /* "View.MemoryView":981
27600 * try:
27601 * count = __pyx_collections_abc_Sequence.count
27602 * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
27603 * except:
27604 * pass
27605*/
27606 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 981, __pyx_L18_error)
27607 __Pyx_GOTREF(__pyx_t_4);
27608 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(1, 981, __pyx_L18_error)
27609 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27610
27611 /* "View.MemoryView":979
27612 *
27613 *
27614 * try: # <<<<<<<<<<<<<<
27615 * count = __pyx_collections_abc_Sequence.count
27616 * index = __pyx_collections_abc_Sequence.index
27617*/
27618 }
27619 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27620 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27621 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27622 goto __pyx_L23_try_end;
27623 __pyx_L18_error:;
27624 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27625 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27626
27627 /* "View.MemoryView":982
27628 * count = __pyx_collections_abc_Sequence.count
27629 * index = __pyx_collections_abc_Sequence.index
27630 * except: # <<<<<<<<<<<<<<
27631 * pass
27632 *
27633*/
27634 /*except:*/ {
27635 __Pyx_ErrRestore(0,0,0);
27636 goto __pyx_L19_exception_handled;
27637 }
27638 __pyx_L19_exception_handled:;
27639 __Pyx_XGIVEREF(__pyx_t_1);
27640 __Pyx_XGIVEREF(__pyx_t_2);
27641 __Pyx_XGIVEREF(__pyx_t_3);
27642 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27643 __pyx_L23_try_end:;
27644 }
27645
27646 /* "View.MemoryView":985
27647 * pass
27648 *
27649 * try: # <<<<<<<<<<<<<<
27650 * if __pyx_collections_abc_Sequence:
27651 *
27652*/
27653 {
27654 __Pyx_PyThreadState_declare
27655 __Pyx_PyThreadState_assign
27656 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
27657 __Pyx_XGOTREF(__pyx_t_3);
27658 __Pyx_XGOTREF(__pyx_t_2);
27659 __Pyx_XGOTREF(__pyx_t_1);
27660 /*try:*/ {
27661
27662 /* "View.MemoryView":986
27663 *
27664 * try:
27665 * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
27666 *
27667 *
27668*/
27669 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 986, __pyx_L26_error)
27670 if (__pyx_t_8) {
27671
27672
27673 /* "View.MemoryView":990
27674 *
27675 *
27676 * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<<
27677 * __pyx_collections_abc_Sequence.register(array)
27678 * except:
27679*/
27680 __pyx_t_5 = __pyx_collections_abc_Sequence;
27681 __Pyx_INCREF(__pyx_t_5);
27682 __pyx_t_6 = 0;
27683 {
27684 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_memoryviewslice_type)};
27685 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27686 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27687 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 990, __pyx_L26_error)
27688 __Pyx_GOTREF(__pyx_t_4);
27689 }
27690 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27691
27692 /* "View.MemoryView":991
27693 *
27694 * __pyx_collections_abc_Sequence.register(_memoryviewslice)
27695 * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<<
27696 * except:
27697 * pass # ignore failure, it's a minor issue
27698*/
27699 __pyx_t_5 = __pyx_collections_abc_Sequence;
27700 __Pyx_INCREF(__pyx_t_5);
27701 __pyx_t_6 = 0;
27702 {
27703 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_array_type)};
27704 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27705 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27706 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 991, __pyx_L26_error)
27707 __Pyx_GOTREF(__pyx_t_4);
27708 }
27709 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27710
27711 /* "View.MemoryView":986
27712 *
27713 * try:
27714 * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
27715 *
27716 *
27717*/
27718 }
27719
27720 /* "View.MemoryView":985
27721 * pass
27722 *
27723 * try: # <<<<<<<<<<<<<<
27724 * if __pyx_collections_abc_Sequence:
27725 *
27726*/
27727 }
27728 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27729 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27730 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27731 goto __pyx_L31_try_end;
27732 __pyx_L26_error:;
27733 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27734 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27735
27736 /* "View.MemoryView":992
27737 * __pyx_collections_abc_Sequence.register(_memoryviewslice)
27738 * __pyx_collections_abc_Sequence.register(array)
27739 * except: # <<<<<<<<<<<<<<
27740 * pass # ignore failure, it's a minor issue
27741 *
27742*/
27743 /*except:*/ {
27744 __Pyx_ErrRestore(0,0,0);
27745 goto __pyx_L27_exception_handled;
27746 }
27747 __pyx_L27_exception_handled:;
27748 __Pyx_XGIVEREF(__pyx_t_3);
27749 __Pyx_XGIVEREF(__pyx_t_2);
27750 __Pyx_XGIVEREF(__pyx_t_1);
27751 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
27752 __pyx_L31_try_end:;
27753 }
27754
27755 /* "(tree fragment)":4
27756 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
27757 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
27758 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
27759 * cdef object __pyx_result
27760 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
27761*/
27762 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_mstate_global->__pyx_n_u_View_MemoryView); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
27763 __Pyx_GOTREF(__pyx_t_4);
27764 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum, __pyx_t_4) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
27765 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27766
27767 /* "superluWrappers.pyx":7
27768 * # correctly. perhaps they should only be enabled when not in debug mode?
27769 *
27770 * import numpy as np # <<<<<<<<<<<<<<
27771 * import cython
27772 * cimport numpy as np
27773*/
27774 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
27775 __pyx_t_4 = __pyx_t_1;
27776 __Pyx_GOTREF(__pyx_t_4);
27777 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_4) < (0)) __PYX_ERR(0, 7, __pyx_L1_error)
27778 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27779
27780 /* "superluWrappers.pyx":13
27781 * from libc.stdlib cimport malloc
27782 *
27783 * class SparseMatrix(object): # <<<<<<<<<<<<<<
27784 *
27785 * def __init__(self,
27786*/
27787 __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[4]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error)
27788 __Pyx_GOTREF(__pyx_t_4);
27789 __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
27790 __Pyx_GOTREF(__pyx_t_5);
27791 __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_SparseMatrix, __pyx_mstate_global->__pyx_n_u_SparseMatrix, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, (PyObject *) NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 13, __pyx_L1_error)
27792 __Pyx_GOTREF(__pyx_t_9);
27793 if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[4]) {
27794 if (unlikely((PyDict_SetItemString(__pyx_t_9, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[4]) < 0))) __PYX_ERR(0, 13, __pyx_L1_error)
27795 }
27796
27797 /* "superluWrappers.pyx":15
27798 * class SparseMatrix(object):
27799 *
27800 * def __init__(self, # <<<<<<<<<<<<<<
27801 * nr,
27802 * nc,
27803*/
27804 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_1__init__, 0, __pyx_mstate_global->__pyx_n_u_SparseMatrix___init, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 15, __pyx_L1_error)
27805 __Pyx_GOTREF(__pyx_t_10);
27806 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27807 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
27808 #endif
27809 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_10) < (0)) __PYX_ERR(0, 15, __pyx_L1_error)
27810 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
27811
27812 /* "superluWrappers.pyx":35
27813 * self.rowptr)
27814 *
27815 * def matvec(self, x, y): # <<<<<<<<<<<<<<
27816 * """
27817 * Compute the sparse matrix-vector product y = Ax
27818*/
27819 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_3matvec, 0, __pyx_mstate_global->__pyx_n_u_SparseMatrix_matvec, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 35, __pyx_L1_error)
27820 __Pyx_GOTREF(__pyx_t_10);
27821 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27822 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
27823 #endif
27824 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_matvec, __pyx_t_10) < (0)) __PYX_ERR(0, 35, __pyx_L1_error)
27825 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
27826
27827 /* "superluWrappers.pyx":46
27828 * SparseMatrix_matvec(self._cSparseMatrix, x, y)
27829 *
27830 * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
27831 * """ Write the sparse matrix to a file
27832 *
27833*/
27834 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite, 0, __pyx_mstate_global->__pyx_n_u_SparseMatrix_fwrite, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
27835 __Pyx_GOTREF(__pyx_t_10);
27836 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27837 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
27838 #endif
27839 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_fwrite, __pyx_t_10) < (0)) __PYX_ERR(0, 46, __pyx_L1_error)
27840 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
27841
27842 /* "superluWrappers.pyx":62
27843 * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
27844 *
27845 * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
27846 * """ Get the CSR representation of the sparse matrix.
27847 *
27848*/
27849 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation, 0, __pyx_mstate_global->__pyx_n_u_SparseMatrix_getCSRrepresentatio, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error)
27850 __Pyx_GOTREF(__pyx_t_10);
27851 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27852 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
27853 #endif
27854 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_getCSRrepresentation, __pyx_t_10) < (0)) __PYX_ERR(0, 62, __pyx_L1_error)
27855 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
27856
27857 /* "superluWrappers.pyx":72
27858 * return (self.rowptr, self.colind, self.nzvals)
27859 *
27860 * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
27861 * range_start,
27862 * range_end):
27863*/
27864 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, 0, __pyx_mstate_global->__pyx_n_u_SparseMatrix_getSubMatCSRreprese, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 72, __pyx_L1_error)
27865 __Pyx_GOTREF(__pyx_t_10);
27866 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27867 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
27868 #endif
27869 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_getSubMatCSRrepresentation, __pyx_t_10) < (0)) __PYX_ERR(0, 72, __pyx_L1_error)
27870 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
27871
27872 /* "superluWrappers.pyx":13
27873 * from libc.stdlib cimport malloc
27874 *
27875 * class SparseMatrix(object): # <<<<<<<<<<<<<<
27876 *
27877 * def __init__(self,
27878*/
27879 __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SparseMatrix, __pyx_t_4, __pyx_t_9, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 13, __pyx_L1_error)
27880 __Pyx_GOTREF(__pyx_t_10);
27881 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27882 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
27883 #endif
27884 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SparseMatrix, __pyx_t_10) < (0)) __PYX_ERR(0, 13, __pyx_L1_error)
27885 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
27886 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27887 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27888 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27889
27890 /* "(tree fragment)":1
27891 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
27892 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
27893 * def __setstate_cython__(self, __pyx_state):
27894*/
27895 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_13cSparseMatrix_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cSparseMatrix___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
27896 __Pyx_GOTREF(__pyx_t_4);
27897 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27898 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
27899 #endif
27900 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
27901 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27902
27903 /* "(tree fragment)":3
27904 * def __reduce_cython__(self):
27905 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
27906 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
27907 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
27908*/
27909 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_13cSparseMatrix_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cSparseMatrix___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
27910 __Pyx_GOTREF(__pyx_t_4);
27911 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27912 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
27913 #endif
27914 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
27915 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27916
27917 /* "(tree fragment)":1
27918 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
27919 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling"
27920 * def __setstate_cython__(self, __pyx_state):
27921*/
27922 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseFactor_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SparseFactor___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
27923 __Pyx_GOTREF(__pyx_t_4);
27924 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27925 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
27926 #endif
27927 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
27928 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27929
27930 /* "(tree fragment)":3
27931 * def __reduce_cython__(self):
27932 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling"
27933 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
27934 * raise TypeError, "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling"
27935*/
27936 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseFactor_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SparseFactor___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
27937 __Pyx_GOTREF(__pyx_t_4);
27938 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27939 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
27940 #endif
27941 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
27942 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27943
27944 /* "superluWrappers.pyx":222
27945 * self.X.Store = &self.storeX
27946 *
27947 * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
27948 * sparseFactor):
27949 * """ Python wrapper for superlu Sparse Factor Prepare function.
27950*/
27951 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_1sparseFactorPrepare, 0, __pyx_mstate_global->__pyx_n_u_sparseFactorPrepare, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
27952 __Pyx_GOTREF(__pyx_t_4);
27953 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27954 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
27955 #endif
27956 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sparseFactorPrepare, __pyx_t_4) < (0)) __PYX_ERR(0, 222, __pyx_L1_error)
27957 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27958
27959 /* "superluWrappers.pyx":289
27960 * &info)
27961 *
27962 * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
27963 * x):
27964 * """ Sparse factor solve wrappers
27965*/
27966 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_3sparseFactorSolve, 0, __pyx_mstate_global->__pyx_n_u_sparseFactorSolve, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
27967 __Pyx_GOTREF(__pyx_t_4);
27968 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27969 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
27970 #endif
27971 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sparseFactorSolve, __pyx_t_4) < (0)) __PYX_ERR(0, 289, __pyx_L1_error)
27972 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27973
27974 /* "superluWrappers.pyx":1
27975 * #cython: boundscheck=False, wraparound=False, nonecheck=False, initializedcheck=False # <<<<<<<<<<<<<<
27976 *
27977 * # ARB - the cython directives above allow code to run much faster. it is worth noting
27978*/
27979 __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
27980 __Pyx_GOTREF(__pyx_t_4);
27981 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27982 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27983
27984 /*--- Wrapped vars code ---*/
27985
27986 goto __pyx_L0;
27987 __pyx_L1_error:;
27988 __Pyx_XDECREF(__pyx_t_4);
27989 __Pyx_XDECREF(__pyx_t_5);
27990 __Pyx_XDECREF(__pyx_t_9);
27991 __Pyx_XDECREF(__pyx_t_10);
27992 if (__pyx_m) {
27993 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
27994 __Pyx_AddTraceback("init superluWrappers", __pyx_clineno, __pyx_lineno, __pyx_filename);
27995 }
27996 #if !CYTHON_USE_MODULE_STATE
27997 Py_CLEAR(__pyx_m);
27998 #else
27999 Py_DECREF(__pyx_m);
28000 if (pystate_addmodule_run) {
28001 PyObject *tp, *value, *tb;
28002 __Pyx_PyErr_FetchException(&tp, &value, &tb);
28003 __Pyx_State_RemoveModule(&__pyx_moduledef);
28004 __Pyx_PyErr_RestoreException(tp, value, tb);
28005 }
28006 #endif
28007 } else if (!PyErr_Occurred()) {
28008 PyErr_SetString(PyExc_ImportError, "init superluWrappers");
28009 }
28010 __pyx_L0:;
28011 __Pyx_RefNannyFinishContext();
28012 #if CYTHON_PEP489_MULTI_PHASE_INIT
28013 return (__pyx_m != NULL) ? 0 : -1;
28014 #else
28015 return __pyx_m;
28016 #endif
28017}
28018/* #### Code section: pystring_table ### */
28019/* #### Code section: cached_builtins ### */
28020
28021static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
28022 int __pyx_lineno = 0;
28023 const char *__pyx_filename = NULL;
28024 int __pyx_clineno = 0;
28025 CYTHON_UNUSED_VAR(__pyx_mstate);
28026 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_object); if (!__pyx_builtin_object) __PYX_ERR(0, 13, __pyx_L1_error)
28027 __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_open); if (!__pyx_builtin_open) __PYX_ERR(0, 56, __pyx_L1_error)
28028 __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 119, __pyx_L1_error)
28029 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 175, __pyx_L1_error)
28030 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 436, __pyx_L1_error)
28031 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(1, 662, __pyx_L1_error)
28032
28033 /* Cached unbound methods */
28034 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
28035 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
28036 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
28037 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
28038 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
28039 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
28040 return 0;
28041 __pyx_L1_error:;
28042 return -1;
28043}
28044/* #### Code section: cached_constants ### */
28045
28046static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
28047 __Pyx_RefNannyDeclarations
28048 int __pyx_lineno = 0;
28049 const char *__pyx_filename = NULL;
28050 int __pyx_clineno = 0;
28051 CYTHON_UNUSED_VAR(__pyx_mstate);
28052 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
28053
28054 /* "View.MemoryView":625
28055 * def suboffsets(self):
28056 * if self.view.suboffsets == NULL:
28057 * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
28058 *
28059 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
28060*/
28061 __pyx_mstate_global->__pyx_tuple[0] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(1, 625, __pyx_L1_error)
28062 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
28063 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
28064 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_1);
28065 if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[0], 0, __pyx_mstate_global->__pyx_int_neg_1) != (0)) __PYX_ERR(1, 625, __pyx_L1_error);
28066 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
28067
28068 /* "View.MemoryView":745
28069 *
28070 * if first_ellipsis_index >= 0:
28071 * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
28072 *
28073 * for idx in range(first_ellipsis_index):
28074*/
28075 __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(1, 745, __pyx_L1_error)
28076 __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
28077 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
28078
28079 /* "View.MemoryView":763
28080 *
28081 * have_slices = True
28082 * index_tuple += (slice(None),) * (ndim - idx) # <<<<<<<<<<<<<<
28083 *
28084 * return have_slices, index_tuple
28085*/
28086 __pyx_mstate_global->__pyx_tuple[1] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 763, __pyx_L1_error)
28087 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
28088 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
28089 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
28090 if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[1], 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 763, __pyx_L1_error);
28091 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
28092
28093 /* "superluWrappers.pyx":56
28094 * ?!Possibly something to do with parallel?!
28095 * """
28096 * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
28097 * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
28098 * for i in range(self.nr):
28099*/
28100 {
28101 PyObject* __pyx_temp[3] = {Py_None, Py_None, Py_None};
28102 __pyx_mstate_global->__pyx_tuple[2] = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 56, __pyx_L1_error)
28103 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
28104 }
28105 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
28106
28107 /* "superluWrappers.pyx":13
28108 * from libc.stdlib cimport malloc
28109 *
28110 * class SparseMatrix(object): # <<<<<<<<<<<<<<
28111 *
28112 * def __init__(self,
28113*/
28114 {
28115 PyObject* __pyx_temp[1] = {__pyx_builtin_object};
28116 __pyx_mstate_global->__pyx_tuple[3] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 13, __pyx_L1_error)
28117 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
28118 }
28119 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
28120 {
28121 PyObject* __pyx_temp[1] = {__pyx_builtin_object};
28122 __pyx_mstate_global->__pyx_tuple[4] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 13, __pyx_L1_error)
28123 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
28124 }
28125 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
28126 #if CYTHON_IMMORTAL_CONSTANTS
28127 {
28128 PyObject **table = __pyx_mstate->__pyx_tuple;
28129 for (Py_ssize_t i=0; i<5; ++i) {
28130 #if PY_VERSION_HEX >= 0x030F0000
28131 PyUnstable_SetImmortal(table[i]);
28132 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28133 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
28134 #if PY_VERSION_HEX < 0x030E0000
28135 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
28136 #else
28137 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
28138 #endif
28139 {
28140 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
28141 }
28142 #else
28143 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
28144 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
28145 #endif
28146 }
28147 }
28148 #endif
28149 #if CYTHON_IMMORTAL_CONSTANTS
28150 {
28151 PyObject **table = __pyx_mstate->__pyx_slice;
28152 for (Py_ssize_t i=0; i<1; ++i) {
28153 #if PY_VERSION_HEX >= 0x030F0000
28154 PyUnstable_SetImmortal(table[i]);
28155 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28156 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
28157 #if PY_VERSION_HEX < 0x030E0000
28158 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
28159 #else
28160 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
28161 #endif
28162 {
28163 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
28164 }
28165 #else
28166 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
28167 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
28168 #endif
28169 }
28170 }
28171 #endif
28172 __Pyx_RefNannyFinishContext();
28173 return 0;
28174 __pyx_L1_error:;
28175 __Pyx_RefNannyFinishContext();
28176 return -1;
28177}
28178/* #### Code section: init_constants ### */
28179
28180static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
28181 int __pyx_lineno = 0;
28182 const char *__pyx_filename = NULL;
28183 int __pyx_clineno = 0;
28184 CYTHON_UNUSED_VAR(__pyx_mstate);
28185 {
28186 const struct { const unsigned int length: 8; } str_length_index[] = {{6},{8},{13},{10},{15},{1},{2},{15},{23},{25},{32},{20},{22},{1},{1},{37},{45},{22},{179},{8},{15},{7},{6},{2},{9},{50},{39},{34},{27},{146},{30},{37},{5},{8},{8},{12},{30},{32},{12},{21},{19},{33},{39},{19},{15},{20},{12},{9},{17},{8},{7},{9},{8},{8},{12},{10},{8},{8},{13},{10},{15},{8},{7},{11},{14},{11},{10},{19},{14},{12},{10},{17},{13},{12},{12},{19},{8},{14},{13},{5},{3},{15},{18},{4},{1},{13},{31},{33},{18},{6},{5},{3},{15},{6},{9},{5},{8},{5},{6},{7},{6},{20},{26},{1},{2},{5},{5},{8},{1},{6},{7},{4},{4},{2},{4},{3},{2},{2},{5},{5},{6},{3},{6},{4},{11},{4},{3},{9},{11},{8},{6},{4},{10},{5},{4},{12},{19},{17},{13},{5},{4},{4},{6},{15},{6},{6},{6},{1},{5},{1},{1}};
28187 const struct { const unsigned int length: 8; } bytes_length_index[] = {{1},{9},{14},{16},{93},{19},{18},{131},{165}};
28188 #ifndef CYTHON_COMPRESS_STRINGS
28189 #define CYTHON_COMPRESS_STRINGS 90
28190 #endif
28191 #if (CYTHON_COMPRESS_STRINGS) == 1 /* compression: zlib (1390 bytes) */
28192static const char cstring[] = "x\332\205UAO\033G\024\006\211H\200h\n)m\324\252J\206*\304i\003n\254\320\022UQ*\213@J\325\244\030\223\022)RW\343\331g3ewf\231\23156j\245\0349\356q\217>\372\350\243\217>r\364\321\307\374\204\374\204\276\331\301\304\2304\265\326;o\337\274\231\367\275\367\276yC\250!\017\032DV\376\002f\236,\373\304>\205\207\371G0\273\314\211{f\357\031\005@\252\212\326B\020\346\333\374O\344\361s\010\245j\376\301\341\230\310*y\314\2440\274\026\313X\023*|\342se\267\033Ws1\234\320Fq\037\374\021c\"\325G\347/\353.,\237\374\274A\205\220\206P\255yM\020#\211\002\352\257J\0214I\230\201\254#\310mQ\247\001\367I(}X!\320\210p-n\225c9\3537W\225\312(*r+\244\206[\r\215\365\001\215\000]\021\332\340\232\274\220\006\2109\300|m4\315\201\024\004u>\004\274\002\212\032@o\026\037\356\252\254\221 ;\233;\253k\217\3262\264\nlv5\321q\205\005\010\024\264MZ%\346\201\301\335M3\002\235\047\333U\322\2241\021\200\2700\212\010\355F\027\230\003\020D\203\261\002\311e1S\303\245\360p9\027\265\334y\232x\035\354\352-\032h\310S\337\367\320\016\230\014\002;\047\205\316\323\n\363\271\246\225\000@\330w\215q\355$_H\014\250J\343\300\020\317S\340\307\014<\217\370q\266\243\220b\025\003\254s\032\340,\343\202\033\317\023q\0305\363\036\223\n\362!\256\343T)\332$U\312\003\027\005\017#L\355\250Y\034Rsp\305\"R\0103\326\337\3538\002\025\304\373\212F(\350|\324lh\010\252\371\342\212\0336\334\370\233\033^\272\341\225\033\300\262\324\211\2706\364\330\210\254\234\254\rB(\216\310\257\010s\364\251\000A\262\326A\031\007\213\222\035Wew2\0102\204D\234\035\006\230\3538KWf\025\004\222a\365\211\213\333\247\206\346?0\353\210d\231\3408\254\363\305\362\306\366\366f\020\360Hs]\206\243\030\004\203rD\225\206-\312\020\331\250\234\277\250\006\3130y\336\330,\322B#\033\306\347\237S\364\326\030\225\321\326\025\356\222\262z\254\270\201K\252\032\230\215\362\256\202H\001\262\3031m\334\240\034W\360\343\343fX\354:0\333&\362\357;\206\347\3554\033\370\177\212\307\305{\001\r\263\013U\317;\2474R\016\351eI\377^@g\0100\264\n\337\256\261\243dv@\247\2402\241\3013}5\026\331Dm\230""\022\3749\212e\222pV!\345\"\033\301\320\013_\330\033\342 [\020*iwV\034\262\tA\303L-,t\317\303`1\304L\203\364\364\330\001\260C\035\207\356\353\334\251\025\355\271vR,2\352\200\267)\206vucYb\3678\212i0\3640<tW\n~\241\200\206\375\300\202_\240\322#\221^!\202\347\031\3206d6Z\026\217k{\030e\214\355\007<%\217\261\037\260![\275J\\\255bO\323M\301\270\314_\330\351\n\325\300.\355\303\306\2705\006z|\372\n:\026X\377X\nl\276\014*\224\035b\247\302\326\316d,\214\317C?K!\202u\207\020\317\010\266o\300\034f-\027\224\222\252\212}\304f\242\032\320\232\306C\212\204;o\346\216\325\037\"\362\177s\227s\037\335[.A\250\335\353\004\016\035\211\3612\2617\211\275A\254C\301\360\n\n\2058\021\221PY\203\023\047xmd/\215x\035d\031\201\300\364E\261\361,\322\010C\214d\204\350jXJ\341;\001\223\202\210\241\306\265\2611\035GF\331\016\205\351:o\307Y\377\260P\364\310\271\037\225w\034%GUe\031\324\317\025Hw[\201\314\r\272\210\260\363\341_\305x%]n\267\310S\004\030G\330\307\000\303\210A\037gIl4\177\17739\230\232=\275\237\224\336L\276[\234\270\266\334*\266J\203\345\273\356+\327\242\255\177:\305A\356\336\233\342\273\353\0233\237\234n%\313\211I\177l-\014\246\347N\237%\005;l\047\245\304O\227S\323\312>\177M\350\225\241?w+\r\333\205vq\260\262\232=\017:\223\357_\270\371\374\304\314B2\225l\247{\255/\333w\332\024U7&f\276N\013\351\323>)t>\353\024Q\2638q\375F\262\220|\227\376\322*\016\346n&\365\264\224\212\366F\333t~\350Nu7{\213\275\375\263\342\331^\277\264;\230\233O\256%/\323\245t-=\032\314/&\233\351\347)E\204\353\355\245\366\032.X\357.u\013\335b\2674X\274\235\326[\245\376\335\365\216\316t[\275;\275\332Y\351\254\322\337)\365K\373\375\375\327\375\327\225~\205\365\231\217\020nM\314\314\237\376\235>L\375V\256\375U\347a\307\357.\r\246?==Io\244\030\375|2\233~\223\026\255\246\236\224\323\251\264\370v\372\372\251\237\344\322\205\364~k\267e\332\353\235\245N\341\355\364B\262\230\354\247\305\364\317\366\343\216\352~\321U=\314\350P\271\327\272\331\236l\337\306\230\236\365\n\275\347\375R\271_\336\373\237\351\267\350\262\2214\322\243""\177\001\232]\350\344";
28193 PyObject *data = __Pyx_DecompressString(cstring, 1390, 1);
28194 #define __Pyx_DecompressString_LZSS_UNUSED
28195 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
28196 const char* const bytes = __Pyx_PyBytes_AsString(data);
28197 #if !CYTHON_ASSUME_SAFE_MACROS
28198 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
28199 #endif
28200 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90 /* compression: lzss (1844 bytes) */
28201static const char cstring[] = "\377 at 0x o\377bject>%d\375 \000\000%13.8e\317\n%i \000\000\003\000\n(\377tree fra\377gment).:\377 <Memory\377View of \377<contigu\377ous and gdirK\001\007\rin\021\005\177strided\"\010o or \004\031><(\t\376A\006>?Canno\377t assign\377 to read\177-only m\240\002\375v\242\000Invali\377d mode, \347exp\353\000|\000\047c\047\376t\001\047fortra\237n\047, gH\000%\005s\357hape\222\000 ax\377is Note \373th\255 Cytho\373n \021\000delib\237eratek\000\320\001c\367ter!\001n PE\337P-484\212\"re\376\332!s subcl\366\246\000es\261!buil\373ti\260\000ypes.\377 If you \223ne\224 \303\000p\316\000%\tt\177hen set\200\000\367e \047\357\002atio\377n_typing\355\047\355$iv\242\000o F\377alse.add}_\231 ecoll\334@\376+\000s.abcdi\177sableen\002\001\357gcis\004\003dno\377 default\377 __reduc\277e__ duM\002n\367on-\262@vial\376\033\000cinit__\377numpy._c\337ore.m5\000ia\377rray fai\235l\300\003imp\330 \033\tuomath\021\016pr\333 \377us/super\277luWrap\006\000s\377.pyxselfW.A,\001\003C\002\003L\t\003\025U\020\003X\027\003e\242\204\001\"\003B\000\327m_c\001\010r:\003st\272\247\000A\001\010X c\271cb\377e conver\235t\371#a P\340C\224\205\003 ~\237` pickl\351 \371u\264\"\347aalloc\372\373@ \362\003data.\360\013\020\303c\225\205\001\362\204\003s.AS\377CIIEllip\377sisSeque\377nceSparsOeFac\243\000\000\t.\205F\315c\365b__\017\014\224`st\357ate_\022\013Mat\007rixP\003\006\003G\000\263C\010\n\277fwrite\033\ng\377etCSRrep\313re\233`t\345b\021\rSuqb_\000\t\033\352@vec\243\207\001}.\250\207\007__Pyx\001\000\377Dict_Nex?tRef__\314\204\004\360`\033__\241\205\002__\001\005\213\000\236\000\345m\r\001d0\001\027\000doc\276\034\001enter\004\002x>\214\204\001__fun\024\002\276\000\340\215#C\000\377cK\001\260\204\003__m\367ain[\001meta\276c\006modulz\002m\377ro_entri\273es\201\001nam\221\002nCew\220\001\221 \246@\243\002p\305\000\177checksu\233\000\370\n\001n\004\025\001type_\355_\037\001un\266be_E\315n \005vt\377\205\001\337\001qu\303alZ\005\355\205\005\340N\207\206\006ex\036\223!set_\216\005\364F\255 ~\370N__test""\305!\356\373I_is\260\206\001out\377ine_rows\367abc\304\204\005_buf\377ferasync\277io.cor\"\003s\277basecc\303ic`\315l\255\207\004\236\204\005\017\r\226\204\016cl|\001\376\210@traceba\377ckcolind\377countdim\361d\276\"\252\000\231\214\003enco\277deenum\356\211\002e\377rrorfile\376\234Aflagsfo\217rmat\306\212\004\320\204\003\265\204\021g\373et\245\204\024iidin\273de\311`ems\357as\357izek\277\204\003mem\270\306\213\001\276\213\001\215ancn\237\000n\277nznpnr\203\211\002n\363zv\307@\001\001sobj\336\314\215\003open\344 pu\353t_\246\001p\340\000pop_range\337`d\003\003\377startreg\367ist\320\001wptr\216\361\210\001set\210\212\004\204\214\002\207\001s\234\227\207\010\000\tPre\217\204\001\023\tSoolve*\003_m\204\207\002\274b\002`\000psto\001\000r\267uct\340\211\014un\235\001u\377pdateval\357uesw\226\207\002xyO\377\200\001\330\004\n\210+\220\377Q\200\001\360\024\000\005%\177\240A\240Q\330%&\010\003\377\047\240a\240}\260A\330\377\047(\200A\360\016\000\t\377\r\210F\220%\220t\230\3776\240\021\330\010\014\210G\373\2201\003\001I\220Q\220d\337\230%\230t\240\n\002J\220\361a\031\001\000\004\010\003\320\014\036\230\377m\2501\250A\330,->\000\000\330,0\260\001\000\002\005\002\376Z\000\020\000\t\021\220\004\220\377I\230T\240\031\250$\250\375am\000\022\000\t\034\2301\377\230D\320 1\260\023\260\375A\177\000\024\000\016\022\220\021\377\220*\230H\240A\330\014\377\027\220v\230Q\230n\250\377C\250t\2605\270\004\270\377E\300\024\300W\310A\310\377T\320QR\330\014\020\220\377\005\220U\230!\2304\230\377q\330\020\024\220E\230\025\373\230a\237\0007\250!\2504\376.\0007\270!\2701\270A\377\270Q\330\024\037\230v\240\277Q\320&7\260s\017\002F\377\300$\300g\310Q\310b\377\320PQ\320QW\320W\377[\320[b\320bc\320\373cd\202 \036\000\t\020\210\377|\2303\230d\240\047\250\377\032\2603\260d\270!\330\177\010\017\210z\230\022\230\212 \177\020\220\n\230\"\230A\016\001\377v\220S\230\004\230A\340\377\010\016\210d\220\047\230\021\377\230+\240R\240t\2507\377\260!\2601\340\010\021\220\377\024\220W\230A\230^\250\377<\260r\270""\026\270r\300\374\317 \r\005T\240\027\250\001\250\375\037\321\000G\3001\300M\320\177QS\320ST\330\010\002\032}\340\202\000x\220x\230q";
28202 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 1844, 2553);
28203 #define __Pyx_DecompressString_UNUSED
28204 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
28205 const char* const bytes = __Pyx_PyBytes_AsString(data);
28206 #if !CYTHON_ASSUME_SAFE_MACROS
28207 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
28208 #endif
28209 #else /* compression: none (2553 bytes) */
28210static const char bytes[] = " at 0x object>%d %d %13.8e\n%i %i %i \n(tree fragment).: <MemoryView of <contiguous and direct><contiguous and indirect><strided and direct or indirect><strided and direct><strided and indirect>>?Cannot assign to read-only memoryviewInvalid mode, expected \047c\047 or \047fortran\047, got Invalid shape in axis Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the \047annotation_typing\047 directive to False.add_notecollections.abcdisableenablegcisenabledno default __reduce__ due to non-trivial __cinit__numpy._core.multiarray failed to importnumpy._core.umath failed to importproteus/superluWrappers.pyxself.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for picklingunable to allocate array data.unable to allocate shape and strides.ASCIIEllipsisSequenceSparseFactorSparseFactor.__reduce_cython__SparseFactor.__setstate_cython__SparseMatrixSparseMatrix.__init__SparseMatrix.fwriteSparseMatrix.getCSRrepresentationSparseMatrix.getSubMatCSRrepresentationSparseMatrix.matvecView.MemoryView__Pyx_PyDict_NextRef__annotate____class____class_getitem____dict____doc____enter____exit____func____getstate____import____init____main____metaclass____module____mro_entries____name____new____prepare____pyx_checksum__pyx_state__pyx_type__pyx_unpickle_Enum__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex____set_name____setstate____setstate_cython____test___cSparseMatrix_is_coroutine_rowsabcallocate_bufferasyncio.coroutinesbaseccSparseMatrixcSparseMatrix.__reduce_cython__cSparseMatrix.__setstate_cython__cline_in_tracebackcolindcountdimdtype_is_objectencodeenumerateerrorfilenameflagsformatfortranfwritegetCSRrepresentationgetSubMatCSRrepresentationiidindexitemsitemsizekmatvecmemviewmodenamencndimnnznpnrnumpynzvalnzvalsobjobjectopenoutput_filepackpoprange_endrange_startregisterrowptrselfsetdefaultshapesizesparseFactorsp""arseFactorPreparesparseFactorSolvesparse_matrixstartstepstopstructsuperluWrappersunpackupdatevalueswwritexyO\200\001\330\004\n\210+\220Q\200\001\360\024\000\005%\240A\240Q\330%&\200\001\360\024\000\005\047\240a\240}\260A\330\047(\200A\360\016\000\t\r\210F\220%\220t\2306\240\021\330\010\014\210G\2201\330\010\014\210I\220Q\220d\230%\230t\2401\330\010\014\210J\220a\330\010\014\210J\220a\330\010\014\210J\220a\330\010\014\320\014\036\230m\2501\250A\330,-\330,-\330,0\260\001\330,0\260\001\330,0\260\001\200A\360\020\000\t\021\220\004\220I\230T\240\031\250$\250a\200A\360\022\000\t\034\2301\230D\320 1\260\023\260A\200A\360\024\000\016\022\220\021\220*\230H\240A\330\014\027\220v\230Q\230n\250C\250t\2605\270\004\270E\300\024\300W\310A\310T\320QR\330\014\020\220\005\220U\230!\2304\230q\330\020\024\220E\230\025\230a\230t\2407\250!\2504\250t\2607\270!\2701\270A\270Q\330\024\037\230v\240Q\320&7\260s\270!\2701\270F\300$\300g\310Q\310b\320PQ\320QW\320W[\320[b\320bc\320cd\200A\360\036\000\t\020\210|\2303\230d\240\047\250\032\2603\260d\270!\330\010\017\210z\230\022\2301\330\010\020\220\n\230\"\230A\330\010\017\210v\220S\230\004\230A\340\010\016\210d\220\047\230\021\230+\240R\240t\2507\260!\2601\340\010\021\220\024\220W\230A\230^\250<\260r\270\026\270r\300\021\330\010\021\220\024\220W\230A\230T\240\027\250\001\250\037\270\004\270G\3001\300M\320QS\320ST\330\010\021\220\024\220W\230A\230T\240\027\250\001\250\037\270\004\270G\3001\300M\320QS\320ST\340\010\017\210x\220x\230q";
28211 PyObject *data = NULL;
28212 #define __Pyx_DecompressString_UNUSED
28213 #define __Pyx_DecompressString_LZSS_UNUSED
28214 #endif
28215 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
28216 Py_ssize_t pos = 0;
28217 for (int i = 0; i < 151; i++) {
28218 Py_ssize_t bytes_length = str_length_index[i].length;
28219 PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
28220 if (likely(string) && i >= 32) PyUnicode_InternInPlace(&string);
28221 if (unlikely(!string)) {
28222 Py_XDECREF(data);
28223 __PYX_ERR(0, 1, __pyx_L1_error)
28224 }
28225 stringtab[i] = string;
28226 pos += bytes_length;
28227 }
28228 for (int i = 151; i < 160; i++) {
28229 Py_ssize_t bytes_length = bytes_length_index[i-151].length;
28230 PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
28231 stringtab[i] = string;
28232 pos += bytes_length;
28233 if (unlikely(!string)) {
28234 Py_XDECREF(data);
28235 __PYX_ERR(0, 1, __pyx_L1_error)
28236 }
28237 }
28238 Py_XDECREF(data);
28239 for (Py_ssize_t i = 0; i < 160; i++) {
28240 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
28241 __PYX_ERR(0, 1, __pyx_L1_error)
28242 }
28243 }
28244 #if CYTHON_IMMORTAL_CONSTANTS
28245 {
28246 PyObject **table = stringtab + 151;
28247 for (Py_ssize_t i=0; i<9; ++i) {
28248 #if PY_VERSION_HEX >= 0x030F0000
28249 PyUnstable_SetImmortal(table[i]);
28250 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28251 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
28252 #if PY_VERSION_HEX < 0x030E0000
28253 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
28254 #else
28255 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
28256 #endif
28257 {
28258 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
28259 }
28260 #else
28261 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
28262 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
28263 #endif
28264 }
28265 }
28266 #endif
28267 }
28268 {
28269 PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
28270 int8_t const cint_constants_1[] = {0,-1,1};
28271 int32_t const cint_constants_4[] = {136983863L};
28272 for (int i = 0; i < 4; i++) {
28273 numbertab[i] = PyLong_FromLong((i < 3 ? cint_constants_1[i - 0] : cint_constants_4[i - 3]));
28274 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
28275 }
28276 }
28277 #if CYTHON_IMMORTAL_CONSTANTS
28278 {
28279 PyObject **table = __pyx_mstate->__pyx_number_tab;
28280 for (Py_ssize_t i=0; i<4; ++i) {
28281 #if PY_VERSION_HEX >= 0x030F0000
28282 PyUnstable_SetImmortal(table[i]);
28283 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28284 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
28285 #if PY_VERSION_HEX < 0x030E0000
28286 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
28287 #else
28288 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
28289 #endif
28290 {
28291 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
28292 }
28293 #else
28294 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
28295 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
28296 #endif
28297 }
28298 }
28299 #endif
28300 return 0;
28301 __pyx_L1_error:;
28302 return -1;
28303}
28304/* #### Code section: init_codeobjects ### */
28305#ifdef __cplusplus
28306namespace {
28307#endif
28308typedef struct {
28309 unsigned int argcount : 3;
28310 unsigned int num_posonly_args : 1;
28311 unsigned int num_kwonly_args : 1;
28312 unsigned int nlocals : 4;
28313 unsigned int flags : 10;
28314 unsigned int first_line : 9;
28315} __Pyx_PyCode_New_function_description;
28316#ifdef __cplusplus
28317} /* anonymous namespace */
28318#endif
28319/* NewCodeObj.proto */
28320static PyObject* __Pyx_PyCode_New(
28321 const __Pyx_PyCode_New_function_description descr,
28322 PyObject * const *varnames,
28323 PyObject *filename,
28324 PyObject *funcname,
28325 PyObject *line_table,
28326 PyObject *tuple_dedup_map
28327);
28328
28329
28330static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
28331 PyObject* tuple_dedup_map = PyDict_New();
28332 if (unlikely(!tuple_dedup_map)) return -1;
28333 {
28334 const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 15};
28335 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nr, __pyx_mstate->__pyx_n_u_nc, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_nzvals, __pyx_mstate->__pyx_n_u_colind, __pyx_mstate->__pyx_n_u_rowptr};
28336 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_F_t6_G1_IQd_t1_Ja_Ja_Ja_m1A_0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
28337 }
28338 {
28339 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35};
28340 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
28341 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_matvec, __pyx_mstate->__pyx_kp_b_iso88591_A_1D_1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
28342 }
28343 {
28344 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 46};
28345 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_base, __pyx_mstate->__pyx_n_u_output_file, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_k};
28346 __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_fwrite, __pyx_mstate->__pyx_kp_b_iso88591_A_HA_vQnCt5_E_WATQR_U_4q_E_at7_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
28347 }
28348 {
28349 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 62};
28350 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
28351 __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_getCSRrepresentation, __pyx_mstate->__pyx_kp_b_iso88591_A_IT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
28352 }
28353 {
28354 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 72};
28355 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_range_start, __pyx_mstate->__pyx_n_u_range_end, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_rowptr, __pyx_mstate->__pyx_n_u_colind, __pyx_mstate->__pyx_n_u_nzvals};
28356 __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_getSubMatCSRrepresentation, __pyx_mstate->__pyx_kp_b_iso88591_A_3d_3d_z_1_A_vS_A_d_Rt7_1_WA_r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
28357 }
28358 {
28359 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
28360 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
28361 __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
28362 }
28363 {
28364 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
28365 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
28366 __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
28367 }
28368 {
28369 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
28370 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
28371 __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
28372 }
28373 {
28374 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
28375 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
28376 __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
28377 }
28378 {
28379 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 222};
28380 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_sparse_matrix, __pyx_mstate->__pyx_n_u_sparseFactor};
28381 __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_sparseFactorPrepare, __pyx_mstate->__pyx_kp_b_iso88591_a_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
28382 }
28383 {
28384 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 289};
28385 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_sparseFactor, __pyx_mstate->__pyx_n_u_x};
28386 __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_sparseFactorSolve, __pyx_mstate->__pyx_kp_b_iso88591_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
28387 }
28388 Py_DECREF(tuple_dedup_map);
28389 return 0;
28390 bad:
28391 Py_DECREF(tuple_dedup_map);
28392 return -1;
28393}
28394/* #### Code section: init_globals ### */
28395
28396static int __Pyx_InitGlobals(void) {
28397 int __pyx_lineno = 0;
28398 const char *__pyx_filename = NULL;
28399 int __pyx_clineno = 0;
28400 /* PythonCompatibility.init */
28401 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0)); else
28402
28403 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28404
28405 /* PyFrozenDict.init */
28406 #if CYTHON_COMPILING_IN_LIMITED_API
28407 {
28408 PyObject *builtins = PyEval_GetBuiltins(); // borrowed
28409 if (likely(builtins)) {
28410 PyObject *type_name = PyUnicode_FromStringAndSize("frozendict", sizeof("frozendict")-1);
28411 if (likely(type_name)) {
28412 PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
28413 Py_DECREF(type_name);
28414 if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
28415 PyErr_Clear();
28416 frozendict_type = (PyObject*) &PyDict_Type;
28417 Py_INCREF(frozendict_type);
28418 }
28419 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
28420 }
28421 }
28422 } // error handling follows
28423 #endif
28424
28425 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28426
28427 /* AssertionsEnabled.init */
28428 if (likely(__Pyx_init_assertions_enabled() == 0)); else
28429
28430 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28431
28432 /* NumpyImportArray.init */
28433 /*
28434 * Cython has automatically inserted a call to _import_array since
28435 * you didn't include one when you cimported numpy. To disable this
28436 * add the line
28437 * <void>numpy._import_array
28438 */
28439 #ifdef NPY_FEATURE_VERSION
28440 #ifndef NO_IMPORT_ARRAY
28441 if (unlikely(_import_array() == -1)) {
28442 PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import "
28443 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
28444 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
28445 }
28446 #endif
28447 #endif
28448
28449 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28450
28451 /* CommonTypesMetaclass.init */
28452 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
28453
28454 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28455
28456 /* CachedMethodType.init */
28457 #if CYTHON_COMPILING_IN_LIMITED_API
28458 {
28459 PyObject *typesModule=NULL;
28460 typesModule = PyImport_ImportModule("types");
28461 if (typesModule) {
28462 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
28463 Py_DECREF(typesModule);
28464 }
28465 } // error handling follows
28466 #endif
28467
28468 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28469
28470 return 0;
28471 __pyx_L1_error:;
28472 return -1;
28473}
28474/* #### Code section: init_after_shared_utility ### */
28475
28476static int __Pyx_InitAfterSharedUtility(void) {
28477 int __pyx_lineno = 0;
28478 const char *__pyx_filename = NULL;
28479 int __pyx_clineno = 0;
28480 /* CythonFunctionPerModule.init */
28481 if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
28482
28483 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28484
28485 return 0;
28486 __pyx_L1_error:;
28487 return -1;
28488}
28489/* #### Code section: cleanup_globals ### */
28490/* #### Code section: cleanup_module ### */
28491/* #### Code section: main_method ### */
28492/* #### Code section: utility_code_pragmas ### */
28493#ifdef _MSC_VER
28494#pragma warning( push )
28495/* Warning 4127: conditional expression is constant
28496 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
28497 * compile-time, so this warning is not useful
28498 */
28499#pragma warning( disable : 4127 )
28500#endif
28501
28502
28503
28504/* #### Code section: utility_code_def ### */
28505
28506/* --- Runtime support code --- */
28507/* Refnanny */
28508#if CYTHON_REFNANNY
28509static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
28510 PyObject *m = NULL, *p = NULL;
28511 void *r = NULL;
28512 m = PyImport_ImportModule(modname);
28513 if (!m) goto end;
28514 p = PyObject_GetAttrString(m, "RefNannyAPI");
28515 if (!p) goto end;
28516 r = PyLong_AsVoidPtr(p);
28517end:
28518 Py_XDECREF(p);
28519 Py_XDECREF(m);
28520 return (__Pyx_RefNannyAPIStruct *)r;
28521}
28522#endif
28523
28524/* FastTypeChecks (used by GivenExceptionMatches) */
28525#if CYTHON_COMPILING_IN_CPYTHON
28526static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
28527 while (a) {
28528 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
28529 if (a == b)
28530 return 1;
28531 }
28532 return b == &PyBaseObject_Type;
28533}
28534static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
28535 PyObject *mro;
28536 if (a == b) return 1;
28537 mro = a->tp_mro;
28538 if (likely(mro)) {
28539 Py_ssize_t i, n;
28540 n = PyTuple_GET_SIZE(mro);
28541 for (i = 0; i < n; i++) {
28542 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
28543 return 1;
28544 }
28545 return 0;
28546 }
28547 return __Pyx_InBases(a, b);
28548}
28549static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
28550 PyObject *mro;
28551 if (cls == a || cls == b) return 1;
28552 mro = cls->tp_mro;
28553 if (likely(mro)) {
28554 Py_ssize_t i, n;
28555 n = PyTuple_GET_SIZE(mro);
28556 for (i = 0; i < n; i++) {
28557 PyObject *base = PyTuple_GET_ITEM(mro, i);
28558 if (base == (PyObject *)a || base == (PyObject *)b)
28559 return 1;
28560 }
28561 return 0;
28562 }
28563 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
28564}
28565#endif
28566
28567/* PyErrFetchRestore (used by GivenExceptionMatches) */
28568#if CYTHON_FAST_THREAD_STATE
28569static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
28570#if PY_VERSION_HEX >= 0x030C00A6
28571 PyObject *tmp_value;
28572 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
28573 if (value) {
28574 #if CYTHON_COMPILING_IN_CPYTHON
28575 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
28576 #endif
28577 PyException_SetTraceback(value, tb);
28578 }
28579 tmp_value = tstate->current_exception;
28580 tstate->current_exception = value;
28581 Py_XDECREF(tmp_value);
28582 Py_XDECREF(type);
28583 Py_XDECREF(tb);
28584#else
28585 PyObject *tmp_type, *tmp_value, *tmp_tb;
28586 tmp_type = tstate->curexc_type;
28587 tmp_value = tstate->curexc_value;
28588 tmp_tb = tstate->curexc_traceback;
28589 tstate->curexc_type = type;
28590 tstate->curexc_value = value;
28591 tstate->curexc_traceback = tb;
28592 Py_XDECREF(tmp_type);
28593 Py_XDECREF(tmp_value);
28594 Py_XDECREF(tmp_tb);
28595#endif
28596}
28597static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28598#if PY_VERSION_HEX >= 0x030C00A6
28599 PyObject* exc_value;
28600 exc_value = tstate->current_exception;
28601 tstate->current_exception = 0;
28602 *value = exc_value;
28603 *type = NULL;
28604 *tb = NULL;
28605 if (exc_value) {
28606 *type = (PyObject*) Py_TYPE(exc_value);
28607 Py_INCREF(*type);
28608 #if CYTHON_COMPILING_IN_CPYTHON
28609 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
28610 Py_XINCREF(*tb);
28611 #else
28612 *tb = PyException_GetTraceback(exc_value);
28613 #endif
28614 }
28615#else
28616 *type = tstate->curexc_type;
28617 *value = tstate->curexc_value;
28618 *tb = tstate->curexc_traceback;
28619 tstate->curexc_type = 0;
28620 tstate->curexc_value = 0;
28621 tstate->curexc_traceback = 0;
28622#endif
28623}
28624#endif
28625
28626/* GivenExceptionMatches (used by PyErrExceptionMatches) */
28627#if CYTHON_COMPILING_IN_CPYTHON
28628static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
28629 if (exc_type1) {
28630 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
28631 } else {
28632 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
28633 }
28634}
28635static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28636 Py_ssize_t i, n;
28637 assert(PyExceptionClass_Check(exc_type));
28638 n = PyTuple_GET_SIZE(tuple);
28639 for (i=0; i<n; i++) {
28640 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
28641 }
28642 for (i=0; i<n; i++) {
28643 PyObject *t = PyTuple_GET_ITEM(tuple, i);
28644 if (likely(PyExceptionClass_Check(t))) {
28645 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
28646 } else {
28647 }
28648 }
28649 return 0;
28650}
28651static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
28652 if (likely(err == exc_type)) return 1;
28653 if (likely(PyExceptionClass_Check(err))) {
28654 if (likely(PyExceptionClass_Check(exc_type))) {
28655 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
28656 } else if (likely(PyTuple_Check(exc_type))) {
28657 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
28658 } else {
28659 }
28660 }
28661 return PyErr_GivenExceptionMatches(err, exc_type);
28662}
28663static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
28664 assert(PyExceptionClass_Check(exc_type1));
28665 assert(PyExceptionClass_Check(exc_type2));
28666 if (likely(err == exc_type1 || err == exc_type2)) return 1;
28667 if (likely(PyExceptionClass_Check(err))) {
28668 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
28669 }
28670 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
28671}
28672#endif
28673
28674/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
28675#if CYTHON_FAST_THREAD_STATE
28676static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28677 Py_ssize_t i, n;
28678 n = PyTuple_GET_SIZE(tuple);
28679 for (i=0; i<n; i++) {
28680 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
28681 }
28682 for (i=0; i<n; i++) {
28683 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
28684 }
28685 return 0;
28686}
28687static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
28688 int result;
28689 PyObject *exc_type;
28690#if PY_VERSION_HEX >= 0x030C00A6
28691 PyObject *current_exception = tstate->current_exception;
28692 if (unlikely(!current_exception)) return 0;
28693 exc_type = (PyObject*) Py_TYPE(current_exception);
28694 if (exc_type == err) return 1;
28695#else
28696 exc_type = tstate->curexc_type;
28697 if (exc_type == err) return 1;
28698 if (unlikely(!exc_type)) return 0;
28699#endif
28700 #if CYTHON_AVOID_BORROWED_REFS
28701 Py_INCREF(exc_type);
28702 #endif
28703 if (unlikely(PyTuple_Check(err))) {
28704 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
28705 } else {
28706 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
28707 }
28708 #if CYTHON_AVOID_BORROWED_REFS
28709 Py_DECREF(exc_type);
28710 #endif
28711 return result;
28712}
28713#endif
28714
28715/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
28716#if CYTHON_USE_TYPE_SLOTS
28717static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28718 PyTypeObject* tp = Py_TYPE(obj);
28719 if (likely(tp->tp_getattro))
28720 return tp->tp_getattro(obj, attr_name);
28721 return PyObject_GetAttr(obj, attr_name);
28722}
28723#endif
28724
28725/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
28726#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
28727static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
28728 __Pyx_PyThreadState_declare
28729 __Pyx_PyThreadState_assign
28730 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28731 __Pyx_PyErr_Clear();
28732}
28733#endif
28734static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
28735 PyObject *result;
28736#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
28737 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
28738 return result;
28739#else
28740#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
28741 PyTypeObject* tp = Py_TYPE(obj);
28742 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
28743 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
28744 }
28745#endif
28746 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
28747 if (unlikely(!result)) {
28748 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
28749 }
28750 return result;
28751#endif
28752}
28753
28754/* GetBuiltinName */
28755static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
28756 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
28757 if (unlikely(!result) && !PyErr_Occurred()) {
28758 PyErr_Format(PyExc_NameError,
28759 "name '%U' is not defined", name);
28760 }
28761 return result;
28762}
28763
28764/* CopyObjectArray (used by TupleOrListFromArrayImpl) */
28765#if CYTHON_COMPILING_IN_CPYTHON
28766static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
28767 PyObject *v;
28768 Py_ssize_t i;
28769 for (i = 0; i < length; i++) {
28770 v = dest[i] = src[i];
28771 Py_INCREF(v);
28772 }
28773}
28774#endif
28775
28776/* TupleOrListFromArrayImpl (used by TupleFromArray) */
28777#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
28778CYTHON_UNUSED static PyObject *
28779__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) {
28780 if (n <= 0) {
28781 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
28782 }
28783 PyObject *res = PyTuple_New(n);
28784 if (unlikely(res == NULL)) return NULL;
28785 #if CYTHON_COMPILING_IN_CPYTHON
28786 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
28787 #else
28788 Py_ssize_t i;
28789 for (i = 0; i < n; i++) {
28790 Py_INCREF(src[i]);
28791 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
28792 Py_DECREF(res);
28793 return NULL;
28794 }
28795 }
28796 #endif
28797 return res;
28798}
28799#endif
28800
28801/* PyObjectCompare (used by UnicodeEquals) */
28802#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
28803#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
28804static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
28805 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
28806 int result = PyUnicode_Equal(s1, s2);
28807 #if !CYTHON_COMPILING_IN_CPYTHON
28808 if (unlikely(result == -1)) return -1;
28809 #endif
28810 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
28811 #else
28812 int result = PyUnicode_Compare(s1, s2);
28813 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
28814 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
28815 #endif
28816__pyx_return_true:
28817 return 1;
28818__pyx_return_false:
28819 return 0;
28820}
28821#endif
28822static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop) {
28823 CYTHON_UNUSED_VAR(pyop);
28824 if (unlikely(op1 == Py_None)) {
28825 if (op2 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
28826 }
28827 if (unlikely(op2 == Py_None)) {
28828 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
28829 }
28830
28831 if (likely(op1 != Py_None)) {
28832 if (op1 == op2) goto __pyx_return_true;
28833 if (likely(op2 != Py_None)) {
28834 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
28835 }
28836 goto __pyx_richcmp;
28837 }
28838
28839 if ((0)) goto __pyx_richcmp;
28840 if ((0)) goto __pyx_return_true;
28841 if ((0)) goto __pyx_return_false;
28842__pyx_richcmp:
28843 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
28844__pyx_return_true:
28845 return 1;
28846__pyx_return_false:
28847 return 0;
28848}
28849
28850/* fastcall */
28851#if CYTHON_VECTORCALL
28852static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
28853{
28854 Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
28855 #if !CYTHON_ASSUME_SAFE_SIZE
28856 if (unlikely(n == -1)) return NULL;
28857 #endif
28858 for (i = 0; i < n; i++)
28859 {
28860 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
28861 #if !CYTHON_ASSUME_SAFE_MACROS
28862 if (unlikely(!namei)) return NULL;
28863 #endif
28864 if (s == namei) return kwvalues[i];
28865 }
28866 for (i = 0; i < n; i++)
28867 {
28868 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
28869 #if !CYTHON_ASSUME_SAFE_MACROS
28870 if (unlikely(!namei)) return NULL;
28871 #endif
28872 int eq = __Pyx_PyUnicode_Equals(s, namei);
28873 if (unlikely(eq != 0)) {
28874 if (unlikely(eq < 0)) return NULL;
28875 return kwvalues[i];
28876 }
28877 }
28878 return NULL;
28879}
28880#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
28881CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
28882 Py_ssize_t i, nkwargs;
28883 PyObject *dict;
28884#if !CYTHON_ASSUME_SAFE_SIZE
28885 nkwargs = PyTuple_Size(kwnames);
28886 if (unlikely(nkwargs < 0)) return NULL;
28887#else
28888 nkwargs = PyTuple_GET_SIZE(kwnames);
28889#endif
28890 dict = PyDict_New();
28891 if (unlikely(!dict))
28892 return NULL;
28893 for (i=0; i<nkwargs; i++) {
28894#if !CYTHON_ASSUME_SAFE_MACROS
28895 PyObject *key = PyTuple_GetItem(kwnames, i);
28896 if (!key) goto bad;
28897#else
28898 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
28899#endif
28900 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
28901 goto bad;
28902 }
28903 return dict;
28904bad:
28905 Py_DECREF(dict);
28906 return NULL;
28907}
28908#endif
28909#endif
28910
28911/* PyObjectCall (used by PyObjectFastCall) */
28912#if CYTHON_COMPILING_IN_CPYTHON
28913static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
28914 PyObject *result;
28915 ternaryfunc call = Py_TYPE(func)->tp_call;
28916 if (unlikely(!call))
28917 return PyObject_Call(func, arg, kw);
28918 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
28919 return NULL;
28920 result = (*call)(func, arg, kw);
28921 Py_LeaveRecursiveCall();
28922 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28923 PyErr_SetString(
28924 PyExc_SystemError,
28925 "NULL result without error in PyObject_Call");
28926 }
28927 return result;
28928}
28929#endif
28930
28931/* PyObjectCallMethO (used by PyObjectFastCall) */
28932#if CYTHON_COMPILING_IN_CPYTHON
28933static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
28934 PyObject *self, *result;
28935 PyCFunction cfunc;
28936 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
28937 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
28938 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
28939 return NULL;
28940 result = cfunc(self, arg);
28941 Py_LeaveRecursiveCall();
28942 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28943 PyErr_SetString(
28944 PyExc_SystemError,
28945 "NULL result without error in PyObject_Call");
28946 }
28947 return result;
28948}
28949#endif
28950
28951/* PyObjectFastCall (used by PyObjectCallOneArg) */
28952#if CYTHON_COMPILING_IN_LIMITED_API
28953static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
28954 PyObject *argstuple;
28955 PyObject *result = 0;
28956 size_t i;
28957 argstuple = PyTuple_New((Py_ssize_t)nargs);
28958 if (unlikely(!argstuple)) return NULL;
28959 for (i = 0; i < nargs; i++) {
28960 Py_INCREF(args[i]);
28961 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
28962 }
28963 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
28964 bad:
28965 Py_DECREF(argstuple);
28966 return result;
28967}
28968#endif
28969#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
28970 #if CYTHON_COMPILING_IN_CPYTHON
28971static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
28972 PyTypeObject *tp = Py_TYPE(callable);
28973 #if defined(__Pyx_CyFunction_USED)
28974 if (__Pyx_CyFunction_CheckExact(callable)) {
28975 return __Pyx_CyFunction_func_vectorcall(callable);
28976 }
28977 #endif
28978 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
28979 return NULL;
28980 }
28981 assert(PyCallable_Check(callable));
28982 Py_ssize_t offset = tp->tp_vectorcall_offset;
28983 assert(offset > 0);
28984 vectorcallfunc ptr;
28985 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
28986 return ptr;
28987}
28988 #else
28989 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
28990 #endif
28991#endif
28992static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwargs) {
28993 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
28994#if CYTHON_COMPILING_IN_CPYTHON
28995 if (nargs == 0 && kwargs == NULL) {
28996 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
28997 return __Pyx_PyObject_CallMethO(func, NULL);
28998 }
28999 else if (nargs == 1 && kwargs == NULL) {
29000 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
29001 return __Pyx_PyObject_CallMethO(func, args[0]);
29002 }
29003#endif
29004 if (kwargs == NULL) {
29005 #if CYTHON_VECTORCALL
29006 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
29007 return PyObject_Vectorcall(func, args, nargsf, NULL);
29008 #else
29009 vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
29010 if (f) {
29011 return f(func, args, nargsf, NULL);
29012 }
29013 #endif
29014 #endif
29015 }
29016 if (nargs == 0) {
29017 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
29018 }
29019 #if CYTHON_COMPILING_IN_LIMITED_API
29020 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
29021 #elif CYTHON_COMPILING_IN_PYPY
29022 return PyObject_VectorcallDict(func, args, (size_t) nargs, kwargs);
29023 #else
29024 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
29025 #endif
29026}
29027
29028/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
29029static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29030 PyObject *args[2] = {NULL, arg};
29031 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
29032}
29033
29034/* IgnoreException (used by UnpackUnboundCMethod_impl) */
29035static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
29036 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
29037 PyErr_Clear();
29038 return 1;
29039 }
29040 return 0;
29041}
29042
29043/* UnpackUnboundCMethod_impl (used by UnpackUnboundCMethod) */
29044#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
29045static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
29046 PyObject *result;
29047 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
29048 if (unlikely(!selfless_args)) return NULL;
29049 result = PyObject_Call(method, selfless_args, kwargs);
29050 Py_DECREF(selfless_args);
29051 return result;
29052}
29053#else
29054static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
29055 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
29056}
29057#endif
29058static PyMethodDef __Pyx_UnboundCMethod_Def = {
29059 "CythonUnboundCMethod",
29060 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
29061#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
29062 METH_VARARGS | METH_KEYWORDS,
29063#else
29064 METH_FASTCALL | METH_KEYWORDS,
29065#endif
29066 NULL
29067};
29068static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
29069 PyObject *method, *result=NULL;
29070 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
29071 if (unlikely(!method))
29072 return -1;
29073 result = method;
29074#if CYTHON_COMPILING_IN_CPYTHON
29075 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
29076 {
29077 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
29078 target->func = descr->d_method->ml_meth;
29079 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
29080 } else
29081#endif
29082#if CYTHON_COMPILING_IN_PYPY
29083#else
29084 if (PyCFunction_Check(method))
29085#endif
29086 {
29087 PyObject *self;
29088 int self_found;
29089#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
29090 self = PyObject_GetAttrString(method, "__self__");
29091 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
29092 return -1;
29093 }
29094#else
29095 self = PyCFunction_GET_SELF(method);
29096#endif
29097 self_found = (self && self != Py_None);
29098#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
29099 Py_XDECREF(self);
29100#endif
29101 if (self_found) {
29102 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
29103 if (unlikely(!unbound_method)) return -1;
29104 Py_DECREF(method);
29105 result = unbound_method;
29106 }
29107 }
29108#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29109 if (unlikely(target->method)) {
29110 Py_DECREF(result);
29111 } else
29112#endif
29113 target->method = result;
29114 return 0;
29115}
29116
29117/* CallUnboundCMethod0 */
29118#if CYTHON_COMPILING_IN_CPYTHON
29119static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
29120 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
29121 if (likely(was_initialized == 2 && cfunc->func)) {
29122 if (likely(cfunc->flag == METH_NOARGS))
29123 return __Pyx_CallCFunction(cfunc, self, NULL);
29124 if (likely(cfunc->flag == METH_FASTCALL))
29125 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
29126 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
29127 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
29128 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
29129 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
29130 if (cfunc->flag == METH_VARARGS)
29131 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
29132 return __Pyx__CallUnboundCMethod0(cfunc, self);
29133 }
29134#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29135 else if (unlikely(was_initialized == 1)) {
29136 __Pyx_CachedCFunction tmp_cfunc = {
29137#ifndef __cplusplus
29138 0
29139#endif
29140 };
29141 tmp_cfunc.type = cfunc->type;
29142 tmp_cfunc.method_name = cfunc->method_name;
29143 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
29144 }
29145#endif
29146 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
29147 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
29148 return result;
29149}
29150#endif
29151static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
29152 PyObject *result;
29153 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
29154 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
29155 return result;
29156}
29157
29158/* py_dict_items (used by OwnedDictNext) */
29159static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
29160 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
29161}
29162
29163/* py_dict_values (used by OwnedDictNext) */
29164static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
29165 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
29166}
29167
29168/* OwnedDictNext (used by ParseKeywordsImpl) */
29169#if CYTHON_AVOID_BORROWED_REFS
29170static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
29171 PyObject *next = NULL;
29172 if (!*ppos) {
29173 if (pvalue) {
29174 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
29175 if (unlikely(!dictview)) goto bad;
29176 *ppos = PyObject_GetIter(dictview);
29177 Py_DECREF(dictview);
29178 } else {
29179 *ppos = PyObject_GetIter(p);
29180 }
29181 if (unlikely(!*ppos)) goto bad;
29182 }
29183 next = PyIter_Next(*ppos);
29184 if (!next) {
29185 if (PyErr_Occurred()) goto bad;
29186 return 0;
29187 }
29188 if (pkey && pvalue) {
29189 *pkey = __Pyx_PySequence_ITEM(next, 0);
29190 if (unlikely(*pkey)) goto bad;
29191 *pvalue = __Pyx_PySequence_ITEM(next, 1);
29192 if (unlikely(*pvalue)) goto bad;
29193 Py_DECREF(next);
29194 } else if (pkey) {
29195 *pkey = next;
29196 } else {
29197 assert(pvalue);
29198 *pvalue = next;
29199 }
29200 return 1;
29201 bad:
29202 Py_XDECREF(next);
29203#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
29204 PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
29205#else
29206 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
29207#endif
29208 if (pkey) *pkey = NULL;
29209 if (pvalue) *pvalue = NULL;
29210 return 0;
29211}
29212#else // !CYTHON_AVOID_BORROWED_REFS
29213static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
29214 int result = PyDict_Next(p, ppos, pkey, pvalue);
29215 if (likely(result == 1)) {
29216 if (pkey) Py_INCREF(*pkey);
29217 if (pvalue) Py_INCREF(*pvalue);
29218 }
29219 return result;
29220}
29221#endif
29222
29223/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
29224static void __Pyx_RaiseDoubleKeywordsError(
29225 const char* func_name,
29226 PyObject* kw_name)
29227{
29228 PyErr_Format(PyExc_TypeError,
29229 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
29230}
29231
29232/* CallUnboundCMethod2 */
29233#if CYTHON_COMPILING_IN_CPYTHON
29234static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
29235 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
29236 if (likely(was_initialized == 2 && cfunc->func)) {
29237 PyObject *args[2] = {arg1, arg2};
29238 if (cfunc->flag == METH_FASTCALL) {
29239 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
29240 }
29241 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
29242 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
29243 }
29244#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29245 else if (unlikely(was_initialized == 1)) {
29246 __Pyx_CachedCFunction tmp_cfunc = {
29247#ifndef __cplusplus
29248 0
29249#endif
29250 };
29251 tmp_cfunc.type = cfunc->type;
29252 tmp_cfunc.method_name = cfunc->method_name;
29253 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
29254 }
29255#endif
29256 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
29257 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
29258 return result;
29259}
29260#endif
29261static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
29262 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
29263#if CYTHON_COMPILING_IN_CPYTHON
29264 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
29265 PyObject *result = NULL;
29266 PyObject *args = PyTuple_New(2);
29267 if (unlikely(!args)) return NULL;
29268 Py_INCREF(arg1);
29269 PyTuple_SET_ITEM(args, 0, arg1);
29270 Py_INCREF(arg2);
29271 PyTuple_SET_ITEM(args, 1, arg2);
29272 if (cfunc->flag & METH_KEYWORDS)
29273 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
29274 else
29275 result = __Pyx_CallCFunction(cfunc, self, args);
29276 Py_DECREF(args);
29277 return result;
29278 }
29279#endif
29280 {
29281 PyObject *args[4] = {NULL, self, arg1, arg2};
29282 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
29283 }
29284}
29285
29286/* ParseKeywordsImpl (used by ParseKeywords) */
29287static int __Pyx_ValidateDuplicatePosArgs(
29288 PyObject *kwds,
29289 PyObject ** const argnames[],
29290 PyObject ** const *first_kw_arg,
29291 const char* function_name)
29292{
29293 PyObject ** const *name = argnames;
29294 while (name != first_kw_arg) {
29295 PyObject *key = **name;
29296 int found = PyDict_Contains(kwds, key);
29297 if (unlikely(found)) {
29298 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
29299 goto bad;
29300 }
29301 name++;
29302 }
29303 return 0;
29304bad:
29305 return -1;
29306}
29307#if CYTHON_USE_UNICODE_INTERNALS
29308static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
29309 int kind;
29310 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
29311 if (len != PyUnicode_GET_LENGTH(s2)) return 0;
29312 kind = PyUnicode_KIND(s1);
29313 if (kind != PyUnicode_KIND(s2)) return 0;
29314 const void *data1 = PyUnicode_DATA(s1);
29315 const void *data2 = PyUnicode_DATA(s2);
29316 return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
29317}
29318#endif
29319static int __Pyx_MatchKeywordArg_str(
29320 PyObject *key,
29321 PyObject ** const argnames[],
29322 PyObject ** const *first_kw_arg,
29323 size_t *index_found,
29324 const char *function_name)
29325{
29326 PyObject ** const *name;
29327 #if CYTHON_USE_UNICODE_INTERNALS
29328 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
29329 if (unlikely(key_hash == -1)) {
29330 key_hash = PyObject_Hash(key);
29331 if (unlikely(key_hash == -1))
29332 goto bad;
29333 }
29334 #endif
29335 name = first_kw_arg;
29336 while (*name) {
29337 PyObject *name_str = **name;
29338 #if CYTHON_USE_UNICODE_INTERNALS
29339 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
29340 *index_found = (size_t) (name - argnames);
29341 return 1;
29342 }
29343 #else
29344 #if CYTHON_ASSUME_SAFE_SIZE
29345 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
29346 #endif
29347 {
29348 int cmp = PyUnicode_Compare(name_str, key);
29349 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
29350 if (cmp == 0) {
29351 *index_found = (size_t) (name - argnames);
29352 return 1;
29353 }
29354 }
29355 #endif
29356 name++;
29357 }
29358 name = argnames;
29359 while (name != first_kw_arg) {
29360 PyObject *name_str = **name;
29361 #if CYTHON_USE_UNICODE_INTERNALS
29362 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
29363 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
29364 goto arg_passed_twice;
29365 }
29366 #else
29367 #if CYTHON_ASSUME_SAFE_SIZE
29368 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
29369 #endif
29370 {
29371 if (unlikely(name_str == key)) goto arg_passed_twice;
29372 int cmp = PyUnicode_Compare(name_str, key);
29373 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
29374 if (cmp == 0) goto arg_passed_twice;
29375 }
29376 #endif
29377 name++;
29378 }
29379 return 0;
29380arg_passed_twice:
29381 __Pyx_RaiseDoubleKeywordsError(function_name, key);
29382 goto bad;
29383bad:
29384 return -1;
29385}
29386static int __Pyx_MatchKeywordArg_nostr(
29387 PyObject *key,
29388 PyObject ** const argnames[],
29389 PyObject ** const *first_kw_arg,
29390 size_t *index_found,
29391 const char *function_name)
29392{
29393 PyObject ** const *name;
29394 if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
29395 name = first_kw_arg;
29396 while (*name) {
29397 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
29398 if (cmp == 1) {
29399 *index_found = (size_t) (name - argnames);
29400 return 1;
29401 }
29402 if (unlikely(cmp == -1)) goto bad;
29403 name++;
29404 }
29405 name = argnames;
29406 while (name != first_kw_arg) {
29407 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
29408 if (unlikely(cmp != 0)) {
29409 if (cmp == 1) goto arg_passed_twice;
29410 else goto bad;
29411 }
29412 name++;
29413 }
29414 return 0;
29415arg_passed_twice:
29416 __Pyx_RaiseDoubleKeywordsError(function_name, key);
29417 goto bad;
29418invalid_keyword_type:
29419 PyErr_Format(PyExc_TypeError,
29420 "%.200s() keywords must be strings", function_name);
29421 goto bad;
29422bad:
29423 return -1;
29424}
29425static CYTHON_INLINE int __Pyx_MatchKeywordArg(
29426 PyObject *key,
29427 PyObject ** const argnames[],
29428 PyObject ** const *first_kw_arg,
29429 size_t *index_found,
29430 const char *function_name)
29431{
29432 return likely(PyUnicode_CheckExact(key)) ?
29433 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
29434 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
29435}
29436static void __Pyx_RejectUnknownKeyword(
29437 PyObject *kwds,
29438 PyObject ** const argnames[],
29439 PyObject ** const *first_kw_arg,
29440 const char *function_name)
29441{
29442 #if CYTHON_AVOID_BORROWED_REFS
29443 PyObject *pos = NULL;
29444 #else
29445 Py_ssize_t pos = 0;
29446 #endif
29447 PyObject *key = NULL;
29448 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
29449 #if CYTHON_AVOID_BORROWED_REFS
29450 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
29451 #else
29452 (void) __Pyx_PyDict_NextRef;
29453 while (PyDict_Next(kwds, &pos, &key, NULL))
29454 #endif
29455 {
29456 PyObject** const *name = first_kw_arg;
29457 while (*name && (**name != key)) name++;
29458 if (!*name) {
29459 size_t index_found = 0;
29460 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
29461 if (cmp != 1) {
29462 if (cmp == 0) {
29463 PyErr_Format(PyExc_TypeError,
29464 "%s() got an unexpected keyword argument '%U'",
29465 function_name, key);
29466 }
29467 #if CYTHON_AVOID_BORROWED_REFS
29468 Py_DECREF(key);
29469 #endif
29470 break;
29471 }
29472 }
29473 #if CYTHON_AVOID_BORROWED_REFS
29474 Py_DECREF(key);
29475 #endif
29476 }
29477 __Pyx_END_CRITICAL_SECTION();
29478 #if CYTHON_AVOID_BORROWED_REFS
29479 Py_XDECREF(pos);
29480 #endif
29481 assert(PyErr_Occurred());
29482}
29483static int __Pyx_ParseKeywordDict(
29484 PyObject *kwds,
29485 PyObject ** const argnames[],
29486 PyObject *values[],
29487 Py_ssize_t num_pos_args,
29488 Py_ssize_t num_kwargs,
29489 const char* function_name,
29490 int ignore_unknown_kwargs)
29491{
29492 PyObject** const *name;
29493 PyObject** const *first_kw_arg = argnames + num_pos_args;
29494 Py_ssize_t extracted = 0;
29495#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
29496 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
29497#endif
29498 name = first_kw_arg;
29499 while (*name && num_kwargs > extracted) {
29500 PyObject * key = **name;
29501 PyObject *value;
29502 int found = 0;
29503 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
29504 found = PyDict_GetItemRef(kwds, key, &value);
29505 #else
29506 value = PyDict_GetItemWithError(kwds, key);
29507 if (value) {
29508 Py_INCREF(value);
29509 found = 1;
29510 } else {
29511 if (unlikely(PyErr_Occurred())) goto bad;
29512 }
29513 #endif
29514 if (found) {
29515 if (unlikely(found < 0)) goto bad;
29516 values[name-argnames] = value;
29517 extracted++;
29518 }
29519 name++;
29520 }
29521 if (num_kwargs > extracted) {
29522 if (ignore_unknown_kwargs) {
29523 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
29524 goto bad;
29525 } else {
29526 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
29527 goto bad;
29528 }
29529 }
29530 return 0;
29531bad:
29532 return -1;
29533}
29534static int __Pyx_ParseKeywordDictToDict(
29535 PyObject *kwds,
29536 PyObject ** const argnames[],
29537 PyObject *kwds2,
29538 PyObject *values[],
29539 Py_ssize_t num_pos_args,
29540 const char* function_name)
29541{
29542 PyObject** const *name;
29543 PyObject** const *first_kw_arg = argnames + num_pos_args;
29544 Py_ssize_t len;
29545#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
29546 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
29547#endif
29548 if (PyDict_Update(kwds2, kwds) < 0) goto bad;
29549 name = first_kw_arg;
29550 while (*name) {
29551 PyObject *key = **name;
29552 PyObject *value;
29553#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
29554 int found = PyDict_Pop(kwds2, key, &value);
29555 if (found) {
29556 if (unlikely(found < 0)) goto bad;
29557 values[name-argnames] = value;
29558 }
29559#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
29560 int found = PyDict_GetItemRef(kwds2, key, &value);
29561 if (found) {
29562 if (unlikely(found < 0)) goto bad;
29563 values[name-argnames] = value;
29564 if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
29565 }
29566#else
29567 #if CYTHON_COMPILING_IN_CPYTHON
29568 value = _PyDict_Pop(kwds2, key, kwds2);
29569 #else
29570 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
29571 #endif
29572 if (value == kwds2) {
29573 Py_DECREF(value);
29574 } else {
29575 if (unlikely(!value)) goto bad;
29576 values[name-argnames] = value;
29577 }
29578#endif
29579 name++;
29580 }
29581 len = PyDict_Size(kwds2);
29582 if (len > 0) {
29583 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
29584 } else if (unlikely(len == -1)) {
29585 goto bad;
29586 }
29587 return 0;
29588bad:
29589 return -1;
29590}
29591static int __Pyx_ParseKeywordsTuple(
29592 PyObject *kwds,
29593 PyObject * const *kwvalues,
29594 PyObject ** const argnames[],
29595 PyObject *kwds2,
29596 PyObject *values[],
29597 Py_ssize_t num_pos_args,
29598 Py_ssize_t num_kwargs,
29599 const char* function_name,
29600 int ignore_unknown_kwargs)
29601{
29602 PyObject *key = NULL;
29603 PyObject** const * name;
29604 PyObject** const *first_kw_arg = argnames + num_pos_args;
29605 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
29606#if CYTHON_AVOID_BORROWED_REFS
29607 key = __Pyx_PySequence_ITEM(kwds, pos);
29608#else
29609 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
29610#endif
29611#if !CYTHON_ASSUME_SAFE_MACROS
29612 if (unlikely(!key)) goto bad;
29613#endif
29614 name = first_kw_arg;
29615 while (*name && (**name != key)) name++;
29616 if (*name) {
29617 PyObject *value = kwvalues[pos];
29618 values[name-argnames] = __Pyx_NewRef(value);
29619 } else {
29620 size_t index_found = 0;
29621 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
29622 if (cmp == 1) {
29623 PyObject *value = kwvalues[pos];
29624 values[index_found] = __Pyx_NewRef(value);
29625 } else {
29626 if (unlikely(cmp == -1)) goto bad;
29627 if (kwds2) {
29628 PyObject *value = kwvalues[pos];
29629 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
29630 } else if (!ignore_unknown_kwargs) {
29631 goto invalid_keyword;
29632 }
29633 }
29634 }
29635 #if CYTHON_AVOID_BORROWED_REFS
29636 Py_DECREF(key);
29637 key = NULL;
29638 #endif
29639 }
29640 return 0;
29641invalid_keyword:
29642 PyErr_Format(PyExc_TypeError,
29643 "%s() got an unexpected keyword argument '%U'",
29644 function_name, key);
29645 goto bad;
29646bad:
29647 #if CYTHON_AVOID_BORROWED_REFS
29648 Py_XDECREF(key);
29649 #endif
29650 return -1;
29651}
29652
29653/* ParseKeywords */
29654static int __Pyx_ParseKeywords(
29655 PyObject *kwds,
29656 PyObject * const *kwvalues,
29657 PyObject ** const argnames[],
29658 PyObject *kwds2,
29659 PyObject *values[],
29660 Py_ssize_t num_pos_args,
29661 Py_ssize_t num_kwargs,
29662 const char* function_name,
29663 int ignore_unknown_kwargs)
29664{
29665 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
29666 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
29667 else if (kwds2)
29668 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
29669 else
29670 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
29671}
29672
29673/* RaiseArgTupleInvalid */
29674static void __Pyx_RaiseArgtupleInvalid(
29675 const char* func_name,
29676 int exact,
29677 Py_ssize_t num_min,
29678 Py_ssize_t num_max,
29679 Py_ssize_t num_found)
29680{
29681 Py_ssize_t num_expected;
29682 const char *more_or_less;
29683 if (num_found < num_min) {
29684 num_expected = num_min;
29685 more_or_less = "at least";
29686 } else {
29687 num_expected = num_max;
29688 more_or_less = "at most";
29689 }
29690 if (exact) {
29691 more_or_less = "exactly";
29692 }
29693 PyErr_Format(PyExc_TypeError,
29694 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
29695 func_name, more_or_less, num_expected,
29696 (num_expected == 1) ? "" : "s", num_found);
29697}
29698
29699/* ArgTypeTestError (used by ArgTypeTest) */
29700static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact)
29701{
29702 __Pyx_TypeName type_name;
29703 __Pyx_TypeName obj_type_name;
29704 PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
29705 int from_annotation_subclass = 0;
29706 if (unlikely(!type)) {
29707 PyErr_SetString(PyExc_SystemError, "Missing type object");
29708 return;
29709 } else if (exact == 2) {
29710 if (__Pyx_TypeCheck(obj, type)) {
29711 from_annotation_subclass = 1;
29712 extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
29713 }
29714 }
29715 type_name = __Pyx_PyType_GetFullyQualifiedName(type);
29716 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29717 if (unlikely(!type_name)) return;
29718 #endif
29719 obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
29720 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29721 if (unlikely(!obj_type_name)) goto obj_type_name_failed;
29722 #endif
29723 PyErr_Format(PyExc_TypeError,
29724 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")"
29725#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
29726 "%s%U"
29727#endif
29728 , name, type_name, obj_type_name
29729#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
29730 , (from_annotation_subclass ? ". " : ""), extra_info
29731#endif
29732 );
29733#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
29734 if (exact == 2 && from_annotation_subclass) {
29735 PyObject *res;
29736 PyObject *vargs[2];
29737 vargs[0] = PyErr_GetRaisedException();
29738 vargs[1] = extra_info;
29739 res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
29740 Py_XDECREF(res);
29741 PyErr_SetRaisedException(vargs[0]);
29742 }
29743#endif
29744 __Pyx_DECREF_TypeName(obj_type_name);
29745#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29746obj_type_name_failed:
29747#endif
29748 __Pyx_DECREF_TypeName(type_name);
29749 return;
29750}
29751
29752/* ArgTypeTest */
29753static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) {
29754 if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
29755 return 1;
29756 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
29757 return 1;
29758 __Pyx_ArgTypeError(obj, type, name, exact);
29759 return 0;
29760}
29761
29762/* PyObjectFastCallMethod */
29763#if !CYTHON_VECTORCALL
29764static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
29765 PyObject *result;
29766 switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
29767 case 1:
29768 return PyObject_CallMethodObjArgs(args[0], name, NULL);
29769 case 2:
29770 return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
29771 case 3:
29772 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
29773 case 4:
29774 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
29775 case 5:
29776 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
29777 }
29778 PyObject *attr = PyObject_GetAttr(args[0], name);
29779 if (unlikely(!attr))
29780 return NULL;
29781 result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
29782 Py_DECREF(attr);
29783 return result;
29784}
29785#endif
29786
29787/* FormatTypeName (used by RaiseErrorWithObjectType1) */
29788#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29789static __Pyx_TypeName
29790__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
29791{
29792 PyObject *module = NULL, *name = NULL, *result = NULL;
29793 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
29794 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
29795 __pyx_mstate_global->__pyx_n_u_qualname);
29796 #else
29797 name = PyType_GetQualName(tp);
29798 #endif
29799 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
29800 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
29801 __pyx_mstate_global->__pyx_n_u_module);
29802 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
29803 if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
29804 result = name;
29805 name = NULL;
29806 goto done;
29807 }
29808 result = PyUnicode_FromFormat("%U.%U", module, name);
29809 if (unlikely(result == NULL)) goto bad;
29810 done:
29811 Py_XDECREF(name);
29812 Py_XDECREF(module);
29813 return result;
29814 bad:
29815 PyErr_Clear();
29816 if (name) {
29817 result = name;
29818 name = NULL;
29819 } else {
29820 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
29821 }
29822 goto done;
29823}
29824#endif
29825
29826/* RaiseErrorWithObjectType1 (used by RaiseUnexpectedTypeError) */
29827static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj) {
29828 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
29829 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29830 if (unlikely(!type_name)) return;
29831 #endif
29832 PyErr_Format(exc_type, message, arg, type_name);
29833 __Pyx_DECREF_TypeName(type_name);
29834}
29835
29836/* RaiseUnexpectedTypeError */
29837static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) {
29838 __Pyx_RaiseTypeErrorWithObjectType1(
29839 "Expected %.42s, got " __Pyx_FMT_TYPENAME,
29840 expected, obj);
29841 return 0;
29842}
29843
29844/* RaiseException */
29845static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
29846 PyObject* owned_instance = NULL;
29847 if (tb == Py_None) {
29848 tb = 0;
29849 } else if (tb && !PyTraceBack_Check(tb)) {
29850 PyErr_SetString(PyExc_TypeError,
29851 "raise: arg 3 must be a traceback or None");
29852 goto bad;
29853 }
29854 if (value == Py_None)
29855 value = 0;
29856 if (PyExceptionInstance_Check(type)) {
29857 if (value) {
29858 PyErr_SetString(PyExc_TypeError,
29859 "instance exception may not have a separate value");
29860 goto bad;
29861 }
29862 value = type;
29863 type = (PyObject*) Py_TYPE(value);
29864 } else if (PyExceptionClass_Check(type)) {
29865 PyObject *instance_class = NULL;
29866 if (value && PyExceptionInstance_Check(value)) {
29867 instance_class = (PyObject*) Py_TYPE(value);
29868 if (instance_class != type) {
29869 int is_subclass = PyObject_IsSubclass(instance_class, type);
29870 if (!is_subclass) {
29871 instance_class = NULL;
29872 } else if (unlikely(is_subclass == -1)) {
29873 goto bad;
29874 } else {
29875 type = instance_class;
29876 }
29877 }
29878 }
29879 if (!instance_class) {
29880 PyObject *args;
29881 if (!value)
29882 args = PyTuple_New(0);
29883 else if (PyTuple_Check(value)) {
29884 Py_INCREF(value);
29885 args = value;
29886 } else
29887 args = PyTuple_Pack(1, value);
29888 if (!args)
29889 goto bad;
29890 owned_instance = PyObject_Call(type, args, NULL);
29891 Py_DECREF(args);
29892 if (!owned_instance)
29893 goto bad;
29894 value = owned_instance;
29895 if (!PyExceptionInstance_Check(value)) {
29896 PyErr_Format(PyExc_TypeError,
29897 "calling %R should have returned an instance of "
29898 "BaseException, not %R",
29899 type, Py_TYPE(value));
29900 goto bad;
29901 }
29902 }
29903 } else {
29904 PyErr_SetString(PyExc_TypeError,
29905 "raise: exception class must be a subclass of BaseException");
29906 goto bad;
29907 }
29908 if (cause) {
29909 PyObject *fixed_cause;
29910 if (cause == Py_None) {
29911 fixed_cause = NULL;
29912 } else if (PyExceptionClass_Check(cause)) {
29913 fixed_cause = PyObject_CallObject(cause, NULL);
29914 if (fixed_cause == NULL)
29915 goto bad;
29916 } else if (PyExceptionInstance_Check(cause)) {
29917 fixed_cause = cause;
29918 Py_INCREF(fixed_cause);
29919 } else {
29920 PyErr_SetString(PyExc_TypeError,
29921 "exception causes must derive from "
29922 "BaseException");
29923 goto bad;
29924 }
29925 PyException_SetCause(value, fixed_cause);
29926 }
29927 PyErr_SetObject(type, value);
29928 if (tb) {
29929#if PY_VERSION_HEX >= 0x030C00A6
29930 PyException_SetTraceback(value, tb);
29931#elif CYTHON_FAST_THREAD_STATE
29932 PyThreadState *tstate = __Pyx_PyThreadState_Current;
29933 PyObject* tmp_tb = tstate->curexc_traceback;
29934 if (tb != tmp_tb) {
29935 Py_INCREF(tb);
29936 tstate->curexc_traceback = tb;
29937 Py_XDECREF(tmp_tb);
29938 }
29939#else
29940 PyObject *tmp_type, *tmp_value, *tmp_tb;
29941 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
29942 Py_INCREF(tb);
29943 PyErr_Restore(tmp_type, tmp_value, tb);
29944 Py_XDECREF(tmp_tb);
29945#endif
29946 }
29947bad:
29948 Py_XDECREF(owned_instance);
29949 return;
29950}
29951
29952/* CIntToDigits (used by CIntToPyUnicode) */
29953static const char DIGIT_PAIRS_10[2*10*10+1] = {
29954 "00010203040506070809"
29955 "10111213141516171819"
29956 "20212223242526272829"
29957 "30313233343536373839"
29958 "40414243444546474849"
29959 "50515253545556575859"
29960 "60616263646566676869"
29961 "70717273747576777879"
29962 "80818283848586878889"
29963 "90919293949596979899"
29964};
29965static const char DIGIT_PAIRS_8[2*8*8+1] = {
29966 "0001020304050607"
29967 "1011121314151617"
29968 "2021222324252627"
29969 "3031323334353637"
29970 "4041424344454647"
29971 "5051525354555657"
29972 "6061626364656667"
29973 "7071727374757677"
29974};
29975static const char DIGITS_HEX[2*16+1] = {
29976 "0123456789abcdef"
29977 "0123456789ABCDEF"
29978};
29979
29980/* BuildPyUnicode (used by COrdinalToPyUnicode) */
29981static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
29982 int prepend_sign, char padding_char) {
29983 PyObject *uval;
29984 Py_ssize_t uoffset = ulength - clength;
29985#if CYTHON_USE_UNICODE_INTERNALS
29986 Py_ssize_t i;
29987 void *udata;
29988 uval = PyUnicode_New(ulength, 127);
29989 if (unlikely(!uval)) return NULL;
29990 udata = PyUnicode_DATA(uval);
29991 if (uoffset > 0) {
29992 i = 0;
29993 if (prepend_sign) {
29994 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
29995 i++;
29996 }
29997 for (; i < uoffset; i++) {
29998 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
29999 }
30000 }
30001 for (i=0; i < clength; i++) {
30002 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
30003 }
30004#else
30005 {
30006 PyObject *sign = NULL, *padding = NULL;
30007 uval = NULL;
30008 if (uoffset > 0) {
30009 prepend_sign = !!prepend_sign;
30010 if (uoffset > prepend_sign) {
30011 padding = PyUnicode_FromOrdinal(padding_char);
30012 if (likely(padding) && uoffset > prepend_sign + 1) {
30013 PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
30014 Py_DECREF(padding);
30015 padding = tmp;
30016 }
30017 if (unlikely(!padding)) goto done_or_error;
30018 }
30019 if (prepend_sign) {
30020 sign = PyUnicode_FromOrdinal('-');
30021 if (unlikely(!sign)) goto done_or_error;
30022 }
30023 }
30024 uval = PyUnicode_DecodeASCII(chars, clength, NULL);
30025 if (likely(uval) && padding) {
30026 PyObject *tmp = PyUnicode_Concat(padding, uval);
30027 Py_DECREF(uval);
30028 uval = tmp;
30029 }
30030 if (likely(uval) && sign) {
30031 PyObject *tmp = PyUnicode_Concat(sign, uval);
30032 Py_DECREF(uval);
30033 uval = tmp;
30034 }
30035done_or_error:
30036 Py_XDECREF(padding);
30037 Py_XDECREF(sign);
30038 }
30039#endif
30040 return uval;
30041}
30042
30043/* COrdinalToPyUnicode (used by CIntToPyUnicode) */
30044static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
30045 return value <= 1114111;
30046}
30047static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
30048 Py_ssize_t padding_length = ulength - 1;
30049 if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
30050 char chars[256];
30051 if (value <= 255) {
30052 memset(chars, padding_char, (size_t) padding_length);
30053 chars[ulength-1] = (char) value;
30054 return PyUnicode_DecodeLatin1(chars, ulength, NULL);
30055 }
30056 char *cpos = chars + sizeof(chars);
30057 if (value < 0x800) {
30058 *--cpos = (char) (0x80 | (value & 0x3f));
30059 value >>= 6;
30060 *--cpos = (char) (0xc0 | (value & 0x1f));
30061 } else if (value < 0x10000) {
30062 *--cpos = (char) (0x80 | (value & 0x3f));
30063 value >>= 6;
30064 *--cpos = (char) (0x80 | (value & 0x3f));
30065 value >>= 6;
30066 *--cpos = (char) (0xe0 | (value & 0x0f));
30067 } else {
30068 *--cpos = (char) (0x80 | (value & 0x3f));
30069 value >>= 6;
30070 *--cpos = (char) (0x80 | (value & 0x3f));
30071 value >>= 6;
30072 *--cpos = (char) (0x80 | (value & 0x3f));
30073 value >>= 6;
30074 *--cpos = (char) (0xf0 | (value & 0x07));
30075 }
30076 cpos -= padding_length;
30077 memset(cpos, padding_char, (size_t) padding_length);
30078 return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
30079 }
30080 if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
30081 const char chars[1] = {(char) value};
30082 return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
30083 }
30084 {
30085 PyObject *uchar, *padding_uchar, *padding, *result;
30086 padding_uchar = PyUnicode_FromOrdinal(padding_char);
30087 if (unlikely(!padding_uchar)) return NULL;
30088 padding = PySequence_Repeat(padding_uchar, padding_length);
30089 Py_DECREF(padding_uchar);
30090 if (unlikely(!padding)) return NULL;
30091 uchar = PyUnicode_FromOrdinal(value);
30092 if (unlikely(!uchar)) {
30093 Py_DECREF(padding);
30094 return NULL;
30095 }
30096 result = PyUnicode_Concat(padding, uchar);
30097 Py_DECREF(padding);
30098 Py_DECREF(uchar);
30099 return result;
30100 }
30101}
30102
30103/* CIntToPyUnicode */
30104static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char) {
30105#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30106#pragma GCC diagnostic push
30107#pragma GCC diagnostic ignored "-Wconversion"
30108#endif
30109 const int neg_one = (int) -1, const_zero = (int) 0;
30110#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30111#pragma GCC diagnostic pop
30112#endif
30113 const int is_unsigned = neg_one > const_zero;
30114 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
30115 !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
30116 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
30117 return NULL;
30118 }
30119 if (width <= 1) {
30120 return PyUnicode_FromOrdinal((int) value);
30121 }
30122 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
30123}
30124static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
30125 char digits[sizeof(int)*3+2];
30126 char *dpos, *end = digits + sizeof(int)*3+2;
30127 const char *hex_digits = DIGITS_HEX;
30128 Py_ssize_t length, ulength;
30129 int prepend_sign, last_one_off;
30130 int remaining;
30131#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30132#pragma GCC diagnostic push
30133#pragma GCC diagnostic ignored "-Wconversion"
30134#endif
30135 const int neg_one = (int) -1, const_zero = (int) 0;
30136#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30137#pragma GCC diagnostic pop
30138#endif
30139 const int is_unsigned = neg_one > const_zero;
30140 if (format_char == 'X') {
30141 hex_digits += 16;
30142 format_char = 'x';
30143 }
30144 remaining = value;
30145 last_one_off = 0;
30146 dpos = end;
30147 do {
30148 int digit_pos;
30149 switch (format_char) {
30150 case 'o':
30151 digit_pos = abs((int)(remaining % (8*8)));
30152 remaining = (int) (remaining / (8*8));
30153 dpos -= 2;
30154 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
30155 last_one_off = (digit_pos < 8);
30156 break;
30157 case 'd':
30158 digit_pos = abs((int)(remaining % (10*10)));
30159 remaining = (int) (remaining / (10*10));
30160 dpos -= 2;
30161 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
30162 last_one_off = (digit_pos < 10);
30163 break;
30164 case 'x':
30165 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
30166 remaining = (int) (remaining / 16);
30167 break;
30168 default:
30169 assert(0);
30170 break;
30171 }
30172 } while (unlikely(remaining != 0));
30173 assert(!last_one_off || *dpos == '0');
30174 dpos += last_one_off;
30175 length = end - dpos;
30176 ulength = length;
30177 prepend_sign = 0;
30178 if (!is_unsigned && value <= neg_one) {
30179 if (padding_char == ' ' || width <= length + 1) {
30180 *(--dpos) = '-';
30181 ++length;
30182 } else {
30183 prepend_sign = 1;
30184 }
30185 ++ulength;
30186 }
30187 if (width > ulength) {
30188 ulength = width;
30189 }
30190 if (ulength == 1) {
30191 return PyUnicode_FromOrdinal(*dpos);
30192 }
30193 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
30194}
30195
30196/* CIntToPyUnicode */
30197static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char) {
30198#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30199#pragma GCC diagnostic push
30200#pragma GCC diagnostic ignored "-Wconversion"
30201#endif
30202 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
30203#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30204#pragma GCC diagnostic pop
30205#endif
30206 const int is_unsigned = neg_one > const_zero;
30207 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
30208 !(sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
30209 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
30210 return NULL;
30211 }
30212 if (width <= 1) {
30213 return PyUnicode_FromOrdinal((int) value);
30214 }
30215 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
30216}
30217static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
30218 char digits[sizeof(Py_ssize_t)*3+2];
30219 char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
30220 const char *hex_digits = DIGITS_HEX;
30221 Py_ssize_t length, ulength;
30222 int prepend_sign, last_one_off;
30223 Py_ssize_t remaining;
30224#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30225#pragma GCC diagnostic push
30226#pragma GCC diagnostic ignored "-Wconversion"
30227#endif
30228 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
30229#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30230#pragma GCC diagnostic pop
30231#endif
30232 const int is_unsigned = neg_one > const_zero;
30233 if (format_char == 'X') {
30234 hex_digits += 16;
30235 format_char = 'x';
30236 }
30237 remaining = value;
30238 last_one_off = 0;
30239 dpos = end;
30240 do {
30241 int digit_pos;
30242 switch (format_char) {
30243 case 'o':
30244 digit_pos = abs((int)(remaining % (8*8)));
30245 remaining = (Py_ssize_t) (remaining / (8*8));
30246 dpos -= 2;
30247 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
30248 last_one_off = (digit_pos < 8);
30249 break;
30250 case 'd':
30251 digit_pos = abs((int)(remaining % (10*10)));
30252 remaining = (Py_ssize_t) (remaining / (10*10));
30253 dpos -= 2;
30254 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
30255 last_one_off = (digit_pos < 10);
30256 break;
30257 case 'x':
30258 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
30259 remaining = (Py_ssize_t) (remaining / 16);
30260 break;
30261 default:
30262 assert(0);
30263 break;
30264 }
30265 } while (unlikely(remaining != 0));
30266 assert(!last_one_off || *dpos == '0');
30267 dpos += last_one_off;
30268 length = end - dpos;
30269 ulength = length;
30270 prepend_sign = 0;
30271 if (!is_unsigned && value <= neg_one) {
30272 if (padding_char == ' ' || width <= length + 1) {
30273 *(--dpos) = '-';
30274 ++length;
30275 } else {
30276 prepend_sign = 1;
30277 }
30278 ++ulength;
30279 }
30280 if (width > ulength) {
30281 ulength = width;
30282 }
30283 if (ulength == 1) {
30284 return PyUnicode_FromOrdinal(*dpos);
30285 }
30286 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
30287}
30288
30289/* JoinPyUnicode */
30290static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind) {
30291#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH && CYTHON_USE_UNICODE_INTERNALS
30292 PyObject *result_uval;
30293 int result_ukind, kind_shift;
30294 Py_ssize_t i, char_pos;
30295 void *result_udata;
30296 static const Py_UCS4 max_char[5] = {0x7fU, 0xffU, 0xffffU, 0xffffU, 0x10ffffU};
30297 assert (kind >= 0);
30298 if (kind > PyUnicode_4BYTE_KIND) kind = PyUnicode_4BYTE_KIND;
30299 result_uval = PyUnicode_New(result_ulength, max_char[kind]);
30300 if (unlikely(!result_uval)) return NULL;
30301 kind_shift = kind >> 1; // 0, 1, 2
30302 result_ukind = 1 << kind_shift; // 1, 2, 4
30303 result_udata = PyUnicode_DATA(result_uval);
30304 assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
30305 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
30306 goto overflow;
30307 char_pos = 0;
30308 for (i=0; i < value_count; i++) {
30309 int ukind;
30310 Py_ssize_t ulength;
30311 void *udata;
30312 PyObject *uval = values[i];
30313 if (__Pyx_PyUnicode_READY(uval) == (-1))
30314 goto bad;
30315 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
30316 #if !CYTHON_ASSUME_SAFE_SIZE
30317 if (unlikely(ulength < 0)) goto bad;
30318 #endif
30319 if (unlikely(!ulength))
30320 continue;
30321 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
30322 goto overflow;
30323 ukind = __Pyx_PyUnicode_KIND(uval);
30324 udata = __Pyx_PyUnicode_DATA(uval);
30325 if (ukind == result_ukind) {
30326 memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
30327 } else {
30328 #if PY_VERSION_HEX >= 0x030d0000
30329 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
30330 #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
30331 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
30332 #else
30333 Py_ssize_t j;
30334 for (j=0; j < ulength; j++) {
30335 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
30336 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
30337 }
30338 #endif
30339 }
30340 char_pos += ulength;
30341 }
30342 return result_uval;
30343overflow:
30344 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
30345bad:
30346 Py_DECREF(result_uval);
30347 return NULL;
30348#else
30349 Py_ssize_t i;
30350 PyObject *result = NULL;
30351 PyObject *value_tuple = PyTuple_New(value_count);
30352 if (unlikely(!value_tuple)) return NULL;
30353 CYTHON_UNUSED_VAR(kind);
30354 CYTHON_UNUSED_VAR(result_ulength);
30355 for (i=0; i<value_count; i++) {
30356 Py_INCREF(values[i]);
30357 if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
30358 }
30359 result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
30360bad:
30361 Py_DECREF(value_tuple);
30362 return result;
30363#endif
30364}
30365
30366/* UnicodeEqualsUCS4 (used by UnicodeEquals_uchar) */
30367#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL)
30368static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals) {
30369 Py_ssize_t length;
30370 Py_UCS4 ch1;
30371 int kind;
30372 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0)) goto bad;
30373 length = __Pyx_PyUnicode_GET_LENGTH(s1);
30374 #if !CYTHON_ASSUME_SAFE_SIZE
30375 if (unlikely(length < 0)) goto bad;
30376 #endif
30377 if (length != 1) goto return_ne;
30378 kind = PyUnicode_KIND(s1);
30379 if (ch2 < 256) {
30380 if (likely(kind == PyUnicode_1BYTE_KIND)) {
30381 ch1 = PyUnicode_1BYTE_DATA(s1)[0];
30382 } else if (kind == PyUnicode_2BYTE_KIND) {
30383 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
30384 } else {
30385 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
30386 }
30387 } else if (ch2 < 65536) {
30388 if (kind == PyUnicode_2BYTE_KIND) {
30389 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
30390 } else if (kind == PyUnicode_4BYTE_KIND) {
30391 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
30392 } else {
30393 goto return_ne;
30394 }
30395 } else {
30396 if (kind == PyUnicode_4BYTE_KIND){
30397 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
30398 } else {
30399 goto return_ne;
30400 }
30401 }
30402 if (ch1 == ch2) {
30403 goto return_eq;
30404 } else {
30405 goto return_ne;
30406 }
30407return_eq:
30408 return (equals == Py_EQ);
30409return_ne:
30410 return (equals == Py_NE);
30411bad:
30412 return -1;
30413}
30414#endif
30415
30416/* PyObjectCompare */
30417#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
30418#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
30419static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
30420 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
30421 int result = PyUnicode_Equal(s1, s2);
30422 #if !CYTHON_COMPILING_IN_CPYTHON
30423 if (unlikely(result == -1)) return -1;
30424 #endif
30425 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
30426 #else
30427 int result = PyUnicode_Compare(s1, s2);
30428 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
30429 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
30430 #endif
30431__pyx_return_true:
30432 return 1;
30433__pyx_return_false:
30434 return 0;
30435}
30436#endif
30437static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop) {
30438 CYTHON_UNUSED_VAR(pyop);
30439 if (unlikely(op2 == Py_None)) {
30440 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
30441 }
30442 if (PyFloat_CheckExact(op1)) {
30443 goto __pyx_richcmp;
30444 }
30445 if (PyLong_CheckExact(op1)) {
30446 if (op1 == op2) goto __pyx_return_true;
30447 goto __pyx_richcmp;
30448 }
30449
30450 if (likely(PyUnicode_CheckExact(op1))) {
30451 if (op1 == op2) goto __pyx_return_true;
30452 if (likely(op2 != Py_None)) {
30453 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
30454 }
30455 goto __pyx_richcmp;
30456 }
30457
30458 if ((0)) goto __pyx_richcmp;
30459 if ((0)) goto __pyx_return_true;
30460 if ((0)) goto __pyx_return_false;
30461__pyx_richcmp:
30462 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
30463__pyx_return_true:
30464 return 1;
30465__pyx_return_false:
30466 return 0;
30467}
30468
30469/* PyObjectCompare */
30470#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
30471#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
30472#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
30473static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyBytesPyBytesEq(PyObject* s1, PyObject* s2) {
30474 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30475 const char *ps1, *ps2;
30476 Py_ssize_t length = PyBytes_GET_SIZE(s1);
30477 if (length != PyBytes_GET_SIZE(s2)) goto __pyx_return_false;
30478 ps1 = PyBytes_AS_STRING(s1);
30479 ps2 = PyBytes_AS_STRING(s2);
30480 #else
30481 char *ps1, *ps2;
30482 Py_ssize_t length, length2;
30483 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length) == -1)) return NULL;
30484 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return NULL;
30485 if (length != length2) goto __pyx_return_false;
30486 #endif
30487 if (ps1[0] != ps2[0]) goto __pyx_return_false;
30488 if (length == 1) goto __pyx_return_true;
30489 {
30490 int cmp;
30491#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
30492 Py_hash_t hash1 = ((PyBytesObject*)s1)->ob_shash;
30493 Py_hash_t hash2 = ((PyBytesObject*)s2)->ob_shash;
30494 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) goto __pyx_return_false;
30495#endif
30496 cmp = memcmp(ps1, ps2, (size_t)length);
30497 if (cmp == 0) goto __pyx_return_true; else goto __pyx_return_false;
30498 }
30499__pyx_return_true:
30500 Py_RETURN_TRUE;
30501__pyx_return_false:
30502 Py_RETURN_FALSE;
30503}
30504#endif
30505#endif
30506#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
30507#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
30508#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
30509static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyByteArrayPyBytesEq(PyObject* s1, PyObject* s2) {
30510 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30511 const char *ps1, *ps2;
30512 Py_ssize_t length = PyByteArray_GET_SIZE(s1);
30513 if (length != PyBytes_GET_SIZE(s2)) goto __pyx_return_false;
30514 ps1 = PyByteArray_AS_STRING(s1);
30515 ps2 = PyBytes_AS_STRING(s2);
30516 #else
30517 char *ps1, *ps2;
30518 Py_ssize_t length, length2;
30519 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return NULL;
30520 length = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length == -1)) return NULL;
30521 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return NULL;
30522 if (length != length2) goto __pyx_return_false;
30523 #endif
30524 if (length == 0) goto __pyx_return_true;
30525 if (ps1[0] != ps2[0]) goto __pyx_return_false;
30526 if (length == 1) goto __pyx_return_true;
30527 {
30528 int cmp;
30529 cmp = memcmp(ps1, ps2, (size_t)length);
30530 if (cmp == 0) goto __pyx_return_true; else goto __pyx_return_false;
30531 }
30532__pyx_return_true:
30533 Py_RETURN_TRUE;
30534__pyx_return_false:
30535 Py_RETURN_FALSE;
30536}
30537#endif
30538#endif
30539static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2, int pyop) {
30540 CYTHON_UNUSED_VAR(pyop);
30541 if (unlikely(op2 == Py_None)) {
30542 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
30543 }
30544 if (PyFloat_CheckExact(op1)) {
30545 goto __pyx_richcmp;
30546 }
30547 if (PyLong_CheckExact(op1)) {
30548 if (op1 == op2) goto __pyx_return_true;
30549 goto __pyx_richcmp;
30550 }
30551 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
30552 if (likely(PyBytes_CheckExact(op1))) {
30553 if (op1 == op2) goto __pyx_return_true;
30554 if (likely(op2 != Py_None)) {
30555 return __Pyx_PyObject_ComparePyBytesPyBytesEq(op1, op2);
30556 }
30557 goto __pyx_richcmp;
30558 }
30559 #endif
30560 if ((0)) goto __pyx_richcmp;
30561 if ((0)) goto __pyx_return_true;
30562 if ((0)) goto __pyx_return_false;
30563__pyx_richcmp:
30564 return PyObject_RichCompare(op1, op2, Py_EQ);
30565__pyx_return_true:
30566 Py_RETURN_TRUE;
30567__pyx_return_false:
30568 Py_RETURN_FALSE;
30569}
30570
30571/* GetAttr */
30572static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
30573#if CYTHON_USE_TYPE_SLOTS
30574 if (likely(PyUnicode_Check(n)))
30575 return __Pyx_PyObject_GetAttrStr(o, n);
30576#endif
30577 return PyObject_GetAttr(o, n);
30578}
30579
30580/* PyFrozenDict (used by GetItemInt) */
30581#if CYTHON_COMPILING_IN_LIMITED_API
30582static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
30583 return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
30584}
30585#endif
30586
30587/* GettItemInt_wraparound (used by GetItemInt) */
30588#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
30589static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
30590 assert(*i < 0);
30591 if (likely(sm->sq_length)) {
30592 Py_ssize_t l = sm->sq_length(o);
30593 if (likely(l >= 0)) {
30594 *i += l;
30595 } else {
30596 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
30597 return -1;
30598 PyErr_Clear();
30599 }
30600 }
30601 return 0;
30602}
30603#endif
30604
30605/* GetItemInt */
30606static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
30607 PyObject *r;
30608 if (unlikely(!j)) return NULL;
30609 r = PyObject_GetItem(o, j);
30610 Py_DECREF(j);
30611 return r;
30612}
30613static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
30614 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
30615}
30616static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
30617 int wraparound, int boundscheck, int unsafe_shared) {
30618 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
30619#if CYTHON_AVOID_BORROWED_REFS
30620 CYTHON_UNUSED_VAR(boundscheck);
30621 Py_ssize_t wrapped_i = i;
30622 if (wraparound & unlikely(i < 0)) {
30623 Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
30624 #if !CYTHON_ASSUME_SAFE_SIZE
30625 if (unlikely(size < 0)) return NULL;
30626 #endif
30627 wrapped_i += size;
30628 }
30629 return __Pyx_PyList_GetItemRef(o, wrapped_i);
30630#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30631 Py_ssize_t wrapped_i = i;
30632 Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
30633 if (wraparound & unlikely(i < 0)) {
30634 wrapped_i += size;
30635 }
30636 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
30637 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
30638 }
30639 return __Pyx_GetItemInt_Generic_size(o, i);
30640#else
30641 (void)wraparound;
30642 (void)boundscheck;
30643 return PySequence_GetItem(o, i);
30644#endif
30645}
30646static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
30647 int wraparound, int boundscheck, int unsafe_shared) {
30648 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
30649#if CYTHON_AVOID_BORROWED_REFS
30650 CYTHON_UNUSED_VAR(boundscheck);
30651 Py_ssize_t wrapped_i = i;
30652 if (wraparound & unlikely(i < 0)) {
30653 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
30654 #if !CYTHON_ASSUME_SAFE_SIZE
30655 if (unlikely(size < 0)) return NULL;
30656 #endif
30657 wrapped_i += size;
30658 }
30659 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
30660 return PySequence_ITEM(o, wrapped_i);
30661 #else
30662 if (unlikely(wrapped_i < 0)) {
30663 PyErr_SetString(PyExc_IndexError, "tuple index out of range");
30664 return NULL;
30665 }
30666 return PySequence_GetItem(o, wrapped_i);
30667 #endif
30668#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30669 Py_ssize_t wrapped_i = i;
30670 Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
30671 if (wraparound & unlikely(i < 0)) {
30672 wrapped_i += size;
30673 }
30674 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
30675 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
30676 }
30677 return __Pyx_GetItemInt_Generic_size(o, i);
30678#else
30679 (void)wraparound;
30680 (void)boundscheck;
30681 return PySequence_GetItem(o, i);
30682#endif
30683}
30684#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
30685static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
30686 PyObject *r, *key = PyLong_FromSsize_t(i);
30687 if (unlikely(!key)) return NULL;
30688 r = getitem(o, key);
30689 Py_DECREF(key);
30690 return r;
30691}
30692#endif
30693static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
30694 int wraparound, int boundscheck, int unsafe_shared) {
30695 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
30696#if CYTHON_ASSUME_SAFE_SIZE
30697 if (PyList_CheckExact(o)) {
30698 return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
30699 } else
30700 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30701 if (PyTuple_CheckExact(o)) {
30702 return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
30703 } else
30704 #endif
30705#else
30706 if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
30707 return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
30708 } else
30709#endif
30710#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
30711 if (PyDict_CheckExact(o)) {
30712 return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
30713 #if defined(PyFrozenDict_CheckExact)
30714 } else if (PyFrozenDict_CheckExact(o)) {
30715 return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
30716 #endif
30717 } else
30718 {
30719 PyTypeObject *obj_type = Py_TYPE(o);
30720 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
30721 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
30722 PyMappingMethods *mm = obj_type->tp_as_mapping;
30723 if (mm && mm->mp_subscript)
30724 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
30725 }
30726 PySequenceMethods *sm = obj_type->tp_as_sequence;
30727 if (likely(sm && sm->sq_item)) {
30728 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
30729 return NULL;
30730 return sm->sq_item(o, i);
30731 }
30732 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
30733 PyMappingMethods *mm = obj_type->tp_as_mapping;
30734 if (likely(mm && mm->mp_subscript))
30735 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
30736 }
30737 }
30738#else
30739 if (!PyMapping_Check(o)) {
30740 return PySequence_GetItem(o, i);
30741 }
30742#endif
30743 (void)wraparound;
30744 (void)boundscheck;
30745 return __Pyx_GetItemInt_Generic_size(o, i);
30746}
30747
30748/* RaiseErrorWithObjectType (used by ObjectGetItem) */
30749static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj) {
30750 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
30751 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30752 if (unlikely(!type_name)) return;
30753 #endif
30754 PyErr_Format(exc_type, message, type_name);
30755 __Pyx_DECREF_TypeName(type_name);
30756}
30757
30758/* ObjectGetItem */
30759#if CYTHON_USE_TYPE_SLOTS
30760static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
30761 PyObject *runerr = NULL;
30762 Py_ssize_t key_value;
30763 key_value = __Pyx_PyIndex_AsSsize_t(index);
30764 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
30765 return __Pyx_GetItemInt_Fast(obj, key_value, 1, 1, 1);
30766 }
30767 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
30768 PyErr_Clear();
30769 __Pyx_RaiseErrorWithObjectType(
30770 PyExc_IndexError,
30771 "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer",
30772 index);
30773 }
30774 return NULL;
30775}
30776static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
30777 if (likely(PyType_Check(obj))) {
30778 if ((PyTypeObject*)obj == &PyType_Type) {
30779 return Py_GenericAlias(obj, key);
30780 }
30781 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
30782 if (!meth) {
30783 if (PyErr_Occurred()) {
30784 return NULL;
30785 }
30786 } else {
30787 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
30788 Py_DECREF(meth);
30789 return result;
30790 }
30791 }
30792 __Pyx_RaiseTypeErrorWithObjectType(
30793 "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj);
30794 return NULL;
30795}
30796static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
30797 PyTypeObject *tp = Py_TYPE(obj);
30798 PyMappingMethods *mm = tp->tp_as_mapping;
30799 PySequenceMethods *sm = tp->tp_as_sequence;
30800 if (likely(mm && mm->mp_subscript)) {
30801 return mm->mp_subscript(obj, key);
30802 }
30803 if (likely(sm && sm->sq_item)) {
30804 return __Pyx_PyObject_GetIndex(obj, key);
30805 }
30806 return __Pyx_PyObject_GetItem_Slow(obj, key);
30807}
30808#endif
30809
30810/* RejectKeywords */
30811static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
30812 PyObject *key = NULL;
30813 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds))) {
30814 key = __Pyx_PySequence_ITEM(kwds, 0);
30815 } else {
30816#if CYTHON_AVOID_BORROWED_REFS
30817 PyObject *pos = NULL;
30818#else
30819 Py_ssize_t pos = 0;
30820#endif
30821#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
30822 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
30823#endif
30824 __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
30825#if CYTHON_AVOID_BORROWED_REFS
30826 Py_XDECREF(pos);
30827#endif
30828 }
30829 if (likely(key)) {
30830 PyErr_Format(PyExc_TypeError,
30831 "%s() got an unexpected keyword argument '%U'",
30832 function_name, key);
30833 Py_DECREF(key);
30834 }
30835}
30836
30837/* DivInt[Py_ssize_t] */
30838static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
30839 Py_ssize_t q = a / b;
30840 Py_ssize_t r = a - q*b;
30841 Py_ssize_t adapt_python = (b_is_constant ?
30842 ((r != 0) & ((r < 0) ^ (b < 0))) :
30843 ((r != 0) & ((r ^ b) < 0))
30844 );
30845 return q - adapt_python;
30846}
30847
30848/* GetAttr3 */
30849#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
30850static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
30851 __Pyx_PyThreadState_declare
30852 __Pyx_PyThreadState_assign
30853 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
30854 return NULL;
30855 __Pyx_PyErr_Clear();
30856 Py_INCREF(d);
30857 return d;
30858}
30859#endif
30860static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
30861 PyObject *r;
30862#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
30863 int res = PyObject_GetOptionalAttr(o, n, &r);
30864 return (res != 0) ? r : __Pyx_NewRef(d);
30865#else
30866 #if CYTHON_USE_TYPE_SLOTS
30867 if (likely(PyUnicode_Check(n))) {
30868 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
30869 if (unlikely(!r) && likely(!PyErr_Occurred())) {
30870 r = __Pyx_NewRef(d);
30871 }
30872 return r;
30873 }
30874 #endif
30875 r = PyObject_GetAttr(o, n);
30876 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
30877#endif
30878}
30879
30880/* PyDictVersioning (used by GetModuleGlobalName) */
30881#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
30882static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
30883 PyObject *dict = Py_TYPE(obj)->tp_dict;
30884 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
30885}
30886static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
30887 PyObject **dictptr = NULL;
30888 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
30889 if (offset) {
30890#if CYTHON_COMPILING_IN_CPYTHON
30891 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
30892#else
30893 dictptr = _PyObject_GetDictPtr(obj);
30894#endif
30895 }
30896 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
30897}
30898static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
30899 PyObject *dict = Py_TYPE(obj)->tp_dict;
30900 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
30901 return 0;
30902 return obj_dict_version == __Pyx_get_object_dict_version(obj);
30903}
30904#endif
30905
30906/* GetModuleGlobalName */
30907#if CYTHON_USE_DICT_VERSIONS
30908static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
30909#else
30910static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
30911#endif
30912{
30913 PyObject *result;
30914#if CYTHON_COMPILING_IN_LIMITED_API
30915 if (unlikely(!__pyx_m)) {
30916 if (!PyErr_Occurred())
30917 PyErr_SetNone(PyExc_NameError);
30918 return NULL;
30919 }
30920 result = PyObject_GetAttr(__pyx_m, name);
30921 if (likely(result)) {
30922 return result;
30923 }
30924 if (!__Pyx_IgnoreException(PyExc_Exception)) {
30925 return NULL; // BaseException
30926 }
30927#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
30928 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
30929 if (!__Pyx_IgnoreException(PyExc_Exception)) {
30930 return NULL; // BaseException
30931 }
30932 }
30933 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
30934 if (likely(result)) {
30935 return result;
30936 }
30937#else
30938 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
30939 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
30940 if (likely(result)) {
30941 return __Pyx_NewRef(result);
30942 }
30943 PyObject *exc = PyErr_Occurred();
30944 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
30945 return NULL; // BaseException
30946 }
30947#endif
30948 return __Pyx_GetBuiltinName(name);
30949}
30950
30951/* RaiseTooManyValuesToUnpack */
30952static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
30953 PyErr_Format(PyExc_ValueError,
30954 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
30955}
30956
30957/* RaiseNeedMoreValuesToUnpack */
30958static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
30959 PyErr_Format(PyExc_ValueError,
30960 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
30961 index, (index == 1) ? "" : "s");
30962}
30963
30964/* RaiseNoneIterError */
30965static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
30966 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
30967}
30968
30969/* GetTopmostException (used by SaveResetException) */
30970#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
30971static _PyErr_StackItem *
30972__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
30973{
30974 _PyErr_StackItem *exc_info = tstate->exc_info;
30975 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
30976 exc_info->previous_item != NULL)
30977 {
30978 exc_info = exc_info->previous_item;
30979 }
30980 return exc_info;
30981}
30982#endif
30983
30984/* SaveResetException */
30985#if CYTHON_FAST_THREAD_STATE
30986static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
30987 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
30988 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
30989 PyObject *exc_value = exc_info->exc_value;
30990 if (exc_value == NULL || exc_value == Py_None) {
30991 *value = NULL;
30992 *type = NULL;
30993 *tb = NULL;
30994 } else {
30995 *value = exc_value;
30996 Py_INCREF(*value);
30997 *type = (PyObject*) Py_TYPE(exc_value);
30998 Py_INCREF(*type);
30999 *tb = PyException_GetTraceback(exc_value);
31000 }
31001 #elif CYTHON_USE_EXC_INFO_STACK
31002 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
31003 *type = exc_info->exc_type;
31004 *value = exc_info->exc_value;
31005 *tb = exc_info->exc_traceback;
31006 Py_XINCREF(*type);
31007 Py_XINCREF(*value);
31008 Py_XINCREF(*tb);
31009 #else
31010 *type = tstate->exc_type;
31011 *value = tstate->exc_value;
31012 *tb = tstate->exc_traceback;
31013 Py_XINCREF(*type);
31014 Py_XINCREF(*value);
31015 Py_XINCREF(*tb);
31016 #endif
31017}
31018static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
31019 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
31020 _PyErr_StackItem *exc_info = tstate->exc_info;
31021 PyObject *tmp_value = exc_info->exc_value;
31022 exc_info->exc_value = value;
31023 Py_XDECREF(tmp_value);
31024 Py_XDECREF(type);
31025 Py_XDECREF(tb);
31026 #else
31027 PyObject *tmp_type, *tmp_value, *tmp_tb;
31028 #if CYTHON_USE_EXC_INFO_STACK
31029 _PyErr_StackItem *exc_info = tstate->exc_info;
31030 tmp_type = exc_info->exc_type;
31031 tmp_value = exc_info->exc_value;
31032 tmp_tb = exc_info->exc_traceback;
31033 exc_info->exc_type = type;
31034 exc_info->exc_value = value;
31035 exc_info->exc_traceback = tb;
31036 #else
31037 tmp_type = tstate->exc_type;
31038 tmp_value = tstate->exc_value;
31039 tmp_tb = tstate->exc_traceback;
31040 tstate->exc_type = type;
31041 tstate->exc_value = value;
31042 tstate->exc_traceback = tb;
31043 #endif
31044 Py_XDECREF(tmp_type);
31045 Py_XDECREF(tmp_value);
31046 Py_XDECREF(tmp_tb);
31047 #endif
31048}
31049#endif
31050
31051/* RaiseErrorWithObjectTypes (used by ExtTypeTest) */
31052static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
31053 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
31054 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31055 if (unlikely(!type_name1)) return;
31056 #endif
31057 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
31058 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31059 if (unlikely(!type_name2)) goto type2_failed;
31060 #endif
31061 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
31062 __Pyx_DECREF_TypeName(type_name2);
31063#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31064type2_failed:
31065#endif
31066 __Pyx_DECREF_TypeName(type_name1);
31067}
31068
31069/* ExtTypeTest */
31070static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
31071 if (unlikely(!type)) {
31072 PyErr_SetString(PyExc_SystemError, "Missing type object");
31073 return 0;
31074 }
31075 if (likely(__Pyx_TypeCheck(obj, type)))
31076 return 1;
31077 __Pyx_RaiseTypeErrorWithTypes(
31078 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
31079 Py_TYPE(obj), type);
31080 return 0;
31081}
31082
31083/* GetException */
31084#if CYTHON_FAST_THREAD_STATE
31085static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
31086#else
31087static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
31088#endif
31089{
31090 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
31091#if CYTHON_FAST_THREAD_STATE
31092 PyObject *tmp_type, *tmp_value, *tmp_tb;
31093 #if PY_VERSION_HEX >= 0x030C0000
31094 local_value = tstate->current_exception;
31095 tstate->current_exception = 0;
31096 #else
31097 local_type = tstate->curexc_type;
31098 local_value = tstate->curexc_value;
31099 local_tb = tstate->curexc_traceback;
31100 tstate->curexc_type = 0;
31101 tstate->curexc_value = 0;
31102 tstate->curexc_traceback = 0;
31103 #endif
31104#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
31105 local_value = PyErr_GetRaisedException();
31106#else
31107 PyErr_Fetch(&local_type, &local_value, &local_tb);
31108#endif
31109#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
31110 if (likely(local_value)) {
31111 local_type = (PyObject*) Py_TYPE(local_value);
31112 Py_INCREF(local_type);
31113 local_tb = PyException_GetTraceback(local_value);
31114 }
31115#else
31116 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
31117#if CYTHON_FAST_THREAD_STATE
31118 if (unlikely(tstate->curexc_type))
31119#else
31120 if (unlikely(PyErr_Occurred()))
31121#endif
31122 goto bad;
31123 if (local_tb) {
31124 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
31125 goto bad;
31126 }
31127#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000
31128 Py_XINCREF(local_tb);
31129 Py_XINCREF(local_type);
31130 Py_XINCREF(local_value);
31131 *type = local_type;
31132 *value = local_value;
31133 *tb = local_tb;
31134#if CYTHON_FAST_THREAD_STATE
31135 #if CYTHON_USE_EXC_INFO_STACK
31136 {
31137 _PyErr_StackItem *exc_info = tstate->exc_info;
31138 #if PY_VERSION_HEX >= 0x030B00a4
31139 tmp_value = exc_info->exc_value;
31140 exc_info->exc_value = local_value;
31141 tmp_type = NULL;
31142 tmp_tb = NULL;
31143 Py_XDECREF(local_type);
31144 Py_XDECREF(local_tb);
31145 #else
31146 tmp_type = exc_info->exc_type;
31147 tmp_value = exc_info->exc_value;
31148 tmp_tb = exc_info->exc_traceback;
31149 exc_info->exc_type = local_type;
31150 exc_info->exc_value = local_value;
31151 exc_info->exc_traceback = local_tb;
31152 #endif
31153 }
31154 #else
31155 tmp_type = tstate->exc_type;
31156 tmp_value = tstate->exc_value;
31157 tmp_tb = tstate->exc_traceback;
31158 tstate->exc_type = local_type;
31159 tstate->exc_value = local_value;
31160 tstate->exc_traceback = local_tb;
31161 #endif
31162 Py_XDECREF(tmp_type);
31163 Py_XDECREF(tmp_value);
31164 Py_XDECREF(tmp_tb);
31165#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
31166 PyErr_SetHandledException(local_value);
31167 Py_XDECREF(local_value);
31168 Py_XDECREF(local_type);
31169 Py_XDECREF(local_tb);
31170#else
31171 PyErr_SetExcInfo(local_type, local_value, local_tb);
31172#endif
31173 return 0;
31174#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
31175bad:
31176 *type = 0;
31177 *value = 0;
31178 *tb = 0;
31179 Py_XDECREF(local_type);
31180 Py_XDECREF(local_value);
31181 Py_XDECREF(local_tb);
31182 return -1;
31183#endif
31184}
31185
31186/* SwapException */
31187#if CYTHON_FAST_THREAD_STATE
31188static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
31189 PyObject *tmp_type, *tmp_value, *tmp_tb;
31190 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
31191 _PyErr_StackItem *exc_info = tstate->exc_info;
31192 tmp_value = exc_info->exc_value;
31193 exc_info->exc_value = *value;
31194 if (tmp_value == NULL || tmp_value == Py_None) {
31195 Py_XDECREF(tmp_value);
31196 tmp_value = NULL;
31197 tmp_type = NULL;
31198 tmp_tb = NULL;
31199 } else {
31200 tmp_type = (PyObject*) Py_TYPE(tmp_value);
31201 Py_INCREF(tmp_type);
31202 #if CYTHON_COMPILING_IN_CPYTHON
31203 tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
31204 Py_XINCREF(tmp_tb);
31205 #else
31206 tmp_tb = PyException_GetTraceback(tmp_value);
31207 #endif
31208 }
31209 #elif CYTHON_USE_EXC_INFO_STACK
31210 _PyErr_StackItem *exc_info = tstate->exc_info;
31211 tmp_type = exc_info->exc_type;
31212 tmp_value = exc_info->exc_value;
31213 tmp_tb = exc_info->exc_traceback;
31214 exc_info->exc_type = *type;
31215 exc_info->exc_value = *value;
31216 exc_info->exc_traceback = *tb;
31217 #else
31218 tmp_type = tstate->exc_type;
31219 tmp_value = tstate->exc_value;
31220 tmp_tb = tstate->exc_traceback;
31221 tstate->exc_type = *type;
31222 tstate->exc_value = *value;
31223 tstate->exc_traceback = *tb;
31224 #endif
31225 *type = tmp_type;
31226 *value = tmp_value;
31227 *tb = tmp_tb;
31228}
31229#else
31230static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
31231 PyObject *tmp_type, *tmp_value, *tmp_tb;
31232 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
31233 PyErr_SetExcInfo(*type, *value, *tb);
31234 *type = tmp_type;
31235 *value = tmp_value;
31236 *tb = tmp_tb;
31237}
31238#endif
31239
31240/* HasAttr (used by ImportImpl) */
31241#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
31242static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
31243 PyObject *r;
31244 if (unlikely(!PyUnicode_Check(n))) {
31245 PyErr_SetString(PyExc_TypeError,
31246 "hasattr(): attribute name must be string");
31247 return -1;
31248 }
31249 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
31250 if (!r) {
31251 return (unlikely(PyErr_Occurred())) ? -1 : 0;
31252 } else {
31253 Py_DECREF(r);
31254 return 1;
31255 }
31256}
31257#endif
31258
31259/* TupleOrListFromArrayImpl (used by ListFromArray) */
31260CYTHON_UNUSED static PyObject *
31261__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) {
31262 PyObject *res = PyList_New(n);
31263 if (unlikely(res == NULL)) return NULL;
31264 #if CYTHON_COMPILING_IN_CPYTHON
31265 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
31266 #else
31267 Py_ssize_t i;
31268 for (i = 0; i < n; i++) {
31269 Py_INCREF(src[i]);
31270 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
31271 Py_DECREF(res);
31272 return NULL;
31273 }
31274 }
31275 #endif
31276 return res;
31277}
31278
31279/* ImportImpl (used by Import) */
31280static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
31281 PyObject *imported_module = PyImport_GetModule(qualname);
31282 if (unlikely(!imported_module)) {
31283 *module = NULL;
31284 if (PyErr_Occurred()) {
31285 return -1;
31286 }
31287 return 0;
31288 }
31289 *module = imported_module;
31290 return 1;
31291}
31292static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
31293 PyObject *imported_module;
31294 PyObject *top_level_package_name;
31295 Py_ssize_t i;
31296 int status, module_found;
31297 Py_ssize_t dot_index;
31298 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
31299 if (unlikely(!module_found || module_found == -1)) {
31300 *module = NULL;
31301 return module_found;
31302 }
31303 if (imported_names) {
31304 for (i = 0; i < len_imported_names; i++) {
31305 PyObject *imported_name = imported_names[i];
31306#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
31307 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
31308#else
31309 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
31310 if (unlikely(has_imported_attribute == -1)) goto error;
31311#endif
31312 if (!has_imported_attribute) {
31313 goto not_found;
31314 }
31315 }
31316 *module = imported_module;
31317 return 1;
31318 }
31319 dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
31320 if (dot_index == -1) {
31321 *module = imported_module;
31322 return 1;
31323 }
31324 if (unlikely(dot_index == -2)) goto error;
31325 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
31326 if (unlikely(!top_level_package_name)) goto error;
31327 Py_DECREF(imported_module);
31328 status = __Pyx__Import_GetModule(top_level_package_name, module);
31329 Py_DECREF(top_level_package_name);
31330 return status;
31331error:
31332 Py_DECREF(imported_module);
31333 *module = NULL;
31334 return -1;
31335not_found:
31336 Py_DECREF(imported_module);
31337 *module = NULL;
31338 return 0;
31339}
31340static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
31341 PyObject *module = 0;
31342 PyObject *empty_dict = 0;
31343 PyObject *from_list = 0;
31344 int module_found;
31345 if (!qualname) {
31346 qualname = name;
31347 }
31348 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
31349 if (likely(module_found == 1)) {
31350 return module;
31351 } else if (unlikely(module_found == -1)) {
31352 return NULL;
31353 }
31354 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
31355 empty_dict = PyFrozenDict_New(NULL);
31356 #else
31357 empty_dict = PyDict_New();
31358 #endif
31359 if (unlikely(!empty_dict))
31360 goto bad;
31361 if (imported_names) {
31362 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
31363 if (unlikely(!from_list))
31364 goto bad;
31365 }
31366 if (level == -1) {
31367 const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
31368 if (package_sep != (0)) {
31369 module = PyImport_ImportModuleLevelObject(
31370 name, moddict, empty_dict, from_list, 1);
31371 if (unlikely(!module)) {
31372 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
31373 goto bad;
31374 PyErr_Clear();
31375 }
31376 }
31377 level = 0;
31378 }
31379 if (!module) {
31380 module = PyImport_ImportModuleLevelObject(
31381 name, moddict, empty_dict, from_list, level);
31382 }
31383bad:
31384 Py_XDECREF(from_list);
31385 Py_XDECREF(empty_dict);
31386 return module;
31387}
31388
31389/* Import */
31390static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
31391 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
31392}
31393
31394/* ListAppendAndDecrefInternal (used by ListCompAppendAndDecref) */
31395#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
31396static CYTHON_INLINE void __Pyx__ListComp_AppendAndDecref(PyObject* list, Py_ssize_t len, PyObject* x) {
31397 PyList_SET_ITEM(list, len, x);
31398 Py_SET_SIZE(list, len + 1);
31399}
31400#endif
31401
31402/* ListCompAppendAndDecref */
31403#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
31404static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
31405 PyListObject* L = (PyListObject*) list;
31406 Py_ssize_t len = Py_SIZE(list);
31407 if (likely(L->allocated > len)) {
31408 __Pyx__ListComp_AppendAndDecref(list, len, x);
31409 return 0;
31410 }
31411 int result = PyList_Append(list, x);
31412 Py_DECREF(x);
31413 return result;
31414}
31415#else
31416static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
31417 int result = PyList_Append(list, x);
31418 Py_DECREF(x);
31419 return result;
31420}
31421#endif
31422
31423/* PySequenceMultiply */
31424#if CYTHON_USE_TYPE_SLOTS
31425static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
31426 PyObject *result, *pymul = PyLong_FromSsize_t(mul);
31427 if (unlikely(!pymul))
31428 return NULL;
31429 result = PyNumber_Multiply(seq, pymul);
31430 Py_DECREF(pymul);
31431 return result;
31432}
31433static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
31434 PyTypeObject *type = Py_TYPE(seq);
31435 if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
31436 return type->tp_as_sequence->sq_repeat(seq, mul);
31437 } else {
31438 return __Pyx_PySequence_Multiply_Generic(seq, mul);
31439 }
31440}
31441#endif
31442
31443/* PyNumberBinop */
31444#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
31445#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31446#ifndef __Pyx_DEFINED_BinopTypeError
31447#define __Pyx_DEFINED_BinopTypeError
31448static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
31449 char opname[4] = {op[0], op[1], 0, 0};
31450 if (inplace) {
31451 opname[op[1] ? 2 : 1] = '=';
31452 }
31453 __Pyx_RaiseErrorWithObjectTypes1(
31454 PyExc_TypeError,
31455 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
31456 opname, op1, op2);
31457}
31458#endif
31459#endif
31460#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
31461#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
31462static PyObject* __Pyx_PyNumber_Multiply_xfloat_int(PyObject *op1, PyObject *op2, int inplace) {
31463 if (likely(op2 != Py_None)) {
31464 double int_op2;
31465 #if CYTHON_USE_PYLONG_INTERNALS
31466 if (__Pyx_PyLong_IsCompact(op2)) {
31467 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
31468 int_op2 = (double) compact_op2;
31469 } else
31470 #endif
31471 {
31472 int_op2 = PyLong_AsDouble(op2);
31473 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
31474 }
31475 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
31476 #if !CYTHON_ASSUME_SAFE_MACROS
31477 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
31478 #endif
31479 if (float_op1 == 0.) return __Pyx_NewRef(op1);
31480 return PyFloat_FromDouble(float_op1 * int_op2);
31481 }
31482 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31483 {
31484 PyTypeObject *type_op2 = Py_TYPE(op2);
31485 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
31486 if (likely(slot_func)) {
31487 PyObject *result = slot_func(op1, op2);
31488 if (likely(result != Py_NotImplemented)) {
31489 return result;
31490 }
31491 Py_DECREF(result);
31492 }
31493 __Pyx_BinopTypeError(op1, op2, "*", inplace);
31494 return NULL;
31495 }
31496 #else
31497 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
31498 #endif
31499}
31500#endif
31501#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_int
31502#define __Pyx_DEFINED_PyNumber_Multiply_xint_int
31503static PyObject* __Pyx_PyNumber_Multiply_xint_int(PyObject *op1, PyObject *op2, int inplace) {
31504 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31505 {
31506 PyTypeObject *type_op2 = Py_TYPE(op2);
31507 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
31508 if (likely(slot_func)) {
31509 PyObject *result = slot_func(op1, op2);
31510 if (likely(result != Py_NotImplemented)) {
31511 return result;
31512 }
31513 Py_DECREF(result);
31514 }
31515 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
31516 if (likely(repeat_func)) {
31517 Py_ssize_t count;
31518 #if CYTHON_USE_PYLONG_INTERNALS
31519 if (__Pyx_PyLong_IsCompact(op1)) {
31520 count = __Pyx_PyLong_CompactValue(op1);
31521 } else
31522 #endif
31523 {
31524 count = PyLong_AsSsize_t(op1);
31525 if (unlikely((count == -1) && PyErr_Occurred())) return NULL;
31526 }
31527 return repeat_func(op2, count);
31528 }
31529 __Pyx_BinopTypeError(op1, op2, "*", inplace);
31530 return NULL;
31531 }
31532 #else
31533 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
31534 #endif
31535}
31536#endif
31537static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2, int inplace) {
31538 if (PyFloat_CheckExact(op1)) {
31539 return __Pyx_PyNumber_Multiply_xfloat_int(op1, op2, inplace);
31540 }
31541 if (likely(PyLong_CheckExact(op1))) {
31542 if (likely(op2 != Py_None)) {
31543 #if CYTHON_USE_PYLONG_INTERNALS
31544 if (__Pyx_PyLong_IsCompact(op1)) {
31545 long long int_op1 = (long long) __Pyx_PyLong_CompactValue(op1);
31546 if (int_op1 == 0) return __Pyx_NewRef(op1);
31547 if (__Pyx_PyLong_IsCompact(op2)) {
31548 long long int_op2 = (long long) __Pyx_PyLong_CompactValue(op2);
31549 if (int_op2 == 0) return __Pyx_NewRef(op2);
31550 return PyLong_FromLongLong(int_op1 * int_op2);
31551 }
31552 }
31553 else if (__Pyx_PyLong_IsZero(op2)) return __Pyx_NewRef(op2);
31554 #endif
31555 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_multiply, binaryfunc);
31556 if (likely(slot_func)) {
31557 return slot_func(op1, op2);
31558 }
31559 }
31560 return __Pyx_PyNumber_Multiply_xint_int(op1, op2, inplace);
31561 }
31562 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
31563}
31564#endif
31565
31566/* PyObjectFormatAndDecref */
31567static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
31568 if (unlikely(!s)) return NULL;
31569 if (likely(PyUnicode_CheckExact(s))) return s;
31570 return __Pyx_PyObject_FormatAndDecref(s, f);
31571}
31572static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
31573 PyObject *result;
31574 if (unlikely(!s)) return NULL;
31575 result = PyObject_Format(s, f);
31576 Py_DECREF(s);
31577 return result;
31578}
31579
31580/* PyObjectFormat */
31581#if CYTHON_USE_UNICODE_WRITER
31582static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
31583 int ret;
31584 _PyUnicodeWriter writer;
31585 if (likely(PyFloat_CheckExact(obj))) {
31586 _PyUnicodeWriter_Init(&writer);
31587 ret = _PyFloat_FormatAdvancedWriter(
31588 &writer,
31589 obj,
31590 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
31591 } else if (likely(PyLong_CheckExact(obj))) {
31592 _PyUnicodeWriter_Init(&writer);
31593 ret = _PyLong_FormatAdvancedWriter(
31594 &writer,
31595 obj,
31596 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
31597 } else {
31598 return PyObject_Format(obj, format_spec);
31599 }
31600 if (unlikely(ret == -1)) {
31601 _PyUnicodeWriter_Dealloc(&writer);
31602 return NULL;
31603 }
31604 return _PyUnicodeWriter_Finish(&writer);
31605}
31606#endif
31607
31608/* SetItemInt */
31609static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
31610 int r;
31611 if (unlikely(!j)) return -1;
31612 r = PyObject_SetItem(o, j, v);
31613 Py_DECREF(j);
31614 return r;
31615}
31616#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31617static CYTHON_INLINE int __Pyx_SetItemInt_Fast_mapping(PyObject *o, objobjargproc setitem, Py_ssize_t i, PyObject *value) {
31618 PyObject *key = PyLong_FromSsize_t(i);
31619 if (unlikely(!key)) return -1;
31620 int r = setitem(o, key, value);
31621 Py_DECREF(key);
31622 return r;
31623}
31624#endif
31625static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
31626 int wraparound, int boundscheck, int unsafe_shared) {
31627 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
31628#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
31629 if (PyList_CheckExact(o)) {
31630 Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
31631 if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
31632 Py_INCREF(v);
31633 return PyList_SetItem(o, n, v);
31634 } else if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
31635 PyObject* old;
31636 Py_INCREF(v);
31637 old = PyList_GET_ITEM(o, n);
31638 PyList_SET_ITEM(o, n, v);
31639 Py_DECREF(old);
31640 return 0;
31641 }
31642 } else
31643#endif
31644#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31645 if (PyDict_CheckExact(o)) {
31646 return __Pyx_SetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_ass_subscript, i, v);
31647 } else
31648 {
31649 PyTypeObject *obj_type = Py_TYPE(o);
31650 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
31651 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
31652 PyMappingMethods *mm = obj_type->tp_as_mapping;
31653 if (mm && mm->mp_ass_subscript)
31654 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i, v);
31655 }
31656 PySequenceMethods *sm = obj_type->tp_as_sequence;
31657 if (likely(sm && sm->sq_ass_item)) {
31658 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
31659 return -1;
31660 return sm->sq_ass_item(o, i, v);
31661 }
31662 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
31663 PyMappingMethods *mm = obj_type->tp_as_mapping;
31664 if (likely(mm && mm->mp_ass_subscript))
31665 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i, v);
31666 }
31667 }
31668#else
31669 if (!PyMapping_Check(o)) {
31670 return PySequence_SetItem(o, i, v);
31671 }
31672#endif
31673 (void)wraparound;
31674 (void)boundscheck;
31675 return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i), v);
31676}
31677
31678/* RaiseUnboundLocalError */
31679static void __Pyx_RaiseUnboundLocalError(const char *varname) {
31680 PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
31681}
31682
31683/* DivInt[long] */
31684static CYTHON_INLINE long __Pyx_div_long(long a, long b, int b_is_constant) {
31685 long q = a / b;
31686 long r = a - q*b;
31687 long adapt_python = (b_is_constant ?
31688 ((r != 0) & ((r < 0) ^ (b < 0))) :
31689 ((r != 0) & ((r ^ b) < 0))
31690 );
31691 return q - adapt_python;
31692}
31693
31694/* PyObjectSetAttrStr */
31695#if CYTHON_USE_TYPE_SLOTS
31696static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
31697 PyTypeObject* tp = Py_TYPE(obj);
31698 if (likely(tp->tp_setattro))
31699 return tp->tp_setattro(obj, attr_name, value);
31700 return PyObject_SetAttr(obj, attr_name, value);
31701}
31702#endif
31703
31704/* PyObjectLookupSpecial */
31705#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
31706static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
31707 PyObject *res;
31708 PyTypeObject *tp = Py_TYPE(obj);
31709 res = _PyType_Lookup(tp, attr_name);
31710 if (likely(res)) {
31711 descrgetfunc f = Py_TYPE(res)->tp_descr_get;
31712 if (!f) {
31713 Py_INCREF(res);
31714 } else {
31715 res = f(res, obj, (PyObject *)tp);
31716 }
31717 } else if (with_error) {
31718 PyErr_SetObject(PyExc_AttributeError, attr_name);
31719 }
31720 return res;
31721}
31722#endif
31723
31724/* PyLongBinop */
31725#if !CYTHON_COMPILING_IN_PYPY
31726static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
31727 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
31728}
31729#if CYTHON_USE_PYLONG_INTERNALS
31730static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
31731 CYTHON_MAYBE_UNUSED_VAR(inplace);
31732 CYTHON_UNUSED_VAR(zerodivision_check);
31733 const long b = intval;
31734 long a;
31735 const PY_LONG_LONG llb = intval;
31736 PY_LONG_LONG lla;
31737 if (unlikely(__Pyx_PyLong_IsZero(op1))) {
31738 return __Pyx_NewRef(op2);
31739 }
31740 const int is_positive = __Pyx_PyLong_IsPos(op1);
31741 const digit* digits = __Pyx_PyLong_Digits(op1);
31742 const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
31743 if (likely(size == 1)) {
31744 a = (long) digits[0];
31745 if (!is_positive) a *= -1;
31746 } else {
31747 if (size == 2 && 8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
31748 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31749 if (!is_positive) a *= -1;
31750 goto calculate_long;
31751 } else if (size == 2 && 8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
31752 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31753 if (!is_positive) lla *= -1;
31754 goto calculate_long_long;
31755 } else
31756 if (size == 3 && 8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
31757 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31758 if (!is_positive) a *= -1;
31759 goto calculate_long;
31760 } else if (size == 3 && 8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
31761 lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31762 if (!is_positive) lla *= -1;
31763 goto calculate_long_long;
31764 } else
31765 if (size == 4 && 8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
31766 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31767 if (!is_positive) a *= -1;
31768 goto calculate_long;
31769 } else if (size == 4 && 8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
31770 lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31771 if (!is_positive) lla *= -1;
31772 goto calculate_long_long;
31773 } else
31774 {}
31775 return PyLong_Type.tp_as_number->nb_add(op1, op2);
31776 }
31777 calculate_long:
31778 {
31779 long x;
31780 x = a + b;
31781 return PyLong_FromLong(x);
31782 }
31783 calculate_long_long:
31784 {
31785 PY_LONG_LONG llx;
31786 llx = lla + llb;
31787 return PyLong_FromLongLong(llx);
31788 }
31789
31790}
31791#endif
31792static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
31793 CYTHON_UNUSED_VAR(zerodivision_check);
31794 const long b = intval;
31795 double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
31796 double result;
31797
31798 result = ((double)a) + (double)b;
31799 return PyFloat_FromDouble(result);
31800}
31801static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
31802 CYTHON_MAYBE_UNUSED_VAR(intval);
31803 CYTHON_UNUSED_VAR(zerodivision_check);
31804 #if CYTHON_USE_PYLONG_INTERNALS
31805 if (likely(PyLong_CheckExact(op1))) {
31806 return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
31807 }
31808 #endif
31809 if (PyFloat_CheckExact(op1)) {
31810 return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
31811 }
31812 return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
31813}
31814#endif
31815
31816/* PyNumberBinop */
31817#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
31818#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31819#ifndef __Pyx_DEFINED_BinopTypeError
31820#define __Pyx_DEFINED_BinopTypeError
31821static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
31822 char opname[4] = {op[0], op[1], 0, 0};
31823 if (inplace) {
31824 opname[op[1] ? 2 : 1] = '=';
31825 }
31826 __Pyx_RaiseErrorWithObjectTypes1(
31827 PyExc_TypeError,
31828 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
31829 opname, op1, op2);
31830}
31831#endif
31832#endif
31833#ifndef __Pyx_DEFINED_PyNumber_Add_xfloat_object
31834#define __Pyx_DEFINED_PyNumber_Add_xfloat_object
31835static PyObject* __Pyx_PyNumber_Add_xfloat_object(PyObject *op1, PyObject *op2, int inplace) {
31836 if (PyLong_CheckExact(op2)) {
31837 double int_op2;
31838 #if CYTHON_USE_PYLONG_INTERNALS
31839 if (__Pyx_PyLong_IsCompact(op2)) {
31840 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
31841 if (compact_op2 == 0) return __Pyx_NewRef(op1);
31842 int_op2 = (double) compact_op2;
31843 } else
31844 #endif
31845 {
31846 int_op2 = PyLong_AsDouble(op2);
31847 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
31848 #if !CYTHON_USE_PYLONG_INTERNALS
31849 if (int_op2 == 0.) return __Pyx_NewRef(op1);
31850 #endif
31851 }
31852 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
31853 #if !CYTHON_ASSUME_SAFE_MACROS
31854 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
31855 #endif
31856 return PyFloat_FromDouble(float_op1 + int_op2);
31857 }
31858 if (PyLong_Check(op2)) {
31859 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_add, binaryfunc);
31860 if (likely(slot_func)) {
31861 return slot_func(op1, op2);
31862 }
31863 }
31864 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31865 {
31866 PyTypeObject *type_op2 = Py_TYPE(op2);
31867 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_add, binaryfunc);
31868 if (likely(slot_func)) {
31869 PyObject *result = slot_func(op1, op2);
31870 if (likely(result != Py_NotImplemented)) {
31871 return result;
31872 }
31873 Py_DECREF(result);
31874 }
31875 __Pyx_BinopTypeError(op1, op2, "+", inplace);
31876 return NULL;
31877 }
31878 #else
31879 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
31880 #endif
31881}
31882#endif
31883#ifndef __Pyx_DEFINED_PyNumber_Add_xint_object
31884#define __Pyx_DEFINED_PyNumber_Add_xint_object
31885static PyObject* __Pyx_PyNumber_Add_xint_object(PyObject *op1, PyObject *op2, int inplace) {
31886 if (PyFloat_CheckExact(op2)) {
31887 double int_op1;
31888 #if CYTHON_USE_PYLONG_INTERNALS
31889 if (__Pyx_PyLong_IsCompact(op1)) {
31890 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
31891 if (compact_op1 == 0) return __Pyx_NewRef(op2);
31892 int_op1 = (double) compact_op1;
31893 } else
31894 #endif
31895 {
31896 int_op1 = PyLong_AsDouble(op1);
31897 if (unlikely((int_op1 == -1.) && PyErr_Occurred())) return NULL;
31898 #if !CYTHON_USE_PYLONG_INTERNALS
31899 if (int_op1 == 0.) return __Pyx_NewRef(op2);
31900 #endif
31901 }
31902 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
31903 #if !CYTHON_ASSUME_SAFE_MACROS
31904 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
31905 #endif
31906 return PyFloat_FromDouble(int_op1 + float_op2);
31907 }
31908 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31909 {
31910 PyTypeObject *type_op2 = Py_TYPE(op2);
31911 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_add, binaryfunc);
31912 if (likely(slot_func)) {
31913 PyObject *result = slot_func(op1, op2);
31914 if (likely(result != Py_NotImplemented)) {
31915 return result;
31916 }
31917 Py_DECREF(result);
31918 }
31919 __Pyx_BinopTypeError(op1, op2, "+", inplace);
31920 return NULL;
31921 }
31922 #else
31923 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
31924 #endif
31925}
31926#endif
31927static CYTHON_INLINE PyObject* __Pyx__PyNumber_Add_object_object(PyObject *op1, PyObject *op2, int inplace) {
31928 if (PyFloat_CheckExact(op1)) {
31929 if (PyFloat_CheckExact(op2)) {
31930 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
31931 #if !CYTHON_ASSUME_SAFE_MACROS
31932 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
31933 #endif
31934 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
31935 #if !CYTHON_ASSUME_SAFE_MACROS
31936 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
31937 #endif
31938 return PyFloat_FromDouble(float_op1 + float_op2);
31939 }
31940 return __Pyx_PyNumber_Add_xfloat_object(op1, op2, inplace);
31941 }
31942 if (PyLong_CheckExact(op1)) {
31943 if (PyLong_CheckExact(op2)) {
31944 #if CYTHON_USE_PYLONG_INTERNALS
31945 if (__Pyx_PyLong_IsCompact(op1)) {
31946 Py_ssize_t int_op1 = __Pyx_PyLong_CompactValue(op1);
31947 if (int_op1 == 0) return __Pyx_NewRef(op2);
31948 if (__Pyx_PyLong_IsCompact(op2)) {
31949 Py_ssize_t int_op2 = __Pyx_PyLong_CompactValue(op2);
31950 if (int_op2 == 0) return __Pyx_NewRef(op1);
31951 return PyLong_FromSsize_t(int_op1 + int_op2);
31952 }
31953 }
31954 else if (__Pyx_PyLong_IsZero(op2)) return __Pyx_NewRef(op1);
31955 #endif
31956 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_add, binaryfunc);
31957 if (likely(slot_func)) {
31958 return slot_func(op1, op2);
31959 }
31960 }
31961 return __Pyx_PyNumber_Add_xint_object(op1, op2, inplace);
31962 }
31963 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
31964}
31965#endif
31966
31967/* PyObjectCompare */
31968#ifndef __Pyx_DEFINED_PyObject_CompareFloatIntBoolGe
31969#define __Pyx_DEFINED_PyObject_CompareFloatIntBoolGe
31970static int __Pyx_PyObject_CompareFloatIntBoolGe(PyObject *op1, PyObject *op2) {
31971 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
31972 #if !CYTHON_ASSUME_SAFE_MACROS
31973 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
31974 #endif
31975 #if CYTHON_USE_PYLONG_INTERNALS
31976 if (__Pyx_PyLong_IsCompact(op2)) {
31977 Py_ssize_t iop2 = __Pyx_PyLong_CompactValue(op2);
31978 if (float_op1 >= ((double)iop2)) goto __pyx_return_true; else goto __pyx_return_false;
31979 }
31980 if (unlikely(!isfinite(float_op1))) {
31981 if (float_op1 >= 0.0) goto __pyx_return_true; else goto __pyx_return_false;
31982 } else {
31983 int sign2 = __Pyx_PyLong_Sign(op2);
31984 if (float_op1 >= 0.) {
31985 if (sign2 < 0) goto __pyx_return_true;
31986 if (float_op1 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
31987 } else {
31988 if (sign2 > 0) goto __pyx_return_false;
31989 if (float_op1 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
31990 }
31991 }
31992 #else
31993 if (unlikely(!isfinite(float_op1))) {
31994 if (float_op1 >= 0.0) goto __pyx_return_true; else goto __pyx_return_false;
31995 } else {
31996 int overflow2;
31997 long iop2 = PyLong_AsLongAndOverflow(op2, &overflow2);
31998 if (likely(!overflow2)) {
31999 if ((long long) iop2 >= (1LL << 53)) {
32000 overflow2 = 1;
32001 } else if ((long long) iop2 <= - (1LL << 53)) {
32002 overflow2 = -1;
32003 } else {
32004 if (float_op1 >= ((double) iop2)) goto __pyx_return_true; else goto __pyx_return_false;
32005 }
32006 }
32007 if (overflow2 > 0) {
32008 if (float_op1 < ((double) (1LL << 53))) goto __pyx_return_false;
32009 } else {
32010 if (float_op1 > - ((double) (1LL << 53))) goto __pyx_return_true;
32011 }
32012 }
32013 #endif
32014 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GE);
32015__pyx_return_true:
32016 return 1;
32017__pyx_return_false:
32018 return 0;
32019}
32020#endif
32021#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolGe
32022#define __Pyx_DEFINED_PyObject_CompareIntIntBoolGe
32023static int __Pyx_PyObject_CompareIntIntBoolGe(PyObject *op1, PyObject *op2) {
32024#if CYTHON_USE_PYLONG_INTERNALS
32025 Py_ssize_t cmp = __Pyx_PyLong_CompareSignAndSize(op1, op2);
32026 if (cmp == 0) {
32027 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
32028 if (size > 0) {
32029 const digit* digits1 = __Pyx_PyLong_Digits(op1);
32030 const digit* digits2 = __Pyx_PyLong_Digits(op2);
32031 if (size == 1) {
32032 cmp = (Py_ssize_t) digits1[0] - (Py_ssize_t) digits2[0];
32033 } else if ((size == 2) && (8 * sizeof(Py_ssize_t) >= 2 * PyLong_SHIFT)) {
32034 cmp = (Py_ssize_t) (((((size_t)digits1[1]) << PyLong_SHIFT) | (size_t)digits1[0])) - (Py_ssize_t) (((((size_t)digits2[1]) << PyLong_SHIFT) | (size_t)digits2[0]));
32035 } else {
32036 for (Py_ssize_t i=size-1; i >= 0 && !cmp; --i) {
32037 cmp = (Py_ssize_t) digits1[i] - (Py_ssize_t) digits2[i];
32038 }
32039 }
32040 }
32041 if (cmp == 0) goto __pyx_return_true;
32042 if (__Pyx_PyLong_IsNeg(op1)) cmp = -cmp;
32043 }
32044 if (cmp < 0) goto __pyx_return_false; else goto __pyx_return_true;
32045#else
32046 int overflow1, overflow2;
32047 long long iop1 = PyLong_AsLongLongAndOverflow(op1, &overflow1);
32048 long long iop2 = PyLong_AsLongLongAndOverflow(op2, &overflow2);
32049 if (likely(!(overflow1 | overflow2))) {
32050 if (iop1 >= iop2) goto __pyx_return_true; else goto __pyx_return_false;
32051 } else if (overflow1 != overflow2) {
32052 if (overflow1 >= overflow2) goto __pyx_return_true; else goto __pyx_return_false;
32053 } else {
32054 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GE);
32055 }
32056#endif
32057__pyx_return_true:
32058 return 1;
32059__pyx_return_false:
32060 return 0;
32061}
32062#endif
32063static CYTHON_INLINE int __Pyx_PyObject_CompareBoolGe_object_int(PyObject *op1, PyObject *op2, int pyop) {
32064 CYTHON_UNUSED_VAR(pyop);
32065 if (unlikely(op2 == Py_None)) {
32066 goto __pyx_richcmp;
32067 }
32068 if (op1 == op2) goto __pyx_return_true;
32069 if (PyFloat_CheckExact(op1)) {
32070 if (likely(op2 != Py_None)) {
32071 return __Pyx_PyObject_CompareFloatIntBoolGe(op1, op2);
32072 }
32073 goto __pyx_richcmp;
32074 }
32075 if (likely(PyLong_CheckExact(op1))) {
32076 if (op1 == op2) goto __pyx_return_true;
32077 if (likely(op2 != Py_None)) {
32078 return __Pyx_PyObject_CompareIntIntBoolGe(op1, op2);
32079 }
32080 goto __pyx_richcmp;
32081 }
32082 if ((0)) goto __pyx_richcmp;
32083 if ((0)) goto __pyx_return_true;
32084 if ((0)) goto __pyx_return_false;
32085__pyx_richcmp:
32086 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GE);
32087__pyx_return_true:
32088 return 1;
32089__pyx_return_false:
32090 return 0;
32091}
32092
32093/* PyObjectCompare */
32094#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolLe
32095#define __Pyx_DEFINED_PyObject_CompareStrStrBoolLe
32096static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolLe(PyObject* s1, PyObject* s2) {
32097 int result = PyUnicode_Compare(s1, s2);
32098 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
32099 if (result <= 0) goto __pyx_return_true; else goto __pyx_return_false;
32100__pyx_return_true:
32101 return 1;
32102__pyx_return_false:
32103 return 0;
32104}
32105#endif
32106#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32107#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolLe
32108#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolLe
32109static CYTHON_INLINE int __Pyx_PyObject_ComparePyBytesPyBytesBoolLe(PyObject* s1, PyObject* s2) {
32110 Py_ssize_t cmp;
32111 Py_ssize_t length1, length2, short_length;
32112 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32113 const char *ps1, *ps2;
32114 length1 = __Pyx_PyBytes_GET_SIZE(s1);
32115 length2 = __Pyx_PyBytes_GET_SIZE(s2);
32116 short_length = (length1 < length2) ? length1 : length2;
32117 if (short_length == 0) {
32118 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
32119 }
32120 ps1 = PyBytes_AS_STRING(s1);
32121 ps2 = PyBytes_AS_STRING(s2);
32122 #else
32123 char *ps1, *ps2;
32124 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length1) == -1)) return -1;
32125 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return -1;
32126 short_length = (length1 < length2) ? length1 : length2;
32127 if (short_length == 0) {
32128 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
32129 }
32130 #endif
32131 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
32132 if (cmp == 0 && short_length > 1) {
32133 cmp = memcmp(ps1, ps2, (size_t)short_length);
32134 }
32135 if (cmp == 0) cmp = (length1 - length2);
32136 if (cmp <= 0) goto __pyx_return_true; else goto __pyx_return_false;
32137__pyx_return_true:
32138 return 1;
32139__pyx_return_false:
32140 return 0;
32141}
32142#endif
32143#endif
32144#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32145#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolLe
32146#define __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolLe
32147static CYTHON_INLINE int __Pyx_PyObject_ComparePyBytesPyByteArrayBoolLe(PyObject* s1, PyObject* s2) {
32148 Py_ssize_t cmp;
32149 Py_ssize_t length1, length2, short_length;
32150 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32151 const char *ps1, *ps2;
32152 length1 = __Pyx_PyBytes_GET_SIZE(s1);
32153 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
32154 short_length = (length1 < length2) ? length1 : length2;
32155 if (short_length == 0) {
32156 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
32157 }
32158 ps1 = PyBytes_AS_STRING(s1);
32159 ps2 = PyByteArray_AS_STRING(s2);
32160 #else
32161 char *ps1, *ps2;
32162 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length1) == -1)) return -1;
32163 ps2 = __Pyx_PyByteArray_AsString(s2); if (unlikely(!ps2)) return -1;
32164 length2 = __Pyx_PyByteArray_GET_SIZE(s2); if (unlikely(length2 == -1)) return -1;
32165 short_length = (length1 < length2) ? length1 : length2;
32166 if (short_length == 0) {
32167 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
32168 }
32169 #endif
32170 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
32171 if (cmp == 0 && short_length > 1) {
32172 cmp = memcmp(ps1, ps2, (size_t)short_length);
32173 }
32174 if (cmp == 0) cmp = (length1 - length2);
32175 if (cmp <= 0) goto __pyx_return_true; else goto __pyx_return_false;
32176__pyx_return_true:
32177 return 1;
32178__pyx_return_false:
32179 return 0;
32180}
32181#endif
32182#endif
32183#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32184#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolLe
32185#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolLe
32186static CYTHON_INLINE int __Pyx_PyObject_ComparePyByteArrayPyBytesBoolLe(PyObject* s1, PyObject* s2) {
32187 Py_ssize_t cmp;
32188 Py_ssize_t length1, length2, short_length;
32189 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32190 const char *ps1, *ps2;
32191 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
32192 length2 = __Pyx_PyBytes_GET_SIZE(s2);
32193 short_length = (length1 < length2) ? length1 : length2;
32194 if (short_length == 0) {
32195 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
32196 }
32197 ps1 = PyByteArray_AS_STRING(s1);
32198 ps2 = PyBytes_AS_STRING(s2);
32199 #else
32200 char *ps1, *ps2;
32201 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return -1;
32202 length1 = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length1 == -1)) return -1;
32203 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return -1;
32204 short_length = (length1 < length2) ? length1 : length2;
32205 if (short_length == 0) {
32206 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
32207 }
32208 #endif
32209 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
32210 if (cmp == 0 && short_length > 1) {
32211 cmp = memcmp(ps1, ps2, (size_t)short_length);
32212 }
32213 if (cmp == 0) cmp = (length1 - length2);
32214 if (cmp <= 0) goto __pyx_return_true; else goto __pyx_return_false;
32215__pyx_return_true:
32216 return 1;
32217__pyx_return_false:
32218 return 0;
32219}
32220#endif
32221#endif
32222#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32223#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolLe
32224#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolLe
32225static CYTHON_INLINE int __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolLe(PyObject* s1, PyObject* s2) {
32226 Py_ssize_t cmp;
32227 Py_ssize_t length1, length2, short_length;
32228 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32229 const char *ps1, *ps2;
32230 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
32231 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
32232 short_length = (length1 < length2) ? length1 : length2;
32233 if (short_length == 0) {
32234 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
32235 }
32236 ps1 = PyByteArray_AS_STRING(s1);
32237 ps2 = PyByteArray_AS_STRING(s2);
32238 #else
32239 char *ps1, *ps2;
32240 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return -1;
32241 length1 = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length1 == -1)) return -1;
32242 ps2 = __Pyx_PyByteArray_AsString(s2); if (unlikely(!ps2)) return -1;
32243 length2 = __Pyx_PyByteArray_GET_SIZE(s2); if (unlikely(length2 == -1)) return -1;
32244 short_length = (length1 < length2) ? length1 : length2;
32245 if (short_length == 0) {
32246 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
32247 }
32248 #endif
32249 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
32250 if (cmp == 0 && short_length > 1) {
32251 cmp = memcmp(ps1, ps2, (size_t)short_length);
32252 }
32253 if (cmp == 0) cmp = (length1 - length2);
32254 if (cmp <= 0) goto __pyx_return_true; else goto __pyx_return_false;
32255__pyx_return_true:
32256 return 1;
32257__pyx_return_false:
32258 return 0;
32259}
32260#endif
32261#endif
32262#ifndef __Pyx_DEFINED_PyObject_CompareFloatIntBoolLe
32263#define __Pyx_DEFINED_PyObject_CompareFloatIntBoolLe
32264static int __Pyx_PyObject_CompareFloatIntBoolLe(PyObject *op1, PyObject *op2) {
32265 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32266 #if !CYTHON_ASSUME_SAFE_MACROS
32267 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
32268 #endif
32269 #if CYTHON_USE_PYLONG_INTERNALS
32270 if (__Pyx_PyLong_IsCompact(op2)) {
32271 Py_ssize_t iop2 = __Pyx_PyLong_CompactValue(op2);
32272 if (float_op1 <= ((double)iop2)) goto __pyx_return_true; else goto __pyx_return_false;
32273 }
32274 if (unlikely(!isfinite(float_op1))) {
32275 if (float_op1 <= 0.0) goto __pyx_return_true; else goto __pyx_return_false;
32276 } else {
32277 int sign2 = __Pyx_PyLong_Sign(op2);
32278 if (float_op1 >= 0.) {
32279 if (sign2 < 0) goto __pyx_return_false;
32280 if (float_op1 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
32281 } else {
32282 if (sign2 > 0) goto __pyx_return_true;
32283 if (float_op1 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
32284 }
32285 }
32286 #else
32287 if (unlikely(!isfinite(float_op1))) {
32288 if (float_op1 <= 0.0) goto __pyx_return_true; else goto __pyx_return_false;
32289 } else {
32290 int overflow2;
32291 long iop2 = PyLong_AsLongAndOverflow(op2, &overflow2);
32292 if (likely(!overflow2)) {
32293 if ((long long) iop2 >= (1LL << 53)) {
32294 overflow2 = 1;
32295 } else if ((long long) iop2 <= - (1LL << 53)) {
32296 overflow2 = -1;
32297 } else {
32298 if (float_op1 <= ((double) iop2)) goto __pyx_return_true; else goto __pyx_return_false;
32299 }
32300 }
32301 if (overflow2 > 0) {
32302 if (float_op1 < ((double) (1LL << 53))) goto __pyx_return_true;
32303 } else {
32304 if (float_op1 > - ((double) (1LL << 53))) goto __pyx_return_false;
32305 }
32306 }
32307 #endif
32308 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LE);
32309__pyx_return_true:
32310 return 1;
32311__pyx_return_false:
32312 return 0;
32313}
32314#endif
32315#ifndef __Pyx_DEFINED_PyObject_CompareIntFloatBoolLe
32316#define __Pyx_DEFINED_PyObject_CompareIntFloatBoolLe
32317static int __Pyx_PyObject_CompareIntFloatBoolLe(PyObject *op1, PyObject *op2) {
32318 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
32319 #if !CYTHON_ASSUME_SAFE_MACROS
32320 if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
32321 #endif
32322 #if CYTHON_USE_PYLONG_INTERNALS
32323 if (__Pyx_PyLong_IsCompact(op1)) {
32324 Py_ssize_t iop1 = __Pyx_PyLong_CompactValue(op1);
32325 if (((double)iop1) <= float_op2) goto __pyx_return_true; else goto __pyx_return_false;
32326 }
32327 if (unlikely(!isfinite(float_op2))) {
32328 if (0.0 <= float_op2) goto __pyx_return_true; else goto __pyx_return_false;
32329 } else {
32330 int sign1 = __Pyx_PyLong_Sign(op1);
32331 if (float_op2 >= 0.) {
32332 if (sign1 < 0) goto __pyx_return_true;
32333 if (float_op2 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
32334 } else {
32335 if (sign1 > 0) goto __pyx_return_false;
32336 if (float_op2 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
32337 }
32338 }
32339 #else
32340 if (unlikely(!isfinite(float_op2))) {
32341 if (0.0 <= float_op2) goto __pyx_return_true; else goto __pyx_return_false;
32342 } else {
32343 int overflow1;
32344 long iop1 = PyLong_AsLongAndOverflow(op1, &overflow1);
32345 if (likely(!overflow1)) {
32346 if ((long long) iop1 >= (1LL << 53)) {
32347 overflow1 = 1;
32348 } else if ((long long) iop1 <= - (1LL << 53)) {
32349 overflow1 = -1;
32350 } else {
32351 if (((double) iop1) <= float_op2) goto __pyx_return_true; else goto __pyx_return_false;
32352 }
32353 }
32354 if (overflow1 < 0) {
32355 if (float_op2 > ((double) (1LL << 53))) goto __pyx_return_true;
32356 } else {
32357 if (float_op2 < - ((double) (1LL << 53))) goto __pyx_return_false;
32358 }
32359 }
32360 #endif
32361 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LE);
32362__pyx_return_true:
32363 return 1;
32364__pyx_return_false:
32365 return 0;
32366}
32367#endif
32368#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolLe
32369#define __Pyx_DEFINED_PyObject_CompareIntIntBoolLe
32370static int __Pyx_PyObject_CompareIntIntBoolLe(PyObject *op1, PyObject *op2) {
32371#if CYTHON_USE_PYLONG_INTERNALS
32372 Py_ssize_t cmp = __Pyx_PyLong_CompareSignAndSize(op1, op2);
32373 if (cmp == 0) {
32374 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
32375 if (size > 0) {
32376 const digit* digits1 = __Pyx_PyLong_Digits(op1);
32377 const digit* digits2 = __Pyx_PyLong_Digits(op2);
32378 if (size == 1) {
32379 cmp = (Py_ssize_t) digits1[0] - (Py_ssize_t) digits2[0];
32380 } else if ((size == 2) && (8 * sizeof(Py_ssize_t) >= 2 * PyLong_SHIFT)) {
32381 cmp = (Py_ssize_t) (((((size_t)digits1[1]) << PyLong_SHIFT) | (size_t)digits1[0])) - (Py_ssize_t) (((((size_t)digits2[1]) << PyLong_SHIFT) | (size_t)digits2[0]));
32382 } else {
32383 for (Py_ssize_t i=size-1; i >= 0 && !cmp; --i) {
32384 cmp = (Py_ssize_t) digits1[i] - (Py_ssize_t) digits2[i];
32385 }
32386 }
32387 }
32388 if (cmp == 0) goto __pyx_return_true;
32389 if (__Pyx_PyLong_IsNeg(op1)) cmp = -cmp;
32390 }
32391 if (cmp < 0) goto __pyx_return_true; else goto __pyx_return_false;
32392#else
32393 int overflow1, overflow2;
32394 long long iop1 = PyLong_AsLongLongAndOverflow(op1, &overflow1);
32395 long long iop2 = PyLong_AsLongLongAndOverflow(op2, &overflow2);
32396 if (likely(!(overflow1 | overflow2))) {
32397 if (iop1 <= iop2) goto __pyx_return_true; else goto __pyx_return_false;
32398 } else if (overflow1 != overflow2) {
32399 if (overflow1 <= overflow2) goto __pyx_return_true; else goto __pyx_return_false;
32400 } else {
32401 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LE);
32402 }
32403#endif
32404__pyx_return_true:
32405 return 1;
32406__pyx_return_false:
32407 return 0;
32408}
32409#endif
32410static CYTHON_INLINE int __Pyx_PyObject_CompareBoolLe_object_object(PyObject *op1, PyObject *op2, int pyop) {
32411 CYTHON_UNUSED_VAR(pyop);
32412 if (PyFloat_CheckExact(op1)) {
32413 if (PyFloat_CheckExact(op2)) {
32414 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32415 #if !CYTHON_ASSUME_SAFE_MACROS
32416 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
32417 #endif
32418 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
32419 #if !CYTHON_ASSUME_SAFE_MACROS
32420 if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
32421 #endif
32422 if (float_op1 <= float_op2) goto __pyx_return_true; else goto __pyx_return_false;
32423 }
32424 if (PyLong_CheckExact(op2)) {
32425 return __Pyx_PyObject_CompareFloatIntBoolLe(op1, op2);
32426 }
32427 goto __pyx_richcmp;
32428 }
32429 if (PyLong_CheckExact(op1)) {
32430 if (op1 == op2) goto __pyx_return_true;
32431 if (PyLong_CheckExact(op2)) {
32432 return __Pyx_PyObject_CompareIntIntBoolLe(op1, op2);
32433 }
32434 if (PyFloat_CheckExact(op2)) {
32435 return __Pyx_PyObject_CompareIntFloatBoolLe(op1, op2);
32436 }
32437 goto __pyx_richcmp;
32438 }
32439
32440 if (PyUnicode_CheckExact(op1)) {
32441 if (op1 == op2) goto __pyx_return_true;
32442 if (PyUnicode_CheckExact(op2)) {
32443 return __Pyx_PyObject_CompareStrStrBoolLe(op1, op2);
32444 }
32445 goto __pyx_richcmp;
32446 }
32447
32448 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32449 if (PyBytes_CheckExact(op1)) {
32450 if (op1 == op2) goto __pyx_return_true;
32451 if (PyBytes_CheckExact(op2)) {
32452 return __Pyx_PyObject_ComparePyBytesPyBytesBoolLe(op1, op2);
32453 }
32454 if (PyByteArray_CheckExact(op2)) {
32455 return __Pyx_PyObject_ComparePyBytesPyByteArrayBoolLe(op1, op2);
32456 }
32457 goto __pyx_richcmp;
32458 }
32459 #endif
32460 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32461 if (PyByteArray_CheckExact(op1)) {
32462 if (op1 == op2) goto __pyx_return_true;
32463 if (PyByteArray_CheckExact(op2)) {
32464 return __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolLe(op1, op2);
32465 }
32466 if (PyBytes_CheckExact(op2)) {
32467 return __Pyx_PyObject_ComparePyByteArrayPyBytesBoolLe(op1, op2);
32468 }
32469 goto __pyx_richcmp;
32470 }
32471 #endif
32472 if ((0)) goto __pyx_richcmp;
32473 if ((0)) goto __pyx_return_true;
32474 if ((0)) goto __pyx_return_false;
32475__pyx_richcmp:
32476 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LE);
32477__pyx_return_true:
32478 return 1;
32479__pyx_return_false:
32480 return 0;
32481}
32482
32483/* PyObjectCompare */
32484#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolGt
32485#define __Pyx_DEFINED_PyObject_CompareStrStrBoolGt
32486static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolGt(PyObject* s1, PyObject* s2) {
32487 int result = PyUnicode_Compare(s1, s2);
32488 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
32489 if (result > 0) goto __pyx_return_true; else goto __pyx_return_false;
32490__pyx_return_true:
32491 return 1;
32492__pyx_return_false:
32493 return 0;
32494}
32495#endif
32496#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32497#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolGt
32498#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolGt
32499static CYTHON_INLINE int __Pyx_PyObject_ComparePyBytesPyBytesBoolGt(PyObject* s1, PyObject* s2) {
32500 Py_ssize_t cmp;
32501 Py_ssize_t length1, length2, short_length;
32502 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32503 const char *ps1, *ps2;
32504 length1 = __Pyx_PyBytes_GET_SIZE(s1);
32505 length2 = __Pyx_PyBytes_GET_SIZE(s2);
32506 short_length = (length1 < length2) ? length1 : length2;
32507 if (short_length == 0) {
32508 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
32509 }
32510 ps1 = PyBytes_AS_STRING(s1);
32511 ps2 = PyBytes_AS_STRING(s2);
32512 #else
32513 char *ps1, *ps2;
32514 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length1) == -1)) return -1;
32515 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return -1;
32516 short_length = (length1 < length2) ? length1 : length2;
32517 if (short_length == 0) {
32518 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
32519 }
32520 #endif
32521 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
32522 if (cmp == 0 && short_length > 1) {
32523 cmp = memcmp(ps1, ps2, (size_t)short_length);
32524 }
32525 if (cmp == 0) cmp = (length1 - length2);
32526 if (cmp > 0) goto __pyx_return_true; else goto __pyx_return_false;
32527__pyx_return_true:
32528 return 1;
32529__pyx_return_false:
32530 return 0;
32531}
32532#endif
32533#endif
32534#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32535#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolGt
32536#define __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolGt
32537static CYTHON_INLINE int __Pyx_PyObject_ComparePyBytesPyByteArrayBoolGt(PyObject* s1, PyObject* s2) {
32538 Py_ssize_t cmp;
32539 Py_ssize_t length1, length2, short_length;
32540 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32541 const char *ps1, *ps2;
32542 length1 = __Pyx_PyBytes_GET_SIZE(s1);
32543 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
32544 short_length = (length1 < length2) ? length1 : length2;
32545 if (short_length == 0) {
32546 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
32547 }
32548 ps1 = PyBytes_AS_STRING(s1);
32549 ps2 = PyByteArray_AS_STRING(s2);
32550 #else
32551 char *ps1, *ps2;
32552 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length1) == -1)) return -1;
32553 ps2 = __Pyx_PyByteArray_AsString(s2); if (unlikely(!ps2)) return -1;
32554 length2 = __Pyx_PyByteArray_GET_SIZE(s2); if (unlikely(length2 == -1)) return -1;
32555 short_length = (length1 < length2) ? length1 : length2;
32556 if (short_length == 0) {
32557 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
32558 }
32559 #endif
32560 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
32561 if (cmp == 0 && short_length > 1) {
32562 cmp = memcmp(ps1, ps2, (size_t)short_length);
32563 }
32564 if (cmp == 0) cmp = (length1 - length2);
32565 if (cmp > 0) goto __pyx_return_true; else goto __pyx_return_false;
32566__pyx_return_true:
32567 return 1;
32568__pyx_return_false:
32569 return 0;
32570}
32571#endif
32572#endif
32573#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32574#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolGt
32575#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolGt
32576static CYTHON_INLINE int __Pyx_PyObject_ComparePyByteArrayPyBytesBoolGt(PyObject* s1, PyObject* s2) {
32577 Py_ssize_t cmp;
32578 Py_ssize_t length1, length2, short_length;
32579 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32580 const char *ps1, *ps2;
32581 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
32582 length2 = __Pyx_PyBytes_GET_SIZE(s2);
32583 short_length = (length1 < length2) ? length1 : length2;
32584 if (short_length == 0) {
32585 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
32586 }
32587 ps1 = PyByteArray_AS_STRING(s1);
32588 ps2 = PyBytes_AS_STRING(s2);
32589 #else
32590 char *ps1, *ps2;
32591 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return -1;
32592 length1 = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length1 == -1)) return -1;
32593 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return -1;
32594 short_length = (length1 < length2) ? length1 : length2;
32595 if (short_length == 0) {
32596 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
32597 }
32598 #endif
32599 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
32600 if (cmp == 0 && short_length > 1) {
32601 cmp = memcmp(ps1, ps2, (size_t)short_length);
32602 }
32603 if (cmp == 0) cmp = (length1 - length2);
32604 if (cmp > 0) goto __pyx_return_true; else goto __pyx_return_false;
32605__pyx_return_true:
32606 return 1;
32607__pyx_return_false:
32608 return 0;
32609}
32610#endif
32611#endif
32612#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32613#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolGt
32614#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolGt
32615static CYTHON_INLINE int __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolGt(PyObject* s1, PyObject* s2) {
32616 Py_ssize_t cmp;
32617 Py_ssize_t length1, length2, short_length;
32618 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32619 const char *ps1, *ps2;
32620 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
32621 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
32622 short_length = (length1 < length2) ? length1 : length2;
32623 if (short_length == 0) {
32624 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
32625 }
32626 ps1 = PyByteArray_AS_STRING(s1);
32627 ps2 = PyByteArray_AS_STRING(s2);
32628 #else
32629 char *ps1, *ps2;
32630 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return -1;
32631 length1 = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length1 == -1)) return -1;
32632 ps2 = __Pyx_PyByteArray_AsString(s2); if (unlikely(!ps2)) return -1;
32633 length2 = __Pyx_PyByteArray_GET_SIZE(s2); if (unlikely(length2 == -1)) return -1;
32634 short_length = (length1 < length2) ? length1 : length2;
32635 if (short_length == 0) {
32636 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
32637 }
32638 #endif
32639 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
32640 if (cmp == 0 && short_length > 1) {
32641 cmp = memcmp(ps1, ps2, (size_t)short_length);
32642 }
32643 if (cmp == 0) cmp = (length1 - length2);
32644 if (cmp > 0) goto __pyx_return_true; else goto __pyx_return_false;
32645__pyx_return_true:
32646 return 1;
32647__pyx_return_false:
32648 return 0;
32649}
32650#endif
32651#endif
32652#ifndef __Pyx_DEFINED_PyObject_CompareFloatIntBoolGt
32653#define __Pyx_DEFINED_PyObject_CompareFloatIntBoolGt
32654static int __Pyx_PyObject_CompareFloatIntBoolGt(PyObject *op1, PyObject *op2) {
32655 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32656 #if !CYTHON_ASSUME_SAFE_MACROS
32657 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
32658 #endif
32659 #if CYTHON_USE_PYLONG_INTERNALS
32660 if (__Pyx_PyLong_IsCompact(op2)) {
32661 Py_ssize_t iop2 = __Pyx_PyLong_CompactValue(op2);
32662 if (float_op1 > ((double)iop2)) goto __pyx_return_true; else goto __pyx_return_false;
32663 }
32664 if (unlikely(!isfinite(float_op1))) {
32665 if (float_op1 > 0.0) goto __pyx_return_true; else goto __pyx_return_false;
32666 } else {
32667 int sign2 = __Pyx_PyLong_Sign(op2);
32668 if (float_op1 >= 0.) {
32669 if (sign2 < 0) goto __pyx_return_true;
32670 if (float_op1 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
32671 } else {
32672 if (sign2 > 0) goto __pyx_return_false;
32673 if (float_op1 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
32674 }
32675 }
32676 #else
32677 if (unlikely(!isfinite(float_op1))) {
32678 if (float_op1 > 0.0) goto __pyx_return_true; else goto __pyx_return_false;
32679 } else {
32680 int overflow2;
32681 long iop2 = PyLong_AsLongAndOverflow(op2, &overflow2);
32682 if (likely(!overflow2)) {
32683 if ((long long) iop2 >= (1LL << 53)) {
32684 overflow2 = 1;
32685 } else if ((long long) iop2 <= - (1LL << 53)) {
32686 overflow2 = -1;
32687 } else {
32688 if (float_op1 > ((double) iop2)) goto __pyx_return_true; else goto __pyx_return_false;
32689 }
32690 }
32691 if (overflow2 > 0) {
32692 if (float_op1 < ((double) (1LL << 53))) goto __pyx_return_false;
32693 } else {
32694 if (float_op1 > - ((double) (1LL << 53))) goto __pyx_return_true;
32695 }
32696 }
32697 #endif
32698 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
32699__pyx_return_true:
32700 return 1;
32701__pyx_return_false:
32702 return 0;
32703}
32704#endif
32705#ifndef __Pyx_DEFINED_PyObject_CompareIntFloatBoolGt
32706#define __Pyx_DEFINED_PyObject_CompareIntFloatBoolGt
32707static int __Pyx_PyObject_CompareIntFloatBoolGt(PyObject *op1, PyObject *op2) {
32708 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
32709 #if !CYTHON_ASSUME_SAFE_MACROS
32710 if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
32711 #endif
32712 #if CYTHON_USE_PYLONG_INTERNALS
32713 if (__Pyx_PyLong_IsCompact(op1)) {
32714 Py_ssize_t iop1 = __Pyx_PyLong_CompactValue(op1);
32715 if (((double)iop1) > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
32716 }
32717 if (unlikely(!isfinite(float_op2))) {
32718 if (0.0 > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
32719 } else {
32720 int sign1 = __Pyx_PyLong_Sign(op1);
32721 if (float_op2 >= 0.) {
32722 if (sign1 < 0) goto __pyx_return_false;
32723 if (float_op2 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
32724 } else {
32725 if (sign1 > 0) goto __pyx_return_true;
32726 if (float_op2 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
32727 }
32728 }
32729 #else
32730 if (unlikely(!isfinite(float_op2))) {
32731 if (0.0 > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
32732 } else {
32733 int overflow1;
32734 long iop1 = PyLong_AsLongAndOverflow(op1, &overflow1);
32735 if (likely(!overflow1)) {
32736 if ((long long) iop1 >= (1LL << 53)) {
32737 overflow1 = 1;
32738 } else if ((long long) iop1 <= - (1LL << 53)) {
32739 overflow1 = -1;
32740 } else {
32741 if (((double) iop1) > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
32742 }
32743 }
32744 if (overflow1 < 0) {
32745 if (float_op2 > ((double) (1LL << 53))) goto __pyx_return_false;
32746 } else {
32747 if (float_op2 < - ((double) (1LL << 53))) goto __pyx_return_true;
32748 }
32749 }
32750 #endif
32751 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
32752__pyx_return_true:
32753 return 1;
32754__pyx_return_false:
32755 return 0;
32756}
32757#endif
32758#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
32759#define __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
32760static int __Pyx_PyObject_CompareIntIntBoolGt(PyObject *op1, PyObject *op2) {
32761#if CYTHON_USE_PYLONG_INTERNALS
32762 Py_ssize_t cmp = __Pyx_PyLong_CompareSignAndSize(op1, op2);
32763 if (cmp == 0) {
32764 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
32765 if (size > 0) {
32766 const digit* digits1 = __Pyx_PyLong_Digits(op1);
32767 const digit* digits2 = __Pyx_PyLong_Digits(op2);
32768 if (size == 1) {
32769 cmp = (Py_ssize_t) digits1[0] - (Py_ssize_t) digits2[0];
32770 } else if ((size == 2) && (8 * sizeof(Py_ssize_t) >= 2 * PyLong_SHIFT)) {
32771 cmp = (Py_ssize_t) (((((size_t)digits1[1]) << PyLong_SHIFT) | (size_t)digits1[0])) - (Py_ssize_t) (((((size_t)digits2[1]) << PyLong_SHIFT) | (size_t)digits2[0]));
32772 } else {
32773 for (Py_ssize_t i=size-1; i >= 0 && !cmp; --i) {
32774 cmp = (Py_ssize_t) digits1[i] - (Py_ssize_t) digits2[i];
32775 }
32776 }
32777 }
32778 if (cmp == 0) goto __pyx_return_false;
32779 if (__Pyx_PyLong_IsNeg(op1)) cmp = -cmp;
32780 }
32781 if (cmp < 0) goto __pyx_return_false; else goto __pyx_return_true;
32782#else
32783 int overflow1, overflow2;
32784 long long iop1 = PyLong_AsLongLongAndOverflow(op1, &overflow1);
32785 long long iop2 = PyLong_AsLongLongAndOverflow(op2, &overflow2);
32786 if (likely(!(overflow1 | overflow2))) {
32787 if (iop1 > iop2) goto __pyx_return_true; else goto __pyx_return_false;
32788 } else if (overflow1 != overflow2) {
32789 if (overflow1 > overflow2) goto __pyx_return_true; else goto __pyx_return_false;
32790 } else {
32791 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
32792 }
32793#endif
32794__pyx_return_true:
32795 return 1;
32796__pyx_return_false:
32797 return 0;
32798}
32799#endif
32800static CYTHON_INLINE int __Pyx_PyObject_CompareBoolGt_object_object(PyObject *op1, PyObject *op2, int pyop) {
32801 CYTHON_UNUSED_VAR(pyop);
32802 if (PyFloat_CheckExact(op1)) {
32803 if (PyFloat_CheckExact(op2)) {
32804 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32805 #if !CYTHON_ASSUME_SAFE_MACROS
32806 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
32807 #endif
32808 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
32809 #if !CYTHON_ASSUME_SAFE_MACROS
32810 if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
32811 #endif
32812 if (float_op1 > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
32813 }
32814 if (PyLong_CheckExact(op2)) {
32815 return __Pyx_PyObject_CompareFloatIntBoolGt(op1, op2);
32816 }
32817 goto __pyx_richcmp;
32818 }
32819 if (PyLong_CheckExact(op1)) {
32820 if (op1 == op2) goto __pyx_return_false;
32821 if (PyLong_CheckExact(op2)) {
32822 return __Pyx_PyObject_CompareIntIntBoolGt(op1, op2);
32823 }
32824 if (PyFloat_CheckExact(op2)) {
32825 return __Pyx_PyObject_CompareIntFloatBoolGt(op1, op2);
32826 }
32827 goto __pyx_richcmp;
32828 }
32829
32830 if (PyUnicode_CheckExact(op1)) {
32831 if (op1 == op2) goto __pyx_return_false;
32832 if (PyUnicode_CheckExact(op2)) {
32833 return __Pyx_PyObject_CompareStrStrBoolGt(op1, op2);
32834 }
32835 goto __pyx_richcmp;
32836 }
32837
32838 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32839 if (PyBytes_CheckExact(op1)) {
32840 if (op1 == op2) goto __pyx_return_false;
32841 if (PyBytes_CheckExact(op2)) {
32842 return __Pyx_PyObject_ComparePyBytesPyBytesBoolGt(op1, op2);
32843 }
32844 if (PyByteArray_CheckExact(op2)) {
32845 return __Pyx_PyObject_ComparePyBytesPyByteArrayBoolGt(op1, op2);
32846 }
32847 goto __pyx_richcmp;
32848 }
32849 #endif
32850 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32851 if (PyByteArray_CheckExact(op1)) {
32852 if (op1 == op2) goto __pyx_return_false;
32853 if (PyByteArray_CheckExact(op2)) {
32854 return __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolGt(op1, op2);
32855 }
32856 if (PyBytes_CheckExact(op2)) {
32857 return __Pyx_PyObject_ComparePyByteArrayPyBytesBoolGt(op1, op2);
32858 }
32859 goto __pyx_richcmp;
32860 }
32861 #endif
32862 if ((0)) goto __pyx_richcmp;
32863 if ((0)) goto __pyx_return_true;
32864 if ((0)) goto __pyx_return_false;
32865__pyx_richcmp:
32866 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
32867__pyx_return_true:
32868 return 1;
32869__pyx_return_false:
32870 return 0;
32871}
32872
32873/* PyNumberBinop */
32874#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
32875#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32876#ifndef __Pyx_DEFINED_BinopTypeError
32877#define __Pyx_DEFINED_BinopTypeError
32878static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
32879 char opname[4] = {op[0], op[1], 0, 0};
32880 if (inplace) {
32881 opname[op[1] ? 2 : 1] = '=';
32882 }
32883 __Pyx_RaiseErrorWithObjectTypes1(
32884 PyExc_TypeError,
32885 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
32886 opname, op1, op2);
32887}
32888#endif
32889#endif
32890#ifndef __Pyx_DEFINED_PyNumber_Subtract_xfloat_object
32891#define __Pyx_DEFINED_PyNumber_Subtract_xfloat_object
32892static PyObject* __Pyx_PyNumber_Subtract_xfloat_object(PyObject *op1, PyObject *op2, int inplace) {
32893 if (PyLong_CheckExact(op2)) {
32894 double int_op2;
32895 #if CYTHON_USE_PYLONG_INTERNALS
32896 if (__Pyx_PyLong_IsCompact(op2)) {
32897 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
32898 if (compact_op2 == 0) return __Pyx_NewRef(op1);
32899 int_op2 = (double) compact_op2;
32900 } else
32901 #endif
32902 {
32903 int_op2 = PyLong_AsDouble(op2);
32904 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
32905 #if !CYTHON_USE_PYLONG_INTERNALS
32906 if (int_op2 == 0.) return __Pyx_NewRef(op1);
32907 #endif
32908 }
32909 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32910 #if !CYTHON_ASSUME_SAFE_MACROS
32911 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
32912 #endif
32913 return PyFloat_FromDouble(float_op1 - int_op2);
32914 }
32915 if (PyLong_Check(op2)) {
32916 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_subtract, binaryfunc);
32917 if (likely(slot_func)) {
32918 return slot_func(op1, op2);
32919 }
32920 }
32921 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32922 {
32923 PyTypeObject *type_op2 = Py_TYPE(op2);
32924 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_subtract, binaryfunc);
32925 if (likely(slot_func)) {
32926 PyObject *result = slot_func(op1, op2);
32927 if (likely(result != Py_NotImplemented)) {
32928 return result;
32929 }
32930 Py_DECREF(result);
32931 }
32932 __Pyx_BinopTypeError(op1, op2, "-", inplace);
32933 return NULL;
32934 }
32935 #else
32936 return (inplace) ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2);
32937 #endif
32938}
32939#endif
32940#ifndef __Pyx_DEFINED_PyNumber_Subtract_xint_object
32941#define __Pyx_DEFINED_PyNumber_Subtract_xint_object
32942static PyObject* __Pyx_PyNumber_Subtract_xint_object(PyObject *op1, PyObject *op2, int inplace) {
32943 if (PyFloat_CheckExact(op2)) {
32944 double int_op1;
32945 #if CYTHON_USE_PYLONG_INTERNALS
32946 if (__Pyx_PyLong_IsCompact(op1)) {
32947 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
32948 int_op1 = (double) compact_op1;
32949 } else
32950 #endif
32951 {
32952 int_op1 = PyLong_AsDouble(op1);
32953 if (unlikely((int_op1 == -1.) && PyErr_Occurred())) return NULL;
32954 }
32955 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
32956 #if !CYTHON_ASSUME_SAFE_MACROS
32957 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
32958 #endif
32959 return PyFloat_FromDouble(int_op1 - float_op2);
32960 }
32961 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32962 {
32963 PyTypeObject *type_op2 = Py_TYPE(op2);
32964 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_subtract, binaryfunc);
32965 if (likely(slot_func)) {
32966 PyObject *result = slot_func(op1, op2);
32967 if (likely(result != Py_NotImplemented)) {
32968 return result;
32969 }
32970 Py_DECREF(result);
32971 }
32972 __Pyx_BinopTypeError(op1, op2, "-", inplace);
32973 return NULL;
32974 }
32975 #else
32976 return (inplace) ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2);
32977 #endif
32978}
32979#endif
32980static CYTHON_INLINE PyObject* __Pyx__PyNumber_Subtract_object_object(PyObject *op1, PyObject *op2, int inplace) {
32981 if (PyFloat_CheckExact(op1)) {
32982 if (PyFloat_CheckExact(op2)) {
32983 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
32984 #if !CYTHON_ASSUME_SAFE_MACROS
32985 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
32986 #endif
32987 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32988 #if !CYTHON_ASSUME_SAFE_MACROS
32989 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
32990 #endif
32991 return PyFloat_FromDouble(float_op1 - float_op2);
32992 }
32993 return __Pyx_PyNumber_Subtract_xfloat_object(op1, op2, inplace);
32994 }
32995 if (PyLong_CheckExact(op1)) {
32996 if (PyLong_CheckExact(op2)) {
32997 #if CYTHON_USE_PYLONG_INTERNALS
32998 if (__Pyx_PyLong_IsCompact(op1)) {
32999 Py_ssize_t int_op1 = __Pyx_PyLong_CompactValue(op1);
33000 if (__Pyx_PyLong_IsCompact(op2)) {
33001 Py_ssize_t int_op2 = __Pyx_PyLong_CompactValue(op2);
33002 if (int_op2 == 0) return __Pyx_NewRef(op1);
33003 return PyLong_FromSsize_t(int_op1 - int_op2);
33004 }
33005 }
33006 else if (__Pyx_PyLong_IsZero(op2)) return __Pyx_NewRef(op1);
33007 #endif
33008 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_subtract, binaryfunc);
33009 if (likely(slot_func)) {
33010 return slot_func(op1, op2);
33011 }
33012 }
33013 return __Pyx_PyNumber_Subtract_xint_object(op1, op2, inplace);
33014 }
33015 return (inplace) ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2);
33016}
33017#endif
33018
33019/* SliceObject */
33020static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
33021 Py_ssize_t cstart, Py_ssize_t cstop,
33022 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
33023 int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
33024#if CYTHON_USE_TYPE_SLOTS
33025 PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
33026 if (likely(mp && mp->mp_subscript))
33027#else
33028 if ((1))
33029#endif
33030 {
33031 PyObject* result;
33032 PyObject *py_slice, *py_start, *py_stop;
33033 if (_py_slice) {
33034 py_slice = *_py_slice;
33035 } else {
33036 PyObject* owned_start = NULL;
33037 PyObject* owned_stop = NULL;
33038 if (_py_start) {
33039 py_start = *_py_start;
33040 } else {
33041 if (has_cstart) {
33042 owned_start = py_start = PyLong_FromSsize_t(cstart);
33043 if (unlikely(!py_start)) goto bad;
33044 } else
33045 py_start = Py_None;
33046 }
33047 if (_py_stop) {
33048 py_stop = *_py_stop;
33049 } else {
33050 if (has_cstop) {
33051 owned_stop = py_stop = PyLong_FromSsize_t(cstop);
33052 if (unlikely(!py_stop)) {
33053 Py_XDECREF(owned_start);
33054 goto bad;
33055 }
33056 } else
33057 py_stop = Py_None;
33058 }
33059 py_slice = PySlice_New(py_start, py_stop, Py_None);
33060 Py_XDECREF(owned_start);
33061 Py_XDECREF(owned_stop);
33062 if (unlikely(!py_slice)) goto bad;
33063 }
33064#if CYTHON_USE_TYPE_SLOTS
33065 result = mp->mp_subscript(obj, py_slice);
33066#else
33067 result = PyObject_GetItem(obj, py_slice);
33068#endif
33069 if (!_py_slice) {
33070 Py_DECREF(py_slice);
33071 }
33072 return result;
33073 } else {
33074 __Pyx_RaiseTypeErrorWithObjectType(
33075 "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj);
33076 }
33077bad:
33078 return NULL;
33079}
33080
33081/* pybuiltin_invalid (used by pyint_simplify) */
33082static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *builtin_type_name, const char *argname) {
33083 __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
33084 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
33085 if (unlikely(!obj_type_name)) return;
33086 #endif
33087 if (argname) {
33088 PyErr_Format(PyExc_TypeError,
33089 "Argument '%.200s' has incorrect type (expected %.5s, got " __Pyx_FMT_TYPENAME ")",
33090 argname, builtin_type_name, obj_type_name
33091 );
33092 } else {
33093 PyErr_Format(PyExc_TypeError,
33094 "Expected %.5s, got " __Pyx_FMT_TYPENAME,
33095 builtin_type_name, obj_type_name
33096 );
33097 }
33098 __Pyx_DECREF_TypeName(obj_type_name);
33099}
33100
33101/* pyint_simplify */
33102static int __Pyx__PyInt_FromNumber(PyObject **number_var, const char *argname);
33103static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none) {
33104 PyObject *number = *number_var;
33105 if (likely((accept_none && number == Py_None) || PyLong_CheckExact(number))) {
33106 return 0;
33107 }
33108 return __Pyx__PyInt_FromNumber(number_var, argname);
33109}
33110static int __Pyx__PyInt_FromNumber(PyObject **number_var, const char *argname) {
33111 PyObject *number = *number_var;
33112 PyObject *int_object;
33113 if (likely(PyNumber_Check(number))) {
33114 int_object = PyNumber_Long(number);
33115 if (unlikely(!int_object)) goto bad;
33116 } else {
33117 __Pyx_PyBuiltin_Invalid(number, "int", argname);
33118 goto bad;
33119 }
33120 *number_var = int_object;
33121 Py_DECREF(number);
33122 return 0;
33123bad:
33124 *number_var = NULL;
33125 Py_DECREF(number);
33126 return -1;
33127}
33128
33129/* AllocateExtensionType */
33130static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
33131 if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
33132 allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
33133 return alloc_func(t, 0);
33134 } else {
33135 newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
33136 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33137 if (!tp_new) {
33138 PyObject *new_str = PyUnicode_FromString("__new__");
33139 if (likely(new_str)) {
33140 PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
33141 Py_DECREF(new_str);
33142 return o;
33143 } else
33144 return NULL;
33145 } else
33146 #endif
33147 return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
33148 }
33149}
33150
33151/* CallSlotAsVectorcallUnpackDict (used by CallSlotAsVectorcall) */
33152static CYTHON_INLINE int __Pyx_CallSlotAsVectorcallUnpackDict(Py_ssize_t args_size, PyObject *keys_dict, PyObject **args, PyObject *kwnames) {
33153 Py_ssize_t pos = 0, i = 0;
33154 PyObject *key, *value;
33155 while (PyDict_Next(keys_dict, &pos, &key, &value)) {
33156 Py_INCREF(value);
33157 args[args_size+i] = value;
33158 Py_INCREF(key);
33159 if (unlikely(__Pyx_PyTuple_SET_ITEM(kwnames, i, key) == -1)) {
33160 return -1;
33161 }
33162 ++i;
33163 }
33164 return 0;
33165}
33166
33167/* CallSlotAsVectorcall */
33168#if CYTHON_VECTORCALL_TPNEW
33169static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k) {
33170 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
33171#if !CYTHON_ASSUME_SAFE_SIZE
33172 if (unlikely(k_size < 0)) return NULL;
33173#endif
33174 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
33175#if !CYTHON_ASSUME_SAFE_SIZE
33176 if (unlikely(a_size < 0)) return NULL;
33177#endif
33178#if CYTHON_ASSUME_SAFE_MACROS
33179 if (k_size == 0) {
33180 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
33181 }
33182#else
33183 if (k_size == 0 && a_size == 0) {
33184 return f(o, NULL, 0, NULL);
33185 }
33186#endif
33187 PyObject *stack_args[5];
33188 PyObject **args = stack_args;
33189 Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
33190 if (a_size > maxnargs - k_size) {
33191 PyErr_NoMemory();
33192 return NULL;
33193 }
33194 Py_ssize_t total_size = a_size + k_size;
33195 if (total_size > 5) {
33196 args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
33197 if (unlikely(!args)) {
33198 PyErr_NoMemory();
33199 return NULL;
33200 }
33201 }
33202 PyObject * result = NULL;
33203 PyObject *kwnames = NULL;
33204 int unpack_dict_result;
33205 Py_ssize_t i = 0;
33206 for (; i < a_size; ++i) {
33207 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
33208#if !CYTHON_ASSUME_SAFE_MACROS
33209 if (unlikely(!args[i])) goto cleanup;
33210#endif
33211 }
33212#if !CYTHON_ASSUME_SAFE_MACROS
33213 if (k) // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
33214#endif
33215 {
33216 kwnames = PyTuple_New(k_size);
33217 if (unlikely(!kwnames)) goto cleanup;
33218 __Pyx_BEGIN_CRITICAL_SECTION(k);
33219 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
33220 __Pyx_END_CRITICAL_SECTION();
33221 if (unlikely(unpack_dict_result == -1)) goto cleanup;
33222 }
33223 result = f(o, args, a_size, kwnames);
33224 cleanup:
33225 Py_XDECREF(kwnames);
33226 for (i=a_size; i<total_size; ++i) {
33227 Py_XDECREF(args[i]);
33228 }
33229 if (args != stack_args) {
33230 PyMem_Free(args);
33231 }
33232 return result;
33233}
33234#endif
33235
33236/* CallNewInitFromVectorcall */
33237#if CYTHON_VECTORCALL_TPNEW
33238static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
33239 newfunc tp_new = __Pyx_PyType_GetSlot(t, tp_new, newfunc);
33240 if (unlikely(!tp_new)) {
33241 __Pyx_RaiseErrorWithType(PyExc_TypeError, "cannot create " __Pyx_FMT_TYPENAME " instances", t);
33242 return NULL;
33243 }
33244 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
33245 PyObject *result = NULL, *args_tuple = NULL, *kwds_dict = NULL;
33246 Py_ssize_t kw_size = kwnames ? __Pyx_PyTuple_GET_SIZE(kwnames) : 0;
33247#if !CYTHON_ASSUME_SAFE_SIZE
33248 if (unlikely(kw_size == -1)) {
33249 return NULL;
33250 }
33251#endif
33252 if (kw_size) {
33253 kwds_dict = __Pyx_PyDict_NewPresized(kw_size);
33254 if (unlikely(!kwds_dict)) {
33255 return NULL;
33256 }
33257 for (Py_ssize_t i=0; i<kw_size; ++i) {
33258 PyObject *v = args[nargs + i];
33259 PyObject *k = __Pyx_PyTuple_GET_ITEM(kwnames, i);
33260#if !CYTHON_ASSUME_SAFE_MACROS
33261 if (unlikely(!k)) {
33262 goto end;
33263 }
33264#endif
33265 if (unlikely(PyDict_SetItem(kwds_dict, k, v) < 0)) {
33266 goto end;
33267 }
33268 }
33269 }
33270 if (nargs) {
33271 args_tuple = __Pyx_PyTuple_FromArray(args, nargs);
33272 if (unlikely(!args_tuple)) {
33273 goto end;
33274 }
33275 } else {
33276 args_tuple = __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
33277 }
33278 result = tp_new(t, args_tuple, kwds_dict);
33279 if (unlikely(!result)) {
33280 goto end;
33281 }
33282 if (PyObject_TypeCheck(result, t)) {
33283 initproc tp_init = __Pyx_PyObject_GetSlot(result, tp_init, initproc);
33284 if (tp_init && unlikely(tp_init(result, args_tuple, kwds_dict) < 0)) {
33285 Py_CLEAR(result);
33286 }
33287 }
33288 end:
33289 Py_XDECREF(args_tuple);
33290 Py_XDECREF(kwds_dict);
33291 return result;
33292}
33293#endif
33294
33295/* CallSlotAsVectorcall */
33296#if CYTHON_VECTORCALL_TPNEW
33297static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k) {
33298 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
33299#if !CYTHON_ASSUME_SAFE_SIZE
33300 if (unlikely(k_size < 0)) return -1;
33301#endif
33302 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
33303#if !CYTHON_ASSUME_SAFE_SIZE
33304 if (unlikely(a_size < 0)) return -1;
33305#endif
33306#if CYTHON_ASSUME_SAFE_MACROS
33307 if (k_size == 0) {
33308 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
33309 }
33310#else
33311 if (k_size == 0 && a_size == 0) {
33312 return f(o, NULL, 0, NULL);
33313 }
33314#endif
33315 PyObject *stack_args[5];
33316 PyObject **args = stack_args;
33317 Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
33318 if (a_size > maxnargs - k_size) {
33319 PyErr_NoMemory();
33320 return -1;
33321 }
33322 Py_ssize_t total_size = a_size + k_size;
33323 if (total_size > 5) {
33324 args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
33325 if (unlikely(!args)) {
33326 PyErr_NoMemory();
33327 return -1;
33328 }
33329 }
33330 int result = -1;
33331 PyObject *kwnames = NULL;
33332 int unpack_dict_result;
33333 Py_ssize_t i = 0;
33334 for (; i < a_size; ++i) {
33335 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
33336#if !CYTHON_ASSUME_SAFE_MACROS
33337 if (unlikely(!args[i])) goto cleanup;
33338#endif
33339 }
33340#if !CYTHON_ASSUME_SAFE_MACROS
33341 if (k) // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
33342#endif
33343 {
33344 kwnames = PyTuple_New(k_size);
33345 if (unlikely(!kwnames)) goto cleanup;
33346 __Pyx_BEGIN_CRITICAL_SECTION(k);
33347 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
33348 __Pyx_END_CRITICAL_SECTION();
33349 if (unlikely(unpack_dict_result == -1)) goto cleanup;
33350 }
33351 result = f(o, args, a_size, kwnames);
33352 cleanup:
33353 Py_XDECREF(kwnames);
33354 for (i=a_size; i<total_size; ++i) {
33355 Py_XDECREF(args[i]);
33356 }
33357 if (args != stack_args) {
33358 PyMem_Free(args);
33359 }
33360 return result;
33361}
33362#endif
33363
33364/* CallTypeTraverse */
33365#if !CYTHON_USE_TYPE_SPECS
33366#else
33367static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
33368 if (!always_call) {
33369 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
33370 unsigned long flags = PyType_GetFlags(base);
33371 if (flags & Py_TPFLAGS_HEAPTYPE) {
33372 return 0;
33373 }
33374 }
33375 Py_VISIT((PyObject*)Py_TYPE(o));
33376 return 0;
33377}
33378#endif
33379
33380/* PyObjectCallMethod0 (used by PyType_Ready) */
33381static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
33382#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
33383 return PyObject_VectorcallMethod(method_name, &obj, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
33384#elif CYTHON_COMPILING_IN_LIMITED_API
33385 return PyObject_CallMethodObjArgs(obj, method_name, NULL);
33386#else
33387 return PyObject_CallMethodNoArgs(obj, method_name);
33388#endif
33389}
33390
33391/* GetTypeDictOffset (used by ValidateBasesTuple) */
33392#if !CYTHON_USE_TYPE_SLOTS
33393CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result) {
33394 PyObject *tp_dictoffset_o;
33395 Py_ssize_t tp_dictoffset;
33396 tp_dictoffset_o = PyObject_GetAttrString(tp, "__dictoffset__");
33397 if (unlikely(!tp_dictoffset_o)) return -1;
33398 tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
33399 Py_DECREF(tp_dictoffset_o);
33400 if (unlikely(require_cython_valid_result && tp_dictoffset == 0)) {
33401 PyErr_SetString(
33402 PyExc_TypeError,
33403 "'type' doesn't have a dictoffset");
33404 return -1;
33405 } else if (unlikely(require_cython_valid_result && tp_dictoffset < 0)) {
33406 PyErr_SetString(
33407 PyExc_TypeError,
33408 "'type' has an unexpected negative dictoffset. "
33409 "Please report this as Cython bug");
33410 return -1;
33411 }
33412 return tp_dictoffset;
33413}
33414#endif
33415
33416/* ValidateBasesTuple (used by PyType_Ready) */
33417#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
33418static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases) {
33419 Py_ssize_t i, n;
33420#if CYTHON_ASSUME_SAFE_SIZE
33421 n = PyTuple_GET_SIZE(bases);
33422#else
33423 n = PyTuple_Size(bases);
33424 if (unlikely(n < 0)) return -1;
33425#endif
33426 if (!has_dictoffset) {
33427 PyObject *b;
33428#if CYTHON_AVOID_BORROWED_REFS
33429 b = PySequence_GetItem(bases, 0);
33430 if (!b) return -1;
33431#elif CYTHON_ASSUME_SAFE_MACROS
33432 b = PyTuple_GET_ITEM(bases, 0);
33433#else
33434 b = PyTuple_GetItem(bases, 0);
33435 if (!b) return -1;
33436#endif
33437#if CYTHON_USE_TYPE_SLOTS
33438 has_dictoffset = ((PyTypeObject*)b)->tp_dictoffset != 0;
33439#else
33440 Py_ssize_t dictoffset = __Pyx_GetTypeDictOffset(b, 0);
33441 has_dictoffset = dictoffset != 0;
33442#endif
33443#if CYTHON_AVOID_BORROWED_REFS
33444 Py_DECREF(b);
33445#endif
33446#if !CYTHON_USE_TYPE_SLOTS
33447 if (dictoffset == -1 && PyErr_Occurred()) return -1;
33448#endif
33449 }
33450 for (i = 1; i < n; i++)
33451 {
33452 PyTypeObject *b;
33453#if CYTHON_AVOID_BORROWED_REFS
33454 PyObject *b0 = PySequence_GetItem(bases, i);
33455 if (!b0) return -1;
33456#elif CYTHON_ASSUME_SAFE_MACROS
33457 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
33458#else
33459 PyObject *b0 = PyTuple_GetItem(bases, i);
33460 if (!b0) return -1;
33461#endif
33462 b = (PyTypeObject*) b0;
33463 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
33464 {
33465 __Pyx_RaiseErrorWithType(
33466 PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b);
33467#if CYTHON_AVOID_BORROWED_REFS
33468 Py_DECREF(b0);
33469#endif
33470 return -1;
33471 }
33472 if (!has_dictoffset)
33473 {
33474 Py_ssize_t b_dictoffset = 0;
33475#if CYTHON_USE_TYPE_SLOTS
33476 b_dictoffset = b->tp_dictoffset;
33477#else
33478 b_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)b, 0);
33479 if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
33480#endif
33481 if (b_dictoffset) {
33482 __Pyx_RaiseErrorWithType1(
33483 PyExc_TypeError,
33484 "extension type '%.200s' has no __dict__ slot, "
33485 "but base type '" __Pyx_FMT_TYPENAME "' has: "
33486 "either add 'cdef dict __dict__' to the extension type "
33487 "or add '__slots__ = [...]' to the base type",
33488 type_name, b);
33489#if !CYTHON_USE_TYPE_SLOTS
33490 dictoffset_return:
33491#endif
33492#if CYTHON_AVOID_BORROWED_REFS
33493 Py_DECREF(b0);
33494#endif
33495 return -1;
33496 }
33497 }
33498#if CYTHON_AVOID_BORROWED_REFS
33499 Py_DECREF(b0);
33500#endif
33501 }
33502 return 0;
33503}
33504#endif
33505
33506/* PyType_Ready */
33507CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
33508 while (t) {
33509 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
33510 if (bases) {
33511 return 1;
33512 }
33513 t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
33514 }
33515 return 0;
33516}
33517static int __Pyx_PyType_Ready(PyTypeObject *t) {
33518#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON
33519 (void)__Pyx_PyObject_CallMethod0;
33520#if CYTHON_USE_TYPE_SPECS
33521 (void)__Pyx_validate_bases_tuple;
33522#endif
33523 return PyType_Ready(t);
33524#else
33525 int r;
33526 if (!__Pyx_PyType_HasMultipleInheritance(t)) {
33527 return PyType_Ready(t);
33528 }
33529 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
33530 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset != 0, bases) == -1))
33531 return -1;
33532 {
33533 int gc_was_enabled;
33534 #if PY_VERSION_HEX >= 0x030A00b1
33535 gc_was_enabled = PyGC_Disable();
33536 (void)__Pyx_PyObject_CallMethod0;
33537 #else
33538 PyObject *ret, *py_status;
33539 PyObject *gc = NULL;
33540 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
33541 !CYTHON_COMPILING_IN_GRAAL
33542 gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
33543 #endif
33544 if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
33545 if (unlikely(!gc)) return -1;
33546 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
33547 if (unlikely(!py_status)) {
33548 Py_DECREF(gc);
33549 return -1;
33550 }
33551 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
33552 Py_DECREF(py_status);
33553 if (gc_was_enabled > 0) {
33554 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
33555 if (unlikely(!ret)) {
33556 Py_DECREF(gc);
33557 return -1;
33558 }
33559 Py_DECREF(ret);
33560 } else if (unlikely(gc_was_enabled == -1)) {
33561 Py_DECREF(gc);
33562 return -1;
33563 }
33564 #endif
33565 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
33566#if PY_VERSION_HEX >= 0x030A0000
33567 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
33568#endif
33569 r = PyType_Ready(t);
33570 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
33571 #if PY_VERSION_HEX >= 0x030A00b1
33572 if (gc_was_enabled)
33573 PyGC_Enable();
33574 #else
33575 if (gc_was_enabled) {
33576 PyObject *tp, *v, *tb;
33577 PyErr_Fetch(&tp, &v, &tb);
33578 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
33579 if (likely(ret || r == -1)) {
33580 Py_XDECREF(ret);
33581 PyErr_Restore(tp, v, tb);
33582 } else {
33583 Py_XDECREF(tp);
33584 Py_XDECREF(v);
33585 Py_XDECREF(tb);
33586 r = -1;
33587 }
33588 }
33589 Py_DECREF(gc);
33590 #endif
33591 }
33592 return r;
33593#endif
33594}
33595
33596/* LimitedApiGetTypeTypeDict (used by DelItemOnTypeDict) */
33597#if CYTHON_COMPILING_IN_LIMITED_API
33598static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp) {
33599 static Py_ssize_t tp_dictoffset = 0;
33600 if (unlikely(tp_dictoffset == 0)) {
33601 tp_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)(&PyType_Type), 1);
33602 if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
33603 tp_dictoffset = 0; // try again next time?
33604 return NULL;
33605 }
33606 }
33607 return *(PyObject**)((char*)tp + tp_dictoffset);
33608}
33609#endif
33610
33611/* DelItemOnTypeDict (used by SetupReduce) */
33612static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
33613 int result;
33614 PyObject *tp_dict;
33615#if CYTHON_COMPILING_IN_LIMITED_API
33616 tp_dict = __Pyx_GetTypeTypeDict(tp);
33617 if (unlikely(!tp_dict)) return -1;
33618#else
33619 tp_dict = tp->tp_dict;
33620#endif
33621 result = PyDict_DelItem(tp_dict, k);
33622 if (likely(!result)) PyType_Modified(tp);
33623 return result;
33624}
33625
33626/* SetItemOnTypeDict (used by SetupReduce) */
33627static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
33628 int result;
33629 PyObject *tp_dict;
33630#if CYTHON_COMPILING_IN_LIMITED_API
33631 tp_dict = __Pyx_GetTypeTypeDict(tp);
33632 if (unlikely(!tp_dict)) return -1;
33633#else
33634 tp_dict = tp->tp_dict;
33635#endif
33636 result = PyDict_SetItem(tp_dict, k, v);
33637 if (likely(!result)) {
33638 PyType_Modified(tp);
33639 if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
33640 PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL);
33641 if (!setNameResult) return -1;
33642 Py_DECREF(setNameResult);
33643 }
33644 }
33645 return result;
33646}
33647
33648/* SetupReduce */
33649static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
33650 int ret;
33651 PyObject *name_attr;
33652 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_2);
33653 if (likely(name_attr)) {
33654 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
33655 } else {
33656 ret = -1;
33657 }
33658 if (unlikely(ret < 0) && __Pyx_IgnoreException(PyExc_Exception)) {
33659 ret = 0; // But BaseException is still propagated.
33660 }
33661 Py_XDECREF(name_attr);
33662 return ret;
33663}
33664static PyObject *__Pyx_setup_reduce_get_reduce_attribute(PyObject *type_obj, PyObject *name, int allow_not_present) {
33665#if CYTHON_USE_PYTYPE_LOOKUP
33666 CYTHON_UNUSED_VAR(allow_not_present);
33667 return _PyType_Lookup((PyTypeObject*)type_obj, name);
33668#else
33669 if (allow_not_present) {
33670 return __Pyx_PyObject_GetAttrStrNoError(type_obj, name);
33671 } else {
33672 return __Pyx_PyObject_GetAttrStr(type_obj, name);
33673 }
33674#endif
33675}
33676static int __Pyx_setup_reduce(PyObject* type_obj) {
33677 int ret = 0;
33678 PyObject *object_reduce = NULL;
33679 PyObject *object_getstate = NULL;
33680 PyObject *object_reduce_ex = NULL;
33681 PyObject *reduce = NULL;
33682 PyObject *reduce_ex = NULL;
33683 PyObject *reduce_cython = NULL;
33684 PyObject *setstate = NULL;
33685 PyObject *setstate_cython = NULL;
33686 PyObject *getstate = NULL;
33687 getstate = __Pyx_setup_reduce_get_reduce_attribute(type_obj, __pyx_mstate_global->__pyx_n_u_getstate, 1);
33688 if (!getstate && PyErr_Occurred()) {
33689 goto __PYX_BAD;
33690 }
33691 if (getstate) {
33692 object_getstate = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate, 1);
33693 if (!object_getstate && PyErr_Occurred()) {
33694 goto __PYX_BAD;
33695 }
33696 if (object_getstate != getstate) {
33697 goto __PYX_GOOD;
33698 }
33699 }
33700 object_reduce_ex = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex, 0);
33701 if (unlikely(!object_reduce_ex)) goto __PYX_BAD;
33702 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
33703 if (reduce_ex == object_reduce_ex) {
33704 object_reduce = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce, 0);
33705 if (!object_reduce) goto __PYX_BAD;
33706 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
33707 int try_to_replace_reduce = (reduce == object_reduce);
33708 if (!try_to_replace_reduce) {
33709 try_to_replace_reduce = __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython);
33710 if (unlikely(try_to_replace_reduce < 0)) {
33711 goto __PYX_BAD;
33712 }
33713 }
33714 if (try_to_replace_reduce) {
33715 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
33716 if (likely(reduce_cython)) {
33717 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
33718 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
33719 } else if (reduce == object_reduce || PyErr_Occurred()) {
33720 goto __PYX_BAD;
33721 }
33722 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
33723 int try_to_replace_setstate;
33724 if (!setstate) {
33725 PyObject *exc = PyErr_Occurred();
33726 if (exc && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
33727 goto __PYX_BAD;
33728 }
33729 try_to_replace_setstate = 1;
33730 } else {
33731 try_to_replace_setstate = __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython);
33732 if (unlikely(try_to_replace_setstate < 0)) {
33733 goto __PYX_BAD;
33734 }
33735 }
33736 if (try_to_replace_setstate) {
33737 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
33738 if (likely(setstate_cython)) {
33739 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
33740 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
33741 } else if (!setstate || PyErr_Occurred()) {
33742 goto __PYX_BAD;
33743 }
33744 }
33745 PyType_Modified((PyTypeObject*)type_obj);
33746 }
33747 }
33748 goto __PYX_GOOD;
33749__PYX_BAD:
33750 if (!PyErr_Occurred()) {
33751 __Pyx_RaiseErrorWithType(
33752 PyExc_RuntimeError,
33753 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME,
33754 (PyTypeObject*)type_obj);
33755 }
33756 ret = -1;
33757__PYX_GOOD:
33758#if !CYTHON_USE_PYTYPE_LOOKUP
33759 Py_XDECREF(object_reduce);
33760 Py_XDECREF(object_reduce_ex);
33761 Py_XDECREF(object_getstate);
33762 Py_XDECREF(getstate);
33763#endif
33764 Py_XDECREF(reduce);
33765 Py_XDECREF(reduce_ex);
33766 Py_XDECREF(reduce_cython);
33767 Py_XDECREF(setstate);
33768 Py_XDECREF(setstate_cython);
33769 return ret;
33770}
33771
33772/* GetVTable (used by MergeVTables) */
33773static int __Pyx_GetVtable(PyTypeObject *type, void** table) {
33774 void* ptr;
33775 *table = NULL;
33776#if CYTHON_COMPILING_IN_LIMITED_API
33777 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
33778#else
33779 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
33780#endif
33781 if (!ob)
33782 goto no_attr;
33783 ptr = PyCapsule_GetPointer(ob, 0);
33784 if (!ptr && !PyErr_Occurred())
33785 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
33786 Py_DECREF(ob);
33787 *table = ptr;
33788 return 1;
33789no_attr:
33790 if (PyErr_ExceptionMatches(CYTHON_COMPILING_IN_LIMITED_API ? PyExc_AttributeError : PyExc_KeyError)) {
33791 return 0;
33792 }
33793 Py_XDECREF(ob);
33794 return -1;
33795}
33796
33797/* MergeVTables (used by SetVTable) */
33798static int __Pyx_MergeVtables(PyTypeObject *type) {
33799 int i=0;
33800 Py_ssize_t size;
33801 void** base_vtables;
33802 void* unknown = (void*)-1;
33803 PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
33804 int base_depth = 0;
33805 {
33806 PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
33807 while (base) {
33808 base_depth += 1;
33809 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
33810 }
33811 }
33812 base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
33813 if (unlikely(!base_vtables)) {
33814 PyErr_NoMemory();
33815 return -1;
33816 }
33817 base_vtables[0] = unknown;
33818#if CYTHON_COMPILING_IN_LIMITED_API
33819 size = PyTuple_Size(bases);
33820 if (size < 0) goto other_failure;
33821#else
33822 size = PyTuple_GET_SIZE(bases);
33823#endif
33824 for (i = 1; i < size; i++) {
33825 PyObject *basei;
33826 void* base_vtable;
33827#if CYTHON_AVOID_BORROWED_REFS
33828 basei = PySequence_GetItem(bases, i);
33829 if (unlikely(!basei)) goto other_failure;
33830#elif !CYTHON_ASSUME_SAFE_MACROS
33831 basei = PyTuple_GetItem(bases, i);
33832 if (unlikely(!basei)) goto other_failure;
33833#else
33834 basei = PyTuple_GET_ITEM(bases, i);
33835#endif
33836 int get_vtable_result = __Pyx_GetVtable((PyTypeObject*)basei, &base_vtable);
33837#if CYTHON_AVOID_BORROWED_REFS
33838 Py_DECREF(basei);
33839#endif
33840 if (get_vtable_result != 1) {
33841 if (get_vtable_result == -1) {
33842 goto other_failure;
33843 }
33844 PyErr_Clear(); // Class doesn't have a vtable.
33845 } else {
33846 assert(base_vtable != NULL);
33847 int j;
33848 PyTypeObject* base = __Pyx_PyType_TryGetSlot(type, tp_base, PyTypeObject*);
33849#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33850 if (!base) goto bad;
33851#endif
33852 for (j = 0; j < base_depth; j++) {
33853 if (base_vtables[j] == unknown) {
33854 switch (__Pyx_GetVtable(base, &base_vtables[j])) {
33855 case 1:
33856 assert(base_vtables[j] == NULL);
33857 break;
33858 case 0:
33859 goto bad;
33860 case -1:
33861 default:
33862 goto other_failure;
33863 }
33864 base_vtables[j + 1] = unknown;
33865 }
33866 if (base_vtables[j] == base_vtable) {
33867 break;
33868 }
33869 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
33870#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33871 if (!base) goto bad;
33872#endif
33873 }
33874 }
33875 }
33876 PyMem_Free(base_vtables);
33877 return 0;
33878bad:
33879 {
33880 PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
33881 PyTypeObject* basei;
33882#if CYTHON_AVOID_BORROWED_REFS
33883 basei = (PyTypeObject*)PySequence_GetItem(bases, i);
33884 if (unlikely(!basei)) goto other_failure;
33885#elif !CYTHON_ASSUME_SAFE_MACROS
33886 basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
33887 if (unlikely(!basei)) goto other_failure;
33888#else
33889 basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
33890#endif
33891 __Pyx_RaiseTypeErrorWithTypes(
33892 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base, basei);
33893#if CYTHON_AVOID_BORROWED_REFS
33894 Py_DECREF(basei);
33895#endif
33896 }
33897other_failure:
33898 PyMem_Free(base_vtables);
33899 return -1;
33900}
33901
33902/* SetVTable */
33903static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
33904 PyObject *ob = PyCapsule_New(vtable, 0, 0);
33905 if (unlikely(!ob))
33906 goto bad;
33907#if CYTHON_COMPILING_IN_LIMITED_API
33908 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
33909#else
33910 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
33911#endif
33912 goto bad;
33913 Py_DECREF(ob);
33914 return __Pyx_MergeVtables(type);
33915bad:
33916 Py_XDECREF(ob);
33917 return -1;
33918}
33919
33920/* ApplySequenceOrMappingFlag */
33921#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_PYPY && CYTHON_USE_TYPE_SPECS)
33922int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence) {
33923 PyObject *abc;
33924 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
33925 if (unlikely(!collections_abc)) return -1;
33926 abc = PyObject_GetAttrString(collections_abc, is_sequence ? "Sequence": "Mapping");
33927 Py_DECREF(collections_abc);
33928 if (unlikely(!abc)) return -1;
33929 PyObject *register_result = PyObject_CallMethod(abc, "register", "O", (PyObject*)tp);
33930 Py_DECREF(abc);
33931 if (unlikely(!register_result)) return -1;
33932 Py_DECREF(register_result);
33933 return 0;
33934}
33935#elif CYTHON_COMPILING_IN_PYPY // && !CYTHON_USE_TYPE_SPECS
33936int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence) {
33937 CYTHON_UNUSED_VAR(tp);
33938 CYTHON_UNUSED_VAR(is_sequence);
33939 return PyErr_WarnEx(
33940 PyExc_RuntimeWarning,
33941 "cython.collection_type only works on PyPy with the C flag CYTHON_USE_TYPE_SPECS=1",
33942 1
33943 );
33944}
33945#endif
33946
33947/* TypeImport */
33948#ifndef __PYX_HAVE_RT_ImportType_3_3_0
33949#define __PYX_HAVE_RT_ImportType_3_3_0
33950static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module, const char *module_name, const char *class_name,
33951 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
33952{
33953 PyObject *result = 0;
33954 Py_ssize_t basicsize;
33955 Py_ssize_t itemsize;
33956#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
33957 PyObject *py_basicsize;
33958 PyObject *py_itemsize;
33959#endif
33960 result = PyObject_GetAttrString(module, class_name);
33961 if (!result)
33962 goto bad;
33963 if (!PyType_Check(result)) {
33964 PyErr_Format(PyExc_TypeError,
33965 "%.200s.%.200s is not a type object",
33966 module_name, class_name);
33967 goto bad;
33968 }
33969#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
33970 basicsize = ((PyTypeObject *)result)->tp_basicsize;
33971 itemsize = ((PyTypeObject *)result)->tp_itemsize;
33972#else
33973 if (size == 0) {
33974 return (PyTypeObject *)result;
33975 }
33976 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
33977 if (!py_basicsize)
33978 goto bad;
33979 basicsize = PyLong_AsSsize_t(py_basicsize);
33980 Py_DECREF(py_basicsize);
33981 py_basicsize = 0;
33982 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
33983 goto bad;
33984 py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
33985 if (!py_itemsize)
33986 goto bad;
33987 itemsize = PyLong_AsSsize_t(py_itemsize);
33988 Py_DECREF(py_itemsize);
33989 py_itemsize = 0;
33990 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
33991 goto bad;
33992#endif
33993 if (itemsize) {
33994 if (size % alignment) {
33995 alignment = size % alignment;
33996 }
33997 if (itemsize < (Py_ssize_t)alignment)
33998 itemsize = (Py_ssize_t)alignment;
33999 }
34000 if ((size_t)(basicsize + itemsize) < size) {
34001 PyErr_Format(PyExc_ValueError,
34002 "%.200s.%.200s size changed, may indicate binary incompatibility. "
34003 "Expected %zd from C header, got %zd from PyObject",
34004 module_name, class_name, size, basicsize+itemsize);
34005 goto bad;
34006 }
34007 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
34008 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
34009 PyErr_Format(PyExc_ValueError,
34010 "%.200s.%.200s size changed, may indicate binary incompatibility. "
34011 "Expected %zd from C header, got %zd-%zd from PyObject",
34012 module_name, class_name, size, basicsize, basicsize+itemsize);
34013 goto bad;
34014 }
34015 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (size_t)basicsize > size) {
34016 if (PyErr_WarnFormat(NULL, 0,
34017 "%.200s.%.200s size changed, may indicate binary incompatibility. "
34018 "Expected %zd from C header, got %zd from PyObject",
34019 module_name, class_name, size, basicsize) < 0) {
34020 goto bad;
34021 }
34022 }
34023 return (PyTypeObject *)result;
34024bad:
34025 Py_XDECREF(result);
34026 return NULL;
34027}
34028#endif
34029
34030/* Py3UpdateBases */
34031static PyObject*
34032__Pyx_PEP560_update_bases(PyObject *bases)
34033{
34034 Py_ssize_t i, j, size_bases;
34035 PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
34036#if CYTHON_ASSUME_SAFE_SIZE
34037 size_bases = PyTuple_GET_SIZE(bases);
34038#else
34039 size_bases = PyTuple_Size(bases);
34040 if (size_bases < 0) return NULL;
34041#endif
34042 for (i = 0; i < size_bases; i++) {
34043#if CYTHON_AVOID_BORROWED_REFS
34044 Py_CLEAR(base);
34045#endif
34046#if CYTHON_ASSUME_SAFE_MACROS
34047 base = PyTuple_GET_ITEM(bases, i);
34048#else
34049 base = PyTuple_GetItem(bases, i);
34050 if (!base) goto error;
34051#endif
34052#if CYTHON_AVOID_BORROWED_REFS
34053 Py_INCREF(base);
34054#endif
34055 if (PyType_Check(base)) {
34056 if (new_bases) {
34057 if (PyList_Append(new_bases, base) < 0) {
34058 goto error;
34059 }
34060 }
34061 continue;
34062 }
34063 meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries);
34064 if (!meth && PyErr_Occurred()) {
34065 goto error;
34066 }
34067 if (!meth) {
34068 if (new_bases) {
34069 if (PyList_Append(new_bases, base) < 0) {
34070 goto error;
34071 }
34072 }
34073 continue;
34074 }
34075 new_base = __Pyx_PyObject_CallOneArg(meth, bases);
34076 Py_DECREF(meth);
34077 if (!new_base) {
34078 goto error;
34079 }
34080 if (!PyTuple_Check(new_base)) {
34081 PyErr_SetString(PyExc_TypeError,
34082 "__mro_entries__ must return a tuple");
34083 Py_DECREF(new_base);
34084 goto error;
34085 }
34086 if (!new_bases) {
34087 if (!(new_bases = PyList_New(i))) {
34088 goto error;
34089 }
34090 for (j = 0; j < i; j++) {
34091 PyObject *base_from_list;
34092#if CYTHON_ASSUME_SAFE_MACROS
34093 base_from_list = PyTuple_GET_ITEM(bases, j);
34094 PyList_SET_ITEM(new_bases, j, base_from_list);
34095 Py_INCREF(base_from_list);
34096#else
34097 base_from_list = PyTuple_GetItem(bases, j);
34098 if (!base_from_list) goto error;
34099 Py_INCREF(base_from_list);
34100 if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error;
34101#endif
34102 }
34103 }
34104#if CYTHON_ASSUME_SAFE_SIZE
34105 j = PyList_GET_SIZE(new_bases);
34106#else
34107 j = PyList_Size(new_bases);
34108 if (j < 0) goto error;
34109#endif
34110 if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
34111 goto error;
34112 }
34113 Py_DECREF(new_base);
34114 }
34115 if (!new_bases) {
34116 Py_INCREF(bases);
34117 return bases;
34118 }
34119 result = PyList_AsTuple(new_bases);
34120 Py_DECREF(new_bases);
34121#if CYTHON_AVOID_BORROWED_REFS
34122 Py_XDECREF(base);
34123#endif
34124 return result;
34125error:
34126 Py_XDECREF(new_bases);
34127#if CYTHON_AVOID_BORROWED_REFS
34128 Py_XDECREF(base);
34129#endif
34130 return NULL;
34131}
34132
34133/* CalculateMetaclass */
34134static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
34135 Py_ssize_t i, nbases;
34136#if CYTHON_ASSUME_SAFE_SIZE
34137 nbases = PyTuple_GET_SIZE(bases);
34138#else
34139 nbases = PyTuple_Size(bases);
34140 if (nbases < 0) return NULL;
34141#endif
34142 for (i=0; i < nbases; i++) {
34143 PyTypeObject *tmptype;
34144#if CYTHON_ASSUME_SAFE_MACROS
34145 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
34146#else
34147 PyObject *tmp = PyTuple_GetItem(bases, i);
34148 if (!tmp) return NULL;
34149#endif
34150 tmptype = Py_TYPE(tmp);
34151 if (!metaclass) {
34152 metaclass = tmptype;
34153 continue;
34154 }
34155 if (PyType_IsSubtype(metaclass, tmptype))
34156 continue;
34157 if (PyType_IsSubtype(tmptype, metaclass)) {
34158 metaclass = tmptype;
34159 continue;
34160 }
34161 PyErr_SetString(PyExc_TypeError,
34162 "metaclass conflict: "
34163 "the metaclass of a derived class "
34164 "must be a (non-strict) subclass "
34165 "of the metaclasses of all its bases");
34166 return NULL;
34167 }
34168 if (!metaclass) {
34169 metaclass = &PyType_Type;
34170 }
34171 Py_INCREF((PyObject*) metaclass);
34172 return (PyObject*) metaclass;
34173}
34174
34175/* dict_setdefault (used by FetchCommonType) */
34176static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
34177 PyObject* value;
34178#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
34179 PyDict_SetDefaultRef(d, key, default_value, &value);
34180#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
34181 PyObject *args[] = {d, key, default_value};
34182 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
34183#elif CYTHON_COMPILING_IN_LIMITED_API
34184 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
34185#else
34186 value = PyDict_SetDefault(d, key, default_value);
34187 if (unlikely(!value)) return NULL;
34188 Py_INCREF(value);
34189#endif
34190 return value;
34191}
34192
34193/* AddModuleRef (used by FetchSharedCythonModule) */
34194#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
34195 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
34196 PyObject *module_dict = PyImport_GetModuleDict();
34197 PyObject *m;
34198 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
34199 return NULL;
34200 }
34201 if (m != NULL && PyModule_Check(m)) {
34202 return m;
34203 }
34204 Py_XDECREF(m);
34205 m = PyModule_NewObject(name);
34206 if (m == NULL)
34207 return NULL;
34208 if (PyDict_CheckExact(module_dict)) {
34209 PyObject *new_m;
34210 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
34211 Py_DECREF(m);
34212 return new_m;
34213 } else {
34214 if (PyObject_SetItem(module_dict, name, m) != 0) {
34215 Py_DECREF(m);
34216 return NULL;
34217 }
34218 return m;
34219 }
34220 }
34221 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
34222 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
34223 return PyImport_AddModuleRef(name);
34224 }
34225 PyObject *py_name = PyUnicode_FromString(name);
34226 if (!py_name) return NULL;
34227 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
34228 Py_DECREF(py_name);
34229 return module;
34230 }
34231#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
34232 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
34233 PyObject *module = PyImport_AddModule(name);
34234 Py_XINCREF(module);
34235 return module;
34236 }
34237#endif
34238
34239/* FetchSharedCythonModule (used by FetchCommonType) */
34240static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
34241 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
34242}
34243
34244/* VerifyCachedType (used by FetchCommonType) */
34245static int __Pyx_VerifyCachedType(PyObject *cached_type,
34246 const char *name,
34247 Py_ssize_t expected_basicsize) {
34248 Py_ssize_t basicsize;
34249 if (!PyType_Check(cached_type)) {
34250 PyErr_Format(PyExc_TypeError,
34251 "Shared Cython type %.200s is not a type object", name);
34252 return -1;
34253 }
34254 if (expected_basicsize == 0) {
34255 return 0; // size is inherited, nothing useful to check
34256 }
34257#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
34258 if (expected_basicsize < 0) {
34259 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
34260 } else
34261#endif
34262 {
34263 #if CYTHON_COMPILING_IN_LIMITED_API
34264 PyObject *py_basicsize;
34265 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
34266 if (unlikely(!py_basicsize)) return -1;
34267 basicsize = PyLong_AsSsize_t(py_basicsize);
34268 Py_DECREF(py_basicsize);
34269 py_basicsize = NULL;
34270 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
34271 #else
34272 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
34273 #endif
34274 }
34275 if ((expected_basicsize >= 0) ?
34276 (basicsize != expected_basicsize) :
34277 (basicsize < -expected_basicsize)) {
34278 PyErr_Format(PyExc_TypeError,
34279 "Shared Cython type %.200s has the wrong size, try recompiling",
34280 name);
34281 return -1;
34282 }
34283 return 0;
34284}
34285
34286/* FetchCommonType (used by CommonTypesMetaclass) */
34287#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
34288static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
34289 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
34290 if (result && metaclass) {
34291 PyObject *old_tp = (PyObject*)Py_TYPE(result);
34292 Py_INCREF((PyObject*)metaclass);
34293 Py_SET_TYPE(result, metaclass);
34294 Py_DECREF(old_tp);
34295 PyType_Modified((PyTypeObject*)result);
34296 }
34297 return result;
34298}
34299#else
34300#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
34301#endif
34302static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
34303 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
34304 int get_item_ref_result;
34305 const char* object_name = strrchr(spec->name, '.');
34306 object_name = object_name ? object_name+1 : spec->name;
34307 py_object_name = PyUnicode_FromString(object_name);
34308 if (!py_object_name) return NULL;
34309 abi_module = __Pyx_FetchSharedCythonABIModule();
34310 if (!abi_module) goto done;
34311 abi_module_dict = PyModule_GetDict(abi_module);
34312 if (!abi_module_dict) goto done;
34313 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
34314 if (get_item_ref_result == 1) {
34315 if (__Pyx_VerifyCachedType(
34316 cached_type,
34317 object_name,
34318 spec->basicsize) < 0) {
34319 goto bad;
34320 }
34321 goto done;
34322 } else if (unlikely(get_item_ref_result == -1)) {
34323 goto bad;
34324 }
34325 cached_type = __Pyx_PyType_FromMetaclass(
34326 metaclass,
34327 CYTHON_USE_MODULE_STATE ? module : abi_module,
34328 spec, bases);
34329 if (unlikely(!cached_type)) goto bad;
34330 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
34331 if (unlikely(new_cached_type != cached_type)) {
34332 if (unlikely(!new_cached_type)) goto bad;
34333 Py_DECREF(cached_type);
34334 cached_type = new_cached_type;
34335 if (__Pyx_VerifyCachedType(
34336 cached_type,
34337 object_name,
34338 spec->basicsize) < 0) {
34339 goto bad;
34340 }
34341 goto done;
34342 } else {
34343 Py_DECREF(new_cached_type);
34344 }
34345done:
34346 Py_XDECREF(abi_module);
34347 Py_DECREF(py_object_name);
34348 assert(cached_type == NULL || PyType_Check(cached_type));
34349 return (PyTypeObject *) cached_type;
34350bad:
34351 Py_XDECREF(cached_type);
34352 cached_type = NULL;
34353 goto done;
34354}
34355
34356/* CommonTypesMetaclass (used by CythonFunctionShared) */
34357static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
34358 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
34359}
34360#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
34361static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
34362 PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
34363 return NULL;
34364}
34365static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
34366 PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
34367 return -1;
34368}
34369#endif
34370static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
34371 {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
34372 {0, 0, 0, 0, 0}
34373};
34374static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
34375 {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
34376 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
34377 {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
34378 {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
34379 {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
34380 #endif
34381 {0, 0}
34382};
34383static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
34384 __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
34385 0,
34386 0,
34387 Py_TPFLAGS_IMMUTABLETYPE |
34388 Py_TPFLAGS_DISALLOW_INSTANTIATION |
34389 Py_TPFLAGS_DEFAULT,
34390 __pyx_CommonTypesMetaclass_slots
34391};
34392static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
34393 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
34394 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
34395 if (unlikely(!bases)) {
34396 return -1;
34397 }
34398 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
34399 Py_DECREF(bases);
34400 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
34401 return -1;
34402 }
34403 return 0;
34404}
34405
34406/* CythonFunctionPerModule (used by CythonFunctionShared) */
34407#if CYTHON_COMPILING_IN_LIMITED_API
34408static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
34409 if (__Pyx_CyFunction_Check(func)) {
34410 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
34411 } else if (PyCFunction_Check(func)) {
34412 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
34413 }
34414 return 0;
34415}
34416static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
34417 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
34418 int result;
34419 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
34420 if (unlikely(!newFunc)) {
34421 PyErr_Clear(); // It's only an optimization, so don't throw an error
34422 return 0;
34423 }
34424 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
34425 Py_DECREF(newFunc);
34426 return result;
34427 }
34428 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
34429}
34430#else
34431static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
34432 if (PyMethod_Check(func)) {
34433 func = PyMethod_GET_FUNCTION(func);
34434 }
34435 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
34436}
34437#endif
34438static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
34439#if CYTHON_COMPILING_IN_LIMITED_API
34440 __Pyx_Py_XDECREF_SET(
34441 __Pyx__CyFunction_GetClassObj(f),
34442 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
34443#else
34444 __Pyx_Py_XDECREF_SET(
34445 ((PyCMethodObject *) (f))->mm_class,
34446 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
34447#endif
34448}
34449static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
34450 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34451 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
34452 if (unlikely(!m->defaults))
34453 return NULL;
34454 return m->defaults;
34455}
34456static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
34457 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34458 m->defaults_tuple = tuple;
34459 Py_INCREF(tuple);
34460}
34461static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
34462 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34463 m->defaults_kwdict = dict;
34464 Py_INCREF(dict);
34465}
34466static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
34467 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34468 m->func_annotations = dict;
34469 Py_INCREF(dict);
34470}
34471
34472/* PyMethodNew (used by CythonFunctionShared) */
34473#if CYTHON_COMPILING_IN_LIMITED_API
34474static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
34475 PyObject *result;
34476 CYTHON_UNUSED_VAR(typ);
34477 if (!self)
34478 return __Pyx_NewRef(func);
34479 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
34480 {
34481 PyObject *args[] = {func, self};
34482 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
34483 }
34484 #else
34485 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
34486 #endif
34487 return result;
34488}
34489#else
34490static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
34491 CYTHON_UNUSED_VAR(typ);
34492 if (!self)
34493 return __Pyx_NewRef(func);
34494 return PyMethod_New(func, self);
34495}
34496#endif
34497
34498/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
34499#if CYTHON_VECTORCALL
34500static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
34501{
34502 PyObject *res = NULL;
34503 PyObject *kwnames;
34504 PyObject **newargs;
34505 PyObject **kwvalues;
34506 Py_ssize_t i;
34507 #if CYTHON_AVOID_BORROWED_REFS
34508 PyObject *pos;
34509 #else
34510 Py_ssize_t pos;
34511 #endif
34512 size_t j;
34513 PyObject *key, *value;
34514 unsigned long keys_are_strings;
34515 #if !CYTHON_ASSUME_SAFE_SIZE
34516 Py_ssize_t nkw = PyDict_Size(kw);
34517 if (unlikely(nkw == -1)) return NULL;
34518 #else
34519 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
34520 #endif
34521 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
34522 if (unlikely(newargs == NULL)) {
34523 PyErr_NoMemory();
34524 return NULL;
34525 }
34526 for (j = 0; j < nargs; j++) newargs[j] = args[j];
34527 kwnames = PyTuple_New(nkw);
34528 if (unlikely(kwnames == NULL)) {
34529 PyMem_Free(newargs);
34530 return NULL;
34531 }
34532 kwvalues = newargs + nargs;
34533 pos = 0;
34534 i = 0;
34535 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
34536 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
34537 keys_are_strings &=
34538 #if CYTHON_COMPILING_IN_LIMITED_API
34539 PyType_GetFlags(Py_TYPE(key));
34540 #else
34541 Py_TYPE(key)->tp_flags;
34542 #endif
34543 #if !CYTHON_ASSUME_SAFE_MACROS
34544 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
34545 #else
34546 PyTuple_SET_ITEM(kwnames, i, key);
34547 #endif
34548 kwvalues[i] = value;
34549 i++;
34550 }
34551 if (unlikely(!keys_are_strings)) {
34552 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
34553 goto cleanup;
34554 }
34555 res = vc(func, newargs, nargs, kwnames);
34556cleanup:
34557 #if CYTHON_AVOID_BORROWED_REFS
34558 Py_DECREF(pos);
34559 #endif
34560 Py_DECREF(kwnames);
34561 for (i = 0; i < nkw; i++)
34562 Py_DECREF(kwvalues[i]);
34563 PyMem_Free(newargs);
34564 return res;
34565}
34566static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
34567{
34568 Py_ssize_t kw_size =
34569 likely(kw == NULL) ?
34570 0 :
34571#if !CYTHON_ASSUME_SAFE_SIZE
34572 PyDict_Size(kw);
34573#else
34574 PyDict_GET_SIZE(kw);
34575#endif
34576 if (kw_size == 0) {
34577 return vc(func, args, nargs, NULL);
34578 }
34579#if !CYTHON_ASSUME_SAFE_SIZE
34580 else if (unlikely(kw_size == -1)) {
34581 return NULL;
34582 }
34583#endif
34584 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
34585}
34586#endif
34587
34588/* CythonFunctionShared (used by CythonFunction) */
34589static PyObject *
34590__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
34591{
34592 if (unlikely(op->func_doc == NULL)) {
34593#if CYTHON_COMPILING_IN_LIMITED_API
34594 const char *doc = op->func_methoddef->ml_doc;
34595#else
34596 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
34597#endif
34598 if (doc) {
34599 op->func_doc = PyUnicode_FromString(doc);
34600 if (unlikely(op->func_doc == NULL))
34601 return NULL;
34602 } else {
34603 Py_INCREF(Py_None);
34604 return Py_None;
34605 }
34606 }
34607 Py_INCREF(op->func_doc);
34608 return op->func_doc;
34609}
34610static PyObject *
34611__Pyx_CyFunction_get_doc(PyObject *op_in, void *closure) {
34612 PyObject *result;
34613 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34614 CYTHON_UNUSED_VAR(closure);
34615 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34616 result = __Pyx_CyFunction_get_doc_locked(op);
34617 __Pyx_END_CRITICAL_SECTION();
34618 return result;
34619}
34620static int
34621__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value, void *context)
34622{
34623 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34624 CYTHON_UNUSED_VAR(context);
34625 if (value == NULL) {
34626 value = Py_None;
34627 }
34628 Py_INCREF(value);
34629 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34630 __Pyx_Py_XDECREF_SET(op->func_doc, value);
34631 __Pyx_END_CRITICAL_SECTION();
34632 return 0;
34633}
34634static PyObject *
34635__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
34636{
34637 if (unlikely(op->func_name == NULL)) {
34638#if CYTHON_COMPILING_IN_LIMITED_API
34639 const char *name = op->func_methoddef->ml_name;
34640#else
34641 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
34642#endif
34643 op->func_name = PyUnicode_InternFromString(name);
34644 if (unlikely(op->func_name == NULL))
34645 return NULL;
34646 }
34647 Py_INCREF(op->func_name);
34648 return op->func_name;
34649}
34650static PyObject *
34651__Pyx_CyFunction_get_name(PyObject *op, void *context)
34652{
34653 PyObject *result = NULL;
34654 CYTHON_UNUSED_VAR(context);
34655 __Pyx_BEGIN_CRITICAL_SECTION(op);
34656 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
34657 __Pyx_END_CRITICAL_SECTION();
34658 return result;
34659}
34660static int
34661__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value, void *context)
34662{
34663 CYTHON_UNUSED_VAR(context);
34664 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
34665 PyErr_SetString(PyExc_TypeError,
34666 "__name__ must be set to a string object");
34667 return -1;
34668 }
34669 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34670 Py_INCREF(value);
34671 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34672 __Pyx_Py_XDECREF_SET(op->func_name, value);
34673 __Pyx_END_CRITICAL_SECTION();
34674 return 0;
34675}
34676static PyObject *
34677__Pyx_CyFunction_get_qualname(PyObject *op_in, void *context)
34678{
34679 CYTHON_UNUSED_VAR(context);
34680 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34681 PyObject *result;
34682 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34683 Py_INCREF(op->func_qualname);
34684 result = op->func_qualname;
34685 __Pyx_END_CRITICAL_SECTION();
34686 return result;
34687}
34688static int
34689__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value, void *context)
34690{
34691 CYTHON_UNUSED_VAR(context);
34692 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
34693 PyErr_SetString(PyExc_TypeError,
34694 "__qualname__ must be set to a string object");
34695 return -1;
34696 }
34697 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34698 Py_INCREF(value);
34699 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34700 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
34701 __Pyx_END_CRITICAL_SECTION();
34702 return 0;
34703}
34704#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34705static PyObject *
34706__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
34707{
34708 CYTHON_UNUSED_VAR(context);
34709 if (unlikely(op->func_dict == NULL)) {
34710 op->func_dict = PyDict_New();
34711 if (unlikely(op->func_dict == NULL))
34712 return NULL;
34713 }
34714 Py_INCREF(op->func_dict);
34715 return op->func_dict;
34716}
34717#endif
34718static PyObject *
34719__Pyx_CyFunction_get_globals(PyObject *op_in, void *context)
34720{
34721 CYTHON_UNUSED_VAR(context);
34722 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34723 Py_INCREF(op->func_globals);
34724 return op->func_globals;
34725}
34726static PyObject *
34727__Pyx_CyFunction_get_closure(PyObject *op, void *context)
34728{
34729 CYTHON_UNUSED_VAR(op);
34730 CYTHON_UNUSED_VAR(context);
34731 Py_INCREF(Py_None);
34732 return Py_None;
34733}
34734static PyObject *
34735__Pyx_CyFunction_get_code(PyObject *op_in, void *context)
34736{
34737 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34738 PyObject* result = (op->func_code) ? op->func_code : Py_None;
34739 CYTHON_UNUSED_VAR(context);
34740 Py_INCREF(result);
34741 return result;
34742}
34743static int
34744__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
34745 int result = 0;
34746 PyObject *res = op->defaults_getter(op_obj);
34747 if (unlikely(!res))
34748 return -1;
34749 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34750 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
34751 Py_INCREF(op->defaults_tuple);
34752 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
34753 Py_INCREF(op->defaults_kwdict);
34754 #else
34755 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
34756 if (unlikely(!op->defaults_tuple)) result = -1;
34757 else {
34758 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
34759 if (unlikely(!op->defaults_kwdict)) result = -1;
34760 }
34761 #endif
34762 Py_DECREF(res);
34763 return result;
34764}
34765static int
34766__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value, void *context) {
34767 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34768 CYTHON_UNUSED_VAR(context);
34769 if (!value) {
34770 value = Py_None;
34771 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
34772 PyErr_SetString(PyExc_TypeError,
34773 "__defaults__ must be set to a tuple object");
34774 return -1;
34775 }
34776 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
34777 "currently affect the values used in function calls", 1);
34778 Py_INCREF(value);
34779 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34780 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
34781 __Pyx_END_CRITICAL_SECTION();
34782 return 0;
34783}
34784static PyObject *
34785__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
34786 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34787 PyObject* result = op->defaults_tuple;
34788 if (unlikely(!result)) {
34789 if (op->defaults_getter) {
34790 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
34791 result = op->defaults_tuple;
34792 } else {
34793 result = Py_None;
34794 }
34795 }
34796 Py_INCREF(result);
34797 return result;
34798}
34799static PyObject *
34800__Pyx_CyFunction_get_defaults(PyObject *op, void *context) {
34801 PyObject* result = NULL;
34802 CYTHON_UNUSED_VAR(context);
34803 __Pyx_BEGIN_CRITICAL_SECTION(op);
34804 result = __Pyx_CyFunction_get_defaults_locked(op);
34805 __Pyx_END_CRITICAL_SECTION();
34806 return result;
34807}
34808static int
34809__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value, void *context) {
34810 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34811 CYTHON_UNUSED_VAR(context);
34812 if (!value) {
34813 value = Py_None;
34814 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
34815 PyErr_SetString(PyExc_TypeError,
34816 "__kwdefaults__ must be set to a dict object");
34817 return -1;
34818 }
34819 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
34820 "currently affect the values used in function calls", 1);
34821 Py_INCREF(value);
34822 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34823 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
34824 __Pyx_END_CRITICAL_SECTION();
34825 return 0;
34826}
34827static PyObject *
34828__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
34829 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34830 PyObject* result = op->defaults_kwdict;
34831 if (unlikely(!result)) {
34832 if (op->defaults_getter) {
34833 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
34834 result = op->defaults_kwdict;
34835 } else {
34836 result = Py_None;
34837 }
34838 }
34839 Py_INCREF(result);
34840 return result;
34841}
34842static PyObject *
34843__Pyx_CyFunction_get_kwdefaults(PyObject *op, void *context) {
34844 PyObject* result;
34845 CYTHON_UNUSED_VAR(context);
34846 __Pyx_BEGIN_CRITICAL_SECTION(op);
34847 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
34848 __Pyx_END_CRITICAL_SECTION();
34849 return result;
34850}
34851static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
34852static int
34853__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value, void *context) {
34854 CYTHON_UNUSED_VAR(context);
34855 if (!value || value == Py_None) {
34856 value = NULL;
34857 } else if (unlikely(!PyDict_Check(value))) {
34858 PyErr_SetString(PyExc_TypeError,
34859 "__annotations__ must be set to a dict object");
34860 return -1;
34861 }
34862 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34863 Py_XINCREF(value);
34864 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34865 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
34866 __Pyx_END_CRITICAL_SECTION();
34867 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0)) return -1;
34868 return 0;
34869}
34870static int
34871__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
34872 /* Return 1 if the function dict exists, 0 otherwise. This cannot fail:
34873 * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
34874#if CYTHON_COMPILING_IN_PYPY
34875 *dict = PyObject_GenericGetDict(op_in, NULL);
34876#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
34877 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
34878#else
34879 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
34880 *dict = likely(dictptr) ? *dictptr : NULL;
34881#endif
34882 return *dict ? 1 : 0;
34883}
34884static int
34885__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
34886 PyObject *dict;
34887 int dict_found;
34888 *annotate = NULL;
34889 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
34890 if (!dict_found) return 0;
34891 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
34892}
34893static int
34894__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
34895 PyObject *dict;
34896 int dict_found;
34897 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
34898 if (!dict_found) return 0;
34899 if (value) {
34900 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
34901 } else {
34902#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
34903 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
34904#else
34905 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
34906 if (result == 1) {
34907 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
34908 }
34909 return result;
34910#endif
34911 }
34912}
34913static int
34914__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
34915 PyObject *dict;
34916 int result;
34917#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34918 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
34919#else
34920 dict = PyObject_GenericGetDict(op_in, NULL);
34921#endif
34922 if (unlikely(!dict)) return -1;
34923 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
34924 Py_DECREF(dict);
34925 return result;
34926}
34927static PyObject *
34928__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
34929 PyObject* result = op->func_annotations;
34930 if (unlikely(!result)) {
34931 result = PyDict_New();
34932 if (unlikely(!result)) return NULL;
34933 op->func_annotations = result;
34934 }
34935 Py_INCREF(result);
34936 return result;
34937}
34938static PyObject *
34939__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) {
34940 PyObject *annotate = NULL;
34941 PyObject *result = NULL;
34942 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34943 CYTHON_UNUSED_VAR(context);
34944 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34945 result = __Pyx_XNewRef(op->func_annotations);
34946 __Pyx_END_CRITICAL_SECTION();
34947 if (result) return result;
34948 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
34949 if (!annotate || annotate == Py_None) {
34950 Py_XDECREF(annotate);
34951 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34952 result = __Pyx_CyFunction_get_annotations_locked(op);
34953 __Pyx_END_CRITICAL_SECTION();
34954 return result;
34955 }
34956 PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE
34957 if (likely(format)) {
34958 if (!Py_EnterRecursiveCall(" cyfunction __annotations__.__get__")) {
34959 result = __Pyx_PyObject_CallOneArg(annotate, format);
34960 Py_LeaveRecursiveCall();
34961 Py_DECREF(format);
34962 }
34963 }
34964 Py_DECREF(annotate);
34965 if (unlikely(!result)) return NULL;
34966 if (unlikely(!PyDict_Check(result))) {
34967 PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
34968 Py_DECREF(result);
34969 return NULL;
34970 }
34971 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34972 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
34973 __Pyx_END_CRITICAL_SECTION();
34974 return result;
34975}
34976static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
34977 CYTHON_UNUSED_VAR(arg);
34978 if (unlikely(!self)) {
34979 PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
34980 return NULL;
34981 }
34982 PyObject *result;
34983 if (Py_EnterRecursiveCall(" in cyfunction annotate")) {
34984 return NULL;
34985 }
34986 result = __Pyx_CyFunction_get_annotations(self, NULL);
34987 Py_LeaveRecursiveCall();
34988 return result;
34989}
34990static PyObject *
34991__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context);
34992static int
34993__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
34994 CYTHON_UNUSED_VAR(context);
34995 if (value == NULL) {
34996 PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
34997 return -1;
34998 }
34999 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
35000 PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
35001 return -1;
35002 }
35003 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
35004#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
35005 PyCFunction cfunction = PyCFunction_GetFunction(value);
35006 if (unlikely(!cfunction)) return -1;
35007 PyObject *value_self = PyCFunction_GetSelf(value);
35008 if (unlikely(!value_self && PyErr_Occurred())) return -1;
35009#else
35010 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
35011 PyObject *value_self = PyCFunction_GET_SELF(value);
35012#endif
35013 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
35014 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
35015 }
35016 }
35017 if (value != Py_None) {
35018 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35019 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35020 Py_CLEAR(op->func_annotations);
35021 __Pyx_END_CRITICAL_SECTION();
35022 }
35023 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
35024}
35025#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35026static PyObject *
35027__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
35028 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
35029 if (is_coroutine) {
35030 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
35031 fromlist = PyList_New(1);
35032 if (unlikely(!fromlist)) return NULL;
35033 Py_INCREF(marker);
35034#if CYTHON_ASSUME_SAFE_MACROS
35035 PyList_SET_ITEM(fromlist, 0, marker);
35036#else
35037 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
35038 Py_DECREF(fromlist);
35039 return NULL;
35040 }
35041#endif
35042 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
35043 Py_DECREF(fromlist);
35044 if (unlikely(!module)) {
35045 goto ignore_or_error;
35046 }
35047 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
35048 Py_DECREF(module);
35049 if (likely(is_coroutine_value)) {
35050 return is_coroutine_value;
35051 }
35052ignore_or_error:
35053 if (!__Pyx_IgnoreException(PyExc_Exception)) {
35054 return NULL;
35055 }
35056 }
35057 return __Pyx_PyBool_FromLong(is_coroutine);
35058}
35059static PyObject *
35060__Pyx_CyFunction_get_is_coroutine(PyObject *op_in, void *context) {
35061 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35062 PyObject *result;
35063 CYTHON_UNUSED_VAR(context);
35064 if (op->func_is_coroutine) {
35065 return __Pyx_NewRef(op->func_is_coroutine);
35066 }
35067 result = __Pyx_CyFunction_get_is_coroutine_value(op);
35068 if (unlikely(!result))
35069 return NULL;
35070 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35071 if (op->func_is_coroutine) {
35072 Py_DECREF(result);
35073 result = __Pyx_NewRef(op->func_is_coroutine);
35074 } else {
35075 op->func_is_coroutine = __Pyx_NewRef(result);
35076 }
35077 __Pyx_END_CRITICAL_SECTION();
35078 return result;
35079}
35080#endif
35081static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func, const char* message, Py_ssize_t size) {
35082#if CYTHON_COMPILING_IN_LIMITED_API
35083 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
35084 if (!py_name) return;
35085 PyErr_Format(PyExc_TypeError,
35086 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
35087 py_name, message, size);
35088 Py_DECREF(py_name);
35089#else
35090 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
35091 PyErr_Format(PyExc_TypeError,
35092 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
35093 name, message, size);
35094#endif
35095}
35096static void __Pyx_CyFunction_raise_type_error(PyObject *func, const char* message) {
35097#if CYTHON_COMPILING_IN_LIMITED_API
35098 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
35099 if (!py_name) return;
35100 PyErr_Format(PyExc_TypeError,
35101 "%.200S() %s",
35102 py_name, message);
35103 Py_DECREF(py_name);
35104#else
35105 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
35106 PyErr_Format(PyExc_TypeError,
35107 "%.200s() %s",
35108 name, message);
35109#endif
35110}
35111#if CYTHON_COMPILING_IN_LIMITED_API
35112static PyObject *
35113__Pyx_CyFunction_get_module(PyObject *op_in, void *context) {
35114 CYTHON_UNUSED_VAR(context);
35115 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35116 Py_INCREF(op->func_module);
35117 return op->func_module;
35118}
35119static int
35120__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value, void *context) {
35121 CYTHON_UNUSED_VAR(context);
35122 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35123 if (value == NULL) {
35124 value = Py_None;
35125 }
35126 Py_INCREF(value);
35127 PyObject *old = op->func_module;
35128 op->func_module = value;
35129 Py_DECREF(old);
35130 return 0;
35131}
35132#endif
35133static PyGetSetDef __pyx_CyFunction_getsets[] = {
35134 {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
35135 {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
35136 {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
35137 {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
35138 {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
35139#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
35140 {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
35141 {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
35142#else
35143 {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
35144 {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
35145#endif
35146 {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
35147 {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
35148 {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
35149 {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
35150 {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
35151 {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
35152 {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
35153 {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
35154 {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
35155 {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
35156 {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
35157#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35158 {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
35159#endif
35160#if CYTHON_COMPILING_IN_LIMITED_API
35161 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
35162#endif
35163 {0, 0, 0, 0, 0}
35164};
35165static PyMemberDef __pyx_CyFunction_members[] = {
35166#if !CYTHON_COMPILING_IN_LIMITED_API
35167 {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
35168#endif
35169#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35170 {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
35171 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
35172#endif
35173#if CYTHON_VECTORCALL
35174#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
35175 {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
35176 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
35177#else
35178 {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
35179#endif
35180#if CYTHON_COMPILING_IN_LIMITED_API
35181 {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
35182 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
35183#else
35184 {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
35185#endif
35186#endif
35187 {0, 0, 0, 0, 0}
35188};
35189static PyObject *
35190__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
35191{
35192 PyObject *result = NULL;
35193 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
35194 CYTHON_UNUSED_VAR(args);
35195 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
35196 Py_INCREF(m->func_qualname);
35197 result = m->func_qualname;
35198 __Pyx_END_CRITICAL_SECTION();
35199 return result;
35200}
35201static PyMethodDef __pyx_CyFunction_methods[] = {
35202 {"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
35203 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
35204 "on Cython functions."},
35205 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
35206 {0, 0, 0, 0}
35207};
35208static PyObject *
35209__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
35210 PyObject *annotate = NULL;
35211 CYTHON_UNUSED_VAR(context);
35212 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
35213 if (annotate) return annotate;
35214 PyObject *method = PyCFunction_New(
35215 &__pyx_CyFunction_methods[0],
35216 op_in);
35217 return method;
35218}
35219#if CYTHON_COMPILING_IN_LIMITED_API
35220#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
35221#else
35222#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
35223#endif
35224static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
35225 PyMethodDef *ml, int flags, PyObject* qualname,
35226 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
35227 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
35228#if !CYTHON_COMPILING_IN_LIMITED_API
35229 PyCFunctionObject *cf = (PyCFunctionObject*) op;
35230#endif
35231 if (unlikely(op == NULL))
35232 return NULL;
35233#if CYTHON_COMPILING_IN_LIMITED_API
35234 op->func_methoddef = ml;
35235 Py_INCREF(module);
35236 op->func_module = module;
35237#endif
35238 op->flags = flags;
35239 __Pyx_CyFunction_weakreflist(op) = NULL;
35240#if !CYTHON_COMPILING_IN_LIMITED_API
35241 cf->m_ml = ml;
35242 cf->m_self = (PyObject *) op;
35243#endif
35244 Py_XINCREF(closure);
35245 op->func_closure = closure;
35246#if !CYTHON_COMPILING_IN_LIMITED_API
35247 Py_XINCREF(module);
35248 cf->m_module = module;
35249#endif
35250#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35251 op->func_dict = NULL;
35252#endif
35253 op->func_name = NULL;
35254 Py_INCREF(qualname);
35255 op->func_qualname = qualname;
35256 op->func_doc = NULL;
35257#if CYTHON_COMPILING_IN_LIMITED_API
35258 op->func_classobj = NULL;
35259#else
35260 ((PyCMethodObject*)op)->mm_class = NULL;
35261#endif
35262 op->func_globals = globals;
35263 Py_INCREF(op->func_globals);
35264 Py_XINCREF(code);
35265 op->func_code = code;
35266 op->defaults = NULL;
35267 op->defaults_tuple = NULL;
35268 op->defaults_kwdict = NULL;
35269 op->defaults_getter = NULL;
35270 op->func_annotations = NULL;
35271#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35272 op->func_is_coroutine = NULL;
35273#endif
35274#if CYTHON_VECTORCALL
35275 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
35276 case METH_NOARGS:
35277 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
35278 break;
35279 case METH_O:
35280 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
35281 break;
35282 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
35283 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
35284 break;
35285 case METH_FASTCALL | METH_KEYWORDS:
35286 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
35287 break;
35288 case METH_VARARGS | METH_KEYWORDS:
35289 __Pyx_CyFunction_func_vectorcall(op) = NULL;
35290 break;
35291 default:
35292 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
35293 Py_DECREF(op_in);
35294 return NULL;
35295 }
35296#endif
35297 return op_in;
35298}
35299static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
35300{
35301 Py_CLEAR(m->func_closure);
35302#if CYTHON_COMPILING_IN_LIMITED_API
35303 Py_CLEAR(m->func_module);
35304#else
35305 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
35306#endif
35307#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35308 Py_CLEAR(m->func_dict);
35309#elif PY_VERSION_HEX < 0x030d0000
35310 _PyObject_ClearManagedDict((PyObject*)m);
35311#else
35312 PyObject_ClearManagedDict((PyObject*)m);
35313#endif
35314 Py_CLEAR(m->func_name);
35315 Py_CLEAR(m->func_qualname);
35316 Py_CLEAR(m->func_doc);
35317 Py_CLEAR(m->func_globals);
35318 Py_CLEAR(m->func_code);
35319#if CYTHON_COMPILING_IN_LIMITED_API
35320 Py_CLEAR(m->func_classobj);
35321#else
35322 {
35323 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
35324 ((PyCMethodObject *) (m))->mm_class = NULL;
35325 Py_XDECREF(cls);
35326 }
35327#endif
35328 Py_CLEAR(m->defaults_tuple);
35329 Py_CLEAR(m->defaults_kwdict);
35330 Py_CLEAR(m->func_annotations);
35331#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35332 Py_CLEAR(m->func_is_coroutine);
35333#endif
35334 Py_CLEAR(m->defaults);
35335 return 0;
35336}
35337static int
35338__Pyx_CyFunction_clear(PyObject *m)
35339{
35340 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
35341}
35342static void __Pyx__CyFunction_dealloc(PyObject *m)
35343{
35344 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
35345 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
35346 PyObject_ClearWeakRefs(m);
35347 __Pyx__CyFunction_clear(cyfunc);
35348 __Pyx_PyHeapTypeObject_GC_Del(m);
35349}
35350static void __Pyx_CyFunction_dealloc(PyObject *m)
35351{
35352 PyObject_GC_UnTrack(m);
35353 __Pyx__CyFunction_dealloc(m);
35354}
35355static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit, void *arg)
35356{
35357 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
35358 {
35359 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
35360 if (e) return e;
35361 }
35362 Py_VISIT(m->func_closure);
35363#if CYTHON_COMPILING_IN_LIMITED_API
35364 Py_VISIT(m->func_module);
35365#else
35366 Py_VISIT(((PyCFunctionObject*)m)->m_module);
35367#endif
35368#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35369 Py_VISIT(m->func_dict);
35370#else
35371 {
35372 int e =
35373#if PY_VERSION_HEX < 0x030d0000
35374 _PyObject_VisitManagedDict
35375#else
35376 PyObject_VisitManagedDict
35377#endif
35378 ((PyObject*)m, visit, arg);
35379 if (e != 0) return e;
35380 }
35381#endif
35382 __Pyx_VISIT_CONST(m->func_name);
35383 __Pyx_VISIT_CONST(m->func_qualname);
35384 Py_VISIT(m->func_doc);
35385 Py_VISIT(m->func_globals);
35386 __Pyx_VISIT_CONST(m->func_code);
35387 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
35388 Py_VISIT(m->defaults_tuple);
35389 Py_VISIT(m->defaults_kwdict);
35390 Py_VISIT(m->func_annotations);
35391#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35392 Py_VISIT(m->func_is_coroutine);
35393#endif
35394 Py_VISIT(m->defaults);
35395 return 0;
35396}
35397static PyObject*
35398__Pyx_CyFunction_repr(PyObject *op_in)
35399{
35400 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35401 PyObject *repr;
35402 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35403 repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
35404 op->func_qualname, (void *)op);
35405 __Pyx_END_CRITICAL_SECTION();
35406 return repr;
35407}
35408static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
35409#if CYTHON_COMPILING_IN_LIMITED_API
35410 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35411 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35412 int flags = cyfunc->func_methoddef->ml_flags;
35413#else
35414 PyCFunctionObject* f = (PyCFunctionObject*)func;
35415 PyCFunction meth = f->m_ml->ml_meth;
35416 int flags = f->m_ml->ml_flags;
35417#endif
35418 Py_ssize_t size;
35419 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
35420 case METH_VARARGS:
35421 if (likely(kw == NULL || PyDict_Size(kw) == 0))
35422 return (*meth)(self, arg);
35423 break;
35424 case METH_VARARGS | METH_KEYWORDS:
35425 return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
35426 case METH_NOARGS:
35427 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
35428#if CYTHON_ASSUME_SAFE_SIZE
35429 size = PyTuple_GET_SIZE(arg);
35430#else
35431 size = PyTuple_Size(arg);
35432 if (unlikely(size < 0)) return NULL;
35433#endif
35434 if (likely(size == 0))
35435 return (*meth)(self, NULL);
35436 __Pyx_CyFunction_raise_argument_count_error(
35437 func,
35438 "takes no arguments", size);
35439 return NULL;
35440 }
35441 break;
35442 case METH_O:
35443 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
35444#if CYTHON_ASSUME_SAFE_SIZE
35445 size = PyTuple_GET_SIZE(arg);
35446#else
35447 size = PyTuple_Size(arg);
35448 if (unlikely(size < 0)) return NULL;
35449#endif
35450 if (likely(size == 1)) {
35451 PyObject *result, *arg0;
35452 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35453 arg0 = PyTuple_GET_ITEM(arg, 0);
35454 #else
35455 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
35456 #endif
35457 result = (*meth)(self, arg0);
35458 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
35459 Py_DECREF(arg0);
35460 #endif
35461 return result;
35462 }
35463 __Pyx_CyFunction_raise_argument_count_error(
35464 func,
35465 "takes exactly one argument", size);
35466 return NULL;
35467 }
35468 break;
35469 default:
35470 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
35471 return NULL;
35472 }
35473 __Pyx_CyFunction_raise_type_error(
35474 func, "takes no keyword arguments");
35475 return NULL;
35476}
35477static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
35478 PyObject *result;
35479 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
35480 return result;
35481}
35482static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
35483 PyObject *result;
35484 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35485#if CYTHON_VECTORCALL
35486 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
35487 if (vc) {
35488#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
35489 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
35490#else
35491 (void) &__Pyx_PyVectorcall_FastCallDict;
35492 return PyVectorcall_Call(func, args, kw);
35493#endif
35494 }
35495#endif
35496 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
35497 Py_ssize_t argc;
35498 PyObject *new_args;
35499 PyObject *self;
35500#if CYTHON_ASSUME_SAFE_SIZE
35501 argc = PyTuple_GET_SIZE(args);
35502#else
35503 argc = PyTuple_Size(args);
35504 if (unlikely(argc < 0)) return NULL;
35505#endif
35506 new_args = PyTuple_GetSlice(args, 1, argc);
35507 if (unlikely(!new_args))
35508 return NULL;
35509 self = PyTuple_GetItem(args, 0);
35510 if (unlikely(!self)) {
35511 Py_DECREF(new_args);
35512 PyErr_Format(PyExc_TypeError,
35513 "unbound method %.200S() needs an argument",
35514 cyfunc->func_qualname);
35515 return NULL;
35516 }
35517 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
35518 Py_DECREF(new_args);
35519 } else {
35520 result = __Pyx_CyFunction_Call(func, args, kw);
35521 }
35522 return result;
35523}
35524#if CYTHON_VECTORCALL
35525static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
35526{
35527 int ret = 0;
35528 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
35529 if (unlikely(nargs < 1)) {
35530 __Pyx_CyFunction_raise_type_error(
35531 func, "needs an argument");
35532 return -1;
35533 }
35534 ret = 1;
35535 }
35536 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
35537 __Pyx_CyFunction_raise_type_error(
35538 func, "takes no keyword arguments");
35539 return -1;
35540 }
35541 return ret;
35542}
35543static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
35544{
35545 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35546 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35547 PyObject *self;
35548#if CYTHON_COMPILING_IN_LIMITED_API
35549 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35550 if (unlikely(!meth)) return NULL;
35551#else
35552 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35553#endif
35554 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
35555 case 1:
35556 self = args[0];
35557 args += 1;
35558 nargs -= 1;
35559 break;
35560 case 0:
35561 self = func;
35562 break;
35563 default:
35564 return NULL;
35565 }
35566 if (unlikely(nargs != 0)) {
35567 __Pyx_CyFunction_raise_argument_count_error(
35568 func, "takes no arguments", nargs);
35569 return NULL;
35570 }
35571 return meth(self, NULL);
35572}
35573static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
35574{
35575 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35576 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35577 PyObject *self;
35578#if CYTHON_COMPILING_IN_LIMITED_API
35579 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35580 if (unlikely(!meth)) return NULL;
35581#else
35582 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35583#endif
35584 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
35585 case 1:
35586 self = args[0];
35587 args += 1;
35588 nargs -= 1;
35589 break;
35590 case 0:
35591 self = func;
35592 break;
35593 default:
35594 return NULL;
35595 }
35596 if (unlikely(nargs != 1)) {
35597 __Pyx_CyFunction_raise_argument_count_error(
35598 func, "takes exactly one argument", nargs);
35599 return NULL;
35600 }
35601 return meth(self, args[0]);
35602}
35603static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
35604{
35605 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35606 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35607 PyObject *self;
35608#if CYTHON_COMPILING_IN_LIMITED_API
35609 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35610 if (unlikely(!meth)) return NULL;
35611#else
35612 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35613#endif
35614 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
35615 case 1:
35616 self = args[0];
35617 args += 1;
35618 nargs -= 1;
35619 break;
35620 case 0:
35621 self = func;
35622 break;
35623 default:
35624 return NULL;
35625 }
35626 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
35627}
35628static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
35629{
35630 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35631 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
35632 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35633 PyObject *self;
35634#if CYTHON_COMPILING_IN_LIMITED_API
35635 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35636 if (unlikely(!meth)) return NULL;
35637#else
35638 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35639#endif
35640 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
35641 case 1:
35642 self = args[0];
35643 args += 1;
35644 nargs -= 1;
35645 break;
35646 case 0:
35647 self = func;
35648 break;
35649 default:
35650 return NULL;
35651 }
35652 #if PY_VERSION_HEX < 0x030e00A6
35653 size_t nargs_value = (size_t) nargs;
35654 #else
35655 Py_ssize_t nargs_value = nargs;
35656 #endif
35657 return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
35658}
35659#endif
35660static PyType_Slot __pyx_CyFunctionType_slots[] = {
35661 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
35662 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
35663 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
35664 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
35665 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
35666 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
35667 {Py_tp_members, (void *)__pyx_CyFunction_members},
35668 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
35669 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
35670 {0, 0},
35671};
35672static PyType_Spec __pyx_CyFunctionType_spec = {
35673 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
35674 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
35675 0,
35676#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
35677 Py_TPFLAGS_METHOD_DESCRIPTOR |
35678#endif
35679#if CYTHON_VECTORCALL
35680#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
35681 Py_TPFLAGS_HAVE_VECTORCALL |
35682#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
35683 _Py_TPFLAGS_HAVE_VECTORCALL |
35684#endif
35685#endif // CYTHON_VECTORCALL
35686#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
35687 Py_TPFLAGS_MANAGED_DICT |
35688#endif
35689 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
35690 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
35691 __pyx_CyFunctionType_slots
35692};
35693static int __pyx_CyFunction_init(PyObject *module) {
35694 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
35695 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
35696 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
35697 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
35698 return -1;
35699 }
35700 return 0;
35701}
35702
35703/* CythonFunction */
35704static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
35705 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
35706 (void)&__Pyx_Get_CyFunction_Type;
35707 PyObject *op = __Pyx_CyFunction_Init(
35708 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
35709 ml, flags, qualname, closure, module, globals, code
35710 );
35711 if (likely(op)) {
35712 PyObject_GC_Track(op);
35713 }
35714 return op;
35715}
35716static PyTypeObject *__Pyx_Get_CyFunction_Type(void) {
35717 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
35718 Py_INCREF((PyObject*)tp);
35719 return tp;
35720}
35721
35722/* PyObjectCall2Args (used by Py3ClassCreate) */
35723static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
35724 PyObject *args[3] = {NULL, arg1, arg2};
35725 return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
35726}
35727
35728/* Py3ClassCreate */
35729static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
35730 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
35731 PyObject *ns;
35732 if (metaclass) {
35733 PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare);
35734 if (prep) {
35735 PyObject *pargs[3] = {NULL, name, bases};
35736 ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
35737 Py_DECREF(prep);
35738 } else {
35739 if (unlikely(PyErr_Occurred()))
35740 return NULL;
35741 ns = PyDict_New();
35742 }
35743 } else {
35744 ns = PyDict_New();
35745 }
35746 if (unlikely(!ns))
35747 return NULL;
35748 if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
35749 if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
35750 if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad;
35751 return ns;
35752bad:
35753 Py_DECREF(ns);
35754 return NULL;
35755}
35756static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
35757 PyObject *dict, PyObject *mkw,
35758 int calculate_metaclass, int allow_py2_metaclass) {
35759 PyObject *result;
35760 PyObject *owned_metaclass = NULL;
35761 PyObject *margs[4] = {NULL, name, bases, dict};
35762 if (allow_py2_metaclass) {
35763 owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass);
35764 if (owned_metaclass) {
35765 metaclass = owned_metaclass;
35766 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
35767 PyErr_Clear();
35768 } else {
35769 return NULL;
35770 }
35771 }
35772 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
35773 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
35774 Py_XDECREF(owned_metaclass);
35775 if (unlikely(!metaclass))
35776 return NULL;
35777 owned_metaclass = metaclass;
35778 }
35779 result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
35780 Py_XDECREF(owned_metaclass);
35781 return result;
35782}
35783
35784/* CLineInTraceback (used by AddTraceback) */
35785#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
35786#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
35787#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
35788#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35789#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
35790#else
35791PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
35792 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
35793 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
35794}
35795#endif
35796static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
35797 PyObject *use_cline = NULL;
35798 PyObject *ptype, *pvalue, *ptraceback;
35799 PyObject *cython_runtime_dict;
35800 CYTHON_MAYBE_UNUSED_VAR(tstate);
35801 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
35802 return c_line;
35803 }
35804 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
35805 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
35806 if (likely(cython_runtime_dict)) {
35807 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
35808 use_cline, cython_runtime_dict,
35809 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
35810 }
35811 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
35812 c_line = 0;
35813 }
35814 Py_XDECREF(use_cline);
35815 Py_XDECREF(cython_runtime_dict);
35816 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
35817 return c_line;
35818}
35819#endif
35820
35821/* CodeObjectCache (used by AddTraceback) */
35822static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
35823 int start = 0, mid = 0, end = count - 1;
35824 if (end >= 0 && code_line > entries[end].code_line) {
35825 return count;
35826 }
35827 while (start < end) {
35828 mid = start + (end - start) / 2;
35829 if (code_line < entries[mid].code_line) {
35830 end = mid;
35831 } else if (code_line > entries[mid].code_line) {
35832 start = mid + 1;
35833 } else {
35834 return mid;
35835 }
35836 }
35837 if (code_line <= entries[mid].code_line) {
35838 return mid;
35839 } else {
35840 return mid + 1;
35841 }
35842}
35843static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
35844 __Pyx_CachedCodeObjectType* code_object;
35845 int pos;
35846 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
35847 return NULL;
35848 }
35849 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
35850 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
35851 return NULL;
35852 }
35853 code_object = code_cache->entries[pos].code_object;
35854 Py_INCREF(code_object);
35855 return code_object;
35856}
35857static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
35858#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
35859 (void)__pyx__find_code_object;
35860 return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
35861#else
35862 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
35863#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35864 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
35865 if (old_count < 0) {
35866 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
35867 return NULL;
35868 }
35869#endif
35870 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
35871#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35872 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
35873#endif
35874 return result;
35875#endif
35876}
35877static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
35878{
35879 int pos, i;
35880 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
35881 if (unlikely(!code_line)) {
35882 return;
35883 }
35884 if (unlikely(!entries)) {
35885 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
35886 if (likely(entries)) {
35887 code_cache->entries = entries;
35888 code_cache->max_count = 64;
35889 code_cache->count = 1;
35890 entries[0].code_line = code_line;
35891 entries[0].code_object = code_object;
35892 Py_INCREF(code_object);
35893 }
35894 return;
35895 }
35896 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
35897 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
35898 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
35899 entries[pos].code_object = code_object;
35900 Py_INCREF(code_object);
35901 Py_DECREF(tmp);
35902 return;
35903 }
35904 if (code_cache->count == code_cache->max_count) {
35905 int new_max = code_cache->max_count + 64;
35906 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
35907 code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
35908 if (unlikely(!entries)) {
35909 return;
35910 }
35911 code_cache->entries = entries;
35912 code_cache->max_count = new_max;
35913 }
35914 for (i=code_cache->count; i>pos; i--) {
35915 entries[i] = entries[i-1];
35916 }
35917 entries[pos].code_line = code_line;
35918 entries[pos].code_object = code_object;
35919 code_cache->count++;
35920 Py_INCREF(code_object);
35921}
35922static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
35923#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
35924 (void)__pyx__insert_code_object;
35925 return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
35926#else
35927 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
35928#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35929 __pyx_nonatomic_int_type expected = 0;
35930 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
35931 return;
35932 }
35933#endif
35934 __pyx__insert_code_object(code_cache, code_line, code_object);
35935#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35936 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
35937#endif
35938#endif
35939}
35940
35941/* AddTraceback */
35942#include "compile.h"
35943#include "frameobject.h"
35944#include "traceback.h"
35945#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
35946 #ifndef Py_BUILD_CORE
35947 #define Py_BUILD_CORE 1
35948 #endif
35949 #include "internal/pycore_frame.h"
35950#endif
35951#if CYTHON_COMPILING_IN_LIMITED_API
35952static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
35953 PyObject *firstlineno, PyObject *name) {
35954 PyObject *replace = NULL;
35955 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
35956 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
35957 replace = PyObject_GetAttrString(code, "replace");
35958 if (likely(replace)) {
35959 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
35960 Py_DECREF(replace);
35961 return result;
35962 }
35963 return NULL;
35964}
35965static void __Pyx_AddTraceback(const char *funcname, int c_line,
35966 int py_line, const char *filename) {
35967 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
35968 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
35969 PyObject *exc_type, *exc_value, *exc_traceback;
35970 int success = 0;
35971 if (c_line) {
35972 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
35973 }
35974 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
35975 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
35976 if (!code_object) {
35977 code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
35978 if (unlikely(!code_object)) goto bad;
35979 py_py_line = PyLong_FromLong(py_line);
35980 if (unlikely(!py_py_line)) goto bad;
35981 if (c_line) {
35982 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
35983 } else {
35984 py_funcname = PyUnicode_FromString(funcname);
35985 }
35986 if (unlikely(!py_funcname)) goto bad;
35987 dict = PyDict_New();
35988 if (unlikely(!dict)) goto bad;
35989 {
35990 PyObject *old_code_object = code_object;
35991 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
35992 Py_DECREF(old_code_object);
35993 }
35994 if (unlikely(!code_object)) goto bad;
35995 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
35996 } else {
35997 dict = PyDict_New();
35998 }
35999 getframe = PySys_GetObject("_getframe");
36000 if (unlikely(!getframe)) goto bad;
36001 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
36002 frame = PyEval_EvalCode(code_object, dict, dict);
36003 if (unlikely(!frame) || frame == Py_None) goto bad;
36004 success = 1;
36005 bad:
36006 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
36007 Py_XDECREF(code_object);
36008 Py_XDECREF(py_py_line);
36009 Py_XDECREF(py_funcname);
36010 Py_XDECREF(dict);
36011 Py_XDECREF(replace);
36012 if (success) {
36013 PyTraceBack_Here(
36014 (struct _frame*)frame);
36015 }
36016 Py_XDECREF(frame);
36017}
36018#else
36019static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
36020 const char *funcname, int c_line,
36021 int py_line, const char *filename) {
36022 PyCodeObject *py_code = NULL;
36023 PyObject *py_funcname = NULL;
36024 if (c_line) {
36025 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
36026 if (!py_funcname) goto bad;
36027 funcname = PyUnicode_AsUTF8(py_funcname);
36028 if (!funcname) goto bad;
36029 }
36030 py_code = PyCode_NewEmpty(filename, funcname, py_line);
36031 Py_XDECREF(py_funcname);
36032 return py_code;
36033bad:
36034 Py_XDECREF(py_funcname);
36035 return NULL;
36036}
36037static void __Pyx_AddTraceback(const char *funcname, int c_line,
36038 int py_line, const char *filename) {
36039 PyCodeObject *py_code = 0;
36040 PyFrameObject *py_frame = 0;
36041 PyThreadState *tstate = __Pyx_PyThreadState_Current;
36042 PyObject *ptype, *pvalue, *ptraceback;
36043 if (c_line) {
36044 c_line = __Pyx_CLineForTraceback(tstate, c_line);
36045 }
36046 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
36047 if (!py_code) {
36048 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
36049 py_code = __Pyx_CreateCodeObjectForTraceback(
36050 funcname, c_line, py_line, filename);
36051 if (!py_code) {
36052 /* If the code object creation fails, then we should clear the
36053 fetched exception references and propagate the new exception */
36054 Py_XDECREF(ptype);
36055 Py_XDECREF(pvalue);
36056 Py_XDECREF(ptraceback);
36057 goto bad;
36058 }
36059 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
36060 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
36061 }
36062 py_frame = PyFrame_New(
36063 tstate, /*PyThreadState *tstate,*/
36064 py_code, /*PyCodeObject *code,*/
36065 __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/
36066 0 /*PyObject *locals*/
36067 );
36068 if (!py_frame) goto bad;
36069 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
36070 PyTraceBack_Here(py_frame);
36071bad:
36072 Py_XDECREF(py_code);
36073 Py_XDECREF(py_frame);
36074}
36075#endif
36076
36077/* MemviewRefcount */
36078#include <stdio.h>
36079#ifndef _Py_NO_RETURN
36080#define _Py_NO_RETURN
36081#endif
36082_Py_NO_RETURN
36083static void __pyx_fatalerror(const char *fmt, ...) {
36084 va_list vargs;
36085 char msg[200];
36086#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
36087 va_start(vargs, fmt);
36088#else
36089 va_start(vargs);
36090#endif
36091 vsnprintf(msg, 200, fmt, vargs);
36092 va_end(vargs);
36093 Py_FatalError(msg);
36094}
36095static CYTHON_INLINE int
36096__pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
36097 PyThread_type_lock lock)
36098{
36099 int result;
36100 PyThread_acquire_lock(lock, 1);
36101 result = (*acquisition_count)++;
36102 PyThread_release_lock(lock);
36103 return result;
36104}
36105static CYTHON_INLINE int
36106__pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
36107 PyThread_type_lock lock)
36108{
36109 int result;
36110 PyThread_acquire_lock(lock, 1);
36111 result = (*acquisition_count)--;
36112 PyThread_release_lock(lock);
36113 return result;
36114}
36115static CYTHON_INLINE void
36116__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
36117{
36118 __pyx_nonatomic_int_type old_acquisition_count;
36119 struct __pyx_memoryview_obj *memview = memslice->memview;
36120 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
36121 return;
36122 }
36123 old_acquisition_count = __pyx_add_acquisition_count(memview);
36124 if (unlikely(old_acquisition_count <= 0)) {
36125 if (likely(old_acquisition_count == 0)) {
36126 if (have_gil) {
36127 Py_INCREF((PyObject *) memview);
36128 } else {
36129 PyGILState_STATE _gilstate = PyGILState_Ensure();
36130 Py_INCREF((PyObject *) memview);
36131 PyGILState_Release(_gilstate);
36132 }
36133 } else {
36134 __pyx_fatalerror("Acquisition count is %d (line %d)",
36135 old_acquisition_count+1, lineno);
36136 }
36137 }
36138}
36139static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
36140 int have_gil, int lineno) {
36141 __pyx_nonatomic_int_type old_acquisition_count;
36142 struct __pyx_memoryview_obj *memview = memslice->memview;
36143 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
36144 memslice->memview = NULL;
36145 return;
36146 }
36147 old_acquisition_count = __pyx_sub_acquisition_count(memview);
36148 memslice->data = NULL;
36149 if (likely(old_acquisition_count > 1)) {
36150 memslice->memview = NULL;
36151 } else if (likely(old_acquisition_count == 1)) {
36152 if (have_gil) {
36153 Py_CLEAR(memslice->memview);
36154 } else {
36155 PyGILState_STATE _gilstate = PyGILState_Ensure();
36156 Py_CLEAR(memslice->memview);
36157 PyGILState_Release(_gilstate);
36158 }
36159 } else {
36160 __pyx_fatalerror("Acquisition count is %d (line %d)",
36161 old_acquisition_count-1, lineno);
36162 }
36163}
36164
36165/* MemviewSliceIsContig */
36166static int
36167__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
36168{
36169 int i, index, step, start;
36170 Py_ssize_t itemsize = mvs.memview->view.itemsize;
36171 if (order == 'F') {
36172 step = 1;
36173 start = 0;
36174 } else {
36175 step = -1;
36176 start = ndim - 1;
36177 }
36178 for (i = 0; i < ndim; i++) {
36179 index = start + step * i;
36180 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
36181 return 0;
36182 itemsize *= mvs.shape[index];
36183 }
36184 return 1;
36185}
36186
36187/* OverlappingSlices */
36188static void
36189__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
36190 void **out_start, void **out_end,
36191 int ndim, size_t itemsize)
36192{
36193 char *start, *end;
36194 int i;
36195 start = end = slice->data;
36196 for (i = 0; i < ndim; i++) {
36197 Py_ssize_t stride = slice->strides[i];
36198 Py_ssize_t extent = slice->shape[i];
36199 if (extent == 0) {
36200 *out_start = *out_end = start;
36201 return;
36202 } else {
36203 if (stride > 0)
36204 end += stride * (extent - 1);
36205 else
36206 start += stride * (extent - 1);
36207 }
36208 }
36209 *out_start = start;
36210 *out_end = end + itemsize;
36211}
36212static int
36213__pyx_slices_overlap(__Pyx_memviewslice *slice1,
36214 __Pyx_memviewslice *slice2,
36215 int ndim, size_t itemsize)
36216{
36217 void *start1, *end1, *start2, *end2;
36218 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
36219 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
36220 return (start1 < end2) && (start2 < end1);
36221}
36222
36223/* MemviewSliceInit */
36224static int
36225__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
36226 int ndim,
36227 __Pyx_memviewslice *memviewslice,
36228 int memview_is_new_reference)
36229{
36230 __Pyx_RefNannyDeclarations
36231 int i, retval=-1;
36232 Py_buffer *buf = &memview->view;
36233 __Pyx_RefNannySetupContext("init_memviewslice", 0);
36234 if (unlikely(memviewslice->memview || memviewslice->data)) {
36235 PyErr_SetString(PyExc_ValueError,
36236 "memviewslice is already initialized!");
36237 goto fail;
36238 }
36239 if (buf->strides) {
36240 for (i = 0; i < ndim; i++) {
36241 memviewslice->strides[i] = buf->strides[i];
36242 }
36243 } else {
36244 Py_ssize_t stride = buf->itemsize;
36245 for (i = ndim - 1; i >= 0; i--) {
36246 memviewslice->strides[i] = stride;
36247 stride *= buf->shape[i];
36248 }
36249 }
36250 for (i = 0; i < ndim; i++) {
36251 memviewslice->shape[i] = buf->shape[i];
36252 if (buf->suboffsets) {
36253 memviewslice->suboffsets[i] = buf->suboffsets[i];
36254 } else {
36255 memviewslice->suboffsets[i] = -1;
36256 }
36257 }
36258 memviewslice->memview = memview;
36259 memviewslice->data = (char *)buf->buf;
36260 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
36261 Py_INCREF((PyObject*)memview);
36262 }
36263 retval = 0;
36264 goto no_fail;
36265fail:
36266 memviewslice->memview = 0;
36267 memviewslice->data = 0;
36268 retval = -1;
36269no_fail:
36270 __Pyx_RefNannyFinishContext();
36271 return retval;
36272}
36273
36274/* SliceMemoryviewSlice */
36275static void __pyx_memoryview_slice_memviewslice_err_dim(PyObject *error, const char* msg, int dim) {
36276 PyGILState_STATE gilstate = PyGILState_Ensure();
36277 PyErr_Format(error, msg, dim);
36278 PyGILState_Release(gilstate);
36279}
36280static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
36281 __Pyx_memviewslice *dst,
36282 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
36283 int dim, int new_ndim, int *suboffset_dim,
36284 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
36285 int have_start, int have_stop, int have_step,
36286 int is_slice) {
36287 if (!is_slice) {
36288 if (start < 0) {
36289 start += shape;
36290 }
36291 if (unlikely(!(0 <= start && start < shape))) {
36292 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim);
36293 return -1;
36294 }
36295 } else {
36296 int negative_step;
36297 if (have_step) {
36298 negative_step = step < 0;
36299 if (unlikely(step == 0)) {
36300 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim);
36301 return -1;
36302 }
36303 } else {
36304 negative_step = 0;
36305 step = 1;
36306 }
36307 if (have_start) {
36308 if (start < 0) {
36309 start += shape;
36310 if (start < 0) {
36311 start = 0;
36312 }
36313 } else if (start >= shape) {
36314 start = negative_step ? (shape - 1) : shape;
36315 }
36316 } else {
36317 start = negative_step ? (shape - 1) : 0;
36318 }
36319 if (have_stop) {
36320 if (stop < 0) {
36321 stop += shape;
36322 if (stop < 0) {
36323 stop = 0;
36324 }
36325 } else if (stop > shape) {
36326 stop = shape;
36327 }
36328 } else {
36329 stop = negative_step ? -1 : shape;
36330 }
36331 Py_ssize_t new_shape = (stop - start) / step;
36332 if ((stop - start) - step * new_shape) {
36333 ++new_shape;
36334 }
36335 if (new_shape < 0) {
36336 new_shape = 0;
36337 }
36338 dst->strides[new_ndim] = stride * step;
36339 dst->shape[new_ndim] = new_shape;
36340 dst->suboffsets[new_ndim] = suboffset;
36341 }
36342 if (suboffset_dim[0] < 0) {
36343 dst->data += start * stride;
36344 } else {
36345 dst->suboffsets[suboffset_dim[0]] += start * stride;
36346 }
36347 if (suboffset >= 0) {
36348 if (!is_slice) {
36349 if (likely(new_ndim == 0)) {
36350 dst->data = ((char **)(dst->data))[0] + suboffset;
36351 } else {
36352 __pyx_memoryview_slice_memviewslice_err_dim(
36353 PyExc_IndexError,
36354 "All dimensions preceding dimension %d must be indexed and not sliced",
36355 dim);
36356 return -1;
36357 }
36358 } else {
36359 suboffset_dim[0] = new_ndim;
36360 }
36361 }
36362 return 0;
36363}
36364
36365/* CIntFromPyVerify */
36366#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
36367 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
36368#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
36369 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
36370#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
36371 {\
36372 func_type value = func_value;\
36373 if (sizeof(target_type) < sizeof(func_type)) {\
36374 if (unlikely(value != (func_type) (target_type) value)) {\
36375 func_type zero = 0;\
36376 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
36377 return (target_type) -1;\
36378 if (is_unsigned && unlikely(value < zero))\
36379 goto raise_neg_overflow;\
36380 else\
36381 goto raise_overflow;\
36382 }\
36383 }\
36384 return (target_type) value;\
36385 }
36386
36387/* IsLittleEndian (used by BufferFormatCheck) */
36388static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
36389{
36390 union {
36391 uint32_t u32;
36392 uint8_t u8[4];
36393 } S;
36394 S.u32 = 0x01020304;
36395 return S.u8[0] == 4;
36396}
36397
36398/* BufferFormatCheck (used by MemviewSliceValidateAndInit) */
36399static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
36400 __Pyx_BufFmt_StackElem* stack,
36401 const __Pyx_TypeInfo* type) {
36402 stack[0].field = &ctx->root;
36403 stack[0].parent_offset = 0;
36404 ctx->root.type = type;
36405 ctx->root.name = "buffer dtype";
36406 ctx->root.offset = 0;
36407 ctx->head = stack;
36408 ctx->head->field = &ctx->root;
36409 ctx->fmt_offset = 0;
36410 ctx->head->parent_offset = 0;
36411 ctx->new_packmode = '@';
36412 ctx->enc_packmode = '@';
36413 ctx->new_count = 1;
36414 ctx->enc_count = 0;
36415 ctx->enc_type = 0;
36416 ctx->is_complex = 0;
36417 ctx->is_valid_array = 0;
36418 ctx->struct_alignment = 0;
36419 while (type->typegroup == 'S') {
36420 ++ctx->head;
36421 ctx->head->field = type->fields;
36422 ctx->head->parent_offset = 0;
36423 type = type->fields->type;
36424 }
36425}
36426static int __Pyx_BufFmt_ParseNumber(const char** ts) {
36427 int count;
36428 const char* t = *ts;
36429 if (*t < '0' || *t > '9') {
36430 return -1;
36431 } else {
36432 count = *t++ - '0';
36433 while (*t >= '0' && *t <= '9') {
36434 count *= 10;
36435 count += *t++ - '0';
36436 }
36437 }
36438 *ts = t;
36439 return count;
36440}
36441static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
36442 int number = __Pyx_BufFmt_ParseNumber(ts);
36443 if (number == -1)
36444 PyErr_Format(PyExc_ValueError,\
36445 "Does not understand character buffer dtype format string ('%c')", **ts);
36446 return number;
36447}
36448static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
36449 PyErr_Format(PyExc_ValueError,
36450 "Unexpected format string character: '%c'", ch);
36451}
36452static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
36453 switch (ch) {
36454 case '?': return "'bool'";
36455 case 'c': return "'char'";
36456 case 'b': return "'signed char'";
36457 case 'B': return "'unsigned char'";
36458 case 'h': return "'short'";
36459 case 'H': return "'unsigned short'";
36460 case 'i': return "'int'";
36461 case 'I': return "'unsigned int'";
36462 case 'l': return "'long'";
36463 case 'L': return "'unsigned long'";
36464 case 'q': return "'long long'";
36465 case 'Q': return "'unsigned long long'";
36466 case 'f': return (is_complex ? "'complex float'" : "'float'");
36467 case 'd': return (is_complex ? "'complex double'" : "'double'");
36468 case 'g': return (is_complex ? "'complex long double'" : "'long double'");
36469 case 'T': return "a struct";
36470 case 'O': return "Python object";
36471 case 'P': return "a pointer";
36472 case 's': case 'p': return "a string";
36473 case 0: return "end";
36474 default: return "unparsable format string";
36475 }
36476}
36477static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
36478 switch (ch) {
36479 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36480 case 'h': case 'H': return 2;
36481 case 'i': case 'I': case 'l': case 'L': return 4;
36482 case 'q': case 'Q': return 8;
36483 case 'f': return (is_complex ? 8 : 4);
36484 case 'd': return (is_complex ? 16 : 8);
36485 case 'g': {
36486 PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
36487 return 0;
36488 }
36489 case 'O': case 'P': return sizeof(void*);
36490 default:
36491 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36492 return 0;
36493 }
36494}
36495static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
36496 switch (ch) {
36497 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36498 case 'h': case 'H': return sizeof(short);
36499 case 'i': case 'I': return sizeof(int);
36500 case 'l': case 'L': return sizeof(long);
36501 case 'q': case 'Q': return sizeof(PY_LONG_LONG);
36502 case 'f': return sizeof(float) * (is_complex ? 2 : 1);
36503 case 'd': return sizeof(double) * (is_complex ? 2 : 1);
36504 case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
36505 case 'O': case 'P': return sizeof(void*);
36506 default: {
36507 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36508 return 0;
36509 }
36510 }
36511}
36512typedef struct { char c; short x; } __Pyx_st_short;
36513typedef struct { char c; int x; } __Pyx_st_int;
36514typedef struct { char c; long x; } __Pyx_st_long;
36515typedef struct { char c; float x; } __Pyx_st_float;
36516typedef struct { char c; double x; } __Pyx_st_double;
36517typedef struct { char c; long double x; } __Pyx_st_longdouble;
36518typedef struct { char c; void *x; } __Pyx_st_void_p;
36519typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
36520static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
36521 CYTHON_UNUSED_VAR(is_complex);
36522 switch (ch) {
36523 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36524 case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
36525 case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
36526 case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
36527 case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
36528 case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
36529 case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
36530 case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
36531 case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
36532 default:
36533 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36534 return 0;
36535 }
36536}
36537/* These are for computing the padding at the end of the struct to align
36538 on the first member of the struct. This will probably the same as above,
36539 but we don't have any guarantees.
36540 */
36541typedef struct { short x; char c; } __Pyx_pad_short;
36542typedef struct { int x; char c; } __Pyx_pad_int;
36543typedef struct { long x; char c; } __Pyx_pad_long;
36544typedef struct { float x; char c; } __Pyx_pad_float;
36545typedef struct { double x; char c; } __Pyx_pad_double;
36546typedef struct { long double x; char c; } __Pyx_pad_longdouble;
36547typedef struct { void *x; char c; } __Pyx_pad_void_p;
36548typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
36549static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
36550 CYTHON_UNUSED_VAR(is_complex);
36551 switch (ch) {
36552 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36553 case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
36554 case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
36555 case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
36556 case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
36557 case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
36558 case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
36559 case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
36560 case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
36561 default:
36562 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36563 return 0;
36564 }
36565}
36566static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
36567 switch (ch) {
36568 case 'c':
36569 return 'H';
36570 case 'b': case 'h': case 'i':
36571 case 'l': case 'q': case 's': case 'p':
36572 return 'I';
36573 case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
36574 return 'U';
36575 case 'f': case 'd': case 'g':
36576 return (is_complex ? 'C' : 'R');
36577 case 'O':
36578 return 'O';
36579 case 'P':
36580 return 'P';
36581 default: {
36582 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36583 return 0;
36584 }
36585 }
36586}
36587static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
36588 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
36589 const char* expected;
36590 const char* quote;
36591 if (ctx->head == NULL) {
36592 expected = "end";
36593 quote = "";
36594 } else {
36595 expected = ctx->head->field->type->name;
36596 quote = "'";
36597 }
36598 PyErr_Format(PyExc_ValueError,
36599 "Buffer dtype mismatch, expected %s%s%s but got %s",
36600 quote, expected, quote,
36601 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
36602 } else {
36603 const __Pyx_StructField* field = ctx->head->field;
36604 const __Pyx_StructField* parent = (ctx->head - 1)->field;
36605 PyErr_Format(PyExc_ValueError,
36606 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
36607 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
36608 parent->type->name, field->name);
36609 }
36610}
36611static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
36612 char group;
36613 size_t size, offset, arraysize = 1;
36614 if (ctx->enc_type == 0) return 0;
36615 if (ctx->head->field->type->arraysize[0]) {
36616 int i, ndim = 0;
36617 if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
36618 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
36619 ndim = 1;
36620 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
36621 PyErr_Format(PyExc_ValueError,
36622 "Expected a dimension of size %zu, got %zu",
36623 ctx->head->field->type->arraysize[0], ctx->enc_count);
36624 return -1;
36625 }
36626 }
36627 if (!ctx->is_valid_array) {
36628 PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
36629 ctx->head->field->type->ndim, ndim);
36630 return -1;
36631 }
36632 for (i = 0; i < ctx->head->field->type->ndim; i++) {
36633 arraysize *= ctx->head->field->type->arraysize[i];
36634 }
36635 ctx->is_valid_array = 0;
36636 ctx->enc_count = 1;
36637 }
36638 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
36639 do {
36640 const __Pyx_StructField* field = ctx->head->field;
36641 const __Pyx_TypeInfo* type = field->type;
36642 if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
36643 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
36644 } else {
36645 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
36646 }
36647 if (ctx->enc_packmode == '@') {
36648 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
36649 size_t align_mod_offset;
36650 if (align_at == 0) return -1;
36651 align_mod_offset = ctx->fmt_offset % align_at;
36652 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
36653 if (ctx->struct_alignment == 0)
36654 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
36655 ctx->is_complex);
36656 }
36657 if (type->size != size || type->typegroup != group) {
36658 if (type->typegroup == 'C' && type->fields != NULL) {
36659 size_t parent_offset = ctx->head->parent_offset + field->offset;
36660 ++ctx->head;
36661 ctx->head->field = type->fields;
36662 ctx->head->parent_offset = parent_offset;
36663 continue;
36664 }
36665 if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
36666 } else {
36667 __Pyx_BufFmt_RaiseExpected(ctx);
36668 return -1;
36669 }
36670 }
36671 offset = ctx->head->parent_offset + field->offset;
36672 if (ctx->fmt_offset != offset) {
36673 PyErr_Format(PyExc_ValueError,
36674 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
36675 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
36676 return -1;
36677 }
36678 ctx->fmt_offset += size;
36679 if (arraysize)
36680 ctx->fmt_offset += (arraysize - 1) * size;
36681 --ctx->enc_count;
36682 while (1) {
36683 if (field == &ctx->root) {
36684 ctx->head = NULL;
36685 if (ctx->enc_count != 0) {
36686 __Pyx_BufFmt_RaiseExpected(ctx);
36687 return -1;
36688 }
36689 break;
36690 }
36691 ctx->head->field = ++field;
36692 if (field->type == NULL) {
36693 --ctx->head;
36694 field = ctx->head->field;
36695 continue;
36696 } else if (field->type->typegroup == 'S') {
36697 size_t parent_offset = ctx->head->parent_offset + field->offset;
36698 if (field->type->fields->type == NULL) continue;
36699 field = field->type->fields;
36700 ++ctx->head;
36701 ctx->head->field = field;
36702 ctx->head->parent_offset = parent_offset;
36703 break;
36704 } else {
36705 break;
36706 }
36707 }
36708 } while (ctx->enc_count);
36709 ctx->enc_type = 0;
36710 ctx->is_complex = 0;
36711 return 0;
36712}
36713static int
36714__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
36715{
36716 const char *ts = *tsp;
36717 int i = 0, number, ndim;
36718 ++ts;
36719 if (ctx->new_count != 1) {
36720 PyErr_SetString(PyExc_ValueError,
36721 "Cannot handle repeated arrays in format string");
36722 return -1;
36723 }
36724 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
36725 ndim = ctx->head->field->type->ndim;
36726 while (*ts && *ts != ')') {
36727 switch (*ts) {
36728 case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
36729 default: break;
36730 }
36731 number = __Pyx_BufFmt_ExpectNumber(&ts);
36732 if (number == -1) return -1;
36733 if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
36734 PyErr_Format(PyExc_ValueError,
36735 "Expected a dimension of size %zu, got %d",
36736 ctx->head->field->type->arraysize[i], number);
36737 return -1;
36738 }
36739 if (*ts != ',' && *ts != ')') {
36740 PyErr_Format(PyExc_ValueError,
36741 "Expected a comma in format string, got '%c'", *ts);
36742 return -1;
36743 }
36744 if (*ts == ',') ts++;
36745 i++;
36746 }
36747 if (i != ndim) {
36748 PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
36749 ctx->head->field->type->ndim, i);
36750 return -1;
36751 }
36752 if (!*ts) {
36753 PyErr_SetString(PyExc_ValueError,
36754 "Unexpected end of format string, expected ')'");
36755 return -1;
36756 }
36757 ctx->is_valid_array = 1;
36758 ctx->new_count = 1;
36759 *tsp = ++ts;
36760 return 0;
36761}
36762static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
36763 int got_Z = 0;
36764 while (1) {
36765 switch(*ts) {
36766 case 0:
36767 if (ctx->enc_type != 0 && ctx->head == NULL) {
36768 __Pyx_BufFmt_RaiseExpected(ctx);
36769 return NULL;
36770 }
36771 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36772 if (ctx->head != NULL) {
36773 __Pyx_BufFmt_RaiseExpected(ctx);
36774 return NULL;
36775 }
36776 return ts;
36777 case ' ':
36778 case '\r':
36779 case '\n':
36780 ++ts;
36781 break;
36782 case '<':
36783 if (!__Pyx_Is_Little_Endian()) {
36784 PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
36785 return NULL;
36786 }
36787 ctx->new_packmode = '=';
36788 ++ts;
36789 break;
36790 case '>':
36791 case '!':
36792 if (__Pyx_Is_Little_Endian()) {
36793 PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
36794 return NULL;
36795 }
36796 ctx->new_packmode = '=';
36797 ++ts;
36798 break;
36799 case '=':
36800 case '@':
36801 case '^':
36802 ctx->new_packmode = *ts++;
36803 break;
36804 case 'T':
36805 {
36806 const char* ts_after_sub;
36807 size_t i, struct_count = ctx->new_count;
36808 size_t struct_alignment = ctx->struct_alignment;
36809 ctx->new_count = 1;
36810 ++ts;
36811 if (*ts != '\x7B') {
36812 PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '\x7B' after 'T'");
36813 return NULL;
36814 }
36815 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36816 ctx->enc_type = 0;
36817 ctx->enc_count = 0;
36818 ctx->struct_alignment = 0;
36819 ++ts;
36820 ts_after_sub = ts;
36821 for (i = 0; i != struct_count; ++i) {
36822 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
36823 if (!ts_after_sub) return NULL;
36824 }
36825 ts = ts_after_sub;
36826 if (struct_alignment) ctx->struct_alignment = struct_alignment;
36827 }
36828 break;
36829 case '\x7D':
36830 {
36831 size_t alignment = ctx->struct_alignment;
36832 ++ts;
36833 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36834 ctx->enc_type = 0;
36835 if (alignment && ctx->fmt_offset % alignment) {
36836 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
36837 }
36838 }
36839 return ts;
36840 case 'x':
36841 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36842 ctx->fmt_offset += ctx->new_count;
36843 ctx->new_count = 1;
36844 ctx->enc_count = 0;
36845 ctx->enc_type = 0;
36846 ctx->enc_packmode = ctx->new_packmode;
36847 ++ts;
36848 break;
36849 case 'Z':
36850 got_Z = 1;
36851 ++ts;
36852 if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
36853 __Pyx_BufFmt_RaiseUnexpectedChar('Z');
36854 return NULL;
36855 }
36856 CYTHON_FALLTHROUGH;
36857 case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
36858 case 'l': case 'L': case 'q': case 'Q':
36859 case 'f': case 'd': case 'g':
36860 case 'O': case 'p':
36861 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
36862 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
36863 ctx->enc_count += ctx->new_count;
36864 ctx->new_count = 1;
36865 got_Z = 0;
36866 ++ts;
36867 break;
36868 }
36869 CYTHON_FALLTHROUGH;
36870 case 's':
36871 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36872 ctx->enc_count = ctx->new_count;
36873 ctx->enc_packmode = ctx->new_packmode;
36874 ctx->enc_type = *ts;
36875 ctx->is_complex = got_Z;
36876 ++ts;
36877 ctx->new_count = 1;
36878 got_Z = 0;
36879 break;
36880 case ':':
36881 ++ts;
36882 while(*ts != ':') ++ts;
36883 ++ts;
36884 break;
36885 case '(':
36886 if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
36887 break;
36888 default:
36889 {
36890 int number = __Pyx_BufFmt_ExpectNumber(&ts);
36891 if (number == -1) return NULL;
36892 ctx->new_count = (size_t)number;
36893 }
36894 }
36895 }
36896}
36897
36898/* TypeInfoCompare (used by MemviewSliceValidateAndInit) */
36899static int
36900__pyx_typeinfo_cmp(const __Pyx_TypeInfo *a, const __Pyx_TypeInfo *b)
36901{
36902 int i;
36903 if (!a || !b)
36904 return 0;
36905 if (a == b)
36906 return 1;
36907 if (a->size != b->size || a->typegroup != b->typegroup ||
36908 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
36909 if (a->typegroup == 'H' || b->typegroup == 'H') {
36910 return a->size == b->size;
36911 } else {
36912 return 0;
36913 }
36914 }
36915 if (a->ndim) {
36916 for (i = 0; i < a->ndim; i++)
36917 if (a->arraysize[i] != b->arraysize[i])
36918 return 0;
36919 }
36920 if (a->typegroup == 'S') {
36921 if (a->flags != b->flags)
36922 return 0;
36923 if (a->fields || b->fields) {
36924 if (!(a->fields && b->fields))
36925 return 0;
36926 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
36927 const __Pyx_StructField *field_a = a->fields + i;
36928 const __Pyx_StructField *field_b = b->fields + i;
36929 if (field_a->offset != field_b->offset ||
36930 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
36931 return 0;
36932 }
36933 return !a->fields[i].type && !b->fields[i].type;
36934 }
36935 }
36936 return 1;
36937}
36938
36939/* MemviewSliceValidateAndInit (used by ObjectToMemviewSlice) */
36940static int
36941__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
36942{
36943 if (buf->shape[dim] <= 1)
36944 return 1;
36945 if (buf->strides) {
36946 if (spec & __Pyx_MEMVIEW_CONTIG) {
36947 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
36948 if (unlikely(buf->strides[dim] != sizeof(void *))) {
36949 PyErr_Format(PyExc_ValueError,
36950 "Buffer is not indirectly contiguous "
36951 "in dimension %d.", dim);
36952 goto fail;
36953 }
36954 } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
36955 PyErr_SetString(PyExc_ValueError,
36956 "Buffer and memoryview are not contiguous "
36957 "in the same dimension.");
36958 goto fail;
36959 }
36960 }
36961 if (spec & __Pyx_MEMVIEW_FOLLOW) {
36962 Py_ssize_t stride = buf->strides[dim];
36963 if (stride < 0)
36964 stride = -stride;
36965 if (unlikely(stride < buf->itemsize)) {
36966 PyErr_SetString(PyExc_ValueError,
36967 "Buffer and memoryview are not contiguous "
36968 "in the same dimension.");
36969 goto fail;
36970 }
36971 }
36972 } else {
36973 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
36974 PyErr_Format(PyExc_ValueError,
36975 "C-contiguous buffer is not contiguous in "
36976 "dimension %d", dim);
36977 goto fail;
36978 } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
36979 PyErr_Format(PyExc_ValueError,
36980 "C-contiguous buffer is not indirect in "
36981 "dimension %d", dim);
36982 goto fail;
36983 } else if (unlikely(buf->suboffsets)) {
36984 PyErr_SetString(PyExc_ValueError,
36985 "Buffer exposes suboffsets but no strides");
36986 goto fail;
36987 }
36988 }
36989 return 1;
36990fail:
36991 return 0;
36992}
36993static int
36994__pyx_check_suboffsets(Py_buffer *buf, int dim, int ndim, int spec)
36995{
36996 CYTHON_UNUSED_VAR(ndim);
36997 if (spec & __Pyx_MEMVIEW_DIRECT) {
36998 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
36999 PyErr_Format(PyExc_ValueError,
37000 "Buffer not compatible with direct access "
37001 "in dimension %d.", dim);
37002 goto fail;
37003 }
37004 }
37005 if (spec & __Pyx_MEMVIEW_PTR) {
37006 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
37007 PyErr_Format(PyExc_ValueError,
37008 "Buffer is not indirectly accessible "
37009 "in dimension %d.", dim);
37010 goto fail;
37011 }
37012 }
37013 return 1;
37014fail:
37015 return 0;
37016}
37017static int
37018__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
37019{
37020 int i;
37021 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
37022 Py_ssize_t stride = 1;
37023 for (i = 0; i < ndim; i++) {
37024 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
37025 PyErr_SetString(PyExc_ValueError,
37026 "Buffer not fortran contiguous.");
37027 goto fail;
37028 }
37029 stride = stride * buf->shape[i];
37030 }
37031 } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
37032 Py_ssize_t stride = 1;
37033 for (i = ndim - 1; i >- 1; i--) {
37034 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
37035 PyErr_SetString(PyExc_ValueError,
37036 "Buffer not C contiguous.");
37037 goto fail;
37038 }
37039 stride = stride * buf->shape[i];
37040 }
37041 }
37042 return 1;
37043fail:
37044 return 0;
37045}
37046static int __Pyx_ValidateAndInit_memviewslice(
37047 int *axes_specs,
37048 int c_or_f_flag,
37049 int buf_flags,
37050 int ndim,
37051 const __Pyx_TypeInfo *dtype,
37052 __Pyx_BufFmt_StackElem stack[],
37053 __Pyx_memviewslice *memviewslice,
37054 PyObject *original_obj)
37055{
37056 struct __pyx_memoryview_obj *memview, *new_memview;
37057 __Pyx_RefNannyDeclarations
37058 Py_buffer *buf;
37059 int i, spec = 0, retval = -1;
37060 __Pyx_BufFmt_Context ctx;
37061 int from_memoryview = __pyx_memoryview_check(original_obj);
37062 __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
37063 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
37064 original_obj)->typeinfo)) {
37065 memview = (struct __pyx_memoryview_obj *) original_obj;
37066 new_memview = NULL;
37067 } else {
37068 memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
37069 original_obj, buf_flags, 0, dtype);
37070 new_memview = memview;
37071 if (unlikely(!memview))
37072 goto fail;
37073 }
37074 buf = &memview->view;
37075 if (unlikely(buf->ndim != ndim)) {
37076 PyErr_Format(PyExc_ValueError,
37077 "Buffer has wrong number of dimensions (expected %d, got %d)",
37078 ndim, buf->ndim);
37079 goto fail;
37080 }
37081 if (new_memview) {
37082 __Pyx_BufFmt_Init(&ctx, stack, dtype);
37083 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
37084 }
37085 if (unlikely((unsigned) buf->itemsize != dtype->size)) {
37086 PyErr_Format(PyExc_ValueError,
37087 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
37088 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
37089 buf->itemsize,
37090 (buf->itemsize > 1) ? "s" : "",
37091 dtype->name,
37092 dtype->size,
37093 (dtype->size > 1) ? "s" : "");
37094 goto fail;
37095 }
37096 if (buf->len > 0) {
37097 for (i = 0; i < ndim; i++) {
37098 spec = axes_specs[i];
37099 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
37100 goto fail;
37101 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
37102 goto fail;
37103 }
37104 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
37105 goto fail;
37106 }
37107 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
37108 new_memview != NULL) == -1)) {
37109 goto fail;
37110 }
37111 retval = 0;
37112 goto no_fail;
37113fail:
37114 Py_XDECREF((PyObject*)new_memview);
37115 retval = -1;
37116no_fail:
37117 __Pyx_RefNannyFinishContext();
37118 return retval;
37119}
37120
37121/* ObjectToMemviewSlice */
37122static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj, int writable_flag) {
37123 __Pyx_memviewslice result = __Pyx_MEMSLICE_INIT;
37124 __Pyx_BufFmt_StackElem stack[1];
37125 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
37126 int retcode;
37127 if (obj == Py_None) {
37128 result.memview = (struct __pyx_memoryview_obj *) Py_None;
37129 return result;
37130 }
37131 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
37132 PyBUF_RECORDS_RO | writable_flag, 1,
37133 &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
37134 &result, obj);
37135 if (unlikely(retcode == -1))
37136 goto __pyx_fail;
37137 return result;
37138__pyx_fail:
37139 result.memview = NULL;
37140 result.data = NULL;
37141 return result;
37142}
37143
37144/* ObjectToMemviewSlice */
37145static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj, int writable_flag) {
37146 __Pyx_memviewslice result = __Pyx_MEMSLICE_INIT;
37147 __Pyx_BufFmt_StackElem stack[1];
37148 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
37149 int retcode;
37150 if (obj == Py_None) {
37151 result.memview = (struct __pyx_memoryview_obj *) Py_None;
37152 return result;
37153 }
37154 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
37155 PyBUF_RECORDS_RO | writable_flag, 1,
37156 &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
37157 &result, obj);
37158 if (unlikely(retcode == -1))
37159 goto __pyx_fail;
37160 return result;
37161__pyx_fail:
37162 result.memview = NULL;
37163 result.data = NULL;
37164 return result;
37165}
37166
37167/* Declarations */
37168#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37169 #ifdef __cplusplus
37170 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
37171 return ::std::complex< float >(x, y);
37172 }
37173 #else
37174 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
37175 return x + y*(__pyx_t_float_complex)_Complex_I;
37176 }
37177 #endif
37178#else
37179 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
37180 __pyx_t_float_complex z;
37181 z.real = x;
37182 z.imag = y;
37183 return z;
37184 }
37185#endif
37186
37187/* Arithmetic */
37188#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37189#else
37190 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37191 return (a.real == b.real) && (a.imag == b.imag);
37192 }
37193 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37194 __pyx_t_float_complex z;
37195 z.real = a.real + b.real;
37196 z.imag = a.imag + b.imag;
37197 return z;
37198 }
37199 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37200 __pyx_t_float_complex z;
37201 z.real = a.real - b.real;
37202 z.imag = a.imag - b.imag;
37203 return z;
37204 }
37205 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37206 __pyx_t_float_complex z;
37207 z.real = a.real * b.real - a.imag * b.imag;
37208 z.imag = a.real * b.imag + a.imag * b.real;
37209 return z;
37210 }
37211 #if 1
37212 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37213 if (b.imag == 0) {
37214 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
37215 } else if (fabsf(b.real) >= fabsf(b.imag)) {
37216 if (b.real == 0 && b.imag == 0) {
37217 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
37218 } else {
37219 float r = b.imag / b.real;
37220 float s = (float)(1.0) / (b.real + b.imag * r);
37221 return __pyx_t_float_complex_from_parts(
37222 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
37223 }
37224 } else {
37225 float r = b.real / b.imag;
37226 float s = (float)(1.0) / (b.imag + b.real * r);
37227 return __pyx_t_float_complex_from_parts(
37228 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
37229 }
37230 }
37231 #else
37232 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37233 if (b.imag == 0) {
37234 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
37235 } else {
37236 float denom = b.real * b.real + b.imag * b.imag;
37237 return __pyx_t_float_complex_from_parts(
37238 (a.real * b.real + a.imag * b.imag) / denom,
37239 (a.imag * b.real - a.real * b.imag) / denom);
37240 }
37241 }
37242 #endif
37243 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
37244 __pyx_t_float_complex z;
37245 z.real = -a.real;
37246 z.imag = -a.imag;
37247 return z;
37248 }
37249 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
37250 return (a.real == 0) && (a.imag == 0);
37251 }
37252 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
37253 __pyx_t_float_complex z;
37254 z.real = a.real;
37255 z.imag = -a.imag;
37256 return z;
37257 }
37258 #if 1
37259 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
37260 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
37261 return sqrtf(z.real*z.real + z.imag*z.imag);
37262 #else
37263 return hypotf(z.real, z.imag);
37264 #endif
37265 }
37266 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37267 __pyx_t_float_complex z;
37268 float r, lnr, theta, z_r, z_theta;
37269 if (b.imag == 0 && b.real == (int)b.real) {
37270 if (b.real < 0) {
37271 float denom = a.real * a.real + a.imag * a.imag;
37272 a.real = a.real / denom;
37273 a.imag = -a.imag / denom;
37274 b.real = -b.real;
37275 }
37276 switch ((int)b.real) {
37277 case 0:
37278 z.real = 1;
37279 z.imag = 0;
37280 return z;
37281 case 1:
37282 return a;
37283 case 2:
37284 return __Pyx_c_prod_float(a, a);
37285 case 3:
37286 z = __Pyx_c_prod_float(a, a);
37287 return __Pyx_c_prod_float(z, a);
37288 case 4:
37289 z = __Pyx_c_prod_float(a, a);
37290 return __Pyx_c_prod_float(z, z);
37291 }
37292 }
37293 if (a.imag == 0) {
37294 if (a.real == 0) {
37295 return a;
37296 } else if ((b.imag == 0) && (a.real >= 0)) {
37297 z.real = powf(a.real, b.real);
37298 z.imag = 0;
37299 return z;
37300 } else if (a.real > 0) {
37301 r = a.real;
37302 theta = 0;
37303 } else {
37304 r = -a.real;
37305 theta = atan2f(0.0, -1.0);
37306 }
37307 } else {
37308 r = __Pyx_c_abs_float(a);
37309 theta = atan2f(a.imag, a.real);
37310 }
37311 lnr = logf(r);
37312 z_r = expf(lnr * b.real - theta * b.imag);
37313 z_theta = theta * b.real + lnr * b.imag;
37314 z.real = z_r * cosf(z_theta);
37315 z.imag = z_r * sinf(z_theta);
37316 return z;
37317 }
37318 #endif
37319#endif
37320
37321/* Declarations */
37322#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37323 #ifdef __cplusplus
37324 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
37325 return ::std::complex< double >(x, y);
37326 }
37327 #else
37328 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
37329 return x + y*(__pyx_t_double_complex)_Complex_I;
37330 }
37331 #endif
37332#else
37333 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
37334 __pyx_t_double_complex z;
37335 z.real = x;
37336 z.imag = y;
37337 return z;
37338 }
37339#endif
37340
37341/* Arithmetic */
37342#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37343#else
37344 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37345 return (a.real == b.real) && (a.imag == b.imag);
37346 }
37347 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37348 __pyx_t_double_complex z;
37349 z.real = a.real + b.real;
37350 z.imag = a.imag + b.imag;
37351 return z;
37352 }
37353 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37354 __pyx_t_double_complex z;
37355 z.real = a.real - b.real;
37356 z.imag = a.imag - b.imag;
37357 return z;
37358 }
37359 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37360 __pyx_t_double_complex z;
37361 z.real = a.real * b.real - a.imag * b.imag;
37362 z.imag = a.real * b.imag + a.imag * b.real;
37363 return z;
37364 }
37365 #if 1
37366 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37367 if (b.imag == 0) {
37368 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37369 } else if (fabs(b.real) >= fabs(b.imag)) {
37370 if (b.real == 0 && b.imag == 0) {
37371 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
37372 } else {
37373 double r = b.imag / b.real;
37374 double s = (double)(1.0) / (b.real + b.imag * r);
37375 return __pyx_t_double_complex_from_parts(
37376 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
37377 }
37378 } else {
37379 double r = b.real / b.imag;
37380 double s = (double)(1.0) / (b.imag + b.real * r);
37381 return __pyx_t_double_complex_from_parts(
37382 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
37383 }
37384 }
37385 #else
37386 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37387 if (b.imag == 0) {
37388 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37389 } else {
37390 double denom = b.real * b.real + b.imag * b.imag;
37391 return __pyx_t_double_complex_from_parts(
37392 (a.real * b.real + a.imag * b.imag) / denom,
37393 (a.imag * b.real - a.real * b.imag) / denom);
37394 }
37395 }
37396 #endif
37397 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
37398 __pyx_t_double_complex z;
37399 z.real = -a.real;
37400 z.imag = -a.imag;
37401 return z;
37402 }
37403 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
37404 return (a.real == 0) && (a.imag == 0);
37405 }
37406 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
37407 __pyx_t_double_complex z;
37408 z.real = a.real;
37409 z.imag = -a.imag;
37410 return z;
37411 }
37412 #if 1
37413 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
37414 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
37415 return sqrt(z.real*z.real + z.imag*z.imag);
37416 #else
37417 return hypot(z.real, z.imag);
37418 #endif
37419 }
37420 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37421 __pyx_t_double_complex z;
37422 double r, lnr, theta, z_r, z_theta;
37423 if (b.imag == 0 && b.real == (int)b.real) {
37424 if (b.real < 0) {
37425 double denom = a.real * a.real + a.imag * a.imag;
37426 a.real = a.real / denom;
37427 a.imag = -a.imag / denom;
37428 b.real = -b.real;
37429 }
37430 switch ((int)b.real) {
37431 case 0:
37432 z.real = 1;
37433 z.imag = 0;
37434 return z;
37435 case 1:
37436 return a;
37437 case 2:
37438 return __Pyx_c_prod_double(a, a);
37439 case 3:
37440 z = __Pyx_c_prod_double(a, a);
37441 return __Pyx_c_prod_double(z, a);
37442 case 4:
37443 z = __Pyx_c_prod_double(a, a);
37444 return __Pyx_c_prod_double(z, z);
37445 }
37446 }
37447 if (a.imag == 0) {
37448 if (a.real == 0) {
37449 return a;
37450 } else if ((b.imag == 0) && (a.real >= 0)) {
37451 z.real = pow(a.real, b.real);
37452 z.imag = 0;
37453 return z;
37454 } else if (a.real > 0) {
37455 r = a.real;
37456 theta = 0;
37457 } else {
37458 r = -a.real;
37459 theta = atan2(0.0, -1.0);
37460 }
37461 } else {
37462 r = __Pyx_c_abs_double(a);
37463 theta = atan2(a.imag, a.real);
37464 }
37465 lnr = log(r);
37466 z_r = exp(lnr * b.real - theta * b.imag);
37467 z_theta = theta * b.real + lnr * b.imag;
37468 z.real = z_r * cos(z_theta);
37469 z.imag = z_r * sin(z_theta);
37470 return z;
37471 }
37472 #endif
37473#endif
37474
37475/* Declarations */
37476#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37477 #ifdef __cplusplus
37478 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
37479 return ::std::complex< long double >(x, y);
37480 }
37481 #else
37482 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
37483 return x + y*(__pyx_t_long_double_complex)_Complex_I;
37484 }
37485 #endif
37486#else
37487 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
37488 __pyx_t_long_double_complex z;
37489 z.real = x;
37490 z.imag = y;
37491 return z;
37492 }
37493#endif
37494
37495/* Arithmetic */
37496#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37497#else
37498 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37499 return (a.real == b.real) && (a.imag == b.imag);
37500 }
37501 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37502 __pyx_t_long_double_complex z;
37503 z.real = a.real + b.real;
37504 z.imag = a.imag + b.imag;
37505 return z;
37506 }
37507 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37508 __pyx_t_long_double_complex z;
37509 z.real = a.real - b.real;
37510 z.imag = a.imag - b.imag;
37511 return z;
37512 }
37513 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37514 __pyx_t_long_double_complex z;
37515 z.real = a.real * b.real - a.imag * b.imag;
37516 z.imag = a.real * b.imag + a.imag * b.real;
37517 return z;
37518 }
37519 #if 1
37520 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37521 if (b.imag == 0) {
37522 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37523 } else if (fabsl(b.real) >= fabsl(b.imag)) {
37524 if (b.real == 0 && b.imag == 0) {
37525 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
37526 } else {
37527 long double r = b.imag / b.real;
37528 long double s = (long double)(1.0) / (b.real + b.imag * r);
37529 return __pyx_t_long_double_complex_from_parts(
37530 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
37531 }
37532 } else {
37533 long double r = b.real / b.imag;
37534 long double s = (long double)(1.0) / (b.imag + b.real * r);
37535 return __pyx_t_long_double_complex_from_parts(
37536 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
37537 }
37538 }
37539 #else
37540 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37541 if (b.imag == 0) {
37542 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37543 } else {
37544 long double denom = b.real * b.real + b.imag * b.imag;
37545 return __pyx_t_long_double_complex_from_parts(
37546 (a.real * b.real + a.imag * b.imag) / denom,
37547 (a.imag * b.real - a.real * b.imag) / denom);
37548 }
37549 }
37550 #endif
37551 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
37552 __pyx_t_long_double_complex z;
37553 z.real = -a.real;
37554 z.imag = -a.imag;
37555 return z;
37556 }
37557 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
37558 return (a.real == 0) && (a.imag == 0);
37559 }
37560 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
37561 __pyx_t_long_double_complex z;
37562 z.real = a.real;
37563 z.imag = -a.imag;
37564 return z;
37565 }
37566 #if 1
37567 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
37568 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
37569 return sqrtl(z.real*z.real + z.imag*z.imag);
37570 #else
37571 return hypotl(z.real, z.imag);
37572 #endif
37573 }
37574 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37575 __pyx_t_long_double_complex z;
37576 long double r, lnr, theta, z_r, z_theta;
37577 if (b.imag == 0 && b.real == (int)b.real) {
37578 if (b.real < 0) {
37579 long double denom = a.real * a.real + a.imag * a.imag;
37580 a.real = a.real / denom;
37581 a.imag = -a.imag / denom;
37582 b.real = -b.real;
37583 }
37584 switch ((int)b.real) {
37585 case 0:
37586 z.real = 1;
37587 z.imag = 0;
37588 return z;
37589 case 1:
37590 return a;
37591 case 2:
37592 return __Pyx_c_prod_long__double(a, a);
37593 case 3:
37594 z = __Pyx_c_prod_long__double(a, a);
37595 return __Pyx_c_prod_long__double(z, a);
37596 case 4:
37597 z = __Pyx_c_prod_long__double(a, a);
37598 return __Pyx_c_prod_long__double(z, z);
37599 }
37600 }
37601 if (a.imag == 0) {
37602 if (a.real == 0) {
37603 return a;
37604 } else if ((b.imag == 0) && (a.real >= 0)) {
37605 z.real = powl(a.real, b.real);
37606 z.imag = 0;
37607 return z;
37608 } else if (a.real > 0) {
37609 r = a.real;
37610 theta = 0;
37611 } else {
37612 r = -a.real;
37613 theta = atan2l(0.0, -1.0);
37614 }
37615 } else {
37616 r = __Pyx_c_abs_long__double(a);
37617 theta = atan2l(a.imag, a.real);
37618 }
37619 lnr = logl(r);
37620 z_r = expl(lnr * b.real - theta * b.imag);
37621 z_theta = theta * b.real + lnr * b.imag;
37622 z.real = z_r * cosl(z_theta);
37623 z.imag = z_r * sinl(z_theta);
37624 return z;
37625 }
37626 #endif
37627#endif
37628
37629/* MemviewSliceCopy */
37630static __Pyx_memviewslice
37631__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
37632 const char *mode, int ndim,
37633 Py_ssize_t sizeof_dtype, int contig_flag,
37634 int dtype_is_object)
37635{
37636 __Pyx_RefNannyDeclarations
37637 int i;
37638 __Pyx_memviewslice new_mvs = __Pyx_MEMSLICE_INIT;
37639 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
37640 Py_buffer *buf = &from_memview->view;
37641 PyObject *shape_tuple = NULL;
37642 struct __pyx_array_obj *array_obj = NULL;
37643 struct __pyx_memoryview_obj *memview_obj = NULL;
37644 __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
37645 for (i = 0; i < ndim; i++) {
37646 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
37647 PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
37648 "indirect dimensions (axis %d)", i);
37649 goto fail;
37650 }
37651 }
37652 shape_tuple = PyTuple_New(ndim);
37653 if (unlikely(!shape_tuple)) {
37654 goto fail;
37655 }
37656 __Pyx_GOTREF(shape_tuple);
37657 for(i = 0; i < ndim; i++) {
37658 PyObject *temp_int = PyLong_FromSsize_t(from_mvs->shape[i]);
37659 if(unlikely(!temp_int)) {
37660 goto fail;
37661 } else {
37662#if CYTHON_ASSUME_SAFE_MACROS
37663 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
37664#else
37665 if (PyTuple_SetItem(shape_tuple, i, temp_int) < 0) {
37666 goto fail;
37667 }
37668#endif
37669 }
37670 }
37671 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, mode, NULL);
37672 if (unlikely(!array_obj)) {
37673 goto fail;
37674 }
37675 __Pyx_GOTREF(array_obj);
37676 memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
37677 (PyObject *) array_obj, contig_flag,
37678 dtype_is_object,
37679 from_mvs->memview->typeinfo);
37680 if (unlikely(!memview_obj))
37681 goto fail;
37682 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
37683 goto fail;
37684 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
37685 dtype_is_object) < 0))
37686 goto fail;
37687 goto no_fail;
37688fail:
37689 __Pyx_XDECREF((PyObject *) new_mvs.memview);
37690 new_mvs.memview = NULL;
37691 new_mvs.data = NULL;
37692no_fail:
37693 __Pyx_XDECREF(shape_tuple);
37694 __Pyx_XDECREF((PyObject *) array_obj);
37695 __Pyx_RefNannyFinishContext();
37696 return new_mvs;
37697}
37698
37699/* CIntFromPy */
37700static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
37701static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(void) {
37702 const char* type_name = "int";
37703 PyErr_Format(PyExc_OverflowError,
37704 "can't convert negative value to %.200s", type_name);
37705 return (int) -1;
37706}
37707static int __Pyx_raise_overflow___Pyx_PyLong_As_int(void) {
37708 const char* type_name = "int";
37709 PyErr_Format(PyExc_OverflowError,
37710 "value too large to convert to %.200s", type_name);
37711 return (int) -1;
37712}
37713static CYTHON_INLINE int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
37714 const int is_unsigned = 1;
37715#if CYTHON_USE_PYLONG_INTERNALS
37716 {
37717 const digit* digits = __Pyx_PyLong_Digits(x);
37718 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37719 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
37720 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
37721 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37722 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
37723 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37724 }
37725 } else
37726 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
37727 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
37728 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37729 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
37730 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37731 }
37732 } else
37733 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
37734 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
37735 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37736 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
37737 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37738 }
37739 } else
37740 {}
37741 }
37742#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
37743 if (unlikely(Py_SIZE(x) < 0)) {
37744 goto raise_neg_overflow;
37745 }
37746#else
37747 {
37748 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37749 if (unlikely(result < 0))
37750 return (int) -1;
37751 if (unlikely(result == 1))
37752 goto raise_neg_overflow;
37753 }
37754#endif
37755 if ((sizeof(int) <= sizeof(unsigned long))) {
37756 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
37757 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
37758 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37759 }
37760 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
37761raise_neg_overflow:
37762 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37763raise_overflow:
37764 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37765}
37766static CYTHON_INLINE int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
37767 const int is_unsigned = 0;
37768#if CYTHON_USE_PYLONG_INTERNALS
37769 if (__Pyx_PyLong_IsNeg(x)) {
37770 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37771 const digit* digits = __Pyx_PyLong_Digits(x);
37772 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
37773 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37774 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37775 __PYX_VERIFY_RETURN_INT(int, long, ival)
37776 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
37777 return (int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37778 }
37779 } else
37780 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
37781 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37782 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37783 __PYX_VERIFY_RETURN_INT(int, long, ival)
37784 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
37785 return (int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37786 }
37787 } else
37788 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
37789 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
37790 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37791 __PYX_VERIFY_RETURN_INT(int, long, ival)
37792 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
37793 return (int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37794 }
37795 } else
37796 {}
37797 } else {
37798 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37799 const digit* digits = __Pyx_PyLong_Digits(x);
37800 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
37801 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37802 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37803 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
37804 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37805 }
37806 } else
37807 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
37808 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37809 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37810 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
37811 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37812 }
37813 } else
37814 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
37815 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
37816 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37817 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
37818 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37819 }
37820 } else
37821 {}
37822 }
37823#endif
37824 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
37825 if ((sizeof(int) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
37826 __PYX_VERIFY_RETURN_INT_EXC(int, int, PyLong_AsInt(x))
37827 } else
37828 #endif
37829 if ((sizeof(int) <= sizeof(long))) {
37830 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
37831 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
37832 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
37833 }
37834 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
37835raise_neg_overflow:
37836 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37837raise_overflow:
37838 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37839}
37840static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
37841#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37842#pragma GCC diagnostic push
37843#pragma GCC diagnostic ignored "-Wconversion"
37844#endif
37845 const int neg_one = (int) -1, const_zero = (int) 0;
37846#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37847#pragma GCC diagnostic pop
37848#endif
37849 const int is_unsigned = neg_one > const_zero;
37850 int val;
37851 int ret = -1;
37852#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
37853 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
37854 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
37855 if (unlikely(bytes_copied == -1)) {
37856 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
37857 goto raise_overflow;
37858 } else {
37859 ret = 0;
37860 }
37861#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
37862 int one = 1; int is_little = (int)*(unsigned char *)&one;
37863 unsigned char *bytes = (unsigned char *)&val;
37864 ret = _PyLong_AsByteArray((PyLongObject *)x,
37865 bytes, sizeof(val),
37866 is_little, !is_unsigned);
37867 if ((0)) goto raise_overflow;
37868#else
37869 PyObject *v;
37870 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
37871 int bits, remaining_bits, is_negative = 0;
37872 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
37873 if (likely(PyLong_CheckExact(x))) {
37874 v = __Pyx_NewRef(x);
37875 } else {
37876 v = PyNumber_Long(x);
37877 if (unlikely(!v)) return (int) -1;
37878 assert(PyLong_CheckExact(v));
37879 }
37880 {
37881 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
37882 if (unlikely(result < 0)) {
37883 Py_DECREF(v);
37884 return (int) -1;
37885 }
37886 is_negative = result == 1;
37887 }
37888 if (is_unsigned && unlikely(is_negative)) {
37889 Py_DECREF(v);
37890 PyErr_SetString(PyExc_OverflowError,
37891 "can't convert negative value to int");
37892 return (int) -1;
37893 } else if (is_negative) {
37894 stepval = PyNumber_Invert(v);
37895 Py_DECREF(v);
37896 if (unlikely(!stepval))
37897 return (int) -1;
37898 } else {
37899 stepval = v;
37900 }
37901 v = NULL;
37902 val = (int) 0;
37903 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
37904 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
37905 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
37906 PyObject *tmp, *digit;
37907 long idigit;
37908 digit = PyNumber_And(stepval, mask);
37909 if (unlikely(!digit)) goto done;
37910 idigit = PyLong_AsLong(digit);
37911 Py_DECREF(digit);
37912 if (unlikely(idigit < 0)) goto done;
37913 val |= ((int) idigit) << bits;
37914 tmp = PyNumber_Rshift(stepval, shift);
37915 if (unlikely(!tmp)) goto done;
37916 Py_DECREF(stepval); stepval = tmp;
37917 }
37918 Py_DECREF(shift); shift = NULL;
37919 Py_DECREF(mask); mask = NULL;
37920 {
37921 long idigit = PyLong_AsLong(stepval);
37922 if (unlikely(idigit < 0)) goto done;
37923 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
37924 if (unlikely(idigit >= (1L << remaining_bits)))
37925 goto raise_overflow;
37926 val |= ((int) idigit) << bits;
37927 }
37928 if (!is_unsigned) {
37929 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
37930 goto raise_overflow;
37931 if (is_negative)
37932 val = ~val;
37933 }
37934 ret = 0;
37935done:
37936 Py_XDECREF(shift);
37937 Py_XDECREF(mask);
37938 Py_XDECREF(stepval);
37939#endif
37940 if (unlikely(ret))
37941 return (int) -1;
37942 return val;
37943raise_overflow:
37944 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37945}
37946static CYTHON_INLINE int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
37947#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37948#pragma GCC diagnostic push
37949#pragma GCC diagnostic ignored "-Wconversion"
37950#endif
37951 const int neg_one = (int) -1, const_zero = (int) 0;
37952#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37953#pragma GCC diagnostic pop
37954#endif
37955 const int is_unsigned = neg_one > const_zero;
37956 if (is_unsigned) {
37957 #if CYTHON_USE_PYLONG_INTERNALS
37958 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
37959 goto raise_neg_overflow;
37960 } else if (__Pyx_PyLong_IsCompact(x)) {
37961 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
37962 } else
37963 #endif
37964 {
37965 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
37966 }
37967 } else {
37968 #if CYTHON_USE_PYLONG_INTERNALS
37969 if (__Pyx_PyLong_IsCompact(x)) {
37970 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
37971 } else
37972 #endif
37973 {
37974 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
37975 }
37976 }
37977#if CYTHON_USE_PYLONG_INTERNALS
37978raise_neg_overflow:
37979 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37980raise_overflow:
37981 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37982#endif
37983}
37984static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
37985 int val;
37986 PyObject *tmp = __Pyx_PyNumber_Long(x);
37987 if (!tmp) return (int) -1;
37988 val = __Pyx_PyLong_As_int(tmp);
37989 Py_DECREF(tmp);
37990 return val;
37991}
37992static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
37993 if (likely(PyLong_Check(x))) {
37994 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
37995 } else {
37996 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
37997 }
37998}
37999
38000/* PyObjectVectorcallKwds (used by PyObjectVectorcallMethodKwds) */
38001#if CYTHON_VECTORCALL
38002CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
38003 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
38004#if !CYTHON_ASSUME_SAFE_MACROS
38005 if (unlikely(!key)) return -1;
38006#endif
38007 if (unlikely(!PyUnicode_Check(key))) {
38008 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
38009 return -1;
38010 }
38011 return 0;
38012}
38013#else
38014CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n) {
38015 PyObject *out = PyDict_New();
38016 if (unlikely(!out)) return NULL;
38017 for (Py_ssize_t i=0; i<n; ++i) {
38018 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
38019 Py_DECREF(out);
38020 return NULL;
38021 }
38022 }
38023 return out;
38024}
38025CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
38026 PyObject *key = kwnames[i];
38027 if (unlikely(!PyUnicode_Check(key))) {
38028 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
38029 return -1;
38030 }
38031 return 0;
38032}
38033#endif
38034
38035/* PyObjectVectorcallMethodKwds (used by CIntToPy) */
38036#if !CYTHON_VECTORCALL
38037static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
38038 PyObject *result;
38039 PyObject *obj = PyObject_GetAttr(args[0], name);
38040 if (unlikely(!obj))
38041 return NULL;
38042 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
38043 Py_DECREF(obj);
38044 return result;
38045}
38046#endif
38047
38048/* CIntToPy */
38049static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_int32(npy_int32 value) {
38050#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38051#pragma GCC diagnostic push
38052#pragma GCC diagnostic ignored "-Wconversion"
38053#endif
38054 const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
38055#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38056#pragma GCC diagnostic pop
38057#endif
38058 const int is_unsigned = neg_one > const_zero;
38059 if (is_unsigned) {
38060 if (sizeof(npy_int32) < sizeof(long)) {
38061 return PyLong_FromLong((long) value);
38062 } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
38063 return PyLong_FromUnsignedLong((unsigned long) value);
38064#if !CYTHON_COMPILING_IN_PYPY
38065 } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
38066 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
38067#endif
38068 }
38069 } else {
38070 if (sizeof(npy_int32) <= sizeof(long)) {
38071 return PyLong_FromLong((long) value);
38072 } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
38073 return PyLong_FromLongLong((PY_LONG_LONG) value);
38074 }
38075 }
38076 {
38077 unsigned char *bytes = (unsigned char *)&value;
38078#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
38079 if (is_unsigned) {
38080 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
38081 } else {
38082 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
38083 }
38084#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
38085 int one = 1; int little = (int)*(unsigned char *)&one;
38086 return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
38087 little, !is_unsigned);
38088#else
38089 int one = 1; int little = (int)*(unsigned char *)&one;
38090 PyObject *result = NULL, *kwds = NULL;
38091 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
38092 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_int32));
38093 if (!py_bytes) goto limited_bad;
38094 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
38095 if (!from_bytes_str) goto limited_bad;
38096 order_str = PyUnicode_FromString(little ? "little" : "big");
38097 if (!order_str) goto limited_bad;
38098 {
38099 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
38100 if (!is_unsigned) {
38101 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
38102 if (!signed_str) goto limited_bad;
38103#if CYTHON_VECTORCALL
38104 kwds = PyTuple_Pack(1, signed_str);
38105#else
38106 {
38107 PyObject *keys[] = {signed_str};
38108 PyObject *values[] = {Py_True};
38109 kwds = __Pyx_MakeKwargDict(keys, values, 1);
38110 }
38111#endif
38112 Py_DECREF(signed_str);
38113 if (unlikely(!kwds)) goto limited_bad;
38114 }
38115 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
38116 }
38117 limited_bad:
38118 Py_XDECREF(kwds);
38119 Py_XDECREF(order_str);
38120 Py_XDECREF(py_bytes);
38121 Py_XDECREF(from_bytes_str);
38122 return result;
38123#endif
38124 }
38125}
38126
38127/* CIntToPy */
38128static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
38129#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38130#pragma GCC diagnostic push
38131#pragma GCC diagnostic ignored "-Wconversion"
38132#endif
38133 const int neg_one = (int) -1, const_zero = (int) 0;
38134#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38135#pragma GCC diagnostic pop
38136#endif
38137 const int is_unsigned = neg_one > const_zero;
38138 if (is_unsigned) {
38139 if (sizeof(int) < sizeof(long)) {
38140 return PyLong_FromLong((long) value);
38141 } else if (sizeof(int) <= sizeof(unsigned long)) {
38142 return PyLong_FromUnsignedLong((unsigned long) value);
38143#if !CYTHON_COMPILING_IN_PYPY
38144 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
38145 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
38146#endif
38147 }
38148 } else {
38149 if (sizeof(int) <= sizeof(long)) {
38150 return PyLong_FromLong((long) value);
38151 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
38152 return PyLong_FromLongLong((PY_LONG_LONG) value);
38153 }
38154 }
38155 {
38156 unsigned char *bytes = (unsigned char *)&value;
38157#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
38158 if (is_unsigned) {
38159 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
38160 } else {
38161 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
38162 }
38163#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
38164 int one = 1; int little = (int)*(unsigned char *)&one;
38165 return _PyLong_FromByteArray(bytes, sizeof(int),
38166 little, !is_unsigned);
38167#else
38168 int one = 1; int little = (int)*(unsigned char *)&one;
38169 PyObject *result = NULL, *kwds = NULL;
38170 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
38171 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
38172 if (!py_bytes) goto limited_bad;
38173 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
38174 if (!from_bytes_str) goto limited_bad;
38175 order_str = PyUnicode_FromString(little ? "little" : "big");
38176 if (!order_str) goto limited_bad;
38177 {
38178 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
38179 if (!is_unsigned) {
38180 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
38181 if (!signed_str) goto limited_bad;
38182#if CYTHON_VECTORCALL
38183 kwds = PyTuple_Pack(1, signed_str);
38184#else
38185 {
38186 PyObject *keys[] = {signed_str};
38187 PyObject *values[] = {Py_True};
38188 kwds = __Pyx_MakeKwargDict(keys, values, 1);
38189 }
38190#endif
38191 Py_DECREF(signed_str);
38192 if (unlikely(!kwds)) goto limited_bad;
38193 }
38194 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
38195 }
38196 limited_bad:
38197 Py_XDECREF(kwds);
38198 Py_XDECREF(order_str);
38199 Py_XDECREF(py_bytes);
38200 Py_XDECREF(from_bytes_str);
38201 return result;
38202#endif
38203 }
38204}
38205
38206/* CIntFromPy */
38207static npy_int32 __Pyx_LargePyLong___Pyx_PyLong_As_npy_int32(PyObject *x);
38208static npy_int32 __Pyx_raise_neg_overflow___Pyx_PyLong_As_npy_int32(void) {
38209 const char* type_name = "npy_int32";
38210 PyErr_Format(PyExc_OverflowError,
38211 "can't convert negative value to %.200s", type_name);
38212 return (npy_int32) -1;
38213}
38214static npy_int32 __Pyx_raise_overflow___Pyx_PyLong_As_npy_int32(void) {
38215 const char* type_name = "npy_int32";
38216 PyErr_Format(PyExc_OverflowError,
38217 "value too large to convert to %.200s", type_name);
38218 return (npy_int32) -1;
38219}
38220static CYTHON_INLINE npy_int32 __Pyx_PyULong___Pyx_PyLong_As_npy_int32(PyObject *x) {
38221 const int is_unsigned = 1;
38222#if CYTHON_USE_PYLONG_INTERNALS
38223 {
38224 const digit* digits = __Pyx_PyLong_Digits(x);
38225 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38226 if (size == 2 && (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT)) {
38227 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
38228 __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38229 } else if ((8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT)) {
38230 return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
38231 }
38232 } else
38233 if (size == 3 && (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT)) {
38234 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
38235 __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38236 } else if ((8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT)) {
38237 return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
38238 }
38239 } else
38240 if (size == 4 && (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT)) {
38241 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
38242 __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38243 } else if ((8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT)) {
38244 return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
38245 }
38246 } else
38247 {}
38248 }
38249#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
38250 if (unlikely(Py_SIZE(x) < 0)) {
38251 goto raise_neg_overflow;
38252 }
38253#else
38254 {
38255 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
38256 if (unlikely(result < 0))
38257 return (npy_int32) -1;
38258 if (unlikely(result == 1))
38259 goto raise_neg_overflow;
38260 }
38261#endif
38262 if ((sizeof(npy_int32) <= sizeof(unsigned long))) {
38263 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
38264 } else if ((sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG))) {
38265 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
38266 }
38267 return __Pyx_LargePyLong___Pyx_PyLong_As_npy_int32(x);
38268raise_neg_overflow:
38269 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_npy_int32();
38270raise_overflow:
38271 return __Pyx_raise_overflow___Pyx_PyLong_As_npy_int32();
38272}
38273static CYTHON_INLINE npy_int32 __Pyx_PySLong___Pyx_PyLong_As_npy_int32(PyObject *x) {
38274 const int is_unsigned = 0;
38275#if CYTHON_USE_PYLONG_INTERNALS
38276 if (__Pyx_PyLong_IsNeg(x)) {
38277 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38278 const digit* digits = __Pyx_PyLong_Digits(x);
38279 if (size == 2 && (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT)) {
38280 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
38281 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38282 __PYX_VERIFY_RETURN_INT(npy_int32, long, ival)
38283 } else if ((8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
38284 return (npy_int32) (((npy_int32) -1) * (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
38285 }
38286 } else
38287 if (size == 3 && (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT)) {
38288 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
38289 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38290 __PYX_VERIFY_RETURN_INT(npy_int32, long, ival)
38291 } else if ((8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
38292 return (npy_int32) (((npy_int32) -1) * (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
38293 }
38294 } else
38295 if (size == 4 && (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT)) {
38296 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
38297 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38298 __PYX_VERIFY_RETURN_INT(npy_int32, long, ival)
38299 } else if ((8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT)) {
38300 return (npy_int32) (((npy_int32) -1) * (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
38301 }
38302 } else
38303 {}
38304 } else {
38305 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38306 const digit* digits = __Pyx_PyLong_Digits(x);
38307 if (size == 2 && (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT)) {
38308 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
38309 __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38310 } else if ((8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
38311 return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
38312 }
38313 } else
38314 if (size == 3 && (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT)) {
38315 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
38316 __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38317 } else if ((8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
38318 return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
38319 }
38320 } else
38321 if (size == 4 && (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT)) {
38322 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
38323 __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38324 } else if ((8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT)) {
38325 return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
38326 }
38327 } else
38328 {}
38329 }
38330#endif
38331 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
38332 if ((sizeof(npy_int32) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
38333 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, int, PyLong_AsInt(x))
38334 } else
38335 #endif
38336 if ((sizeof(npy_int32) <= sizeof(long))) {
38337 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
38338 } else if ((sizeof(npy_int32) <= sizeof(PY_LONG_LONG))) {
38339 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
38340 }
38341 return __Pyx_LargePyLong___Pyx_PyLong_As_npy_int32(x);
38342raise_neg_overflow:
38343 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_npy_int32();
38344raise_overflow:
38345 return __Pyx_raise_overflow___Pyx_PyLong_As_npy_int32();
38346}
38347static npy_int32 __Pyx_LargePyLong___Pyx_PyLong_As_npy_int32(PyObject *x) {
38348#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38349#pragma GCC diagnostic push
38350#pragma GCC diagnostic ignored "-Wconversion"
38351#endif
38352 const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
38353#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38354#pragma GCC diagnostic pop
38355#endif
38356 const int is_unsigned = neg_one > const_zero;
38357 npy_int32 val;
38358 int ret = -1;
38359#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
38360 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
38361 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
38362 if (unlikely(bytes_copied == -1)) {
38363 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
38364 goto raise_overflow;
38365 } else {
38366 ret = 0;
38367 }
38368#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
38369 int one = 1; int is_little = (int)*(unsigned char *)&one;
38370 unsigned char *bytes = (unsigned char *)&val;
38371 ret = _PyLong_AsByteArray((PyLongObject *)x,
38372 bytes, sizeof(val),
38373 is_little, !is_unsigned);
38374 if ((0)) goto raise_overflow;
38375#else
38376 PyObject *v;
38377 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
38378 int bits, remaining_bits, is_negative = 0;
38379 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
38380 if (likely(PyLong_CheckExact(x))) {
38381 v = __Pyx_NewRef(x);
38382 } else {
38383 v = PyNumber_Long(x);
38384 if (unlikely(!v)) return (npy_int32) -1;
38385 assert(PyLong_CheckExact(v));
38386 }
38387 {
38388 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
38389 if (unlikely(result < 0)) {
38390 Py_DECREF(v);
38391 return (npy_int32) -1;
38392 }
38393 is_negative = result == 1;
38394 }
38395 if (is_unsigned && unlikely(is_negative)) {
38396 Py_DECREF(v);
38397 PyErr_SetString(PyExc_OverflowError,
38398 "can't convert negative value to npy_int32");
38399 return (npy_int32) -1;
38400 } else if (is_negative) {
38401 stepval = PyNumber_Invert(v);
38402 Py_DECREF(v);
38403 if (unlikely(!stepval))
38404 return (npy_int32) -1;
38405 } else {
38406 stepval = v;
38407 }
38408 v = NULL;
38409 val = (npy_int32) 0;
38410 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
38411 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
38412 for (bits = 0; bits < (int) sizeof(npy_int32) * 8 - chunk_size; bits += chunk_size) {
38413 PyObject *tmp, *digit;
38414 long idigit;
38415 digit = PyNumber_And(stepval, mask);
38416 if (unlikely(!digit)) goto done;
38417 idigit = PyLong_AsLong(digit);
38418 Py_DECREF(digit);
38419 if (unlikely(idigit < 0)) goto done;
38420 val |= ((npy_int32) idigit) << bits;
38421 tmp = PyNumber_Rshift(stepval, shift);
38422 if (unlikely(!tmp)) goto done;
38423 Py_DECREF(stepval); stepval = tmp;
38424 }
38425 Py_DECREF(shift); shift = NULL;
38426 Py_DECREF(mask); mask = NULL;
38427 {
38428 long idigit = PyLong_AsLong(stepval);
38429 if (unlikely(idigit < 0)) goto done;
38430 remaining_bits = ((int) sizeof(npy_int32) * 8) - bits - (is_unsigned ? 0 : 1);
38431 if (unlikely(idigit >= (1L << remaining_bits)))
38432 goto raise_overflow;
38433 val |= ((npy_int32) idigit) << bits;
38434 }
38435 if (!is_unsigned) {
38436 if (unlikely(val & (((npy_int32) 1) << (sizeof(npy_int32) * 8 - 1))))
38437 goto raise_overflow;
38438 if (is_negative)
38439 val = ~val;
38440 }
38441 ret = 0;
38442done:
38443 Py_XDECREF(shift);
38444 Py_XDECREF(mask);
38445 Py_XDECREF(stepval);
38446#endif
38447 if (unlikely(ret))
38448 return (npy_int32) -1;
38449 return val;
38450raise_overflow:
38451 return __Pyx_raise_overflow___Pyx_PyLong_As_npy_int32();
38452}
38453static CYTHON_INLINE npy_int32 __Pyx_PyLong___Pyx_PyLong_As_npy_int32(PyObject *x) {
38454#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38455#pragma GCC diagnostic push
38456#pragma GCC diagnostic ignored "-Wconversion"
38457#endif
38458 const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
38459#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38460#pragma GCC diagnostic pop
38461#endif
38462 const int is_unsigned = neg_one > const_zero;
38463 if (is_unsigned) {
38464 #if CYTHON_USE_PYLONG_INTERNALS
38465 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
38466 goto raise_neg_overflow;
38467 } else if (__Pyx_PyLong_IsCompact(x)) {
38468 __PYX_VERIFY_RETURN_INT(npy_int32, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
38469 } else
38470 #endif
38471 {
38472 return __Pyx_PyULong___Pyx_PyLong_As_npy_int32(x);
38473 }
38474 } else {
38475 #if CYTHON_USE_PYLONG_INTERNALS
38476 if (__Pyx_PyLong_IsCompact(x)) {
38477 __PYX_VERIFY_RETURN_INT(npy_int32, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
38478 } else
38479 #endif
38480 {
38481 return __Pyx_PySLong___Pyx_PyLong_As_npy_int32(x);
38482 }
38483 }
38484#if CYTHON_USE_PYLONG_INTERNALS
38485raise_neg_overflow:
38486 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_npy_int32();
38487raise_overflow:
38488 return __Pyx_raise_overflow___Pyx_PyLong_As_npy_int32();
38489#endif
38490}
38491static npy_int32 __Pyx_NonPyLong___Pyx_PyLong_As_npy_int32(PyObject *x) {
38492 npy_int32 val;
38493 PyObject *tmp = __Pyx_PyNumber_Long(x);
38494 if (!tmp) return (npy_int32) -1;
38495 val = __Pyx_PyLong_As_npy_int32(tmp);
38496 Py_DECREF(tmp);
38497 return val;
38498}
38499static CYTHON_INLINE npy_int32 __Pyx_PyLong_As_npy_int32(PyObject *x) {
38500 if (likely(PyLong_Check(x))) {
38501 return __Pyx_PyLong___Pyx_PyLong_As_npy_int32(x);
38502 } else {
38503 return __Pyx_NonPyLong___Pyx_PyLong_As_npy_int32(x);
38504 }
38505}
38506
38507/* CIntFromPy */
38508static size_t __Pyx_LargePyLong___Pyx_PyLong_As_size_t(PyObject *x);
38509static size_t __Pyx_raise_neg_overflow___Pyx_PyLong_As_size_t(void) {
38510 const char* type_name = "size_t";
38511 PyErr_Format(PyExc_OverflowError,
38512 "can't convert negative value to %.200s", type_name);
38513 return (size_t) -1;
38514}
38515static size_t __Pyx_raise_overflow___Pyx_PyLong_As_size_t(void) {
38516 const char* type_name = "size_t";
38517 PyErr_Format(PyExc_OverflowError,
38518 "value too large to convert to %.200s", type_name);
38519 return (size_t) -1;
38520}
38521static CYTHON_INLINE size_t __Pyx_PyULong___Pyx_PyLong_As_size_t(PyObject *x) {
38522 const int is_unsigned = 1;
38523#if CYTHON_USE_PYLONG_INTERNALS
38524 {
38525 const digit* digits = __Pyx_PyLong_Digits(x);
38526 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38527 if (size == 2 && (8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
38528 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
38529 __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38530 } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) {
38531 return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38532 }
38533 } else
38534 if (size == 3 && (8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
38535 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
38536 __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38537 } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) {
38538 return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38539 }
38540 } else
38541 if (size == 4 && (8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
38542 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
38543 __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38544 } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) {
38545 return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38546 }
38547 } else
38548 {}
38549 }
38550#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
38551 if (unlikely(Py_SIZE(x) < 0)) {
38552 goto raise_neg_overflow;
38553 }
38554#else
38555 {
38556 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
38557 if (unlikely(result < 0))
38558 return (size_t) -1;
38559 if (unlikely(result == 1))
38560 goto raise_neg_overflow;
38561 }
38562#endif
38563 if ((sizeof(size_t) <= sizeof(unsigned long))) {
38564 __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
38565 } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) {
38566 __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
38567 }
38568 return __Pyx_LargePyLong___Pyx_PyLong_As_size_t(x);
38569raise_neg_overflow:
38570 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_size_t();
38571raise_overflow:
38572 return __Pyx_raise_overflow___Pyx_PyLong_As_size_t();
38573}
38574static CYTHON_INLINE size_t __Pyx_PySLong___Pyx_PyLong_As_size_t(PyObject *x) {
38575 const int is_unsigned = 0;
38576#if CYTHON_USE_PYLONG_INTERNALS
38577 if (__Pyx_PyLong_IsNeg(x)) {
38578 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38579 const digit* digits = __Pyx_PyLong_Digits(x);
38580 if (size == 2 && (8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
38581 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
38582 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38583 __PYX_VERIFY_RETURN_INT(size_t, long, ival)
38584 } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
38585 return (size_t) (((size_t) -1) * (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
38586 }
38587 } else
38588 if (size == 3 && (8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
38589 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
38590 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38591 __PYX_VERIFY_RETURN_INT(size_t, long, ival)
38592 } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
38593 return (size_t) (((size_t) -1) * (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
38594 }
38595 } else
38596 if (size == 4 && (8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
38597 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
38598 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38599 __PYX_VERIFY_RETURN_INT(size_t, long, ival)
38600 } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
38601 return (size_t) (((size_t) -1) * (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
38602 }
38603 } else
38604 {}
38605 } else {
38606 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38607 const digit* digits = __Pyx_PyLong_Digits(x);
38608 if (size == 2 && (8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
38609 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
38610 __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38611 } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
38612 return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38613 }
38614 } else
38615 if (size == 3 && (8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
38616 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
38617 __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38618 } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
38619 return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38620 }
38621 } else
38622 if (size == 4 && (8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
38623 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
38624 __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38625 } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
38626 return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38627 }
38628 } else
38629 {}
38630 }
38631#endif
38632 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
38633 if ((sizeof(size_t) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
38634 __PYX_VERIFY_RETURN_INT_EXC(size_t, int, PyLong_AsInt(x))
38635 } else
38636 #endif
38637 if ((sizeof(size_t) <= sizeof(long))) {
38638 __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
38639 } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) {
38640 __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
38641 }
38642 return __Pyx_LargePyLong___Pyx_PyLong_As_size_t(x);
38643raise_neg_overflow:
38644 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_size_t();
38645raise_overflow:
38646 return __Pyx_raise_overflow___Pyx_PyLong_As_size_t();
38647}
38648static size_t __Pyx_LargePyLong___Pyx_PyLong_As_size_t(PyObject *x) {
38649#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38650#pragma GCC diagnostic push
38651#pragma GCC diagnostic ignored "-Wconversion"
38652#endif
38653 const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
38654#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38655#pragma GCC diagnostic pop
38656#endif
38657 const int is_unsigned = neg_one > const_zero;
38658 size_t val;
38659 int ret = -1;
38660#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
38661 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
38662 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
38663 if (unlikely(bytes_copied == -1)) {
38664 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
38665 goto raise_overflow;
38666 } else {
38667 ret = 0;
38668 }
38669#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
38670 int one = 1; int is_little = (int)*(unsigned char *)&one;
38671 unsigned char *bytes = (unsigned char *)&val;
38672 ret = _PyLong_AsByteArray((PyLongObject *)x,
38673 bytes, sizeof(val),
38674 is_little, !is_unsigned);
38675 if ((0)) goto raise_overflow;
38676#else
38677 PyObject *v;
38678 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
38679 int bits, remaining_bits, is_negative = 0;
38680 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
38681 if (likely(PyLong_CheckExact(x))) {
38682 v = __Pyx_NewRef(x);
38683 } else {
38684 v = PyNumber_Long(x);
38685 if (unlikely(!v)) return (size_t) -1;
38686 assert(PyLong_CheckExact(v));
38687 }
38688 {
38689 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
38690 if (unlikely(result < 0)) {
38691 Py_DECREF(v);
38692 return (size_t) -1;
38693 }
38694 is_negative = result == 1;
38695 }
38696 if (is_unsigned && unlikely(is_negative)) {
38697 Py_DECREF(v);
38698 PyErr_SetString(PyExc_OverflowError,
38699 "can't convert negative value to size_t");
38700 return (size_t) -1;
38701 } else if (is_negative) {
38702 stepval = PyNumber_Invert(v);
38703 Py_DECREF(v);
38704 if (unlikely(!stepval))
38705 return (size_t) -1;
38706 } else {
38707 stepval = v;
38708 }
38709 v = NULL;
38710 val = (size_t) 0;
38711 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
38712 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
38713 for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) {
38714 PyObject *tmp, *digit;
38715 long idigit;
38716 digit = PyNumber_And(stepval, mask);
38717 if (unlikely(!digit)) goto done;
38718 idigit = PyLong_AsLong(digit);
38719 Py_DECREF(digit);
38720 if (unlikely(idigit < 0)) goto done;
38721 val |= ((size_t) idigit) << bits;
38722 tmp = PyNumber_Rshift(stepval, shift);
38723 if (unlikely(!tmp)) goto done;
38724 Py_DECREF(stepval); stepval = tmp;
38725 }
38726 Py_DECREF(shift); shift = NULL;
38727 Py_DECREF(mask); mask = NULL;
38728 {
38729 long idigit = PyLong_AsLong(stepval);
38730 if (unlikely(idigit < 0)) goto done;
38731 remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1);
38732 if (unlikely(idigit >= (1L << remaining_bits)))
38733 goto raise_overflow;
38734 val |= ((size_t) idigit) << bits;
38735 }
38736 if (!is_unsigned) {
38737 if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1))))
38738 goto raise_overflow;
38739 if (is_negative)
38740 val = ~val;
38741 }
38742 ret = 0;
38743done:
38744 Py_XDECREF(shift);
38745 Py_XDECREF(mask);
38746 Py_XDECREF(stepval);
38747#endif
38748 if (unlikely(ret))
38749 return (size_t) -1;
38750 return val;
38751raise_overflow:
38752 return __Pyx_raise_overflow___Pyx_PyLong_As_size_t();
38753}
38754static CYTHON_INLINE size_t __Pyx_PyLong___Pyx_PyLong_As_size_t(PyObject *x) {
38755#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38756#pragma GCC diagnostic push
38757#pragma GCC diagnostic ignored "-Wconversion"
38758#endif
38759 const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
38760#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38761#pragma GCC diagnostic pop
38762#endif
38763 const int is_unsigned = neg_one > const_zero;
38764 if (is_unsigned) {
38765 #if CYTHON_USE_PYLONG_INTERNALS
38766 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
38767 goto raise_neg_overflow;
38768 } else if (__Pyx_PyLong_IsCompact(x)) {
38769 __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
38770 } else
38771 #endif
38772 {
38773 return __Pyx_PyULong___Pyx_PyLong_As_size_t(x);
38774 }
38775 } else {
38776 #if CYTHON_USE_PYLONG_INTERNALS
38777 if (__Pyx_PyLong_IsCompact(x)) {
38778 __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
38779 } else
38780 #endif
38781 {
38782 return __Pyx_PySLong___Pyx_PyLong_As_size_t(x);
38783 }
38784 }
38785#if CYTHON_USE_PYLONG_INTERNALS
38786raise_neg_overflow:
38787 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_size_t();
38788raise_overflow:
38789 return __Pyx_raise_overflow___Pyx_PyLong_As_size_t();
38790#endif
38791}
38792static size_t __Pyx_NonPyLong___Pyx_PyLong_As_size_t(PyObject *x) {
38793 size_t val;
38794 PyObject *tmp = __Pyx_PyNumber_Long(x);
38795 if (!tmp) return (size_t) -1;
38796 val = __Pyx_PyLong_As_size_t(tmp);
38797 Py_DECREF(tmp);
38798 return val;
38799}
38800static CYTHON_INLINE size_t __Pyx_PyLong_As_size_t(PyObject *x) {
38801 if (likely(PyLong_Check(x))) {
38802 return __Pyx_PyLong___Pyx_PyLong_As_size_t(x);
38803 } else {
38804 return __Pyx_NonPyLong___Pyx_PyLong_As_size_t(x);
38805 }
38806}
38807
38808/* PyObjectCallMethod1 (used by UpdateUnpickledDict) */
38809static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
38810#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
38811 PyObject *args[2] = {obj, arg};
38812 return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
38813#elif CYTHON_COMPILING_IN_LIMITED_API
38814 return PyObject_CallMethodObjArgs(obj, method_name, arg, NULL);
38815#else
38816 return PyObject_CallMethodOneArg(obj, method_name, arg);
38817#endif
38818}
38819
38820/* UpdateUnpickledDict */
38821static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
38822 PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
38823 if (unlikely(!state_dict)) {
38824 return -1;
38825 }
38826 int non_empty = PyObject_IsTrue(state_dict);
38827 if (non_empty == 0) {
38828 Py_DECREF(state_dict);
38829 return 0;
38830 } else if (unlikely(non_empty == -1)) {
38831 return -1;
38832 }
38833 PyObject *dict;
38834 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
38835 dict = PyObject_GetAttrString(obj, "__dict__");
38836 #else
38837 dict = PyObject_GenericGetDict(obj, NULL);
38838 #endif
38839 if (unlikely(!dict)) {
38840 Py_DECREF(state_dict);
38841 return -1;
38842 }
38843 int result;
38844 if (likely(PyDict_CheckExact(dict))) {
38845 result = PyDict_Update(dict, state_dict);
38846 } else {
38847 PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
38848 if (likely(obj_result)) {
38849 Py_DECREF(obj_result);
38850 result = 0;
38851 } else {
38852 result = -1;
38853 }
38854 }
38855 Py_DECREF(state_dict);
38856 Py_DECREF(dict);
38857 return result;
38858}
38859static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
38860 Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
38861 #if !CYTHON_ASSUME_SAFE_SIZE
38862 if (unlikely(state_size == -1)) return -1;
38863 #endif
38864 if (state_size <= index) {
38865 return 0;
38866 }
38867 return __Pyx__UpdateUnpickledDict(obj, state, index);
38868}
38869
38870/* CheckUnpickleChecksumError (used by CheckUnpickleChecksum) */
38871static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
38872 PyObject *pickle_module = PyImport_ImportModule("pickle");
38873 if (unlikely(!pickle_module)) return;
38874 PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
38875 Py_DECREF(pickle_module);
38876 if (unlikely(!pickle_error)) return;
38877 if (checksum2 == checksum1) {
38878 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
38879 checksum, checksum1, members);
38880 } else if (checksum3 == checksum2) {
38881 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
38882 checksum, checksum1, checksum2, members);
38883 } else {
38884 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
38885 checksum, checksum1, checksum2, checksum3, members);
38886 }
38887 Py_DECREF(pickle_error);
38888}
38889
38890/* CheckUnpickleChecksum */
38891static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
38892 int found = 0;
38893 found |= checksum1 == checksum;
38894 found |= checksum2 == checksum;
38895 found |= checksum3 == checksum;
38896 if (likely(found))
38897 return 0;
38898 __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
38899 return -1;
38900}
38901
38902/* CIntFromPy */
38903static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
38904static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(void) {
38905 const char* type_name = "long";
38906 PyErr_Format(PyExc_OverflowError,
38907 "can't convert negative value to %.200s", type_name);
38908 return (long) -1;
38909}
38910static long __Pyx_raise_overflow___Pyx_PyLong_As_long(void) {
38911 const char* type_name = "long";
38912 PyErr_Format(PyExc_OverflowError,
38913 "value too large to convert to %.200s", type_name);
38914 return (long) -1;
38915}
38916static CYTHON_INLINE long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
38917 const int is_unsigned = 1;
38918#if CYTHON_USE_PYLONG_INTERNALS
38919 {
38920 const digit* digits = __Pyx_PyLong_Digits(x);
38921 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38922 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
38923 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
38924 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38925 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
38926 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
38927 }
38928 } else
38929 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
38930 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
38931 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38932 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
38933 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
38934 }
38935 } else
38936 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
38937 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
38938 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38939 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
38940 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
38941 }
38942 } else
38943 {}
38944 }
38945#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
38946 if (unlikely(Py_SIZE(x) < 0)) {
38947 goto raise_neg_overflow;
38948 }
38949#else
38950 {
38951 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
38952 if (unlikely(result < 0))
38953 return (long) -1;
38954 if (unlikely(result == 1))
38955 goto raise_neg_overflow;
38956 }
38957#endif
38958 if ((sizeof(long) <= sizeof(unsigned long))) {
38959 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
38960 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
38961 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
38962 }
38963 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
38964raise_neg_overflow:
38965 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
38966raise_overflow:
38967 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
38968}
38969static CYTHON_INLINE long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
38970 const int is_unsigned = 0;
38971#if CYTHON_USE_PYLONG_INTERNALS
38972 if (__Pyx_PyLong_IsNeg(x)) {
38973 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38974 const digit* digits = __Pyx_PyLong_Digits(x);
38975 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
38976 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
38977 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38978 __PYX_VERIFY_RETURN_INT(long, long, ival)
38979 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
38980 return (long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
38981 }
38982 } else
38983 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
38984 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
38985 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38986 __PYX_VERIFY_RETURN_INT(long, long, ival)
38987 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
38988 return (long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
38989 }
38990 } else
38991 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
38992 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
38993 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38994 __PYX_VERIFY_RETURN_INT(long, long, ival)
38995 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
38996 return (long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
38997 }
38998 } else
38999 {}
39000 } else {
39001 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
39002 const digit* digits = __Pyx_PyLong_Digits(x);
39003 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
39004 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
39005 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39006 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
39007 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
39008 }
39009 } else
39010 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
39011 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
39012 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39013 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
39014 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
39015 }
39016 } else
39017 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
39018 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
39019 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39020 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
39021 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
39022 }
39023 } else
39024 {}
39025 }
39026#endif
39027 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
39028 if ((sizeof(long) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
39029 __PYX_VERIFY_RETURN_INT_EXC(long, int, PyLong_AsInt(x))
39030 } else
39031 #endif
39032 if ((sizeof(long) <= sizeof(long))) {
39033 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
39034 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
39035 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
39036 }
39037 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
39038raise_neg_overflow:
39039 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
39040raise_overflow:
39041 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
39042}
39043static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
39044#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39045#pragma GCC diagnostic push
39046#pragma GCC diagnostic ignored "-Wconversion"
39047#endif
39048 const long neg_one = (long) -1, const_zero = (long) 0;
39049#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39050#pragma GCC diagnostic pop
39051#endif
39052 const int is_unsigned = neg_one > const_zero;
39053 long val;
39054 int ret = -1;
39055#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
39056 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
39057 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
39058 if (unlikely(bytes_copied == -1)) {
39059 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
39060 goto raise_overflow;
39061 } else {
39062 ret = 0;
39063 }
39064#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
39065 int one = 1; int is_little = (int)*(unsigned char *)&one;
39066 unsigned char *bytes = (unsigned char *)&val;
39067 ret = _PyLong_AsByteArray((PyLongObject *)x,
39068 bytes, sizeof(val),
39069 is_little, !is_unsigned);
39070 if ((0)) goto raise_overflow;
39071#else
39072 PyObject *v;
39073 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
39074 int bits, remaining_bits, is_negative = 0;
39075 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
39076 if (likely(PyLong_CheckExact(x))) {
39077 v = __Pyx_NewRef(x);
39078 } else {
39079 v = PyNumber_Long(x);
39080 if (unlikely(!v)) return (long) -1;
39081 assert(PyLong_CheckExact(v));
39082 }
39083 {
39084 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
39085 if (unlikely(result < 0)) {
39086 Py_DECREF(v);
39087 return (long) -1;
39088 }
39089 is_negative = result == 1;
39090 }
39091 if (is_unsigned && unlikely(is_negative)) {
39092 Py_DECREF(v);
39093 PyErr_SetString(PyExc_OverflowError,
39094 "can't convert negative value to long");
39095 return (long) -1;
39096 } else if (is_negative) {
39097 stepval = PyNumber_Invert(v);
39098 Py_DECREF(v);
39099 if (unlikely(!stepval))
39100 return (long) -1;
39101 } else {
39102 stepval = v;
39103 }
39104 v = NULL;
39105 val = (long) 0;
39106 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
39107 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
39108 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
39109 PyObject *tmp, *digit;
39110 long idigit;
39111 digit = PyNumber_And(stepval, mask);
39112 if (unlikely(!digit)) goto done;
39113 idigit = PyLong_AsLong(digit);
39114 Py_DECREF(digit);
39115 if (unlikely(idigit < 0)) goto done;
39116 val |= ((long) idigit) << bits;
39117 tmp = PyNumber_Rshift(stepval, shift);
39118 if (unlikely(!tmp)) goto done;
39119 Py_DECREF(stepval); stepval = tmp;
39120 }
39121 Py_DECREF(shift); shift = NULL;
39122 Py_DECREF(mask); mask = NULL;
39123 {
39124 long idigit = PyLong_AsLong(stepval);
39125 if (unlikely(idigit < 0)) goto done;
39126 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
39127 if (unlikely(idigit >= (1L << remaining_bits)))
39128 goto raise_overflow;
39129 val |= ((long) idigit) << bits;
39130 }
39131 if (!is_unsigned) {
39132 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
39133 goto raise_overflow;
39134 if (is_negative)
39135 val = ~val;
39136 }
39137 ret = 0;
39138done:
39139 Py_XDECREF(shift);
39140 Py_XDECREF(mask);
39141 Py_XDECREF(stepval);
39142#endif
39143 if (unlikely(ret))
39144 return (long) -1;
39145 return val;
39146raise_overflow:
39147 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
39148}
39149static CYTHON_INLINE long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
39150#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39151#pragma GCC diagnostic push
39152#pragma GCC diagnostic ignored "-Wconversion"
39153#endif
39154 const long neg_one = (long) -1, const_zero = (long) 0;
39155#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39156#pragma GCC diagnostic pop
39157#endif
39158 const int is_unsigned = neg_one > const_zero;
39159 if (is_unsigned) {
39160 #if CYTHON_USE_PYLONG_INTERNALS
39161 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
39162 goto raise_neg_overflow;
39163 } else if (__Pyx_PyLong_IsCompact(x)) {
39164 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
39165 } else
39166 #endif
39167 {
39168 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
39169 }
39170 } else {
39171 #if CYTHON_USE_PYLONG_INTERNALS
39172 if (__Pyx_PyLong_IsCompact(x)) {
39173 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
39174 } else
39175 #endif
39176 {
39177 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
39178 }
39179 }
39180#if CYTHON_USE_PYLONG_INTERNALS
39181raise_neg_overflow:
39182 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
39183raise_overflow:
39184 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
39185#endif
39186}
39187static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
39188 long val;
39189 PyObject *tmp = __Pyx_PyNumber_Long(x);
39190 if (!tmp) return (long) -1;
39191 val = __Pyx_PyLong_As_long(tmp);
39192 Py_DECREF(tmp);
39193 return val;
39194}
39195static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
39196 if (likely(PyLong_Check(x))) {
39197 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
39198 } else {
39199 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
39200 }
39201}
39202
39203/* CIntToPy */
39204static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
39205#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39206#pragma GCC diagnostic push
39207#pragma GCC diagnostic ignored "-Wconversion"
39208#endif
39209 const long neg_one = (long) -1, const_zero = (long) 0;
39210#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39211#pragma GCC diagnostic pop
39212#endif
39213 const int is_unsigned = neg_one > const_zero;
39214 if (is_unsigned) {
39215 if (sizeof(long) < sizeof(long)) {
39216 return PyLong_FromLong((long) value);
39217 } else if (sizeof(long) <= sizeof(unsigned long)) {
39218 return PyLong_FromUnsignedLong((unsigned long) value);
39219#if !CYTHON_COMPILING_IN_PYPY
39220 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
39221 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
39222#endif
39223 }
39224 } else {
39225 if (sizeof(long) <= sizeof(long)) {
39226 return PyLong_FromLong((long) value);
39227 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
39228 return PyLong_FromLongLong((PY_LONG_LONG) value);
39229 }
39230 }
39231 {
39232 unsigned char *bytes = (unsigned char *)&value;
39233#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
39234 if (is_unsigned) {
39235 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
39236 } else {
39237 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
39238 }
39239#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
39240 int one = 1; int little = (int)*(unsigned char *)&one;
39241 return _PyLong_FromByteArray(bytes, sizeof(long),
39242 little, !is_unsigned);
39243#else
39244 int one = 1; int little = (int)*(unsigned char *)&one;
39245 PyObject *result = NULL, *kwds = NULL;
39246 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
39247 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
39248 if (!py_bytes) goto limited_bad;
39249 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
39250 if (!from_bytes_str) goto limited_bad;
39251 order_str = PyUnicode_FromString(little ? "little" : "big");
39252 if (!order_str) goto limited_bad;
39253 {
39254 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
39255 if (!is_unsigned) {
39256 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
39257 if (!signed_str) goto limited_bad;
39258#if CYTHON_VECTORCALL
39259 kwds = PyTuple_Pack(1, signed_str);
39260#else
39261 {
39262 PyObject *keys[] = {signed_str};
39263 PyObject *values[] = {Py_True};
39264 kwds = __Pyx_MakeKwargDict(keys, values, 1);
39265 }
39266#endif
39267 Py_DECREF(signed_str);
39268 if (unlikely(!kwds)) goto limited_bad;
39269 }
39270 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
39271 }
39272 limited_bad:
39273 Py_XDECREF(kwds);
39274 Py_XDECREF(order_str);
39275 Py_XDECREF(py_bytes);
39276 Py_XDECREF(from_bytes_str);
39277 return result;
39278#endif
39279 }
39280}
39281
39282/* CIntFromPy */
39283static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x);
39284static char __Pyx_raise_neg_overflow___Pyx_PyLong_As_char(void) {
39285 const char* type_name = "char";
39286 PyErr_Format(PyExc_OverflowError,
39287 "can't convert negative value to %.200s", type_name);
39288 return (char) -1;
39289}
39290static char __Pyx_raise_overflow___Pyx_PyLong_As_char(void) {
39291 const char* type_name = "char";
39292 PyErr_Format(PyExc_OverflowError,
39293 "value too large to convert to %.200s", type_name);
39294 return (char) -1;
39295}
39296static CYTHON_INLINE char __Pyx_PyULong___Pyx_PyLong_As_char(PyObject *x) {
39297 const int is_unsigned = 1;
39298#if CYTHON_USE_PYLONG_INTERNALS
39299 {
39300 const digit* digits = __Pyx_PyLong_Digits(x);
39301 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
39302 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
39303 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
39304 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39305 } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
39306 return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39307 }
39308 } else
39309 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
39310 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
39311 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39312 } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
39313 return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39314 }
39315 } else
39316 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
39317 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
39318 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39319 } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
39320 return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39321 }
39322 } else
39323 {}
39324 }
39325#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
39326 if (unlikely(Py_SIZE(x) < 0)) {
39327 goto raise_neg_overflow;
39328 }
39329#else
39330 {
39331 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
39332 if (unlikely(result < 0))
39333 return (char) -1;
39334 if (unlikely(result == 1))
39335 goto raise_neg_overflow;
39336 }
39337#endif
39338 if ((sizeof(char) <= sizeof(unsigned long))) {
39339 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
39340 } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
39341 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
39342 }
39343 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
39344raise_neg_overflow:
39345 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
39346raise_overflow:
39347 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
39348}
39349static CYTHON_INLINE char __Pyx_PySLong___Pyx_PyLong_As_char(PyObject *x) {
39350 const int is_unsigned = 0;
39351#if CYTHON_USE_PYLONG_INTERNALS
39352 if (__Pyx_PyLong_IsNeg(x)) {
39353 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
39354 const digit* digits = __Pyx_PyLong_Digits(x);
39355 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
39356 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
39357 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39358 __PYX_VERIFY_RETURN_INT(char, long, ival)
39359 } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
39360 return (char) (((char) -1) * (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
39361 }
39362 } else
39363 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
39364 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
39365 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39366 __PYX_VERIFY_RETURN_INT(char, long, ival)
39367 } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
39368 return (char) (((char) -1) * (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
39369 }
39370 } else
39371 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
39372 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
39373 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39374 __PYX_VERIFY_RETURN_INT(char, long, ival)
39375 } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
39376 return (char) (((char) -1) * (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
39377 }
39378 } else
39379 {}
39380 } else {
39381 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
39382 const digit* digits = __Pyx_PyLong_Digits(x);
39383 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
39384 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
39385 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39386 } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
39387 return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39388 }
39389 } else
39390 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
39391 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
39392 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39393 } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
39394 return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39395 }
39396 } else
39397 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
39398 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
39399 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
39400 } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
39401 return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39402 }
39403 } else
39404 {}
39405 }
39406#endif
39407 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
39408 if ((sizeof(char) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
39409 __PYX_VERIFY_RETURN_INT_EXC(char, int, PyLong_AsInt(x))
39410 } else
39411 #endif
39412 if ((sizeof(char) <= sizeof(long))) {
39413 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
39414 } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
39415 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
39416 }
39417 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
39418raise_neg_overflow:
39419 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
39420raise_overflow:
39421 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
39422}
39423static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x) {
39424#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39425#pragma GCC diagnostic push
39426#pragma GCC diagnostic ignored "-Wconversion"
39427#endif
39428 const char neg_one = (char) -1, const_zero = (char) 0;
39429#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39430#pragma GCC diagnostic pop
39431#endif
39432 const int is_unsigned = neg_one > const_zero;
39433 char val;
39434 int ret = -1;
39435#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
39436 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
39437 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
39438 if (unlikely(bytes_copied == -1)) {
39439 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
39440 goto raise_overflow;
39441 } else {
39442 ret = 0;
39443 }
39444#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
39445 int one = 1; int is_little = (int)*(unsigned char *)&one;
39446 unsigned char *bytes = (unsigned char *)&val;
39447 ret = _PyLong_AsByteArray((PyLongObject *)x,
39448 bytes, sizeof(val),
39449 is_little, !is_unsigned);
39450 if ((0)) goto raise_overflow;
39451#else
39452 PyObject *v;
39453 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
39454 int bits, remaining_bits, is_negative = 0;
39455 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
39456 if (likely(PyLong_CheckExact(x))) {
39457 v = __Pyx_NewRef(x);
39458 } else {
39459 v = PyNumber_Long(x);
39460 if (unlikely(!v)) return (char) -1;
39461 assert(PyLong_CheckExact(v));
39462 }
39463 {
39464 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
39465 if (unlikely(result < 0)) {
39466 Py_DECREF(v);
39467 return (char) -1;
39468 }
39469 is_negative = result == 1;
39470 }
39471 if (is_unsigned && unlikely(is_negative)) {
39472 Py_DECREF(v);
39473 PyErr_SetString(PyExc_OverflowError,
39474 "can't convert negative value to char");
39475 return (char) -1;
39476 } else if (is_negative) {
39477 stepval = PyNumber_Invert(v);
39478 Py_DECREF(v);
39479 if (unlikely(!stepval))
39480 return (char) -1;
39481 } else {
39482 stepval = v;
39483 }
39484 v = NULL;
39485 val = (char) 0;
39486 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
39487 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
39488 for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
39489 PyObject *tmp, *digit;
39490 long idigit;
39491 digit = PyNumber_And(stepval, mask);
39492 if (unlikely(!digit)) goto done;
39493 idigit = PyLong_AsLong(digit);
39494 Py_DECREF(digit);
39495 if (unlikely(idigit < 0)) goto done;
39496 val |= ((char) idigit) << bits;
39497 tmp = PyNumber_Rshift(stepval, shift);
39498 if (unlikely(!tmp)) goto done;
39499 Py_DECREF(stepval); stepval = tmp;
39500 }
39501 Py_DECREF(shift); shift = NULL;
39502 Py_DECREF(mask); mask = NULL;
39503 {
39504 long idigit = PyLong_AsLong(stepval);
39505 if (unlikely(idigit < 0)) goto done;
39506 remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
39507 if (unlikely(idigit >= (1L << remaining_bits)))
39508 goto raise_overflow;
39509 val |= ((char) idigit) << bits;
39510 }
39511 if (!is_unsigned) {
39512 if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
39513 goto raise_overflow;
39514 if (is_negative)
39515 val = ~val;
39516 }
39517 ret = 0;
39518done:
39519 Py_XDECREF(shift);
39520 Py_XDECREF(mask);
39521 Py_XDECREF(stepval);
39522#endif
39523 if (unlikely(ret))
39524 return (char) -1;
39525 return val;
39526raise_overflow:
39527 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
39528}
39529static CYTHON_INLINE char __Pyx_PyLong___Pyx_PyLong_As_char(PyObject *x) {
39530#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39531#pragma GCC diagnostic push
39532#pragma GCC diagnostic ignored "-Wconversion"
39533#endif
39534 const char neg_one = (char) -1, const_zero = (char) 0;
39535#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39536#pragma GCC diagnostic pop
39537#endif
39538 const int is_unsigned = neg_one > const_zero;
39539 if (is_unsigned) {
39540 #if CYTHON_USE_PYLONG_INTERNALS
39541 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
39542 goto raise_neg_overflow;
39543 } else if (__Pyx_PyLong_IsCompact(x)) {
39544 __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
39545 } else
39546 #endif
39547 {
39548 return __Pyx_PyULong___Pyx_PyLong_As_char(x);
39549 }
39550 } else {
39551 #if CYTHON_USE_PYLONG_INTERNALS
39552 if (__Pyx_PyLong_IsCompact(x)) {
39553 __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
39554 } else
39555 #endif
39556 {
39557 return __Pyx_PySLong___Pyx_PyLong_As_char(x);
39558 }
39559 }
39560#if CYTHON_USE_PYLONG_INTERNALS
39561raise_neg_overflow:
39562 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
39563raise_overflow:
39564 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
39565#endif
39566}
39567static char __Pyx_NonPyLong___Pyx_PyLong_As_char(PyObject *x) {
39568 char val;
39569 PyObject *tmp = __Pyx_PyNumber_Long(x);
39570 if (!tmp) return (char) -1;
39571 val = __Pyx_PyLong_As_char(tmp);
39572 Py_DECREF(tmp);
39573 return val;
39574}
39575static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *x) {
39576 if (likely(PyLong_Check(x))) {
39577 return __Pyx_PyLong___Pyx_PyLong_As_char(x);
39578 } else {
39579 return __Pyx_NonPyLong___Pyx_PyLong_As_char(x);
39580 }
39581}
39582
39583/* GetRuntimeVersion */
39584#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
39585void __Pyx_init_runtime_version(void) {
39586 if (__Pyx_cached_runtime_version == 0) {
39587 const char* rt_version = Py_GetVersion();
39588 unsigned long version = 0;
39589 unsigned long factor = 0x01000000UL;
39590 unsigned int digit = 0;
39591 int i = 0;
39592 while (factor) {
39593 while ('0' <= rt_version[i] && rt_version[i] <= '9') {
39594 digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
39595 ++i;
39596 }
39597 version += factor * digit;
39598 if (rt_version[i] != '.')
39599 break;
39600 digit = 0;
39601 factor >>= 8;
39602 ++i;
39603 }
39604 __Pyx_cached_runtime_version = version;
39605 }
39606}
39607#endif
39608static unsigned long __Pyx_get_runtime_version(void) {
39609#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
39610 return Py_Version & ~0xFFUL;
39611#else
39612 return __Pyx_cached_runtime_version;
39613#endif
39614}
39615
39616/* CheckBinaryVersion */
39617static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
39618 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
39619 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
39620 return 0;
39621 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
39622 return 1;
39623 {
39624 char message[200];
39625 PyOS_snprintf(message, sizeof(message),
39626 "compile time Python version %d.%d "
39627 "of module '%.100s' "
39628 "%s "
39629 "runtime version %d.%d",
39630 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
39631 __Pyx_MODULE_NAME,
39632 (allow_newer) ? "was newer than" : "does not match",
39633 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
39634 );
39635 return PyErr_WarnEx(NULL, message, 1);
39636 }
39637}
39638
39639/* NewCodeObj */
39640#if CYTHON_COMPILING_IN_LIMITED_API
39641 static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
39642 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
39643 PyObject *fv, PyObject *cell, PyObject* fn,
39644 PyObject *name, int fline, PyObject *lnos) {
39645 PyObject *exception_table = NULL;
39646 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
39647 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
39648 PyObject *version_info;
39649 PyObject *py_minor_version = NULL;
39650 #endif
39651 long minor_version = 0;
39652 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
39653 minor_version = 11;
39654 #else
39655 if (!(version_info = PySys_GetObject("version_info"))) goto end;
39656 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
39657 minor_version = PyLong_AsLong(py_minor_version);
39658 Py_DECREF(py_minor_version);
39659 if (minor_version == -1 && PyErr_Occurred()) goto end;
39660 #endif
39661 if (!(types_module = PyImport_ImportModule("types"))) goto end;
39662 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
39663 if (minor_version <= 10) {
39664 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
39665 c, n, v, fn, name, fline, lnos, fv, cell);
39666 } else {
39667 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
39668 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
39669 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
39670 }
39671 end:
39672 Py_XDECREF(code_type);
39673 Py_XDECREF(exception_table);
39674 Py_XDECREF(types_module);
39675 if (!result) {
39676 PyObject *exc_type, *exc_value, *exc_tb;
39677 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
39678 if (PyErr_WarnFormat(
39679 PyExc_RuntimeWarning, 1,
39680 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
39681 exc_value ? exc_value : exc_type) == 0) {
39682 result = Py_None;
39683 Py_INCREF(result);
39684 }
39685 Py_DECREF(exc_type);
39686 Py_XDECREF(exc_value);
39687 Py_XDECREF(exc_tb);
39688 }
39689 return result;
39690 }
39691#elif PY_VERSION_HEX >= 0x030B0000
39692 static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
39693 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
39694 PyObject *fv, PyObject *cell, PyObject* fn,
39695 PyObject *name, int fline, PyObject *lnos) {
39696 PyCodeObject *result;
39697 result =
39698 #if PY_VERSION_HEX >= 0x030C0000
39699 PyUnstable_Code_NewWithPosOnlyArgs
39700 #else
39701 PyCode_NewWithPosOnlyArgs
39702 #endif
39703 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
39704 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
39705 if (likely(result))
39706 result->_co_firsttraceable = 0;
39707 #endif
39708 return result;
39709 }
39710#elif !CYTHON_COMPILING_IN_PYPY
39711 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
39712 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
39713#else
39714 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
39715 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
39716#endif
39717static PyObject* __Pyx_PyCode_New(
39718 const __Pyx_PyCode_New_function_description descr,
39719 PyObject * const *varnames,
39720 PyObject *filename,
39721 PyObject *funcname,
39722 PyObject *line_table,
39723 PyObject *tuple_dedup_map
39724) {
39725 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
39726 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
39727 PyObject *varnames_tuple = PyTuple_New(var_count);
39728 if (unlikely(!varnames_tuple)) return NULL;
39729 for (Py_ssize_t i=0; i < var_count; i++) {
39730 Py_INCREF(varnames[i]);
39731 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
39732 }
39733 #if CYTHON_COMPILING_IN_LIMITED_API
39734 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
39735 if (!varnames_tuple_dedup) {
39736 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
39737 varnames_tuple_dedup = varnames_tuple;
39738 }
39739 #else
39740 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
39741 if (unlikely(!varnames_tuple_dedup)) goto done;
39742 #endif
39743 #if CYTHON_AVOID_BORROWED_REFS
39744 Py_INCREF(varnames_tuple_dedup);
39745 #endif
39746 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
39747 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
39748 #if !CYTHON_ASSUME_SAFE_SIZE
39749 if (unlikely(line_table_length == -1)) goto done;
39750 #endif
39751 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
39752 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
39753 if (unlikely(!code_bytes)) goto done;
39754 char* c_code_bytes = PyBytes_AsString(code_bytes);
39755 if (unlikely(!c_code_bytes)) goto done;
39756 memset(c_code_bytes, 0, (size_t) code_len);
39757 }
39758 code_obj = (PyObject*) __Pyx__PyCode_New(
39759 (int) descr.argcount,
39760 (int) descr.num_posonly_args,
39761 (int) descr.num_kwonly_args,
39762 (int) descr.nlocals,
39763 0,
39764 (int) descr.flags,
39765 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
39766 __pyx_mstate_global->__pyx_empty_tuple,
39767 __pyx_mstate_global->__pyx_empty_tuple,
39768 varnames_tuple_dedup,
39769 __pyx_mstate_global->__pyx_empty_tuple,
39770 __pyx_mstate_global->__pyx_empty_tuple,
39771 filename,
39772 funcname,
39773 (int) descr.first_line,
39774 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
39775 );
39776done:
39777 Py_XDECREF(code_bytes);
39778 #if CYTHON_AVOID_BORROWED_REFS
39779 Py_XDECREF(varnames_tuple_dedup);
39780 #endif
39781 Py_DECREF(varnames_tuple);
39782 return code_obj;
39783}
39784
39785/* DecompressString */
39786CYTHON_UNUSED
39787static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
39788#ifdef __Pyx_DecompressString_UNUSED
39789 CYTHON_UNUSED_VAR(s);
39790 CYTHON_UNUSED_VAR(length);
39791 CYTHON_UNUSED_VAR(algo);
39792 return NULL;
39793#else
39794 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
39795 const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
39796 PyObject *methodname = PyUnicode_FromString("decompress");
39797 if (unlikely(!methodname)) return NULL;
39798 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
39799 if (algo == 3) {
39800 PyObject *fromlist = Py_BuildValue("[O]", methodname);
39801 if (unlikely(!fromlist)) goto bad;
39802 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
39803 Py_DECREF(fromlist);
39804 } else
39805 #endif
39806 module = PyImport_ImportModule(module_name);
39807 if (unlikely(!module)) goto import_failed;
39808 decompress = PyObject_GetAttr(module, methodname);
39809 if (unlikely(!decompress)) goto import_failed;
39810 {
39811 #ifdef __cplusplus
39812 char *memview_bytes = const_cast<char*>(s);
39813 #else
39814 #if defined(__clang__)
39815 #pragma clang diagnostic push
39816 #pragma clang diagnostic ignored "-Wcast-qual"
39817 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
39818 #pragma GCC diagnostic push
39819 #pragma GCC diagnostic ignored "-Wcast-qual"
39820 #endif
39821 char *memview_bytes = (char*) s;
39822 #if defined(__clang__)
39823 #pragma clang diagnostic pop
39824 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
39825 #pragma GCC diagnostic pop
39826 #endif
39827 #endif
39828 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
39829 int memview_flags = 0x100;
39830 #else
39831 int memview_flags = PyBUF_READ;
39832 #endif
39833 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
39834 }
39835 if (unlikely(!compressed_bytes)) {
39836 Py_DECREF(decompress);
39837 goto bad;
39838 }
39839 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
39840 Py_DECREF(compressed_bytes);
39841 Py_DECREF(decompress);
39842 Py_DECREF(module);
39843 Py_DECREF(methodname);
39844 return decompressed;
39845import_failed:
39846 PyErr_Format(PyExc_ImportError,
39847 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
39848 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
39849 module_name, algo);
39850bad:
39851 Py_XDECREF(module);
39852 Py_DECREF(methodname);
39853 return NULL;
39854#endif
39855}
39856
39857/* DecompressString_LZSS */
39858#ifndef __Pyx_DecompressString_LZSS_UNUSED
39859CYTHON_UNUSED
39860static CYTHON_SMALL_CODE size_t __pyx_lzss_decompress(const uint8_t* src, uint8_t* dst, size_t dst_len) {
39861 size_t pos = 0, out_pos = 0;
39862 while (1) {
39863 uint32_t flags = src[pos++] | 0xFF00;
39864 while (flags & 0x100) {
39865 if (flags & 1) {
39866 dst[out_pos++] = src[pos++];
39867 } else {
39868 uint32_t lo = src[pos++], hi = src[pos++];
39869 uint32_t end_offset_of_last_occurrence, match_length;
39870 if (!(lo & 0x80)) {
39871 end_offset_of_last_occurrence = lo;
39872 match_length = hi;
39873 } else if (!(hi & 0x80)) {
39874 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
39875 match_length = hi & 0x1F;
39876 } else {
39877 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
39878 match_length = src[pos++];
39879 }
39880 match_length += 3;
39881 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
39882 memcpy(dst + out_pos, dst + ref_pos, match_length);
39883 out_pos += match_length;
39884 }
39885 if (out_pos >= dst_len) return pos;
39886 flags >>= 1;
39887 }
39888 }
39889}
39890#endif
39891static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length) {
39892#ifdef __Pyx_DecompressString_LZSS_UNUSED
39893 CYTHON_UNUSED_VAR(s);
39894 CYTHON_UNUSED_VAR(compressed_length);
39895 CYTHON_UNUSED_VAR(uncompressed_length);
39896 return NULL;
39897#else
39898 PyObject *result;
39899 unsigned char *result_data;
39900 size_t src_length;
39901 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
39902 if (unlikely(!result)) return NULL;
39903 result_data = __Pyx_PyBytes_AsWritableUString(result);
39904 if (unlikely(!result_data)) goto bad;
39905 src_length = __pyx_lzss_decompress((const uint8_t*) s, result_data, uncompressed_length);
39906 if (unlikely(src_length != compressed_length)) goto decompression_failed;
39907 return result;
39908decompression_failed:
39909 PyErr_SetString(PyExc_RuntimeError, "LZSS string data decompression failed");
39910bad:
39911 Py_DECREF(result);
39912 return NULL;
39913#endif
39914}
39915
39916#include <string.h>
39917static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
39918 size_t len = strlen(s);
39919 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
39920 PyErr_SetString(PyExc_OverflowError, "byte string is too long");
39921 return -1;
39922 }
39923 return (Py_ssize_t) len;
39924}
39925static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
39926 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
39927 if (unlikely(len < 0)) return NULL;
39928 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
39929}
39930static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
39931 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
39932 if (unlikely(len < 0)) return NULL;
39933 return PyByteArray_FromStringAndSize(c_str, len);
39934}
39935static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
39936 Py_ssize_t ignore;
39937 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
39938}
39939#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
39940static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
39941 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
39942#if CYTHON_COMPILING_IN_LIMITED_API
39943 {
39944 const char* result;
39945 Py_ssize_t unicode_length;
39946 CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
39947 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
39948 if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
39949 #else
39950 result = PyUnicode_AsUTF8AndSize(o, length);
39951 #endif
39952 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
39953 unicode_length = PyUnicode_GetLength(o);
39954 if (unlikely(unicode_length < 0)) return NULL;
39955 if (unlikely(unicode_length != *length)) {
39956 PyUnicode_AsASCIIString(o);
39957 return NULL;
39958 }
39959 #endif
39960 return result;
39961 }
39962#else
39963#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
39964 if (likely(PyUnicode_IS_ASCII(o))) {
39965 *length = PyUnicode_GET_LENGTH(o);
39966 return PyUnicode_AsUTF8(o);
39967 } else {
39968 PyUnicode_AsASCIIString(o);
39969 return NULL;
39970 }
39971#else
39972 return PyUnicode_AsUTF8AndSize(o, length);
39973#endif
39974#endif
39975}
39976#endif
39977static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
39978#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
39979 if (PyUnicode_Check(o)) {
39980 return __Pyx_PyUnicode_AsStringAndSize(o, length);
39981 } else
39982#endif
39983 if (PyByteArray_Check(o)) {
39984#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
39985 *length = PyByteArray_GET_SIZE(o);
39986 return PyByteArray_AS_STRING(o);
39987#else
39988 *length = PyByteArray_Size(o);
39989 if (*length == -1) return NULL;
39990 return PyByteArray_AsString(o);
39991#endif
39992 } else
39993 {
39994 char* result;
39995 int r = PyBytes_AsStringAndSize(o, &result, length);
39996 if (unlikely(r < 0)) {
39997 return NULL;
39998 } else {
39999 return result;
40000 }
40001 }
40002}
40003static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
40004 int is_true = x == Py_True;
40005 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
40006 else return PyObject_IsTrue(x);
40007}
40008static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
40009 int retval;
40010 if (unlikely(!x)) return -1;
40011 retval = __Pyx_PyObject_IsTrue(x);
40012 Py_DECREF(x);
40013 return retval;
40014}
40015static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
40016 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
40017 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
40018 if (unlikely(!result_type_name)) goto bad;
40019 #endif
40020 if (PyLong_Check(result)) {
40021 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
40022 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
40023 "The ability to return an instance of a strict subclass of int is deprecated, "
40024 "and may be removed in a future version of Python.",
40025 result_type_name)) {
40026 __Pyx_DECREF_TypeName(result_type_name);
40027 goto bad;
40028 }
40029 __Pyx_DECREF_TypeName(result_type_name);
40030 return result;
40031 }
40032 PyErr_Format(PyExc_TypeError,
40033 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
40034 result_type_name);
40035 __Pyx_DECREF_TypeName(result_type_name);
40036bad:
40037 Py_DECREF(result);
40038 return NULL;
40039}
40040static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
40041#if CYTHON_USE_TYPE_SLOTS
40042 PyNumberMethods *m;
40043#endif
40044 PyObject *res = NULL;
40045 if (likely(PyLong_Check(x)))
40046 return __Pyx_NewRef(x);
40047#if CYTHON_USE_TYPE_SLOTS
40048 m = Py_TYPE(x)->tp_as_number;
40049 if (likely(m && m->nb_int)) {
40050 res = m->nb_int(x);
40051 }
40052#else
40053 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
40054 res = PyNumber_Long(x);
40055 }
40056#endif
40057 if (likely(res)) {
40058 if (unlikely(!PyLong_CheckExact(res))) {
40059 return __Pyx_PyNumber_LongWrongResultType(res);
40060 }
40061 }
40062 else if (!PyErr_Occurred()) {
40063 PyErr_SetString(PyExc_TypeError,
40064 "an integer is required");
40065 }
40066 return res;
40067}
40068static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
40069 #if CYTHON_USE_PYLONG_INTERNALS
40070 Py_ssize_t ival;
40071 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
40072 const int is_neg = __Pyx_PyLong_IsNeg(b);
40073 const digit* digits = __Pyx_PyLong_Digits(b);
40074 if (size == 0) return 0;
40075 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
40076 if (size == 1) {
40077 ival = (Py_ssize_t) (((size_t)digits[0]));
40078 } else
40079 #endif
40080 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
40081 if (size == 2) {
40082 ival = (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
40083 } else
40084 #endif
40085 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
40086 if (size == 3) {
40087 ival = (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
40088 } else
40089 #endif
40090 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
40091 if (size == 4) {
40092 ival = (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
40093 } else
40094 #endif
40095 return PyLong_AsSsize_t(b);
40096 return is_neg ? -ival : ival;
40097 #else
40098 return PyLong_AsSsize_t(b);
40099 #endif
40100}
40101static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
40102 if (likely(PyLong_Check(b))) {
40103 return __Pyx_PyLong_AsSsize_t(b);
40104 } else {
40105 Py_ssize_t ival;
40106 PyObject *x = PyNumber_Index(b);
40107 if (unlikely(!x)) return -1;
40108 ival = __Pyx_PyLong_AsSsize_t(x);
40109 Py_DECREF(x);
40110 return ival;
40111 }
40112}
40113static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
40114 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
40115 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
40116 } else {
40117 Py_ssize_t ival;
40118 PyObject *x;
40119 x = PyNumber_Index(o);
40120 if (!x) return -1;
40121 ival = PyLong_AsLong(x);
40122 Py_DECREF(x);
40123 return ival;
40124 }
40125}
40126static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
40127 CYTHON_UNUSED_VAR(b);
40128 return __Pyx_NewRef(Py_None);
40129}
40130static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
40131 return __Pyx_NewRef(b ? Py_True: Py_False);
40132}
40133static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
40134 return PyLong_FromSize_t(ival);
40135}
40136
40137
40138/* MultiPhaseInitModuleState */
40139#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
40140#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40141#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
40142 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
40143#else
40144 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
40145#endif
40146#endif
40147#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
40148#error "Module state with PEP489 requires atomics. Currently that's one of\
40149 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
40150#endif
40151#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40152#define __Pyx_ModuleStateLookup_Lock()
40153#define __Pyx_ModuleStateLookup_Unlock()
40154#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
40155static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
40156#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
40157#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
40158#elif defined(__cplusplus) && __cplusplus >= 201103L
40159#include <mutex>
40160static std::mutex __Pyx_ModuleStateLookup_mutex;
40161#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
40162#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
40163#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
40164#include <threads.h>
40165static mtx_t __Pyx_ModuleStateLookup_mutex;
40166static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
40167static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
40168 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
40169}
40170#define __Pyx_ModuleStateLookup_Lock()\
40171 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
40172 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
40173#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
40174#elif defined(HAVE_PTHREAD_H)
40175#include <pthread.h>
40176static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
40177#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
40178#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
40179#elif defined(_WIN32)
40180#include <Windows.h> // synchapi.h on its own doesn't work
40181static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
40182#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
40183#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
40184#else
40185#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
40186 Requires C standard >= C11, or C++ standard >= C++11,\
40187 or pthreads, or the Windows 32 API, or Python >= 3.13."
40188#endif
40189typedef struct {
40190 int64_t id;
40191 PyObject *module;
40192} __Pyx_InterpreterIdAndModule;
40193typedef struct {
40194 char interpreter_id_as_index;
40195 Py_ssize_t count;
40196 Py_ssize_t allocated;
40197 __Pyx_InterpreterIdAndModule table[1];
40198} __Pyx_ModuleStateLookupData;
40199#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
40200#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40201static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
40202#endif
40203#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40204static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
40205#else
40206static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
40207#endif
40208static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
40209 __Pyx_InterpreterIdAndModule* table,
40210 Py_ssize_t count,
40211 int64_t interpreterId) {
40212 __Pyx_InterpreterIdAndModule* begin = table;
40213 __Pyx_InterpreterIdAndModule* end = begin + count;
40214 if (begin->id == interpreterId) {
40215 return begin;
40216 }
40217 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
40218 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
40219 if (halfway->id == interpreterId) {
40220 return halfway;
40221 }
40222 if (halfway->id < interpreterId) {
40223 begin = halfway;
40224 } else {
40225 end = halfway;
40226 }
40227 }
40228 for (; begin < end; ++begin) {
40229 if (begin->id >= interpreterId) return begin;
40230 }
40231 return begin;
40232}
40233static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
40234 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
40235 if (interpreter_id == -1) return NULL;
40236#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40237 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
40238 {
40239 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
40240 if (likely(data)) {
40241 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
40242 if (likely(data == new_data)) {
40243 goto read_finished;
40244 }
40245 }
40246 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
40247 __Pyx_ModuleStateLookup_Lock();
40248 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
40249 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
40250 __Pyx_ModuleStateLookup_Unlock();
40251 }
40252 read_finished:;
40253#else
40254 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
40255#endif
40256 __Pyx_InterpreterIdAndModule* found = NULL;
40257 if (unlikely(!data)) goto end;
40258 if (data->interpreter_id_as_index) {
40259 if (interpreter_id < data->count) {
40260 found = data->table+interpreter_id;
40261 }
40262 } else {
40263 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
40264 data->table, data->count, interpreter_id);
40265 }
40266 end:
40267 {
40268 PyObject *result=NULL;
40269 if (found && found->id == interpreter_id) {
40270 result = found->module;
40271 }
40272#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40273 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
40274#endif
40275 return result;
40276 }
40277}
40278#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40279static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
40280 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
40281}
40282#else
40283#define __Pyx_ModuleStateLookup_wait_until_no_readers()
40284#endif
40285static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
40286 Py_ssize_t to_allocate = (*old_data)->allocated;
40287 while (to_allocate <= interpreter_id) {
40288 if (to_allocate == 0) to_allocate = 1;
40289 else to_allocate *= 2;
40290 }
40291 __Pyx_ModuleStateLookupData *new_data = *old_data;
40292 if (to_allocate != (*old_data)->allocated) {
40293 new_data = (__Pyx_ModuleStateLookupData *)realloc(
40294 *old_data,
40295 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
40296 if (!new_data) {
40297 PyErr_NoMemory();
40298 return -1;
40299 }
40300 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
40301 new_data->table[i].id = i;
40302 new_data->table[i].module = NULL;
40303 }
40304 new_data->allocated = to_allocate;
40305 }
40306 new_data->table[interpreter_id].module = module;
40307 if (new_data->count < interpreter_id+1) {
40308 new_data->count = interpreter_id+1;
40309 }
40310 *old_data = new_data;
40311 return 0;
40312}
40313static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
40314 __Pyx_InterpreterIdAndModule *read = data->table;
40315 __Pyx_InterpreterIdAndModule *write = data->table;
40316 __Pyx_InterpreterIdAndModule *end = read + data->count;
40317 for (; read<end; ++read) {
40318 if (read->module) {
40319 write->id = read->id;
40320 write->module = read->module;
40321 ++write;
40322 }
40323 }
40324 data->count = write - data->table;
40325 for (; write<end; ++write) {
40326 write->id = 0;
40327 write->module = NULL;
40328 }
40329 data->interpreter_id_as_index = 0;
40330}
40331static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
40332 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
40333 if (interpreter_id == -1) return -1;
40334 int result = 0;
40335 __Pyx_ModuleStateLookup_Lock();
40336#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40337 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
40338 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
40339#else
40340 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
40341#endif
40342 __Pyx_ModuleStateLookupData *new_data = old_data;
40343 if (!new_data) {
40344 new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
40345 if (!new_data) {
40346 result = -1;
40347 PyErr_NoMemory();
40348 goto end;
40349 }
40350 new_data->allocated = 1;
40351 new_data->interpreter_id_as_index = 1;
40352 }
40353 __Pyx_ModuleStateLookup_wait_until_no_readers();
40354 if (new_data->interpreter_id_as_index) {
40355 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
40356 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
40357 goto end;
40358 }
40359 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
40360 }
40361 {
40362 Py_ssize_t insert_at = 0;
40363 {
40364 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
40365 new_data->table, new_data->count, interpreter_id);
40366 assert(lower_bound);
40367 insert_at = lower_bound - new_data->table;
40368 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
40369 lower_bound->module = module;
40370 goto end; // already in table, nothing more to do
40371 }
40372 }
40373 if (new_data->count+1 >= new_data->allocated) {
40374 Py_ssize_t to_allocate = (new_data->count+1)*2;
40375 new_data =
40376 (__Pyx_ModuleStateLookupData*)realloc(
40377 new_data,
40378 sizeof(__Pyx_ModuleStateLookupData) +
40379 (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
40380 if (!new_data) {
40381 result = -1;
40382 new_data = old_data;
40383 PyErr_NoMemory();
40384 goto end;
40385 }
40386 new_data->allocated = to_allocate;
40387 }
40388 ++new_data->count;
40389 int64_t last_id = interpreter_id;
40390 PyObject *last_module = module;
40391 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
40392 int64_t current_id = new_data->table[i].id;
40393 new_data->table[i].id = last_id;
40394 last_id = current_id;
40395 PyObject *current_module = new_data->table[i].module;
40396 new_data->table[i].module = last_module;
40397 last_module = current_module;
40398 }
40399 }
40400 end:
40401#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40402 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
40403#else
40404 __Pyx_ModuleStateLookup_data = new_data;
40405#endif
40406 __Pyx_ModuleStateLookup_Unlock();
40407 return result;
40408}
40409static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
40410 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
40411 if (interpreter_id == -1) return -1;
40412 __Pyx_ModuleStateLookup_Lock();
40413#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40414 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
40415 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
40416#else
40417 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
40418#endif
40419 if (data->interpreter_id_as_index) {
40420 if (interpreter_id < data->count) {
40421 data->table[interpreter_id].module = NULL;
40422 }
40423 goto done;
40424 }
40425 {
40426 __Pyx_ModuleStateLookup_wait_until_no_readers();
40427 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
40428 data->table, data->count, interpreter_id);
40429 if (!lower_bound) goto done;
40430 if (lower_bound->id != interpreter_id) goto done;
40431 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
40432 for (;lower_bound<end-1; ++lower_bound) {
40433 lower_bound->id = (lower_bound+1)->id;
40434 lower_bound->module = (lower_bound+1)->module;
40435 }
40436 }
40437 --data->count;
40438 if (data->count == 0) {
40439 free(data);
40440 data = NULL;
40441 }
40442 done:
40443#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40444 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
40445#else
40446 __Pyx_ModuleStateLookup_data = data;
40447#endif
40448 __Pyx_ModuleStateLookup_Unlock();
40449 return 0;
40450}
40451#endif
40452
40453/* #### Code section: utility_code_pragmas_end ### */
40454#ifdef _MSC_VER
40455#pragma warning( pop )
40456#endif
40457
40458
40459
40460/* #### Code section: end ### */
40461#endif /* Py_PYTHON_H */
Int n
Definition Headers.h:28
Double q
Definition Headers.h:81
Double T
Definition Headers.h:87
Double L
Definition Headers.h:72
Double r
Definition Headers.h:83
Double U
Definition Headers.h:88
Int number
Definition Headers.h:33
Double f
Definition Headers.h:64
Double s
Definition Headers.h:84
Int ns
Definition Headers.h:30
Double * z
Definition Headers.h:49
Double v
Definition Headers.h:95
#define sign(x, y)
Definition jf.h:44
#define c(i)
Definition jf.h:21
#define nnz
Definition m_comp_co2.h:19