proteus 1.9.0
C/C++/Fortran libraries
Loading...
Searching...
No Matches
csparsity.cpp
Go to the documentation of this file.
1/* Generated by Cython 3.3.0 */
2
3/* BEGIN: Cython Metadata
4{
5 "distutils": {
6 "depends": [
7 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayobject.h",
8 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayscalars.h",
9 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarrayobject.h",
10 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarraytypes.h",
11 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ufuncobject.h",
12 "proteus/sparsity.h"
13 ],
14 "include_dirs": [
15 "proteus",
16 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include"
17 ],
18 "language": "c++",
19 "name": "csparsity",
20 "sources": [
21 "proteus/csparsity.pyx",
22 "proteus/sparsity.cpp"
23 ]
24 },
25 "module_name": "csparsity"
26}
27END: Cython Metadata */
28
29#ifndef PY_SSIZE_T_CLEAN
30#define PY_SSIZE_T_CLEAN
31#endif /* PY_SSIZE_T_CLEAN */
32/* InitLimitedAPI */
33#if defined(Py_LIMITED_API)
34 #if !defined(CYTHON_LIMITED_API)
35 #define CYTHON_LIMITED_API 1
36 #endif
37#elif defined(CYTHON_LIMITED_API)
38 #ifdef _MSC_VER
39 #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
40 #else
41 #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
42 #endif
43#endif
44
45#include "Python.h"
46#ifndef Py_PYTHON_H
47 #error Python headers needed to compile C extensions, please install development version of Python.
48#elif PY_VERSION_HEX < 0x03090000
49 #error Cython requires Python 3.9+.
50#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
51 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
52#else
53#define __PYX_ABI_VERSION "3_3_0"
54#define CYTHON_HEX_VERSION 0x030300F0
55#define CYTHON_FUTURE_DIVISION 1
56/* CModulePreamble */
57#include <stddef.h>
58#ifndef offsetof
59 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
60#endif
61#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
62 #ifndef __stdcall
63 #define __stdcall
64 #endif
65 #ifndef __cdecl
66 #define __cdecl
67 #endif
68 #ifndef __fastcall
69 #define __fastcall
70 #endif
71#endif
72#ifdef __has_builtin
73 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
74#else
75 #define __Pyx_has_cbuiltin(name) (0)
76#endif
77#ifndef DL_IMPORT
78 #define DL_IMPORT(t) t
79#endif
80#ifndef DL_EXPORT
81 #define DL_EXPORT(t) t
82#endif
83#define __PYX_COMMA ,
84#ifndef PY_LONG_LONG
85 #define PY_LONG_LONG LONG_LONG
86#endif
87#ifndef Py_HUGE_VAL
88 #define Py_HUGE_VAL HUGE_VAL
89#endif
90#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
91#if defined(CYTHON_LIMITED_API)
92 #ifdef Py_LIMITED_API
93 #undef __PYX_LIMITED_VERSION_HEX
94 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
95 #if Py_LIMITED_API < 0x03090000
96 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
97 #endif
98 #endif
99 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
100 #ifdef _MSC_VER
101 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
102 code for PyPy and GraalPy and is unlikely to work.")
103 #else
104 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
105 code for PyPy and GraalPy and is unlikely to work."
106 #endif
107 #endif
108 #define CYTHON_COMPILING_IN_PYPY 0
109 #define CYTHON_COMPILING_IN_CPYTHON 0
110 #define CYTHON_COMPILING_IN_LIMITED_API 1
111 #define CYTHON_COMPILING_IN_GRAAL 0
112 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
113 #undef CYTHON_USE_TYPE_SLOTS
114 #define CYTHON_USE_TYPE_SLOTS 0
115 #undef CYTHON_USE_TYPE_SPECS
116 #define CYTHON_USE_TYPE_SPECS 1
117 #undef CYTHON_USE_PYTYPE_LOOKUP
118 #define CYTHON_USE_PYTYPE_LOOKUP 0
119 #undef CYTHON_USE_PYLIST_INTERNALS
120 #define CYTHON_USE_PYLIST_INTERNALS 0
121 #undef CYTHON_USE_UNICODE_INTERNALS
122 #define CYTHON_USE_UNICODE_INTERNALS 0
123 #ifndef CYTHON_USE_UNICODE_WRITER
124 #define CYTHON_USE_UNICODE_WRITER 0
125 #endif
126 #undef CYTHON_USE_PYLONG_INTERNALS
127 #define CYTHON_USE_PYLONG_INTERNALS 0
128 #ifndef CYTHON_AVOID_BORROWED_REFS
129 #define CYTHON_AVOID_BORROWED_REFS 0
130 #endif
131 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
132 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
133 #endif
134 #undef CYTHON_ASSUME_SAFE_MACROS
135 #define CYTHON_ASSUME_SAFE_MACROS 0
136 #undef CYTHON_ASSUME_SAFE_SIZE
137 #define CYTHON_ASSUME_SAFE_SIZE 0
138 #undef CYTHON_UNPACK_METHODS
139 #define CYTHON_UNPACK_METHODS 0
140 #undef CYTHON_FAST_THREAD_STATE
141 #define CYTHON_FAST_THREAD_STATE 0
142 #undef CYTHON_FAST_GIL
143 #define CYTHON_FAST_GIL 0
144 #undef CYTHON_VECTORCALL
145 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
146 #ifndef CYTHON_VECTORCALL_TPNEW
147 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
148 #endif
149 #ifndef CYTHON_PEP487_INIT_SUBCLASS
150 #define CYTHON_PEP487_INIT_SUBCLASS 1
151 #endif
152 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
153 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
154 #endif
155 #ifndef CYTHON_USE_MODULE_STATE
156 #define CYTHON_USE_MODULE_STATE 0
157 #endif
158 #undef CYTHON_USE_SYS_MONITORING
159 #define CYTHON_USE_SYS_MONITORING 0
160 #ifndef CYTHON_USE_TP_FINALIZE
161 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
162 #endif
163 #ifndef CYTHON_USE_AM_SEND
164 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
165 #endif
166 #undef CYTHON_USE_DICT_VERSIONS
167 #define CYTHON_USE_DICT_VERSIONS 0
168 #undef CYTHON_USE_EXC_INFO_STACK
169 #define CYTHON_USE_EXC_INFO_STACK 0
170 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
171 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
172 #endif
173 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
174 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
175 #endif
176 #ifndef CYTHON_USE_FREELISTS
177 #define CYTHON_USE_FREELISTS 1
178 #endif
179 #undef CYTHON_IMMORTAL_CONSTANTS
180 #define CYTHON_IMMORTAL_CONSTANTS 0
181 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
182 #undef CYTHON_OPAQUE_OBJECTS
183 #define CYTHON_OPAQUE_OBJECTS 0
184 #elif !defined(CYTHON_OPAQUE_OBJECTS)
185 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
186 #endif
187#elif defined(GRAALVM_PYTHON)
188 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
189 The existence of this section does not imply that anything works or is even tested */
190 #define CYTHON_COMPILING_IN_PYPY 0
191 #define CYTHON_COMPILING_IN_CPYTHON 0
192 #define CYTHON_COMPILING_IN_LIMITED_API 0
193 #define CYTHON_COMPILING_IN_GRAAL 1
194 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
195 #ifndef CYTHON_USE_TYPE_SLOTS
196 #define CYTHON_USE_TYPE_SLOTS 0
197 #endif
198 #undef CYTHON_USE_TYPE_SPECS
199 #define CYTHON_USE_TYPE_SPECS 0
200 #undef CYTHON_USE_PYTYPE_LOOKUP
201 #define CYTHON_USE_PYTYPE_LOOKUP 0
202 #undef CYTHON_USE_PYLIST_INTERNALS
203 #define CYTHON_USE_PYLIST_INTERNALS 0
204 #undef CYTHON_USE_UNICODE_INTERNALS
205 #define CYTHON_USE_UNICODE_INTERNALS 0
206 #undef CYTHON_USE_UNICODE_WRITER
207 #define CYTHON_USE_UNICODE_WRITER 0
208 #undef CYTHON_USE_PYLONG_INTERNALS
209 #define CYTHON_USE_PYLONG_INTERNALS 0
210 #undef CYTHON_AVOID_BORROWED_REFS
211 #define CYTHON_AVOID_BORROWED_REFS 1
212 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
213 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
214 #undef CYTHON_ASSUME_SAFE_MACROS
215 #define CYTHON_ASSUME_SAFE_MACROS 0
216 #undef CYTHON_ASSUME_SAFE_SIZE
217 #define CYTHON_ASSUME_SAFE_SIZE 0
218 #undef CYTHON_UNPACK_METHODS
219 #define CYTHON_UNPACK_METHODS 0
220 #undef CYTHON_FAST_THREAD_STATE
221 #define CYTHON_FAST_THREAD_STATE 0
222 #undef CYTHON_FAST_GIL
223 #define CYTHON_FAST_GIL 0
224 #ifndef CYTHON_VECTORCALL
225 #define CYTHON_VECTORCALL 1
226 #endif
227 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
228 #undef CYTHON_VECTORCALL_TPNEW
229 #define CYTHON_VECTORCALL_TPNEW 0
230 #elif !defined(CYTHON_VECTORCALL_TPNEW)
231 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
232 #endif
233 #ifndef CYTHON_PEP487_INIT_SUBCLASS
234 #define CYTHON_PEP487_INIT_SUBCLASS 1
235 #endif
236 #undef CYTHON_PEP489_MULTI_PHASE_INIT
237 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
238 #undef CYTHON_USE_MODULE_STATE
239 #define CYTHON_USE_MODULE_STATE 0
240 #undef CYTHON_USE_SYS_MONITORING
241 #define CYTHON_USE_SYS_MONITORING 0
242 #undef CYTHON_USE_TP_FINALIZE
243 #define CYTHON_USE_TP_FINALIZE 0
244 #undef CYTHON_USE_AM_SEND
245 #define CYTHON_USE_AM_SEND 0
246 #undef CYTHON_USE_DICT_VERSIONS
247 #define CYTHON_USE_DICT_VERSIONS 0
248 #undef CYTHON_USE_EXC_INFO_STACK
249 #define CYTHON_USE_EXC_INFO_STACK 1
250 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
251 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
252 #endif
253 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
254 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
255 #endif
256 #undef CYTHON_USE_FREELISTS
257 #define CYTHON_USE_FREELISTS 0
258 #undef CYTHON_IMMORTAL_CONSTANTS
259 #define CYTHON_IMMORTAL_CONSTANTS 0
260 #undef CYTHON_OPAQUE_OBJECTS
261 #define CYTHON_OPAQUE_OBJECTS 0
262#elif defined(PYPY_VERSION)
263 #define CYTHON_COMPILING_IN_PYPY 1
264 #define CYTHON_COMPILING_IN_CPYTHON 0
265 #define CYTHON_COMPILING_IN_LIMITED_API 0
266 #define CYTHON_COMPILING_IN_GRAAL 0
267 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
268 #undef CYTHON_USE_TYPE_SLOTS
269 #define CYTHON_USE_TYPE_SLOTS 1
270 #ifndef CYTHON_USE_TYPE_SPECS
271 #define CYTHON_USE_TYPE_SPECS 0
272 #endif
273 #undef CYTHON_USE_PYTYPE_LOOKUP
274 #define CYTHON_USE_PYTYPE_LOOKUP 0
275 #undef CYTHON_USE_PYLIST_INTERNALS
276 #define CYTHON_USE_PYLIST_INTERNALS 0
277 #undef CYTHON_USE_UNICODE_INTERNALS
278 #define CYTHON_USE_UNICODE_INTERNALS 0
279 #undef CYTHON_USE_UNICODE_WRITER
280 #define CYTHON_USE_UNICODE_WRITER 0
281 #undef CYTHON_USE_PYLONG_INTERNALS
282 #define CYTHON_USE_PYLONG_INTERNALS 0
283 #undef CYTHON_AVOID_BORROWED_REFS
284 #define CYTHON_AVOID_BORROWED_REFS 1
285 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
286 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
287 #undef CYTHON_ASSUME_SAFE_MACROS
288 #define CYTHON_ASSUME_SAFE_MACROS 0
289 #ifndef CYTHON_ASSUME_SAFE_SIZE
290 #define CYTHON_ASSUME_SAFE_SIZE 1
291 #endif
292 #undef CYTHON_UNPACK_METHODS
293 #define CYTHON_UNPACK_METHODS 0
294 #undef CYTHON_FAST_THREAD_STATE
295 #define CYTHON_FAST_THREAD_STATE 0
296 #undef CYTHON_FAST_GIL
297 #define CYTHON_FAST_GIL 0
298 #ifndef CYTHON_VECTORCALL
299 #define CYTHON_VECTORCALL 1
300 #endif
301 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
302 #undef CYTHON_VECTORCALL_TPNEW
303 #define CYTHON_VECTORCALL_TPNEW 0
304 #elif !defined(CYTHON_VECTORCALL_TPNEW)
305 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
306 #endif
307 #ifndef CYTHON_PEP487_INIT_SUBCLASS
308 #define CYTHON_PEP487_INIT_SUBCLASS 1
309 #endif
310 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
311 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
312 #endif
313 #undef CYTHON_USE_MODULE_STATE
314 #define CYTHON_USE_MODULE_STATE 0
315 #undef CYTHON_USE_SYS_MONITORING
316 #define CYTHON_USE_SYS_MONITORING 0
317 #ifndef CYTHON_USE_TP_FINALIZE
318 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
319 #endif
320 #undef CYTHON_USE_AM_SEND
321 #define CYTHON_USE_AM_SEND 0
322 #undef CYTHON_USE_DICT_VERSIONS
323 #define CYTHON_USE_DICT_VERSIONS 0
324 #undef CYTHON_USE_EXC_INFO_STACK
325 #define CYTHON_USE_EXC_INFO_STACK 0
326 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
327 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
328 #endif
329 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
330 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
331 #endif
332 #undef CYTHON_USE_FREELISTS
333 #define CYTHON_USE_FREELISTS 0
334 #undef CYTHON_IMMORTAL_CONSTANTS
335 #define CYTHON_IMMORTAL_CONSTANTS 0
336 #undef CYTHON_OPAQUE_OBJECTS
337 #define CYTHON_OPAQUE_OBJECTS 0
338#else
339 #define CYTHON_COMPILING_IN_PYPY 0
340 #define CYTHON_COMPILING_IN_CPYTHON 1
341 #define CYTHON_COMPILING_IN_LIMITED_API 0
342 #define CYTHON_COMPILING_IN_GRAAL 0
343 #ifdef Py_GIL_DISABLED
344 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
345 #else
346 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
347 #endif
348 #if PY_VERSION_HEX < 0x030A0000
349 #undef CYTHON_USE_TYPE_SLOTS
350 #define CYTHON_USE_TYPE_SLOTS 1
351 #elif !defined(CYTHON_USE_TYPE_SLOTS)
352 #define CYTHON_USE_TYPE_SLOTS 1
353 #endif
354 #ifndef CYTHON_USE_TYPE_SPECS
355 #define CYTHON_USE_TYPE_SPECS 0
356 #endif
357 #ifndef CYTHON_USE_PYTYPE_LOOKUP
358 #define CYTHON_USE_PYTYPE_LOOKUP 1
359 #endif
360 #ifndef CYTHON_USE_PYLONG_INTERNALS
361 #define CYTHON_USE_PYLONG_INTERNALS 1
362 #endif
363 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
364 #undef CYTHON_USE_PYLIST_INTERNALS
365 #define CYTHON_USE_PYLIST_INTERNALS 0
366 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
367 #define CYTHON_USE_PYLIST_INTERNALS 1
368 #endif
369 #ifndef CYTHON_USE_UNICODE_INTERNALS
370 #define CYTHON_USE_UNICODE_INTERNALS 1
371 #endif
372 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
373 #undef CYTHON_USE_UNICODE_WRITER
374 #define CYTHON_USE_UNICODE_WRITER 0
375 #elif !defined(CYTHON_USE_UNICODE_WRITER)
376 #define CYTHON_USE_UNICODE_WRITER 1
377 #endif
378 #ifndef CYTHON_AVOID_BORROWED_REFS
379 #define CYTHON_AVOID_BORROWED_REFS 0
380 #endif
381 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
382 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
383 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
384 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
385 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
386 #endif
387 #ifndef CYTHON_ASSUME_SAFE_MACROS
388 #define CYTHON_ASSUME_SAFE_MACROS 1
389 #endif
390 #ifndef CYTHON_ASSUME_SAFE_SIZE
391 #define CYTHON_ASSUME_SAFE_SIZE 1
392 #endif
393 #ifndef CYTHON_UNPACK_METHODS
394 #define CYTHON_UNPACK_METHODS 1
395 #endif
396 #ifndef CYTHON_FAST_THREAD_STATE
397 #define CYTHON_FAST_THREAD_STATE 1
398 #endif
399 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
400 #undef CYTHON_FAST_GIL
401 #define CYTHON_FAST_GIL 0
402 #elif !defined(CYTHON_FAST_GIL)
403 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
404 #endif
405 #ifndef CYTHON_VECTORCALL
406 #define CYTHON_VECTORCALL 1
407 #endif
408 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
409 #undef CYTHON_VECTORCALL_TPNEW
410 #define CYTHON_VECTORCALL_TPNEW 0
411 #elif !defined(CYTHON_VECTORCALL_TPNEW)
412 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
413 #endif
414 #ifndef CYTHON_PEP487_INIT_SUBCLASS
415 #define CYTHON_PEP487_INIT_SUBCLASS 1
416 #endif
417 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
418 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
419 #endif
420 #ifndef CYTHON_USE_MODULE_STATE
421 #define CYTHON_USE_MODULE_STATE 0
422 #endif
423 #ifndef CYTHON_USE_SYS_MONITORING
424 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
425 #endif
426 #ifndef CYTHON_USE_TP_FINALIZE
427 #define CYTHON_USE_TP_FINALIZE 1
428 #endif
429 #ifndef CYTHON_USE_AM_SEND
430 #define CYTHON_USE_AM_SEND 1
431 #endif
432 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
433 #undef CYTHON_USE_DICT_VERSIONS
434 #define CYTHON_USE_DICT_VERSIONS 0
435 #elif !defined(CYTHON_USE_DICT_VERSIONS)
436 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
437 #endif
438 #ifndef CYTHON_USE_EXC_INFO_STACK
439 #define CYTHON_USE_EXC_INFO_STACK 1
440 #endif
441 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
442 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
443 #endif
444 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
445 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
446 #endif
447 #ifndef CYTHON_USE_FREELISTS
448 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
449 #endif
450 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
451 #undef CYTHON_IMMORTAL_CONSTANTS
452 #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work
453 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
454 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
455 #endif
456 #ifndef CYTHON_OPAQUE_OBJECTS
457 #define CYTHON_OPAQUE_OBJECTS 0
458 #endif
459#endif
460#if CYTHON_USE_PYLONG_INTERNALS
461 #undef SHIFT
462 #undef BASE
463 #undef MASK
464 #ifdef SIZEOF_VOID_P
465 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
466 #endif
467#endif
468#ifndef __has_attribute
469 #define __has_attribute(x) 0
470#endif
471#ifndef __has_cpp_attribute
472 #define __has_cpp_attribute(x) 0
473#endif
474#ifndef CYTHON_RESTRICT
475 #if defined(__GNUC__)
476 #define CYTHON_RESTRICT __restrict__
477 #elif defined(_MSC_VER) && _MSC_VER >= 1400
478 #define CYTHON_RESTRICT __restrict
479 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
480 #define CYTHON_RESTRICT restrict
481 #else
482 #define CYTHON_RESTRICT
483 #endif
484#endif
485#ifndef CYTHON_UNUSED
486 #if defined(__cplusplus)
487 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
488 * but leads to warnings with -pedantic, since it is a C++17 feature */
489 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
490 #if __has_cpp_attribute(maybe_unused)
491 #define CYTHON_UNUSED [[maybe_unused]]
492 #endif
493 #endif
494 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
495 #define CYTHON_UNUSED [[maybe_unused]]
496 #endif
497#endif
498#ifndef CYTHON_UNUSED
499# if defined(__GNUC__)
500# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
501# define CYTHON_UNUSED __attribute__ ((__unused__))
502# else
503# define CYTHON_UNUSED
504# endif
505# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
506# define CYTHON_UNUSED __attribute__ ((__unused__))
507# else
508# define CYTHON_UNUSED
509# endif
510#endif
511#ifndef CYTHON_UNUSED_VAR
512# if defined(__cplusplus)
513 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
514# else
515# define CYTHON_UNUSED_VAR(x) (void)(x)
516# endif
517#endif
518#ifndef CYTHON_MAYBE_UNUSED_VAR
519 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
520#endif
521#ifndef CYTHON_NCP_UNUSED
522# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
523# define CYTHON_NCP_UNUSED
524# else
525# define CYTHON_NCP_UNUSED CYTHON_UNUSED
526# endif
527#endif
528#ifndef CYTHON_USE_CPP_STD_MOVE
529 #if defined(__cplusplus) && (\
530 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
531 #define CYTHON_USE_CPP_STD_MOVE 1
532 #else
533 #define CYTHON_USE_CPP_STD_MOVE 0
534 #endif
535#endif
536#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
537#include <stdint.h>
538typedef uintptr_t __pyx_uintptr_t;
539#ifndef CYTHON_FALLTHROUGH
540 #if defined(__cplusplus)
541 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
542 * but leads to warnings with -pedantic, since it is a C++17 feature */
543 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
544 #if __has_cpp_attribute(fallthrough)
545 #define CYTHON_FALLTHROUGH [[fallthrough]]
546 #endif
547 #endif
548 #ifndef CYTHON_FALLTHROUGH
549 #if __has_cpp_attribute(clang::fallthrough)
550 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
551 #elif __has_cpp_attribute(gnu::fallthrough)
552 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
553 #endif
554 #endif
555 #endif
556 #ifndef CYTHON_FALLTHROUGH
557 #if __has_attribute(fallthrough)
558 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
559 #else
560 #define CYTHON_FALLTHROUGH
561 #endif
562 #endif
563 #if defined(__clang__) && defined(__apple_build_version__)
564 #if __apple_build_version__ < 7000000
565 #undef CYTHON_FALLTHROUGH
566 #define CYTHON_FALLTHROUGH
567 #endif
568 #endif
569#endif
570#ifdef Py_UNREACHABLE
571 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
572#elif __Pyx_has_cbuiltin(__builtin_unreachable)
573 #define __Pyx_UNREACHABLE() __builtin_unreachable()
574#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
575 #define __Pyx_UNREACHABLE() __builtin_unreachable()
576#elif defined(_MSC_VER)
577 #define __Pyx_UNREACHABLE() __assume(0)
578#else
579 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
580#endif
581#ifndef Py_UNREACHABLE
582 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
583#endif
584#ifdef __cplusplus
585 template <typename T>
586 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
587 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
588#else
589 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
590#endif
591#if CYTHON_COMPILING_IN_PYPY == 1
592 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
593#else
594 #define __PYX_NEED_TP_PRINT_SLOT 0
595#endif
596#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
597#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
598#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
599#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
600#else
601#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
602#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
603#endif
604
605/* CppInitCode */
606#ifndef __cplusplus
607 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
608#endif
609#ifndef CYTHON_INLINE
610 #if defined(__clang__)
611 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
612 #else
613 #define CYTHON_INLINE inline
614 #endif
615#endif
616template<typename T>
617void __Pyx_call_destructor(T& x) {
618 x.~T();
619}
620template<typename T>
621class __Pyx_FakeReference {
622 public:
623 __Pyx_FakeReference() : ptr(NULL) { }
624 __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
625 T *operator->() { return ptr; }
626 T *operator&() { return ptr; }
627 operator T&() { return *ptr; }
628 template<typename U> bool operator ==(const U& other) const { return *ptr == other; }
629 template<typename U> bool operator !=(const U& other) const { return *ptr != other; }
630 template<typename U> bool operator==(const __Pyx_FakeReference<U>& other) const { return *ptr == *other.ptr; }
631 template<typename U> bool operator!=(const __Pyx_FakeReference<U>& other) const { return *ptr != *other.ptr; }
632 private:
633 T *ptr;
634};
635
636/* PythonCompatibility */
637#define __PYX_BUILD_PY_SSIZE_T "n"
638#define CYTHON_FORMAT_SSIZE_T "z"
639#define __Pyx_BUILTIN_MODULE_NAME "builtins"
640#define __Pyx_DefaultClassType PyType_Type
641#if CYTHON_COMPILING_IN_LIMITED_API
642 #ifndef CO_OPTIMIZED
643 static int CO_OPTIMIZED;
644 #endif
645 #ifndef CO_NEWLOCALS
646 static int CO_NEWLOCALS;
647 #endif
648 #ifndef CO_VARARGS
649 static int CO_VARARGS;
650 #endif
651 #ifndef CO_VARKEYWORDS
652 static int CO_VARKEYWORDS;
653 #endif
654 #ifndef CO_ASYNC_GENERATOR
655 static int CO_ASYNC_GENERATOR;
656 #endif
657 #ifndef CO_GENERATOR
658 static int CO_GENERATOR;
659 #endif
660 #ifndef CO_COROUTINE
661 static int CO_COROUTINE;
662 #endif
663#else
664 #ifndef CO_COROUTINE
665 #define CO_COROUTINE 0x80
666 #endif
667 #ifndef CO_ASYNC_GENERATOR
668 #define CO_ASYNC_GENERATOR 0x200
669 #endif
670#endif
671static int __Pyx_init_co_variables(void);
672#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
673 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
674#else
675 #define __Pyx_Py_Is(x, y) ((x) == (y))
676#endif
677#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
678 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
679#else
680 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
681#endif
682#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
683 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
684#else
685 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
686#endif
687#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
688 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
689#else
690 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
691#endif
692#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
693#if CYTHON_COMPILING_IN_PYPY
694 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
695#else
696 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
697#endif
698#if CYTHON_COMPILING_IN_LIMITED_API
699static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
700static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
701#else
702#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
703#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
704#endif
705static int __Pyx_init_tpflags_variables(void);
706#ifndef Py_TPFLAGS_HAVE_FINALIZE
707 #define Py_TPFLAGS_HAVE_FINALIZE 0
708#endif
709#ifndef Py_TPFLAGS_SEQUENCE
710 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
711#endif
712#ifndef Py_TPFLAGS_MAPPING
713 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
714#endif
715#ifndef Py_TPFLAGS_IMMUTABLETYPE
716 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
717#endif
718#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
719 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
720#endif
721#ifndef METH_STACKLESS
722 #define METH_STACKLESS 0
723#endif
724#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
725 #ifndef METH_FASTCALL
726 #define METH_FASTCALL 0x80
727 #endif
728 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
729 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
730 Py_ssize_t nargs, PyObject *kwnames);
731#else
732 #if PY_VERSION_HEX >= 0x030d00A4
733 # define __Pyx_PyCFunctionFast PyCFunctionFast
734 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
735 #else
736 # define __Pyx_PyCFunctionFast _PyCFunctionFast
737 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
738 #endif
739#endif
740#if CYTHON_VECTORCALL
741 #define __Pyx_METH_FASTCALL METH_FASTCALL
742 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
743 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
744#else
745 #define __Pyx_METH_FASTCALL METH_VARARGS
746 #define __Pyx_PyCFunction_FastCall PyCFunction
747 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
748#endif
749#if CYTHON_VECTORCALL
750 #define __pyx_vectorcallfunc vectorcallfunc
751 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
752 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
753#else
754 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
755 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
756#endif
757#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
758#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
759#if CYTHON_COMPILING_IN_CPYTHON
760#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
761#elif !CYTHON_COMPILING_IN_LIMITED_API
762#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
763#endif
764#if CYTHON_COMPILING_IN_CPYTHON
765#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
766static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
767 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
768}
769#endif
770static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
771#if CYTHON_COMPILING_IN_LIMITED_API
772 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
773#else
774 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
775#endif
776}
777#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
778#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
779 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
780#else
781 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
782#endif
783#if CYTHON_COMPILING_IN_PYPY
784 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
785#else
786 #define __Pyx_PyCMethod PyCMethod
787#endif
788#ifndef METH_METHOD
789 #define METH_METHOD 0x200
790#endif
791#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
792 #define PyObject_Malloc(s) PyMem_Malloc(s)
793 #define PyObject_Free(p) PyMem_Free(p)
794 #define PyObject_Realloc(p) PyMem_Realloc(p)
795#endif
796#if CYTHON_COMPILING_IN_LIMITED_API
797 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
798#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
799 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
800 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
801#elif CYTHON_COMPILING_IN_GRAAL
802 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
803 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
804#else
805 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
806 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
807#endif
808#if CYTHON_COMPILING_IN_LIMITED_API
809 #define __Pyx_PyThreadState_Current PyThreadState_Get()
810#elif !CYTHON_FAST_THREAD_STATE
811 #define __Pyx_PyThreadState_Current PyThreadState_GET()
812#elif PY_VERSION_HEX >= 0x030d00A1
813 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
814#else
815 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
816#endif
817#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
818 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
819 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
820 #define CYTHON_OPAQUE_SHARED_TYPES 1
821#else
822 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
823 #define __PYX_SHARED_RELATIVE_OFFSET 0
824 #define CYTHON_OPAQUE_SHARED_TYPES 0
825#endif
826#if CYTHON_USE_MODULE_STATE
827static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
828{
829 void *result;
830 result = PyModule_GetState(op);
831 if (!result)
832 Py_FatalError("Couldn't find the module state");
833 return result;
834}
835#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
836#else
837#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
838#endif
839#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
840#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
841#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
842#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
843#if CYTHON_USE_TYPE_SLOTS
844 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
845 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
846 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
847 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
848#else
849 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
850 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
851 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
852 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
853 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
854 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
855 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
856#endif
857#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
858#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
859#else
860#define __Pyx_PyDict_NewPresized(n) PyDict_New()
861#endif
862#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
863#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
864#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
865#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
866static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
867 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
868 if (res == NULL && PyErr_Occurred()) {
869 PyErr_WriteUnraisable(NULL);
870 }
871 return res;
872}
873#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
874#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
875#define __Pyx_PyDict_GetItemStr PyDict_GetItem
876#else
877static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
878#if CYTHON_COMPILING_IN_PYPY
879 return PyDict_GetItem(dict, name);
880#else
881 PyDictEntry *ep;
882 PyDictObject *mp = (PyDictObject*) dict;
883 long hash = ((PyStringObject *) name)->ob_shash;
884 assert(hash != -1);
885 ep = (mp->ma_lookup)(mp, name, hash);
886 if (ep == NULL) {
887 return NULL;
888 }
889 return ep->me_value;
890#endif
891}
892#define __Pyx_PyDict_GetItemStr PyDict_GetItem
893#endif
894#if CYTHON_USE_TYPE_SLOTS
895 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
896 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
897#else
898 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
899 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
900#endif
901#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
902#if CYTHON_USE_TYPE_SPECS
903#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
904 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
905 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
906 PyObject_GC_Del(obj);\
907 Py_DECREF(type);\
908}
909#else
910#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
911#endif
912#if CYTHON_COMPILING_IN_LIMITED_API
913 #define __Pyx_PyUnicode_READY(op) (0)
914 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
915 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
916 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
917 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
918 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
919 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
920 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
921#else
922 #if PY_VERSION_HEX >= 0x030C0000
923 #define __Pyx_PyUnicode_READY(op) (0)
924 #else
925 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
926 0 : _PyUnicode_Ready((PyObject *)(op)))
927 #endif
928 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
929 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
930 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
931 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
932 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
933 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
934 #if PY_VERSION_HEX >= 0x030C0000
935 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
936 #else
937 #if CYTHON_COMPILING_IN_CPYTHON
938 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
939 #else
940 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
941 #endif
942 #endif
943 static CYTHON_INLINE int __Pyx_PyUnicode_KIND_04(PyObject *o) {
944 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
945 }
946#endif
947#if CYTHON_COMPILING_IN_PYPY
948 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
949 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
950#else
951 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
952 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
953 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
954#endif
955#if CYTHON_COMPILING_IN_PYPY
956 #if !defined(PyUnicode_DecodeUnicodeEscape)
957 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
958 #endif
959 #if !defined(PyUnicode_Contains)
960 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
961 #endif
962 #if !defined(PyByteArray_Check)
963 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
964 #endif
965 #if !defined(PyObject_Format)
966 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
967 #endif
968#endif
969#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
970#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
971 #define __Pyx_PySequence_ListKeepNew(obj)\
972 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
973#elif CYTHON_COMPILING_IN_CPYTHON
974 #define __Pyx_PySequence_ListKeepNew(obj)\
975 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
976#else
977 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
978#endif
979#ifndef PySet_CheckExact
980 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
981#endif
982enum __Pyx_ReferenceSharing {
983 __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
984 __Pyx_ReferenceSharing_OwnStrongReference,
985 __Pyx_ReferenceSharing_FunctionArgument,
986 __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
987};
988#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
989#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
990 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
991 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
992 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
993#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
994#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
995#else
996#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
997#endif
998#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
999 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1000#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1001 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1002 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1003 #else
1004 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1005 #endif
1006#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1007 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1008#else
1009 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1010 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1011#endif
1012#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1013 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1014 __Pyx_PyList_GetItemRef(o, i))
1015#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1016 #if CYTHON_ASSUME_SAFE_MACROS
1017 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1018 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1019 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1020 #else
1021 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1022 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1023 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1024 #endif
1025#elif CYTHON_ASSUME_SAFE_MACROS
1026 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1027 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1028#else
1029 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1030 __Pyx_XNewRef(PyList_GetItem(o, i)))
1031#endif
1032#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1033#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1034#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1035static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1036 *result = PyObject_GetItem(dict, key);
1037 if (*result == NULL) {
1038 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1039 PyErr_Clear();
1040 return 0;
1041 }
1042 return -1;
1043 }
1044 return 1;
1045}
1046#else
1047static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1048 *result = PyDict_GetItemWithError(dict, key);
1049 if (*result == NULL) {
1050 return PyErr_Occurred() ? -1 : 0;
1051 }
1052 Py_INCREF(*result);
1053 return 1;
1054}
1055#endif
1056#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1057 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1058#else
1059 #define __Pyx_VISIT_CONST(obj)
1060#endif
1061#if CYTHON_ASSUME_SAFE_MACROS
1062 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1063 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1064 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1065 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1066 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1067 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1068#else
1069 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1070 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1071 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1072 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1073 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1074 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1075#endif
1076#if CYTHON_ASSUME_SAFE_SIZE
1077 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1078 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1079 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1080 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1081 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1082 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1083 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1084#else
1085 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1086 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1087 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1088 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1089 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1090 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1091 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1092#endif
1093#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1094 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1095#endif
1096#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1097#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1098#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1099 #define __Pyx_PySendResult PySendResult
1100#else
1101 typedef enum {
1102 PYGEN_RETURN = 0,
1103 PYGEN_ERROR = -1,
1104 PYGEN_NEXT = 1,
1105 } __Pyx_PySendResult;
1106#endif
1107#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1108 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1109#else
1110 #define __Pyx_pyiter_sendfunc sendfunc
1111#endif
1112#if !CYTHON_USE_AM_SEND
1113#define __PYX_HAS_PY_AM_SEND 0
1114#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1115#define __PYX_HAS_PY_AM_SEND 1
1116#else
1117#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
1118#endif
1119#if __PYX_HAS_PY_AM_SEND < 2
1120 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1121#else
1122 typedef struct {
1123 unaryfunc am_await;
1124 unaryfunc am_aiter;
1125 unaryfunc am_anext;
1126 __Pyx_pyiter_sendfunc am_send;
1127 } __Pyx_PyAsyncMethodsStruct;
1128 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1129#endif
1130#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1131 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1132#else
1133 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1134#endif
1135#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1136#ifdef __cplusplus
1137extern "C"
1138#endif
1139PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
1140#endif
1141#if CYTHON_COMPILING_IN_LIMITED_API
1142static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
1143 int value;
1144 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1145 if (!py_value) return 0;
1146 value = (int) PyLong_AsLong(py_value);
1147 Py_DECREF(py_value);
1148 *write_to = value;
1149 return value != -1 || !PyErr_Occurred();
1150}
1151static int __Pyx_init_co_variables(void) {
1152 PyObject *inspect;
1153 int result;
1154 inspect = PyImport_ImportModule("inspect");
1155 result =
1156#if !defined(CO_OPTIMIZED)
1157 __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
1158#endif
1159#if !defined(CO_NEWLOCALS)
1160 __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
1161#endif
1162#if !defined(CO_VARARGS)
1163 __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
1164#endif
1165#if !defined(CO_VARKEYWORDS)
1166 __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1167#endif
1168#if !defined(CO_ASYNC_GENERATOR)
1169 __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1170#endif
1171#if !defined(CO_GENERATOR)
1172 __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
1173#endif
1174#if !defined(CO_COROUTINE)
1175 __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
1176#endif
1177 1;
1178 Py_DECREF(inspect);
1179 return result ? 0 : -1;
1180}
1181static int __Pyx_init_tpflags_bitcount(unsigned long flag) {
1182 int count = 0;
1183 while (flag) {
1184 count += (int) (flag & 1);
1185 flag >>= 1;
1186 }
1187 return count;
1188}
1189static int __Pyx_init_tpflags_variables(void) {
1190 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1191 return 0;
1192 }
1193 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
1194 if (!collections_abc) return -1;
1195 int result = 0;
1196 PyObject *sequence = NULL, *mapping = NULL;
1197#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1198 if (PyObject_GetOptionalAttrString(collections_abc, "Sequence", &sequence) != 1) goto fail;
1199 if (PyObject_GetOptionalAttrString(collections_abc, "Mapping", &mapping) != 1) goto fail;
1200#else
1201 sequence = PyObject_GetAttrString(collections_abc, "Sequence");
1202 if (!sequence) goto fail_attr_lookup;
1203 mapping = PyObject_GetAttrString(collections_abc, "Mapping");
1204 if (!mapping) goto fail_attr_lookup;
1205#endif
1206 if (!PyType_Check(sequence) || !PyType_Check(mapping)) goto fail;
1207 {
1208 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1209 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1210 unsigned long mutual_flags = sequence_flags & mapping_flags;
1211 sequence_flags = sequence_flags ^ mutual_flags;
1212 mapping_flags = mapping_flags ^ mutual_flags;
1213 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1214 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1215 }
1216 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1217 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1218 }
1219 }
1220 cleanup:
1221 Py_XDECREF(mapping);
1222 Py_XDECREF(sequence);
1223 Py_DECREF(collections_abc);
1224 return result;
1225#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1226 fail_attr_lookup:
1227 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1228 PyErr_Clear();
1229 }
1230#endif
1231 fail:
1232 result = PyErr_Occurred() ? -1 : 0;
1233 goto cleanup;
1234}
1235#else
1236static int __Pyx_init_co_variables(void) {
1237 return 0; // It's a limited API-only feature
1238}
1239static int __Pyx_init_tpflags_variables(void) {
1240 return 0; // It's a limited API-only feature
1241}
1242#endif
1243
1244/* MathInitCode */
1245#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1246 #ifndef _USE_MATH_DEFINES
1247 #define _USE_MATH_DEFINES
1248 #endif
1249#endif
1250#include <math.h>
1251#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1252#define __Pyx_truncl trunc
1253#else
1254#define __Pyx_truncl truncl
1255#endif
1256
1257#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1258#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1259#endif
1260#ifndef CYTHON_CLINE_IN_TRACEBACK
1261#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1262#endif
1263#if CYTHON_CLINE_IN_TRACEBACK
1264#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
1265#else
1266#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
1267#endif
1268#define __PYX_ERR(f_index, lineno, Ln_error) \
1269 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1270
1271#ifdef CYTHON_EXTERN_C
1272 #undef __PYX_EXTERN_C
1273 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1274#elif defined(__PYX_EXTERN_C)
1275 #ifdef _MSC_VER
1276 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1277 #else
1278 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1279 #endif
1280#else
1281 #define __PYX_EXTERN_C extern "C++"
1282#endif
1283
1284#define __PYX_HAVE__csparsity
1285#define __PYX_HAVE_API__csparsity
1286/* Early includes */
1287#include "sparsity.h"
1288#include <string.h>
1289#include <stdio.h>
1290
1291 /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1292
1293#include "numpy/arrayobject.h"
1294#include "numpy/ndarrayobject.h"
1295#include "numpy/ndarraytypes.h"
1296#include "numpy/arrayscalars.h"
1297#include "numpy/ufuncobject.h"
1298#include "pythread.h"
1299
1300 typedef int (*__pyx_memoryview_to_dtype_func_type)(char*, PyObject*);
1301
1302#include <stdlib.h>
1303#ifdef _OPENMP
1304#include <omp.h>
1305#endif /* _OPENMP */
1306
1307#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1308#define CYTHON_WITHOUT_ASSERTIONS
1309#endif
1310
1311#ifdef CYTHON_FREETHREADING_COMPATIBLE
1312#if CYTHON_FREETHREADING_COMPATIBLE
1313#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1314#else
1315#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1316#endif
1317#else
1318#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1319#endif
1320#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1321#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1322#define __PYX_DEFAULT_STRING_ENCODING ""
1323#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1324#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1325#define __Pyx_uchar_cast(c) ((unsigned char)c)
1326#define __Pyx_long_cast(x) ((long)x)
1327#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1328 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1329 (sizeof(type) > sizeof(Py_ssize_t) &&\
1330 likely(v < (type)PY_SSIZE_T_MAX ||\
1331 v == (type)PY_SSIZE_T_MAX) &&\
1332 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1333 v == (type)PY_SSIZE_T_MIN))) ||\
1334 (sizeof(type) == sizeof(Py_ssize_t) &&\
1335 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1336 v == (type)PY_SSIZE_T_MAX))) )
1337static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1338 return (size_t) i < (size_t) limit;
1339}
1340#if defined (__cplusplus) && __cplusplus >= 201103L
1341 #include <cstdlib>
1342 #define __Pyx_sst_abs(value) std::abs(value)
1343#elif SIZEOF_INT >= SIZEOF_SIZE_T
1344 #define __Pyx_sst_abs(value) abs(value)
1345#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1346 #define __Pyx_sst_abs(value) labs(value)
1347#elif defined (_MSC_VER)
1348 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1349#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1350 #define __Pyx_sst_abs(value) llabs(value)
1351#elif defined (__GNUC__)
1352 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1353#else
1354 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1355#endif
1356static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1357static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1358static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1359static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1360#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1361#define __Pyx_PyBytes_FromString PyBytes_FromString
1362#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1363static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1364#if CYTHON_ASSUME_SAFE_MACROS
1365 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1366 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1367 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1368 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1369 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1370 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1371 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1372#else
1373 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1374 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1375 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1376 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1377 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1378 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1379 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1380#endif
1381#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1382#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1383#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1384#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1385#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1386#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1387#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1388#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1389#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1390#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1391#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1392static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1393#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1394 return Py_NewRef(obj);
1395#else
1396 Py_INCREF(obj);
1397 return obj;
1398#endif
1399}
1400static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1401#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1402 return Py_XNewRef(obj);
1403#else
1404 Py_XINCREF(obj);
1405 return obj;
1406#endif
1407}
1408static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
1409static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1410static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1411static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1412static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1413#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1414#define __Pyx_PySequence_Tuple(obj)\
1415 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1416static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1417static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
1418static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1419#if CYTHON_ASSUME_SAFE_MACROS
1420#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1421#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1422#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1423#else
1424#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1425#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1426#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1427#endif
1428#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1429#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1430#if CYTHON_USE_PYLONG_INTERNALS
1431 #if PY_VERSION_HEX >= 0x030C00A7
1432 #ifndef _PyLong_SIGN_MASK
1433 #define _PyLong_SIGN_MASK 3
1434 #endif
1435 #ifndef _PyLong_NON_SIZE_BITS
1436 #define _PyLong_NON_SIZE_BITS 3
1437 #endif
1438 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1439 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1440 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1441 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1442 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1443 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1444 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1445 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1446 #define __Pyx_PyLong_SignedDigitCount(x)\
1447 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1448 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1449 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1450 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1451 #else
1452 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1453 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1454 #endif
1455 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1456 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1457 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1458 if (tag_a == tag_b) return 0;
1459 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1460 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1461 if (sign_a > sign_b) return -1;
1462 if (sign_a < sign_b) return 1;
1463 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1464 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1465 return (1 - sign_a) * (size_a - size_b);
1466 }
1467 typedef Py_ssize_t __Pyx_compact_pylong;
1468 typedef size_t __Pyx_compact_upylong;
1469 #else
1470 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1471 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1472 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1473 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1474 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1475 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1476 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1477 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1478 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1479 #define __Pyx_PyLong_CompactValue(x)\
1480 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1481 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1482 typedef sdigit __Pyx_compact_pylong;
1483 typedef digit __Pyx_compact_upylong;
1484 #endif
1485 #if PY_VERSION_HEX >= 0x030C00A5
1486 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1487 #else
1488 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1489 #endif
1490 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1491#else
1492 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1493#endif
1494#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1495 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1496#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1497 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1498#else
1499 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1500#endif
1501
1502
1503/* Test for GCC > 2.95 */
1504#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1505 #define likely(x) __builtin_expect(!!(x), 1)
1506 #define unlikely(x) __builtin_expect(!!(x), 0)
1507#else /* !__GNUC__ or GCC < 2.95 */
1508 #define likely(x) (x)
1509 #define unlikely(x) (x)
1510#endif /* __GNUC__ */
1511/* PretendToInitialize */
1512#ifdef __cplusplus
1513#if __cplusplus > 201103L
1514#include <type_traits>
1515#endif
1516template <typename T>
1517static void __Pyx_pretend_to_initialize(T* ptr) {
1518#if __cplusplus > 201103L
1519 if ((std::is_trivially_default_constructible<T>::value))
1520#endif
1521 *ptr = T();
1522 (void)ptr;
1523}
1524#else
1525static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1526#endif
1527
1528
1529#if !CYTHON_USE_MODULE_STATE
1530static PyObject *__pyx_m = NULL;
1531#endif
1532static const char * const __pyx_cfilenm = __FILE__;
1533
1534/* Header.proto */
1535#if !defined(CYTHON_CCOMPLEX)
1536 #if defined(__cplusplus)
1537 #define CYTHON_CCOMPLEX 1
1538 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1539 #define CYTHON_CCOMPLEX 1
1540 #else
1541 #define CYTHON_CCOMPLEX 0
1542 #endif
1543#endif
1544#if CYTHON_CCOMPLEX
1545 #ifdef __cplusplus
1546 #include <complex>
1547 #else
1548 #include <complex.h>
1549 #endif
1550#endif
1551#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1552 #undef _Complex_I
1553 #define _Complex_I 1.0fj
1554#endif
1555
1556/* #### Code section: filename_table ### */
1557
1558static const char* const __pyx_f[] = {
1559 "proteus/csparsity.pyx",
1560 "View.MemoryView",
1561 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1562 "cpython/type.pxd",
1563};
1564/* #### Code section: utility_code_proto_before_types ### */
1565/* Atomics.proto (used by UnpackUnboundCMethod) */
1566#include <pythread.h>
1567#ifndef CYTHON_ATOMICS
1568 #define CYTHON_ATOMICS 1
1569#endif
1570#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1571#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1572#define __pyx_atomic_int_type int
1573#define __pyx_nonatomic_int_type int
1574#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1575 (__STDC_VERSION__ >= 201112L) &&\
1576 !defined(__STDC_NO_ATOMICS__))
1577 #include <stdatomic.h>
1578#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1579 (__cplusplus >= 201103L) ||\
1580 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1581 #include <atomic>
1582#endif
1583#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1584 (__STDC_VERSION__ >= 201112L) &&\
1585 !defined(__STDC_NO_ATOMICS__) &&\
1586 ATOMIC_INT_LOCK_FREE == 2)
1587 #undef __pyx_atomic_int_type
1588 #define __pyx_atomic_int_type atomic_int
1589 #define __pyx_atomic_ptr_type atomic_uintptr_t
1590 #define __pyx_nonatomic_ptr_type uintptr_t
1591 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1592 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1593 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1594 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1595 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1596 #define __pyx_atomic_load(value) atomic_load(value)
1597 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1598 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1599 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1600 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1601 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1602 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1603 #pragma message ("Using standard C atomics")
1604 #elif defined(__PYX_DEBUG_ATOMICS)
1605 #warning "Using standard C atomics"
1606 #endif
1607#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1608 (__cplusplus >= 201103L) ||\
1609\
1610 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1611 ATOMIC_INT_LOCK_FREE == 2)
1612 #undef __pyx_atomic_int_type
1613 #define __pyx_atomic_int_type std::atomic_int
1614 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1615 #define __pyx_nonatomic_ptr_type uintptr_t
1616 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1617 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1618 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1619 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1620 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1621 #define __pyx_atomic_load(value) std::atomic_load(value)
1622 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1623 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1624 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1625 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1626 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1627 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1628 #pragma message ("Using standard C++ atomics")
1629 #elif defined(__PYX_DEBUG_ATOMICS)
1630 #warning "Using standard C++ atomics"
1631 #endif
1632#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1633 (__GNUC_MINOR__ > 1 ||\
1634 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1635 #define __pyx_atomic_ptr_type void*
1636 #define __pyx_nonatomic_ptr_type void*
1637 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1638 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1639 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1640 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1641 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1642 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1643 int result = old == *expected;
1644 *expected = old;
1645 return result;
1646 }
1647 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1648 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1649 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1650 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1651 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1652 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1653 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1654 int result = old == *expected;
1655 *expected = old;
1656 return result;
1657 }
1658 #ifdef __PYX_DEBUG_ATOMICS
1659 #warning "Using GNU atomics"
1660 #endif
1661#elif CYTHON_ATOMICS && defined(_MSC_VER)
1662 #include <intrin.h>
1663 #undef __pyx_atomic_int_type
1664 #define __pyx_atomic_int_type long
1665 #define __pyx_atomic_ptr_type void*
1666 #undef __pyx_nonatomic_int_type
1667 #define __pyx_nonatomic_int_type long
1668 #define __pyx_nonatomic_ptr_type void*
1669 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1670 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1671 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1672 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1673 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1674 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1675 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1676 int result = old == *expected;
1677 *expected = old;
1678 return result;
1679 }
1680 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1681 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1682 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1683 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1684 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1685 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1686 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1687 int result = old == *expected;
1688 *expected = old;
1689 return result;
1690 }
1691 #ifdef __PYX_DEBUG_ATOMICS
1692 #pragma message ("Using MSVC atomics")
1693 #endif
1694#else
1695 #undef CYTHON_ATOMICS
1696 #define CYTHON_ATOMICS 0
1697 #ifdef __PYX_DEBUG_ATOMICS
1698 #warning "Not using atomics"
1699 #endif
1700#endif
1701
1702/* CriticalSectionsDefinition.proto (used by CriticalSections) */
1703#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1704#define __Pyx_PyCriticalSection void*
1705#define __Pyx_PyCriticalSection2 void*
1706#define __Pyx_PyCriticalSection_End(cs)
1707#define __Pyx_PyCriticalSection2_End(cs)
1708#else
1709#define __Pyx_PyCriticalSection PyCriticalSection
1710#define __Pyx_PyCriticalSection2 PyCriticalSection2
1711#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1712#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1713#endif
1714
1715/* CriticalSections.proto (used by ParseKeywordsImpl) */
1716#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1717#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1718#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1719#else
1720#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1721#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1722#endif
1723#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1724#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1725#define __Pyx_END_CRITICAL_SECTION() }
1726#else
1727#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1728#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1729#endif
1730
1731/* ForceInitThreads.proto */
1732#ifndef __PYX_FORCE_INIT_THREADS
1733 #define __PYX_FORCE_INIT_THREADS 0
1734#endif
1735
1736/* NoFastGil.proto */
1737#define __Pyx_PyGILState_Ensure PyGILState_Ensure
1738#define __Pyx_PyGILState_Release PyGILState_Release
1739#define __Pyx_FastGIL_Remember()
1740#define __Pyx_FastGIL_Forget()
1741#define __Pyx_FastGilFuncInit()
1742
1743/* IncludeStructmemberH.proto (used by CythonFunctionShared) */
1744#include <structmember.h>
1745
1746/* BufferFormatStructs.proto */
1747struct __Pyx_StructField_;
1748#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1749typedef struct {
1750 const char* name;
1751 const struct __Pyx_StructField_* fields;
1752 size_t size;
1753 size_t arraysize[8];
1754 int ndim;
1755 char typegroup;
1756 char is_unsigned;
1757 int flags;
1758} __Pyx_TypeInfo;
1759typedef struct __Pyx_StructField_ {
1760 const __Pyx_TypeInfo* type;
1761 const char* name;
1762 size_t offset;
1763} __Pyx_StructField;
1764typedef struct {
1765 const __Pyx_StructField* field;
1766 size_t parent_offset;
1767} __Pyx_BufFmt_StackElem;
1768typedef struct {
1769 __Pyx_StructField root;
1770 __Pyx_BufFmt_StackElem* head;
1771 size_t fmt_offset;
1772 size_t new_count, enc_count;
1773 size_t struct_alignment;
1774 int is_complex;
1775 char enc_type;
1776 char new_packmode;
1777 char enc_packmode;
1778 char is_valid_array;
1779} __Pyx_BufFmt_Context;
1780
1781/* MemviewSliceStruct.proto */
1782struct __pyx_memoryview_obj;
1783typedef struct {
1784 struct __pyx_memoryview_obj *memview;
1785 char *data;
1786 Py_ssize_t shape[8];
1787 Py_ssize_t strides[8];
1788 Py_ssize_t suboffsets[8];
1789} __Pyx_memviewslice;
1790#define __Pyx_MemoryView_Len(m) (m.shape[0])
1791#define __Pyx_MEMVIEW_DIRECT 1
1792#define __Pyx_MEMVIEW_PTR 2
1793#define __Pyx_MEMVIEW_FULL 4
1794#define __Pyx_MEMVIEW_CONTIG 8
1795#define __Pyx_MEMVIEW_STRIDED 16
1796#define __Pyx_MEMVIEW_FOLLOW 32
1797#define __Pyx_IS_C_CONTIG 1
1798#define __Pyx_IS_F_CONTIG 2
1799#define __Pyx_MEMSLICE_INIT { 0, 0, { 0 }, { 0 }, { 0 } }
1800#if CYTHON_ATOMICS
1801 #define __pyx_add_acquisition_count(memview)\
1802 __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
1803 #define __pyx_sub_acquisition_count(memview)\
1804 __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
1805#else
1806 #define __pyx_add_acquisition_count(memview)\
1807 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1808 #define __pyx_sub_acquisition_count(memview)\
1809 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1810#endif
1811
1812/* #### Code section: numeric_typedefs ### */
1813
1814/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":761
1815 * # in Cython to enable them only on the right systems.
1816 *
1817 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1818 * ctypedef npy_int16 int16_t
1819 * ctypedef npy_int32 int32_t
1820*/
1821typedef npy_int8 __pyx_t_5numpy_int8_t;
1822
1823/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":762
1824 *
1825 * ctypedef npy_int8 int8_t
1826 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1827 * ctypedef npy_int32 int32_t
1828 * ctypedef npy_int64 int64_t
1829*/
1830typedef npy_int16 __pyx_t_5numpy_int16_t;
1831
1832/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":763
1833 * ctypedef npy_int8 int8_t
1834 * ctypedef npy_int16 int16_t
1835 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1836 * ctypedef npy_int64 int64_t
1837 *
1838*/
1839typedef npy_int32 __pyx_t_5numpy_int32_t;
1840
1841/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":764
1842 * ctypedef npy_int16 int16_t
1843 * ctypedef npy_int32 int32_t
1844 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1845 *
1846 * ctypedef npy_uint8 uint8_t
1847*/
1848typedef npy_int64 __pyx_t_5numpy_int64_t;
1849
1850/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":766
1851 * ctypedef npy_int64 int64_t
1852 *
1853 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1854 * ctypedef npy_uint16 uint16_t
1855 * ctypedef npy_uint32 uint32_t
1856*/
1857typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1858
1859/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":767
1860 *
1861 * ctypedef npy_uint8 uint8_t
1862 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1863 * ctypedef npy_uint32 uint32_t
1864 * ctypedef npy_uint64 uint64_t
1865*/
1866typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1867
1868/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":768
1869 * ctypedef npy_uint8 uint8_t
1870 * ctypedef npy_uint16 uint16_t
1871 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1872 * ctypedef npy_uint64 uint64_t
1873 *
1874*/
1875typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1876
1877/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":769
1878 * ctypedef npy_uint16 uint16_t
1879 * ctypedef npy_uint32 uint32_t
1880 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1881 *
1882 * ctypedef npy_float32 float32_t
1883*/
1884typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1885
1886/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":771
1887 * ctypedef npy_uint64 uint64_t
1888 *
1889 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1890 * ctypedef npy_float64 float64_t
1891 * #ctypedef npy_float80 float80_t
1892*/
1893typedef npy_float32 __pyx_t_5numpy_float32_t;
1894
1895/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":772
1896 *
1897 * ctypedef npy_float32 float32_t
1898 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1899 * #ctypedef npy_float80 float80_t
1900 * #ctypedef npy_float128 float128_t
1901*/
1902typedef npy_float64 __pyx_t_5numpy_float64_t;
1903
1904/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":779
1905 * ctypedef double complex complex128_t
1906 *
1907 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1908 * ctypedef npy_ulonglong ulonglong_t
1909 *
1910*/
1911typedef npy_longlong __pyx_t_5numpy_longlong_t;
1912
1913/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":780
1914 *
1915 * ctypedef npy_longlong longlong_t
1916 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1917 *
1918 * ctypedef npy_intp intp_t
1919*/
1920typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1921
1922/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":782
1923 * ctypedef npy_ulonglong ulonglong_t
1924 *
1925 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1926 * ctypedef npy_uintp uintp_t
1927 *
1928*/
1929typedef npy_intp __pyx_t_5numpy_intp_t;
1930
1931/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":783
1932 *
1933 * ctypedef npy_intp intp_t
1934 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1935 *
1936 * ctypedef npy_double float_t
1937*/
1938typedef npy_uintp __pyx_t_5numpy_uintp_t;
1939
1940/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":785
1941 * ctypedef npy_uintp uintp_t
1942 *
1943 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1944 * ctypedef npy_double double_t
1945 * ctypedef npy_longdouble longdouble_t
1946*/
1947typedef npy_double __pyx_t_5numpy_float_t;
1948
1949/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":786
1950 *
1951 * ctypedef npy_double float_t
1952 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1953 * ctypedef npy_longdouble longdouble_t
1954 *
1955*/
1956typedef npy_double __pyx_t_5numpy_double_t;
1957
1958/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":787
1959 * ctypedef npy_double float_t
1960 * ctypedef npy_double double_t
1961 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1962 *
1963 * ctypedef float complex cfloat_t
1964*/
1965typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1966/* #### Code section: complex_type_declarations ### */
1967/* Declarations.proto */
1968#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1969 #ifdef __cplusplus
1970 typedef ::std::complex< float > __pyx_t_float_complex;
1971 #else
1972 typedef float _Complex __pyx_t_float_complex;
1973 #endif
1974#else
1975 typedef struct { float real, imag; } __pyx_t_float_complex;
1976#endif
1977static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1978
1979/* Declarations.proto */
1980#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1981 #ifdef __cplusplus
1982 typedef ::std::complex< double > __pyx_t_double_complex;
1983 #else
1984 typedef double _Complex __pyx_t_double_complex;
1985 #endif
1986#else
1987 typedef struct { double real, imag; } __pyx_t_double_complex;
1988#endif
1989static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1990
1991/* Declarations.proto */
1992#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1993 #ifdef __cplusplus
1994 typedef ::std::complex< long double > __pyx_t_long_double_complex;
1995 #else
1996 typedef long double _Complex __pyx_t_long_double_complex;
1997 #endif
1998#else
1999 typedef struct { long double real, imag; } __pyx_t_long_double_complex;
2000#endif
2001static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
2002
2003/* #### Code section: type_declarations ### */
2004
2005/*--- Type declarations ---*/
2006struct __pyx_obj_9csparsity_PySparsityInfo;
2007struct __pyx_array_obj;
2008struct __pyx_MemviewEnum_obj;
2009struct __pyx_memoryview_obj;
2010struct __pyx_memoryviewslice_obj;
2011
2012/* "csparsity.pyx":6
2013 * from csparsity cimport SparsityInfo
2014 *
2015 * cdef class PySparsityInfo: # <<<<<<<<<<<<<<
2016 * cdef SparsityInfo cpp
2017 * def __cinit__(self):
2018*/
2019struct __pyx_obj_9csparsity_PySparsityInfo {
2020 PyObject_HEAD
2021 proteus::SparsityInfo cpp;
2022};
2023
2024
2025/* "View.MemoryView":128
2026 *
2027 *
2028 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2029 * @cname("__pyx_array")
2030 * cdef class array:
2031*/
2032struct __pyx_array_obj {
2033 PyObject_HEAD
2034 struct __pyx_vtabstruct_array *__pyx_vtab;
2035 char *data;
2036 Py_ssize_t len;
2037 char *format;
2038 int ndim;
2039 Py_ssize_t *_shape;
2040 Py_ssize_t *_strides;
2041 Py_ssize_t itemsize;
2042 PyObject *mode;
2043 PyObject *_format;
2044 void (*callback_free_data)(void *);
2045 int free_data;
2046 int dtype_is_object;
2047};
2048
2049
2050/* "View.MemoryView":318
2051 *
2052 *
2053 * @cname('__pyx_MemviewEnum') # <<<<<<<<<<<<<<
2054 * cdef class Enum(object):
2055 * cdef object name
2056*/
2057struct __pyx_MemviewEnum_obj {
2058 PyObject_HEAD
2059 PyObject *name;
2060};
2061
2062
2063/* "View.MemoryView":353
2064 *
2065 *
2066 * @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
2067 * cdef class memoryview:
2068 *
2069*/
2070struct __pyx_memoryview_obj {
2071 PyObject_HEAD
2072 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2073 PyObject *obj;
2074 PyObject *_size;
2075 void *_unused;
2076 PyThread_type_lock lock;
2077 __pyx_atomic_int_type acquisition_count;
2078 Py_buffer view;
2079 int flags;
2080 int dtype_is_object;
2081 __Pyx_TypeInfo const *typeinfo;
2082};
2083
2084
2085/* "View.MemoryView":947
2086 *
2087 *
2088 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2089 * @cname('__pyx_memoryviewslice')
2090 * cdef class _memoryviewslice(memoryview):
2091*/
2092struct __pyx_memoryviewslice_obj {
2093 struct __pyx_memoryview_obj __pyx_base;
2094 __Pyx_memviewslice from_slice;
2095 PyObject *from_object;
2096 PyObject *(*to_object_func)(char *);
2097 __pyx_memoryview_to_dtype_func_type to_dtype_func;
2098};
2099
2100
2101
2102/* "View.MemoryView":128
2103 *
2104 *
2105 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2106 * @cname("__pyx_array")
2107 * cdef class array:
2108*/
2109
2110struct __pyx_vtabstruct_array {
2111 PyObject *(*get_memview)(struct __pyx_array_obj *);
2112};
2113static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2114
2115
2116/* "View.MemoryView":353
2117 *
2118 *
2119 * @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
2120 * cdef class memoryview:
2121 *
2122*/
2123
2124struct __pyx_vtabstruct_memoryview {
2125 char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
2126 PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
2127 PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2128 PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
2129 PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2130 PyObject *(*setitem_indexed1)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2131 PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
2132 PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
2133 PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
2134};
2135static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2136
2137
2138/* "View.MemoryView":947
2139 *
2140 *
2141 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2142 * @cname('__pyx_memoryviewslice')
2143 * cdef class _memoryviewslice(memoryview):
2144*/
2145
2146struct __pyx_vtabstruct__memoryviewslice {
2147 struct __pyx_vtabstruct_memoryview __pyx_base;
2148};
2149static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2150/* #### Code section: utility_code_proto ### */
2151
2152/* --- Runtime support code (head) --- */
2153/* Refnanny.proto */
2154#ifndef CYTHON_REFNANNY
2155 #define CYTHON_REFNANNY 0
2156#endif
2157#if CYTHON_REFNANNY
2158 typedef struct {
2159 void (*INCREF)(void*, PyObject*, Py_ssize_t);
2160 void (*DECREF)(void*, PyObject*, Py_ssize_t);
2161 void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2162 void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2163 void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2164 void (*FinishContext)(void**);
2165 } __Pyx_RefNannyAPIStruct;
2166 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2167 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2168 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2169 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2170 if (acquire_gil) {\
2171 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2172 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2173 PyGILState_Release(__pyx_gilstate_save);\
2174 } else {\
2175 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2176 }
2177 #define __Pyx_RefNannyFinishContextNogil() {\
2178 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2179 __Pyx_RefNannyFinishContext();\
2180 PyGILState_Release(__pyx_gilstate_save);\
2181 }
2182 #define __Pyx_RefNannyFinishContextNogil() {\
2183 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2184 __Pyx_RefNannyFinishContext();\
2185 PyGILState_Release(__pyx_gilstate_save);\
2186 }
2187 #define __Pyx_RefNannyFinishContext()\
2188 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2189 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2190 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2191 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2192 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2193 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2194 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2195 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2196 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2197#else
2198 #define __Pyx_RefNannyDeclarations
2199 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2200 #define __Pyx_RefNannyFinishContextNogil()
2201 #define __Pyx_RefNannyFinishContext()
2202 #define __Pyx_INCREF(r) Py_INCREF(r)
2203 #define __Pyx_DECREF(r) Py_DECREF(r)
2204 #define __Pyx_GOTREF(r)
2205 #define __Pyx_GIVEREF(r)
2206 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2207 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2208 #define __Pyx_XGOTREF(r)
2209 #define __Pyx_XGIVEREF(r)
2210#endif
2211#define __Pyx_Py_XDECREF_SET(r, v) do {\
2212 PyObject *tmp = (PyObject *) r;\
2213 r = v; Py_XDECREF(tmp);\
2214 } while (0)
2215#define __Pyx_XDECREF_SET(r, v) do {\
2216 PyObject *tmp = (PyObject *) r;\
2217 r = v; __Pyx_XDECREF(tmp);\
2218 } while (0)
2219#define __Pyx_DECREF_SET(r, v) do {\
2220 PyObject *tmp = (PyObject *) r;\
2221 r = v; __Pyx_DECREF(tmp);\
2222 } while (0)
2223#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2224#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2225
2226/* CopyObjectArray.proto (used by TupleOrListFromArrayImpl) */
2227#if CYTHON_COMPILING_IN_CPYTHON
2228static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2229#endif
2230
2231/* TupleOrListFromArrayImpl.proto (used by TupleFromArray) */
2232#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2233#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2234#else
2235CYTHON_UNUSED static PyObject *
2236__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2237#endif
2238
2239/* TupleFromArray.proto (used by fastcall) */
2240
2241
2242/* IncludeStringH.proto (used by PyObjectCompare) */
2243#include <string.h>
2244
2245/* PyObjectCompare.proto (used by UnicodeEquals) */
2246static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop);
2247
2248/* UnicodeEquals.proto (used by fastcall) */
2249#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2250
2251/* fastcall.proto */
2252#if CYTHON_AVOID_BORROWED_REFS
2253 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2254#elif CYTHON_ASSUME_SAFE_MACROS
2255 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2256#else
2257 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2258#endif
2259#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2260#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2261#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2262#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2263#if CYTHON_VECTORCALL
2264 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2265 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2266 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2267 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2268 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2269 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2270 #else
2271 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2272 #endif
2273#else
2274 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2275 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2276 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2277 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2278 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2279#endif
2280#if CYTHON_VECTORCALL_TPNEW
2281 #if !CYTHON_VECTORCALL
2282 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2283 #endif
2284 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2285 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2286 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2287 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2288 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2289#else
2290 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2291 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2292 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2293 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2294 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2295#endif
2296#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2297#if CYTHON_VECTORCALL
2298#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2299#else
2300#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2301#endif
2302
2303/* py_dict_items.proto (used by OwnedDictNext) */
2304#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2305#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2306#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2307static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2308
2309/* CallCFunction.proto (used by CallUnboundCMethod0) */
2310#define __Pyx_CallCFunction(cfunc, self, args)\
2311 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2312#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2313 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2314#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2315 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2316#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2317 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2318
2319/* PyObjectCall.proto (used by PyObjectFastCall) */
2320#if CYTHON_COMPILING_IN_CPYTHON
2321static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2322#else
2323#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2324#endif
2325
2326/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
2327#if CYTHON_COMPILING_IN_CPYTHON
2328static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2329#endif
2330
2331/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */
2332#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2333static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargsf, PyObject *kwargs);
2334
2335/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
2336static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2337
2338/* UnpackUnboundCMethod_decl.proto (used by UnpackUnboundCMethod) */
2339typedef struct {
2340 PyObject *type;
2341 PyObject **method_name;
2342 PyCFunction func;
2343 PyObject *method;
2344 int flag;
2345#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2346 __pyx_atomic_int_type initialized;
2347#endif
2348} __Pyx_CachedCFunction;
2349
2350/* IgnoreException.proto (used by UnpackUnboundCMethod_impl) */
2351static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2352#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2353
2354/* FastTypeChecks.proto (used by UnpackUnboundCMethod_impl) */
2355#if CYTHON_COMPILING_IN_CPYTHON
2356#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2357#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2358static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2359static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2360#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2361#else
2362#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2363#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2364#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2365#endif
2366
2367/* PyObjectGetAttrStr.proto (used by UnpackUnboundCMethod_impl) */
2368#if CYTHON_USE_TYPE_SLOTS
2369static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2370#else
2371#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2372#endif
2373
2374/* UnpackUnboundCMethod_impl.export */
2375static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2376
2377/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
2378#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2379static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2380#if !CYTHON_ATOMICS
2381 return 1;
2382#else
2383 __pyx_nonatomic_int_type expected = 0;
2384 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2385 return 0;
2386 }
2387 return expected;
2388#endif
2389}
2390static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2391#if CYTHON_ATOMICS
2392 __pyx_atomic_store(&cfunc->initialized, 2);
2393#endif
2394}
2395#else
2396#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2397#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2398#endif
2399
2400/* CallUnboundCMethod0.proto */
2401CYTHON_UNUSED
2402static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2403#if CYTHON_COMPILING_IN_CPYTHON
2404static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2405#else
2406#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2407#endif
2408
2409/* py_dict_values.proto (used by OwnedDictNext) */
2410#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2411#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2412#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2413static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2414
2415/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
2416#if CYTHON_AVOID_BORROWED_REFS
2417static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2418#else
2419CYTHON_INLINE
2420static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2421#endif
2422
2423/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
2424static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2425
2426/* ParseKeywordsImpl.export */
2427static int __Pyx_ParseKeywordsTuple(
2428 PyObject *kwds,
2429 PyObject * const *kwvalues,
2430 PyObject ** const argnames[],
2431 PyObject *kwds2,
2432 PyObject *values[],
2433 Py_ssize_t num_pos_args,
2434 Py_ssize_t num_kwargs,
2435 const char* function_name,
2436 int ignore_unknown_kwargs
2437);
2438static int __Pyx_ParseKeywordDictToDict(
2439 PyObject *kwds,
2440 PyObject ** const argnames[],
2441 PyObject *kwds2,
2442 PyObject *values[],
2443 Py_ssize_t num_pos_args,
2444 const char* function_name
2445);
2446static int __Pyx_ParseKeywordDict(
2447 PyObject *kwds,
2448 PyObject ** const argnames[],
2449 PyObject *values[],
2450 Py_ssize_t num_pos_args,
2451 Py_ssize_t num_kwargs,
2452 const char* function_name,
2453 int ignore_unknown_kwargs
2454);
2455
2456/* CallUnboundCMethod2.proto */
2457CYTHON_UNUSED
2458static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2459#if CYTHON_COMPILING_IN_CPYTHON
2460static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2461#else
2462#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2463#endif
2464
2465/* ParseKeywords.proto */
2466static CYTHON_INLINE int __Pyx_ParseKeywords(
2467 PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
2468 PyObject *kwds2, PyObject *values[],
2469 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2470 const char* function_name,
2471 int ignore_unknown_kwargs
2472);
2473
2474/* RaiseArgTupleInvalid.export */
2475static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2476 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2477
2478/* ArgTypeTestError.export */
2479static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2480
2481/* ArgTypeTest.proto */
2482static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact);
2483
2484/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
2485#if CYTHON_FAST_THREAD_STATE
2486#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2487#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2488#if PY_VERSION_HEX >= 0x030C00A6
2489#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2490#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2491#else
2492#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2493#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2494#endif
2495#else
2496#define __Pyx_PyThreadState_declare
2497#define __Pyx_PyThreadState_assign
2498#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2499#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2500#endif
2501
2502/* PyErrFetchRestore.proto (used by GivenExceptionMatches) */
2503#if CYTHON_FAST_THREAD_STATE
2504#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2505#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2506#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2507#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2508#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2509static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2510static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2511#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2512#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2513#else
2514#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2515#endif
2516#else
2517#define __Pyx_PyErr_Clear() PyErr_Clear()
2518#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2519#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2520#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2521#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2522#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2523#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2524#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2525#endif
2526
2527/* GivenExceptionMatches.proto (used by PyErrExceptionMatches) */
2528#if CYTHON_COMPILING_IN_CPYTHON
2529static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2530static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2531#else
2532#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2533static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2534 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2535}
2536#endif
2537#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2538
2539/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
2540#if CYTHON_FAST_THREAD_STATE
2541#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2542static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2543#else
2544#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2545#endif
2546
2547/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */
2548static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2549
2550/* GetBuiltinName.proto */
2551static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2552
2553/* PyObjectFastCallMethod.proto */
2554#if CYTHON_VECTORCALL
2555#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
2556#else
2557static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
2558#endif
2559
2560/* FormatTypeName.proto (used by RaiseErrorWithObjectType1) */
2561#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2562typedef PyObject *__Pyx_TypeName;
2563#define __Pyx_FMT_TYPENAME "%N"
2564#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2565#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2566#elif CYTHON_COMPILING_IN_LIMITED_API
2567typedef PyObject *__Pyx_TypeName;
2568#define __Pyx_FMT_TYPENAME "%U"
2569#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2570static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2571#else // !LIMITED_API
2572typedef const char *__Pyx_TypeName;
2573#define __Pyx_FMT_TYPENAME "%.200s"
2574#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2575#define __Pyx_DECREF_TypeName(obj)
2576#endif
2577
2578/* RaiseErrorWithObjectType1.proto (used by RaiseUnexpectedTypeError) */
2579#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
2580#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
2581CYTHON_UNUSED
2582static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj);
2583
2584/* RaiseUnexpectedTypeError.proto */
2585CYTHON_UNUSED
2586static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2587
2588/* PyMemoryError_Check.proto */
2589#define __Pyx_PyExc_MemoryError_Check(obj) __Pyx_TypeCheck(obj, PyExc_MemoryError)
2590
2591/* RaiseException.export */
2592static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2593
2594/* PyValueError_Check.proto */
2595#define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError)
2596
2597/* BuildPyUnicode.proto (used by COrdinalToPyUnicode) */
2598static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
2599 int prepend_sign, char padding_char);
2600
2601/* COrdinalToPyUnicode.proto (used by CIntToPyUnicode) */
2602static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value);
2603static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char);
2604
2605/* GCCDiagnostics.proto (used by CIntToPyUnicode) */
2606#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2607#define __Pyx_HAS_GCC_DIAGNOSTIC
2608#endif
2609
2610/* IncludeStdlibH.proto (used by CIntToPyUnicode) */
2611#include <stdlib.h>
2612
2613/* CIntToPyUnicode.proto */
2614#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\
2615 ((format_char) == ('c')) ?\
2616 __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\
2617 __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\
2618 )
2619static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char);
2620static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
2621
2622/* CIntToPyUnicode.proto */
2623#define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\
2624 ((format_char) == ('c')) ?\
2625 __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
2626 __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
2627 )
2628static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char);
2629static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
2630
2631/* JoinPyUnicode.proto */
2632#define __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH\
2633 (!CYTHON_COMPILING_IN_GRAAL && !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API)
2634
2635/* JoinPyUnicode.export */
2636static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind);
2637
2638/* UnicodeEqualsUCS4.proto (used by UnicodeEquals_uchar) */
2639#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
2640#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2641 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2642 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2643 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2644 )
2645#else
2646#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2647 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2648 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2649 (likely((s1_is_str) || PyUnicode_CheckExact(s1)) ?\
2650 __Pyx__PyUnicode_EqualsUCS4(s1, ch2, equals) :\
2651 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2652 ))
2653static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals);
2654#endif
2655
2656/* UnicodeEquals_uchar.proto */
2657#define __Pyx_PyObject_Equals_obj_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 0)
2658
2659/* PyObjectCompare.proto */
2660static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop);
2661
2662/* PyObjectFormatSimple.proto */
2663#if CYTHON_COMPILING_IN_PYPY
2664 #define __Pyx_PyObject_FormatSimple(s, f) (\
2665 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2666 PyObject_Format(s, f))
2667#elif CYTHON_USE_TYPE_SLOTS
2668 #define __Pyx_PyObject_FormatSimple(s, f) (\
2669 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2670 likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2671 likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2672 PyObject_Format(s, f))
2673#else
2674 #define __Pyx_PyObject_FormatSimple(s, f) (\
2675 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2676 PyObject_Format(s, f))
2677#endif
2678
2679/* PyObjectCompare.proto */
2680static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2, int pyop);
2681
2682CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2683/* UnicodeEquals_uchar.proto */
2684#define __Pyx_PyObject_Equals_str_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 1)
2685
2686static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2687/* GetAttr.proto */
2688static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2689
2690/* PyFrozenDict.proto (used by GetItemInt) */
2691#if CYTHON_COMPILING_IN_LIMITED_API
2692#define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
2693#define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
2694static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
2695#define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
2696#define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
2697#define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
2698#define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
2699static CYTHON_INLINE int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
2700 return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
2701}
2702#define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
2703static CYTHON_INLINE int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
2704 return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
2705}
2706#elif PY_VERSION_HEX >= 0x030f00a6 ||\
2707 (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
2708#define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
2709#define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
2710#define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
2711#define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
2712#define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
2713#define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
2714#define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
2715#else
2716#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
2717static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
2718 if (!it) {
2719 return PyDict_New();
2720 } else if (PyDict_Check(it)) {
2721 return PyDict_Copy(it);
2722 } else {
2723 PyObject *dict = PyDict_New();
2724 if (!dict) return NULL;
2725 PyObject *result = PyNumber_InPlaceOr(dict, it);
2726 Py_DECREF(dict);
2727 return result;
2728 }
2729}
2730#define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
2731#define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
2732#define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
2733#define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
2734#define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
2735#endif
2736
2737/* GetItemInt.proto */
2738#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2739 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2740 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2741 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
2742#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2743 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2744 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2745 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2746static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2747 int wraparound, int boundscheck, int unsafe_shared);
2748#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2749 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2750 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2751 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2752static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2753 int wraparound, int boundscheck, int unsafe_shared);
2754static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2755static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2756 int wraparound, int boundscheck, int unsafe_shared);
2757
2758/* RaiseErrorWithObjectType.proto (used by ObjectGetItem) */
2759#define __Pyx_RaiseTypeErrorWithObjectType(message, obj) __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
2760#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj) __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
2761CYTHON_UNUSED
2762static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj);
2763
2764/* ObjectGetItem.proto */
2765#if CYTHON_USE_TYPE_SLOTS
2766static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2767#else
2768#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2769#endif
2770
2771/* RejectKeywords.export */
2772static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);
2773
2774/* PyTypeError_Check.proto */
2775#define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError)
2776
2777/* DivInt[Py_ssize_t].proto */
2778static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);
2779
2780/* UnaryNegOverflows.proto */
2781#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2782 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2783
2784/* GetAttr3.proto */
2785static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2786
2787/* PyDictVersioning.proto (used by GetModuleGlobalName) */
2788#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2789#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2790#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2791#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2792 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2793 (cache_var) = (value);
2794#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2795 static PY_UINT64_T __pyx_dict_version = 0;\
2796 static PyObject *__pyx_dict_cached_value = NULL;\
2797 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2798 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2799 } else {\
2800 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2801 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2802 }\
2803}
2804static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2805static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2806static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2807#else
2808#define __PYX_GET_DICT_VERSION(dict) (0)
2809#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2810#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2811#endif
2812
2813/* GetModuleGlobalName.proto */
2814#if CYTHON_USE_DICT_VERSIONS
2815#define __Pyx_GetModuleGlobalName(var, name) do {\
2816 static PY_UINT64_T __pyx_dict_version = 0;\
2817 static PyObject *__pyx_dict_cached_value = NULL;\
2818 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
2819 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2820 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2821} while(0)
2822#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2823 PY_UINT64_T __pyx_dict_version;\
2824 PyObject *__pyx_dict_cached_value;\
2825 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2826} while(0)
2827static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2828#else
2829#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2830#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2831static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2832#endif
2833
2834/* AssertionsEnabled.proto */
2835#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
2836 static int __pyx_assertions_enabled_flag;
2837 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2838 #if __clang__ || __GNUC__
2839 __attribute__((no_sanitize("thread")))
2840 #endif
2841 static int __Pyx_init_assertions_enabled(void) {
2842 PyObject *builtins, *debug, *debug_str;
2843 int flag;
2844 builtins = PyEval_GetBuiltins();
2845 if (!builtins) goto bad;
2846 debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2847 if (!debug_str) goto bad;
2848 debug = PyObject_GetItem(builtins, debug_str);
2849 Py_DECREF(debug_str);
2850 if (!debug) goto bad;
2851 flag = PyObject_IsTrue(debug);
2852 Py_DECREF(debug);
2853 if (flag == -1) goto bad;
2854 __pyx_assertions_enabled_flag = flag;
2855 return 0;
2856 bad:
2857 __pyx_assertions_enabled_flag = 1;
2858 return -1;
2859 }
2860#else
2861 #define __Pyx_init_assertions_enabled() (0)
2862 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2863#endif
2864
2865/* PyAssertionError_Check.proto */
2866#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
2867
2868/* RaiseTooManyValuesToUnpack.proto */
2869static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2870
2871/* RaiseNeedMoreValuesToUnpack.proto */
2872static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2873
2874/* RaiseNoneIterError.proto */
2875static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2876
2877/* GetTopmostException.proto (used by SaveResetException) */
2878#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2879static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2880#endif
2881
2882/* SaveResetException.proto */
2883#if CYTHON_FAST_THREAD_STATE
2884#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2885static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2886#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2887static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2888#else
2889#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2890#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2891#endif
2892
2893/* RaiseErrorWithObjectTypes.proto (used by ExtTypeTest) */
2894#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
2895#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
2896#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
2897CYTHON_UNUSED
2898static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
2899
2900/* ExtTypeTest.proto */
2901static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2902
2903/* GetException.proto */
2904#if CYTHON_FAST_THREAD_STATE
2905#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2906static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2907#else
2908static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2909#endif
2910
2911/* SwapException.proto */
2912#if CYTHON_FAST_THREAD_STATE
2913#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2914static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2915#else
2916static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2917#endif
2918
2919/* HasAttr.proto (used by ImportImpl) */
2920#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2921#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
2922#else
2923static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2924#endif
2925
2926/* TupleOrListFromArrayImpl.proto (used by ListFromArray) */
2927CYTHON_UNUSED static PyObject *
2928__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2929
2930/* ListFromArray.proto (used by ImportImpl) */
2931
2932
2933/* ImportImpl.export */
2934static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);
2935
2936/* Import.proto */
2937static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);
2938
2939CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2940/* ListCompAppendAndDecref.proto */
2941static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x);
2942
2943/* PySequenceMultiply.proto */
2944#define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
2945#if !CYTHON_USE_TYPE_SLOTS
2946#define __Pyx_PySequence_Multiply PySequence_Repeat
2947#else
2948static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
2949#endif
2950
2951/* PyNumberBinop.proto */
2952#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2953#define __Pyx_PyNumber_Multiply_object_int(op1, op2) PyNumber_Multiply(op1, op2)
2954#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
2955#else
2956#define __Pyx_PyNumber_Multiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 0)
2957#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 1)
2958static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2, int inplace);
2959#endif
2960
2961/* PyObjectFormatAndDecref.proto */
2962static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
2963static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
2964
2965/* PyObjectFormat.proto */
2966#if CYTHON_USE_UNICODE_WRITER
2967static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
2968#else
2969#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
2970#endif
2971
2972/* PyObject_Unicode.proto */
2973#define __Pyx_PyObject_Unicode(obj)\
2974 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2975
2976/* SetItemInt.proto */
2977#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2978 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2979 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, wraparound, boundscheck, unsafe_shared) :\
2980 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
2981static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2982static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2983 int wraparound, int boundscheck, int unsafe_shared);
2984
2985/* RaiseUnboundLocalError.proto */
2986static void __Pyx_RaiseUnboundLocalError(const char *varname);
2987
2988/* DivInt[long].proto */
2989static CYTHON_INLINE long __Pyx_div_long(long, long, int b_is_constant);
2990
2991/* ListAppend.proto */
2992#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
2993static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x);
2994#else
2995#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2996#endif
2997
2998/* PyObjectCallMethod1.proto (used by StringJoin) */
2999static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3000
3001/* StringJoin.proto */
3002static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
3003
3004/* CIntToPyUnicode.proto */
3005#define __Pyx_PyUnicode_From_size_t(value, width, padding_char, format_char) (\
3006 ((format_char) == ('c')) ?\
3007 __Pyx_uchar___Pyx_PyUnicode_From_size_t(value, width, padding_char) :\
3008 __Pyx____Pyx_PyUnicode_From_size_t(value, width, padding_char, format_char)\
3009 )
3010static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char);
3011static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char);
3012
3013/* PyException_Check.proto */
3014#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3015
3016/* PyImportError_Check.proto */
3017#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
3018
3019/* DefaultPlacementNew.proto */
3020#include <new>
3021template<typename T>
3022void __Pyx_default_placement_construct(T* x) {
3023 new (static_cast<void*>(x)) T();
3024}
3025
3026/* AllocateExtensionType.proto */
3027static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);
3028
3029/* CallSlotAsVectorcall.proto */
3030#if CYTHON_VECTORCALL_TPNEW
3031typedef PyObject * (*__Pyx_tpnewvectorcallfunc)(PyTypeObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
3032static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k);
3033#endif
3034
3035/* CallNewInitFromVectorcall.proto */
3036#if CYTHON_VECTORCALL_TPNEW
3037static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3038#endif
3039
3040/* DeallocKeepAlive.proto */
3041#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3042#define __Pyx_DeallocKeepAliveBegin(o) do {\
3043 _Py_atomic_store_uintptr_relaxed(&(o)->ob_tid, _Py_ThreadId());\
3044 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 1);\
3045 _Py_atomic_store_ssize_relaxed(&(o)->ob_ref_shared, 0);\
3046 } while (0)
3047#define __Pyx_DeallocKeepAliveEnd(o)\
3048 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 0)
3049#else
3050#define __Pyx_DeallocKeepAliveBegin(o) Py_SET_REFCNT(o, Py_REFCNT(o) + 1)
3051#define __Pyx_DeallocKeepAliveEnd(o) Py_SET_REFCNT(o, Py_REFCNT(o) - 1)
3052#endif
3053
3054/* CallSlotAsVectorcall.proto */
3055#if CYTHON_VECTORCALL_TPNEW
3056typedef int (*__Pyx_tpinitvectorcallfunc)(PyObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
3057static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k);
3058#endif
3059
3060/* CallTypeTraverse.proto */
3061#if !CYTHON_USE_TYPE_SPECS
3062#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
3063#else
3064static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
3065#endif
3066
3067/* PyObjectCallMethod0.proto (used by PyType_Ready) */
3068static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
3069
3070/* GetTypeDictOffset.proto (used by ValidateBasesTuple) */
3071#if !CYTHON_USE_TYPE_SLOTS
3072CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result);
3073#endif
3074
3075/* ValidateBasesTuple.proto (used by PyType_Ready) */
3076#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
3077static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases);
3078#endif
3079
3080/* PyType_Ready.export */
3081CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
3082
3083/* LimitedApiGetTypeTypeDict.proto (used by DelItemOnTypeDict) */
3084#if CYTHON_COMPILING_IN_LIMITED_API
3085static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp);
3086#endif
3087
3088/* DelItemOnTypeDict.proto (used by SetupReduce) */
3089#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)
3090
3091/* DelItemOnTypeDict.export */
3092static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
3093
3094/* SetItemOnTypeDict.proto (used by SetupReduce) */
3095#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
3096
3097/* SetItemOnTypeDict.export */
3098static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
3099
3100/* SetupReduce.export */
3101static int __Pyx_setup_reduce(PyObject* type_obj);
3102
3103/* ApplySequenceOrMappingFlag.proto */
3104#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3105int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence);
3106#else
3107#define __Pyx_ApplySequenceOrMappingFlag(tp, is_sequence) (0)
3108#endif
3109
3110/* GetVTable.proto (used by MergeVTables) */
3111static int __Pyx_GetVtable(PyTypeObject *type, void** table);
3112
3113/* MergeVTables.proto (used by SetVTable) */
3114static int __Pyx_MergeVtables(PyTypeObject *type);
3115
3116/* SetVTable.export */
3117static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
3118
3119/* TypeImport.proto */
3120#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
3121#define __PYX_HAVE_RT_ImportType_proto_3_3_0
3122#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
3123#include <stdalign.h>
3124#endif
3125#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
3126#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
3127#else
3128#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
3129#endif
3130enum __Pyx_ImportType_CheckSize_3_3_0 {
3131 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
3132 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
3133 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
3134};
3135static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size);
3136#endif
3137
3138/* dict_setdefault.proto (used by FetchCommonType) */
3139static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
3140
3141/* AddModuleRef.proto (used by FetchSharedCythonModule) */
3142#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
3143 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
3144 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
3145#else
3146 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
3147#endif
3148
3149/* FetchSharedCythonModule.proto (used by FetchCommonType) */
3150static PyObject *__Pyx_FetchSharedCythonABIModule(void);
3151
3152/* VerifyCachedType.proto (used by FetchCommonType) */
3153static int __Pyx_VerifyCachedType(PyObject *cached_type,
3154 const char *name,
3155 Py_ssize_t expected_basicsize);
3156
3157/* FetchCommonType.proto (used by CommonTypesMetaclass) */
3158static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
3159
3160/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
3161static int __pyx_CommonTypesMetaclass_init(PyObject *module);
3162#define __Pyx_CommonTypesMetaclass_USED
3163
3164/* CythonFunctionPerModule.proto (used by CythonFunctionShared) */
3165#define __Pyx_CyFunction_USED
3166#if CYTHON_OPAQUE_SHARED_TYPES
3167#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
3168#else
3169#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
3170#endif
3171#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
3172#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
3173#define __Pyx_CYFUNCTION_CCLASS 0x04
3174#define __Pyx_CYFUNCTION_COROUTINE 0x08
3175#define __Pyx_CyFunction_GetClosure(f)\
3176 ((__Pyx_as_CyFunctionObject(f))->func_closure)
3177#if CYTHON_COMPILING_IN_LIMITED_API
3178 #define __Pyx__CyFunction_GetClassObj(f)\
3179 ((f)->func_classobj)
3180#else
3181 #define __Pyx__CyFunction_GetClassObj(f)\
3182 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
3183#endif
3184#define __Pyx_CyFunction_GetClassObj(f)\
3185 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
3186#define __Pyx_CyFunction_SetClassObj(f, classobj)\
3187 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
3188#define __Pyx_CyFunction_Defaults(type, f)\
3189 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
3190#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
3191 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
3192typedef struct {
3193#if CYTHON_COMPILING_IN_LIMITED_API
3194#if !CYTHON_OPAQUE_OBJECTS
3195 PyObject_HEAD
3196#endif
3197 PyMethodDef *func_methoddef;
3198 PyObject *func_module;
3199#else
3200 PyCMethodObject func;
3201#endif
3202#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
3203 __pyx_vectorcallfunc func_vectorcall;
3204#endif
3205#if CYTHON_COMPILING_IN_LIMITED_API
3206 PyObject *func_weakreflist;
3207#endif
3208#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
3209 PyObject *func_dict;
3210#endif
3211 PyObject *func_name;
3212 PyObject *func_qualname;
3213 PyObject *func_doc;
3214 PyObject *func_globals;
3215 PyObject *func_code;
3216 PyObject *func_closure;
3217#if CYTHON_COMPILING_IN_LIMITED_API
3218 PyObject *func_classobj;
3219#endif
3220 PyObject *defaults;
3221 int flags;
3222 PyObject *defaults_tuple;
3223 PyObject *defaults_kwdict;
3224 PyObject *(*defaults_getter)(PyObject *);
3225 PyObject *func_annotations;
3226#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
3227 PyObject *func_is_coroutine;
3228#endif
3229} __pyx_CyFunctionObject;
3230#undef __Pyx_CyOrPyCFunction_Check
3231#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3232#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
3233#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3234static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
3235#undef __Pyx_IsSameCFunction
3236#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
3237static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
3238static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
3239 PyTypeObject *defaults_type);
3240static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
3241 PyObject *tuple);
3242static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3243 PyObject *dict);
3244static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
3245 PyObject *dict);
3246static int __pyx_CyFunction_init(PyObject *module);
3247#if CYTHON_VECTORCALL
3248#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3249#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
3250#else
3251#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3252#endif
3253#endif
3254
3255/* PyMethodNew.proto (used by CythonFunctionShared) */
3256static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
3257
3258/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
3259#if CYTHON_VECTORCALL
3260static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
3261#endif
3262
3263/* CythonFunctionShared.proto (used by CythonFunction) */
3264static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
3265 int flags, PyObject* qualname,
3266 PyObject *closure,
3267 PyObject *module, PyObject *globals,
3268 PyObject* code);
3269#if CYTHON_VECTORCALL
3270static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3271static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3272static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3273static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3274#endif
3275
3276/* CythonFunction.export */
3277static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3278 int flags, PyObject* qualname,
3279 PyObject *closure,
3280 PyObject *module, PyObject *globals,
3281 PyObject* code);
3282static PyTypeObject *__Pyx_Get_CyFunction_Type(void);
3283
3284/* CLineInTraceback.proto (used by AddTraceback) */
3285#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
3286static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3287#else
3288#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3289#endif
3290
3291/* CodeObjectCache.proto (used by AddTraceback) */
3292#if CYTHON_COMPILING_IN_LIMITED_API
3293typedef PyObject __Pyx_CachedCodeObjectType;
3294#else
3295typedef PyCodeObject __Pyx_CachedCodeObjectType;
3296#endif
3297typedef struct {
3298 __Pyx_CachedCodeObjectType* code_object;
3299 int code_line;
3300} __Pyx_CodeObjectCacheEntry;
3301struct __Pyx_CodeObjectCache {
3302 int count;
3303 int max_count;
3304 __Pyx_CodeObjectCacheEntry* entries;
3305 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3306 __pyx_atomic_int_type accessor_count;
3307 #endif
3308};
3309static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3310static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
3311static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);
3312
3313/* AddTraceback.proto */
3314static void __Pyx_AddTraceback(const char *funcname, int c_line,
3315 int py_line, const char *filename);
3316
3317/* MemviewDtypeToObject.proto */
3318static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
3319static CYTHON_INLINE int __pyx_memview_set_int(char *itemp, PyObject *obj);
3320
3321/* MemviewDtypeToObject.proto */
3322static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
3323static CYTHON_INLINE int __pyx_memview_set_double(char *itemp, PyObject *obj);
3324
3325/* RealImag.proto */
3326#if CYTHON_CCOMPLEX
3327 #ifdef __cplusplus
3328 #define __Pyx_CREAL(z) ((z).real())
3329 #define __Pyx_CIMAG(z) ((z).imag())
3330 #else
3331 #define __Pyx_CREAL(z) (__real__(z))
3332 #define __Pyx_CIMAG(z) (__imag__(z))
3333 #endif
3334#else
3335 #define __Pyx_CREAL(z) ((z).real)
3336 #define __Pyx_CIMAG(z) ((z).imag)
3337#endif
3338#if defined(__cplusplus) && CYTHON_CCOMPLEX\
3339 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3340 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3341 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3342#else
3343 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3344 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3345#endif
3346
3347/* Arithmetic.proto */
3348#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3349 #define __Pyx_c_eq_float(a, b) ((a)==(b))
3350 #define __Pyx_c_sum_float(a, b) ((a)+(b))
3351 #define __Pyx_c_diff_float(a, b) ((a)-(b))
3352 #define __Pyx_c_prod_float(a, b) ((a)*(b))
3353 #define __Pyx_c_quot_float(a, b) ((a)/(b))
3354 #define __Pyx_c_neg_float(a) (-(a))
3355 #ifdef __cplusplus
3356 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3357 #define __Pyx_c_conj_float(z) (::std::conj(z))
3358 #if 1
3359 #define __Pyx_c_abs_float(z) (::std::abs(z))
3360 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3361 #endif
3362 #else
3363 #define __Pyx_c_is_zero_float(z) ((z)==0)
3364 #define __Pyx_c_conj_float(z) (conjf(z))
3365 #if 1
3366 #define __Pyx_c_abs_float(z) (cabsf(z))
3367 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3368 #endif
3369 #endif
3370#else
3371 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3372 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3373 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3374 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3375 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3376 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3377 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3378 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3379 #if 1
3380 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3381 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3382 #endif
3383#endif
3384
3385/* Arithmetic.proto */
3386#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3387 #define __Pyx_c_eq_double(a, b) ((a)==(b))
3388 #define __Pyx_c_sum_double(a, b) ((a)+(b))
3389 #define __Pyx_c_diff_double(a, b) ((a)-(b))
3390 #define __Pyx_c_prod_double(a, b) ((a)*(b))
3391 #define __Pyx_c_quot_double(a, b) ((a)/(b))
3392 #define __Pyx_c_neg_double(a) (-(a))
3393 #ifdef __cplusplus
3394 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3395 #define __Pyx_c_conj_double(z) (::std::conj(z))
3396 #if 1
3397 #define __Pyx_c_abs_double(z) (::std::abs(z))
3398 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3399 #endif
3400 #else
3401 #define __Pyx_c_is_zero_double(z) ((z)==0)
3402 #define __Pyx_c_conj_double(z) (conj(z))
3403 #if 1
3404 #define __Pyx_c_abs_double(z) (cabs(z))
3405 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3406 #endif
3407 #endif
3408#else
3409 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3410 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3411 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3412 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3413 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3414 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3415 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3416 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3417 #if 1
3418 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3419 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3420 #endif
3421#endif
3422
3423/* Arithmetic.proto */
3424#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3425 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3426 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3427 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3428 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3429 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3430 #define __Pyx_c_neg_long__double(a) (-(a))
3431 #ifdef __cplusplus
3432 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3433 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3434 #if 1
3435 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3436 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3437 #endif
3438 #else
3439 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3440 #define __Pyx_c_conj_long__double(z) (conjl(z))
3441 #if 1
3442 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3443 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3444 #endif
3445 #endif
3446#else
3447 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3448 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3449 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3450 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3451 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3452 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3453 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3454 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3455 #if 1
3456 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3457 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3458 #endif
3459#endif
3460
3461/* BufferStructDeclare.proto */
3462typedef struct {
3463 Py_ssize_t shape, strides, suboffsets;
3464} __Pyx_Buf_DimInfo;
3465typedef struct {
3466 size_t refcount;
3467 Py_buffer pybuffer;
3468} __Pyx_Buffer;
3469typedef struct {
3470 __Pyx_Buffer *rcbuffer;
3471 char *data;
3472 __Pyx_Buf_DimInfo diminfo[8];
3473} __Pyx_LocalBuf_ND;
3474
3475/* MemviewRefcount.proto */
3476static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3477 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3478static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3479 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3480#define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3481#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3482#define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3483static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3484static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
3485
3486/* MemviewSliceIsContig.proto */
3487static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3488
3489/* OverlappingSlices.proto */
3490static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3491 __Pyx_memviewslice *slice2,
3492 int ndim, size_t itemsize);
3493
3494/* MemviewSliceInit.proto */
3495static int __Pyx_init_memviewslice(
3496 struct __pyx_memoryview_obj *memview,
3497 int ndim,
3498 __Pyx_memviewslice *memviewslice,
3499 int memview_is_new_reference);
3500
3501/* SliceMemoryviewSlice.proto */
3502static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
3503 __Pyx_memviewslice *dst,
3504 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
3505 int dim, int new_ndim, int *suboffset_dim,
3506 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
3507 int have_start, int have_stop, int have_step,
3508 int is_slice);
3509
3510/* CIntFromPy.proto */
3511static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
3512
3513/* PyObjectVectorcallKwds.proto (used by PyObjectVectorcallMethodKwds) */
3514#if CYTHON_VECTORCALL
3515#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
3516CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
3517#else
3518#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
3519CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n);
3520CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
3521#endif
3522
3523/* PyObjectVectorcallMethodKwds.proto (used by CIntToPy) */
3524#if CYTHON_VECTORCALL
3525#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
3526#else
3527static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3528#endif
3529
3530/* CIntToPy.proto */
3531static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value);
3532
3533/* TypeInfoToFormat.proto */
3534struct __pyx_typeinfo_string {
3535 char string[3];
3536};
3537static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(const __Pyx_TypeInfo *type);
3538
3539/* MemviewSliceCopy.proto */
3540static __Pyx_memviewslice
3541__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3542 const char *mode, int ndim,
3543 Py_ssize_t sizeof_dtype, int contig_flag,
3544 int dtype_is_object);
3545
3546/* UpdateUnpickledDict.export */
3547static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);
3548
3549/* CheckUnpickleChecksumError.export */
3550static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
3551
3552/* CheckUnpickleChecksum.proto */
3553static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
3554
3555/* CIntFromPy.proto */
3556static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
3557
3558/* CIntToPy.proto */
3559static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
3560
3561/* CIntFromPy.proto */
3562static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *);
3563
3564/* GetRuntimeVersion.proto */
3565#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
3566static unsigned long __Pyx_cached_runtime_version = 0;
3567static void __Pyx_init_runtime_version(void);
3568#else
3569#define __Pyx_init_runtime_version()
3570#endif
3571static unsigned long __Pyx_get_runtime_version(void);
3572
3573/* CheckBinaryVersion.proto */
3574static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3575
3576/* DecompressString.proto */
3577static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
3578
3579/* DecompressString_LZSS.proto */
3580static PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length);
3581
3582/* MultiPhaseInitModuleState.proto */
3583#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
3584#include <stdlib.h>
3585static PyObject *__Pyx_State_FindModule(void*);
3586static int __Pyx_State_AddModule(PyObject* module, void*);
3587static int __Pyx_State_RemoveModule(void*);
3588#elif CYTHON_USE_MODULE_STATE
3589#define __Pyx_State_FindModule PyState_FindModule
3590#define __Pyx_State_AddModule PyState_AddModule
3591#define __Pyx_State_RemoveModule PyState_RemoveModule
3592#endif
3593
3594/* #### Code section: module_declarations ### */
3595/* CythonABIVersion.proto */
3596#if CYTHON_COMPILING_IN_LIMITED_API
3597 #if CYTHON_VECTORCALL
3598 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
3599 #else
3600 #define __PYX_VECTORCALL_ABI_SUFFIX
3601 #endif
3602 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
3603#else
3604 #define __PYX_LIMITED_ABI_SUFFIX
3605#endif
3606#if __PYX_HAS_PY_AM_SEND == 1
3607 #define __PYX_AM_SEND_ABI_SUFFIX
3608#elif __PYX_HAS_PY_AM_SEND == 2
3609 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
3610#else
3611 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
3612#endif
3613#ifndef __PYX_MONITORING_ABI_SUFFIX
3614 #define __PYX_MONITORING_ABI_SUFFIX
3615#endif
3616#if CYTHON_USE_TP_FINALIZE
3617 #define __PYX_TP_FINALIZE_ABI_SUFFIX
3618#else
3619 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
3620#endif
3621#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
3622 #define __PYX_FREELISTS_ABI_SUFFIX
3623#else
3624 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
3625#endif
3626#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
3627 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
3628#else
3629 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3630#endif
3631#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3632#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
3633#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
3634
3635static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3636static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3637static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3638static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3639static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
3640static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value); /* proto*/
3641static PyObject *__pyx_memoryview_setitem_indexed1(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3642static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3643static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3644static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
3645static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3646static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3647static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
3648static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3649static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3650static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3651static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3652static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3653static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3654static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3655static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3656static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3657static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3658static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3659static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3660static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3661static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3662static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3663static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3664static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3665static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self); /* proto*/
3666static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self); /* proto*/
3667static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self); /* proto*/
3668static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self); /* proto*/
3669static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self); /* proto*/
3670static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self); /* proto*/
3671static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self); /* proto*/
3672static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3673static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3674static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3675static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3676static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3677static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3678static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3679static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3680static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3681static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3682static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3683
3684/* Module declarations from "libc.string" */
3685
3686/* Module declarations from "libc.stdio" */
3687
3688/* Module declarations from "__builtin__" */
3689
3690/* Module declarations from "cpython.type" */
3691
3692/* Module declarations from "cpython" */
3693
3694/* Module declarations from "cpython.object" */
3695
3696/* Module declarations from "cpython.ref" */
3697
3698/* Module declarations from "numpy" */
3699
3700/* Module declarations from "numpy" */
3701
3702/* Module declarations from "csparsity" */
3703static PyObject *__pyx_collections_abc_Sequence = 0;
3704static PyObject *generic = 0;
3705static PyObject *strided = 0;
3706static PyObject *indirect = 0;
3707static PyObject *contiguous = 0;
3708static PyObject *indirect_contiguous = 0;
3709static int __pyx_memoryview_thread_locks_used;
3710static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3711static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
3712static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char const *, char *); /*proto*/
3713static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo const *); /*proto*/
3714static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3715static int __pyx_memoryview_err_invalid_index(PyObject *); /*proto*/
3716static PyObject *_unellipsify_index_tuple(PyObject *, int); /*proto*/
3717static PyObject *_unellipsify(PyObject *, int); /*proto*/
3718static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3719static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3720static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3721static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3722static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), __pyx_memoryview_to_dtype_func_type, int); /*proto*/
3723static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3724static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3725static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3726static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3727static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3728static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3729static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3730static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3731static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3732static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3733static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3734static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3735static int __pyx_memoryview_err_dim(PyObject *, char const *, int); /*proto*/
3736static int __pyx_memoryview_err(PyObject *, char const *); /*proto*/
3737static int __pyx_memoryview_err_no_memory(void); /*proto*/
3738static int __pyx_memoryview_err_ValueError(char const *); /*proto*/
3739static int __pyx_memoryview_err_IndexError(char const *, Py_ssize_t); /*proto*/
3740static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3741static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3742static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3743static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3744static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3745static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3746static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3747static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3748static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo const *); /*proto*/
3749/* #### Code section: typeinfo ### */
3750static const __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, __PYX_IS_UNSIGNED(int) ? 'U' : 'I', __PYX_IS_UNSIGNED(int), 0 };
3751static const __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
3752/* #### Code section: before_global_var ### */
3753#define __Pyx_MODULE_NAME "csparsity"
3754extern int __pyx_module_is_main_csparsity;
3755int __pyx_module_is_main_csparsity = 0;
3756
3757/* Implementation of "csparsity" */
3758/* #### Code section: global_var ### */
3759static PyObject *__pyx_builtin___import__;
3760static PyObject *__pyx_builtin_enumerate;
3761static PyObject *__pyx_builtin_Ellipsis;
3762static PyObject *__pyx_builtin_id;
3763/* #### Code section: string_decls ### */
3764static const char __pyx_k_c[] = "c";
3765static const char __pyx_k_name[] = "name";
3766static const char __pyx_k_fortran[] = "fortran";
3767static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
3768static const char __pyx_k_Cannot_index_with_type_200U[] = "Cannot index with type \047%.200U\047";
3769static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3770static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3771static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3772static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3773static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
3774static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3775static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3776static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %zd)";
3777static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3778static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %zd and %zd)";
3779/* #### Code section: decls ### */
3780static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
3781static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3782static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3783static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3784static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3785static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3786static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3787static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
3788static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3789static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3790static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3791static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3792static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3793static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3794static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3795static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3796static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3797static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3798static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3799static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3800static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3801static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3802static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3803static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3804static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3805static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3806static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3807static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3808static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3809static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3810static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3811static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3812static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3813static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3814static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3815static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3816static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3817static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3818static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3819static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3820static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3821static int __pyx_pf_9csparsity_14PySparsityInfo___cinit__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self); /* proto */
3822static void __pyx_pf_9csparsity_14PySparsityInfo_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self); /* proto */
3823static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_4findNonzeros(struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, int __pyx_v_nElements_global, int __pyx_v_nDOF_test_element, int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_nFreeDOF_test, PyArrayObject *__pyx_v_freeGlobal_test, PyArrayObject *__pyx_v_nFreeDOF_trial, PyArrayObject *__pyx_v_freeGlobal_trial, int __pyx_v_offset_test, int __pyx_v_stride_test, int __pyx_v_offset_trial, int __pyx_v_stride_trial, int __pyx_v_hasNumericalFlux, int __pyx_v_hasDiffusionInMixedForm, int __pyx_v_needNumericalFluxJacobian, int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, int __pyx_v_nInteriorElementBoundaries_global, PyArrayObject *__pyx_v_interiorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray, int __pyx_v_hasFluxBoundaryConditions, int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, int __pyx_v_hasOutflowBoundary, int __pyx_v_needOutflowJacobian); /* proto */
3824static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_6getOffsets_CSR(struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, int __pyx_v_nElements_global, int __pyx_v_nDOF_test_element, int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_nFreeDOF_test, PyArrayObject *__pyx_v_freeGlobal_test, PyArrayObject *__pyx_v_nFreeDOF_trial, PyArrayObject *__pyx_v_freeGlobal_trial, int __pyx_v_offset_test, int __pyx_v_stride_test, int __pyx_v_offset_trial, int __pyx_v_stride_trial, int __pyx_v_hasNumericalFlux, int __pyx_v_hasDiffusionInMixedForm, int __pyx_v_needNumericalFluxJacobian, int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, int __pyx_v_nInteriorElementBoundaries_global, PyArrayObject *__pyx_v_interiorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray, int __pyx_v_hasFluxBoundaryConditions, int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, int __pyx_v_hasOutflowBoundary, int __pyx_v_needOutflowJacobian, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_csrRowIndeces, PyArrayObject *__pyx_v_csrColumnOffsets, PyArrayObject *__pyx_v_csrColumnOffsets_eNebN, PyArrayObject *__pyx_v_csrColumnOffsets_eb, PyArrayObject *__pyx_v_csrColumnOffsets_eb_eNebN); /* proto */
3825static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_8getCSR(struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self); /* proto */
3826static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self); /* proto */
3827static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3828static PyObject *__pyx_tp_new__initialisation_9csparsity_PySparsityInfo(PyObject *o,
3829#if CYTHON_VECTORCALL_TPNEW
3830 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3831#else
3832 PyObject *a, PyObject *k
3833#endif
3834); /*proto*/
3835static PyObject *__pyx_tp_new_vectorcall_9csparsity_PySparsityInfo(PyTypeObject *t,
3836#if CYTHON_VECTORCALL_TPNEW
3837 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3838#else
3839 PyObject *a, PyObject *k
3840#endif
3841); /*proto*/
3842#if CYTHON_VECTORCALL_TPNEW
3843static PyObject *__pyx_tp_new_9csparsity_PySparsityInfo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3844#endif
3845#if !CYTHON_VECTORCALL_TPNEW
3846#define __pyx_tp_new_9csparsity_PySparsityInfo __pyx_tp_new_vectorcall_9csparsity_PySparsityInfo
3847#endif
3848#if CYTHON_VECTORCALL_TPNEW
3849static PyObject *__pyx_tp_vectorcall_9csparsity_PySparsityInfo(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
3850#endif
3851static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
3852#if CYTHON_VECTORCALL_TPNEW
3853 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3854#else
3855 PyObject *a, PyObject *k
3856#endif
3857); /*proto*/
3858static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
3859#if CYTHON_VECTORCALL_TPNEW
3860 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3861#else
3862 PyObject *a, PyObject *k
3863#endif
3864); /*proto*/
3865#if CYTHON_VECTORCALL_TPNEW
3866static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3867#endif
3868#if !CYTHON_VECTORCALL_TPNEW
3869#define __pyx_tp_new_array __pyx_tp_new_vectorcall_array
3870#endif
3871#if CYTHON_VECTORCALL_TPNEW
3872static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
3873#endif
3874static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
3875#if CYTHON_VECTORCALL_TPNEW
3876 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3877#else
3878 PyObject *a, PyObject *k
3879#endif
3880); /*proto*/
3881static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
3882#if CYTHON_VECTORCALL_TPNEW
3883 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3884#else
3885 PyObject *a, PyObject *k
3886#endif
3887); /*proto*/
3888#if CYTHON_VECTORCALL_TPNEW
3889static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3890#endif
3891#if !CYTHON_VECTORCALL_TPNEW
3892#define __pyx_tp_new_Enum __pyx_tp_new_vectorcall_Enum
3893#endif
3894#if CYTHON_VECTORCALL_TPNEW
3895static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
3896#endif
3897#if CYTHON_VECTORCALL_TPNEW
3898static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
3899#endif
3900#if !CYTHON_VECTORCALL_TPNEW
3901#define __pyx_tp_init_Enum __pyx_MemviewEnum___init__
3902#endif
3903static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
3904#if CYTHON_VECTORCALL_TPNEW
3905 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3906#else
3907 PyObject *a, PyObject *k
3908#endif
3909); /*proto*/
3910static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
3911#if CYTHON_VECTORCALL_TPNEW
3912 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3913#else
3914 PyObject *a, PyObject *k
3915#endif
3916); /*proto*/
3917#if CYTHON_VECTORCALL_TPNEW
3918static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3919#endif
3920#if !CYTHON_VECTORCALL_TPNEW
3921#define __pyx_tp_new_memoryview __pyx_tp_new_vectorcall_memoryview
3922#endif
3923#if CYTHON_VECTORCALL_TPNEW
3924static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
3925#endif
3926static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
3927#if CYTHON_VECTORCALL_TPNEW
3928 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3929#else
3930 PyObject *a, PyObject *k
3931#endif
3932); /*proto*/
3933static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
3934#if CYTHON_VECTORCALL_TPNEW
3935 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3936#else
3937 PyObject *a, PyObject *k
3938#endif
3939); /*proto*/
3940#if CYTHON_VECTORCALL_TPNEW
3941static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3942#endif
3943#if !CYTHON_VECTORCALL_TPNEW
3944#define __pyx_tp_new__memoryviewslice __pyx_tp_new_vectorcall__memoryviewslice
3945#endif
3946#if CYTHON_VECTORCALL_TPNEW
3947static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
3948#endif
3949/* #### Code section: late_includes ### */
3950/* #### Code section: module_state ### */
3951/* SmallCodeConfig */
3952#ifndef CYTHON_SMALL_CODE
3953#if defined(__clang__)
3954 #define CYTHON_SMALL_CODE
3955#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3956 #define CYTHON_SMALL_CODE __attribute__((cold))
3957#else
3958 #define CYTHON_SMALL_CODE
3959#endif
3960#endif
3961
3962#ifdef __cplusplus
3963namespace {
3964 #endif
3965 typedef struct {
3966 PyObject *__pyx_d;
3967 PyObject *__pyx_b;
3968 PyObject *__pyx_cython_runtime;
3969 PyObject *__pyx_empty_tuple;
3970 PyObject *__pyx_empty_bytes;
3971 PyObject *__pyx_empty_unicode;
3972 PyTypeObject *__pyx_ptype_7cpython_4type_type;
3973 PyTypeObject *__pyx_ptype_5numpy_dtype;
3974 PyTypeObject *__pyx_ptype_5numpy_flatiter;
3975 PyTypeObject *__pyx_ptype_5numpy_broadcast;
3976 PyTypeObject *__pyx_ptype_5numpy_ndarray;
3977 PyTypeObject *__pyx_ptype_5numpy_generic;
3978 PyTypeObject *__pyx_ptype_5numpy_number;
3979 PyTypeObject *__pyx_ptype_5numpy_integer;
3980 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3981 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3982 PyTypeObject *__pyx_ptype_5numpy_inexact;
3983 PyTypeObject *__pyx_ptype_5numpy_floating;
3984 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3985 PyTypeObject *__pyx_ptype_5numpy_flexible;
3986 PyTypeObject *__pyx_ptype_5numpy_character;
3987 PyTypeObject *__pyx_ptype_5numpy_ufunc;
3988 PyObject *__pyx_type_9csparsity_PySparsityInfo;
3989 PyObject *__pyx_type___pyx_array;
3990 PyObject *__pyx_type___pyx_MemviewEnum;
3991 PyObject *__pyx_type___pyx_memoryview;
3992 PyObject *__pyx_type___pyx_memoryviewslice;
3993 PyTypeObject *__pyx_ptype_9csparsity_PySparsityInfo;
3994 PyTypeObject *__pyx_array_type;
3995 PyTypeObject *__pyx_MemviewEnum_type;
3996 PyTypeObject *__pyx_memoryview_type;
3997 PyTypeObject *__pyx_memoryviewslice_type;
3998 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
3999 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
4000 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
4001 PyObject *__pyx_slice[1];
4002 PyObject *__pyx_tuple[2];
4003 PyObject *__pyx_codeobj_tab[5];
4004 PyObject *__pyx_string_tab[155];
4005 PyObject *__pyx_number_tab[3];
4006/* #### Code section: module_state_contents ### */
4007/* PyFrozenDict.module_state_decls */
4008#if CYTHON_COMPILING_IN_LIMITED_API
4009PyObject *__Pyx_PyFrozenDictType;
4010#endif
4011
4012/* CommonTypesMetaclass.module_state_decls */
4013PyTypeObject *__pyx_CommonTypesMetaclassType;
4014
4015/* CachedMethodType.module_state_decls */
4016#if CYTHON_COMPILING_IN_LIMITED_API
4017PyObject *__Pyx_CachedMethodType;
4018#endif
4019
4020/* CythonFunctionPerModule.module_state_decls */
4021PyTypeObject *__pyx_CyFunctionType;
4022
4023/* CodeObjectCache.module_state_decls */
4024struct __Pyx_CodeObjectCache __pyx_code_cache;
4025
4026/* #### Code section: module_state_end ### */
4027} __pyx_mstatetype;
4028#ifdef __cplusplus
4029} /* anonymous namespace */
4030#endif
4031
4032#if CYTHON_USE_MODULE_STATE
4033#ifdef __cplusplus
4034namespace {
4035extern struct PyModuleDef __pyx_moduledef;
4036} /* anonymous namespace */
4037#else
4038static struct PyModuleDef __pyx_moduledef;
4039#endif
4040
4041#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
4042
4043#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
4044#else
4045static __pyx_mstatetype __pyx_mstate_global_static =
4046#ifdef __cplusplus
4047 {};
4048#else
4049 {0};
4050#endif
4051static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
4052#endif
4053/* #### Code section: constant_name_defines ### */
4054#define __pyx_kp_u_at_0x __pyx_string_tab[0]
4055#define __pyx_kp_u_object __pyx_string_tab[1]
4056#define __pyx_kp_u__9 __pyx_string_tab[2]
4057#define __pyx_kp_u_tree_fragment __pyx_string_tab[3]
4058#define __pyx_kp_u__11 __pyx_string_tab[4]
4059#define __pyx_kp_u__10 __pyx_string_tab[5]
4060#define __pyx_kp_u__3 __pyx_string_tab[6]
4061#define __pyx_kp_u__2 __pyx_string_tab[7]
4062#define __pyx_kp_u_MemoryView_of __pyx_string_tab[8]
4063#define __pyx_kp_u_contiguous_and_direct __pyx_string_tab[9]
4064#define __pyx_kp_u_contiguous_and_indirect __pyx_string_tab[10]
4065#define __pyx_kp_u_strided_and_direct_or_indirect __pyx_string_tab[11]
4066#define __pyx_kp_u_strided_and_direct __pyx_string_tab[12]
4067#define __pyx_kp_u_strided_and_indirect __pyx_string_tab[13]
4068#define __pyx_kp_u__4 __pyx_string_tab[14]
4069#define __pyx_kp_u_ __pyx_string_tab[15]
4070#define __pyx_kp_u_Cannot_assign_to_read_only_memor __pyx_string_tab[16]
4071#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_string_tab[17]
4072#define __pyx_kp_u_Invalid_shape_in_axis __pyx_string_tab[18]
4073#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[19]
4074#define __pyx_kp_u_add_note __pyx_string_tab[20]
4075#define __pyx_kp_u_collections_abc __pyx_string_tab[21]
4076#define __pyx_kp_u_disable __pyx_string_tab[22]
4077#define __pyx_kp_u_enable __pyx_string_tab[23]
4078#define __pyx_kp_u_gc __pyx_string_tab[24]
4079#define __pyx_kp_u_isenabled __pyx_string_tab[25]
4080#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[26]
4081#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[27]
4082#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[28]
4083#define __pyx_kp_u_proteus_csparsity_pyx __pyx_string_tab[29]
4084#define __pyx_kp_u_unable_to_allocate_array_data __pyx_string_tab[30]
4085#define __pyx_kp_u_unable_to_allocate_shape_and_str __pyx_string_tab[31]
4086#define __pyx_n_u_ASCII __pyx_string_tab[32]
4087#define __pyx_n_u_Ellipsis __pyx_string_tab[33]
4088#define __pyx_n_u_PySparsityInfo __pyx_string_tab[34]
4089#define __pyx_n_u_PySparsityInfo___reduce_cython __pyx_string_tab[35]
4090#define __pyx_n_u_PySparsityInfo___setstate_cython __pyx_string_tab[36]
4091#define __pyx_n_u_PySparsityInfo_findNonzeros __pyx_string_tab[37]
4092#define __pyx_n_u_PySparsityInfo_getCSR __pyx_string_tab[38]
4093#define __pyx_n_u_PySparsityInfo_getOffsets_CSR __pyx_string_tab[39]
4094#define __pyx_n_u_Sequence __pyx_string_tab[40]
4095#define __pyx_n_u_View_MemoryView __pyx_string_tab[41]
4096#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[42]
4097#define __pyx_n_u_annotate __pyx_string_tab[43]
4098#define __pyx_n_u_class __pyx_string_tab[44]
4099#define __pyx_n_u_class_getitem __pyx_string_tab[45]
4100#define __pyx_n_u_dict __pyx_string_tab[46]
4101#define __pyx_n_u_func __pyx_string_tab[47]
4102#define __pyx_n_u_getstate __pyx_string_tab[48]
4103#define __pyx_n_u_import __pyx_string_tab[49]
4104#define __pyx_n_u_main __pyx_string_tab[50]
4105#define __pyx_n_u_module __pyx_string_tab[51]
4106#define __pyx_n_u_name_2 __pyx_string_tab[52]
4107#define __pyx_n_u_new __pyx_string_tab[53]
4108#define __pyx_n_u_pyx_checksum __pyx_string_tab[54]
4109#define __pyx_n_u_pyx_state __pyx_string_tab[55]
4110#define __pyx_n_u_pyx_type __pyx_string_tab[56]
4111#define __pyx_n_u_pyx_unpickle_Enum __pyx_string_tab[57]
4112#define __pyx_n_u_pyx_vtable __pyx_string_tab[58]
4113#define __pyx_n_u_qualname __pyx_string_tab[59]
4114#define __pyx_n_u_reduce __pyx_string_tab[60]
4115#define __pyx_n_u_reduce_cython __pyx_string_tab[61]
4116#define __pyx_n_u_reduce_ex __pyx_string_tab[62]
4117#define __pyx_n_u_set_name __pyx_string_tab[63]
4118#define __pyx_n_u_setstate __pyx_string_tab[64]
4119#define __pyx_n_u_setstate_cython __pyx_string_tab[65]
4120#define __pyx_n_u_test __pyx_string_tab[66]
4121#define __pyx_n_u_is_coroutine __pyx_string_tab[67]
4122#define __pyx_n_u_abc __pyx_string_tab[68]
4123#define __pyx_n_u_allocate_buffer __pyx_string_tab[69]
4124#define __pyx_n_u_asarray __pyx_string_tab[70]
4125#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[71]
4126#define __pyx_n_u_base __pyx_string_tab[72]
4127#define __pyx_n_u_c __pyx_string_tab[73]
4128#define __pyx_n_u_cline_in_traceback __pyx_string_tab[74]
4129#define __pyx_n_u_count __pyx_string_tab[75]
4130#define __pyx_n_u_csparsity __pyx_string_tab[76]
4131#define __pyx_n_u_csrColumnOffsets __pyx_string_tab[77]
4132#define __pyx_n_u_csrColumnOffsets_eNebN __pyx_string_tab[78]
4133#define __pyx_n_u_csrColumnOffsets_eb __pyx_string_tab[79]
4134#define __pyx_n_u_csrColumnOffsets_eb_eNebN __pyx_string_tab[80]
4135#define __pyx_n_u_csrRowIndeces __pyx_string_tab[81]
4136#define __pyx_n_u_dtype_is_object __pyx_string_tab[82]
4137#define __pyx_n_u_elementBoundaryElementsArray __pyx_string_tab[83]
4138#define __pyx_n_u_elementBoundaryLocalElementBound __pyx_string_tab[84]
4139#define __pyx_n_u_elementNeighborsArray __pyx_string_tab[85]
4140#define __pyx_n_u_encode __pyx_string_tab[86]
4141#define __pyx_n_u_enumerate __pyx_string_tab[87]
4142#define __pyx_n_u_error __pyx_string_tab[88]
4143#define __pyx_n_u_exteriorElementBoundariesArray __pyx_string_tab[89]
4144#define __pyx_n_u_findNonzeros __pyx_string_tab[90]
4145#define __pyx_n_u_flags __pyx_string_tab[91]
4146#define __pyx_n_u_format __pyx_string_tab[92]
4147#define __pyx_n_u_fortran __pyx_string_tab[93]
4148#define __pyx_n_u_freeGlobal_test __pyx_string_tab[94]
4149#define __pyx_n_u_freeGlobal_trial __pyx_string_tab[95]
4150#define __pyx_n_u_getCSR __pyx_string_tab[96]
4151#define __pyx_n_u_getOffsets_CSR __pyx_string_tab[97]
4152#define __pyx_n_u_hasDiffusionInMixedForm __pyx_string_tab[98]
4153#define __pyx_n_u_hasFluxBoundaryConditions __pyx_string_tab[99]
4154#define __pyx_n_u_hasNumericalFlux __pyx_string_tab[100]
4155#define __pyx_n_u_hasOutflowBoundary __pyx_string_tab[101]
4156#define __pyx_n_u_id __pyx_string_tab[102]
4157#define __pyx_n_u_index __pyx_string_tab[103]
4158#define __pyx_n_u_interiorElementBoundariesArray __pyx_string_tab[104]
4159#define __pyx_n_u_items __pyx_string_tab[105]
4160#define __pyx_n_u_itemsize __pyx_string_tab[106]
4161#define __pyx_n_u_join __pyx_string_tab[107]
4162#define __pyx_n_u_memview __pyx_string_tab[108]
4163#define __pyx_n_u_mode __pyx_string_tab[109]
4164#define __pyx_n_u_nDOF_test_element __pyx_string_tab[110]
4165#define __pyx_n_u_nDOF_trial_element __pyx_string_tab[111]
4166#define __pyx_n_u_nElementBoundaries_element __pyx_string_tab[112]
4167#define __pyx_n_u_nElements_global __pyx_string_tab[113]
4168#define __pyx_n_u_nExteriorElementBoundaries_globa __pyx_string_tab[114]
4169#define __pyx_n_u_nFreeDOF_test __pyx_string_tab[115]
4170#define __pyx_n_u_nFreeDOF_trial __pyx_string_tab[116]
4171#define __pyx_n_u_nInteriorElementBoundaries_globa __pyx_string_tab[117]
4172#define __pyx_n_u_name __pyx_string_tab[118]
4173#define __pyx_n_u_ndim __pyx_string_tab[119]
4174#define __pyx_n_u_needNumericalFluxJacobian __pyx_string_tab[120]
4175#define __pyx_n_u_needOutflowJacobian __pyx_string_tab[121]
4176#define __pyx_n_u_np __pyx_string_tab[122]
4177#define __pyx_n_u_numpy __pyx_string_tab[123]
4178#define __pyx_n_u_obj __pyx_string_tab[124]
4179#define __pyx_n_u_offset_test __pyx_string_tab[125]
4180#define __pyx_n_u_offset_trial __pyx_string_tab[126]
4181#define __pyx_n_u_pack __pyx_string_tab[127]
4182#define __pyx_n_u_pop __pyx_string_tab[128]
4183#define __pyx_n_u_register __pyx_string_tab[129]
4184#define __pyx_n_u_rowptr __pyx_string_tab[130]
4185#define __pyx_n_u_self __pyx_string_tab[131]
4186#define __pyx_n_u_setdefault __pyx_string_tab[132]
4187#define __pyx_n_u_shape __pyx_string_tab[133]
4188#define __pyx_n_u_size __pyx_string_tab[134]
4189#define __pyx_n_u_start __pyx_string_tab[135]
4190#define __pyx_n_u_step __pyx_string_tab[136]
4191#define __pyx_n_u_stop __pyx_string_tab[137]
4192#define __pyx_n_u_stride_test __pyx_string_tab[138]
4193#define __pyx_n_u_stride_trial __pyx_string_tab[139]
4194#define __pyx_n_u_struct __pyx_string_tab[140]
4195#define __pyx_n_u_unpack __pyx_string_tab[141]
4196#define __pyx_n_u_update __pyx_string_tab[142]
4197#define __pyx_n_u_values __pyx_string_tab[143]
4198#define __pyx_n_u_x __pyx_string_tab[144]
4199#define __pyx_kp_b__6 __pyx_string_tab[145]
4200#define __pyx_kp_b__7 __pyx_string_tab[146]
4201#define __pyx_n_b_O __pyx_string_tab[147]
4202#define __pyx_kp_b_T __pyx_string_tab[148]
4203#define __pyx_kp_b__5 __pyx_string_tab[149]
4204#define __pyx_kp_b__8 __pyx_string_tab[150]
4205#define __pyx_kp_b_iso88591_Q __pyx_string_tab[151]
4206#define __pyx_kp_b_iso88591_A_D_q_6_T_T_6_T_t4q_D_9D_F_d __pyx_string_tab[152]
4207#define __pyx_kp_b_iso88591_A4_D_Qa__A_1_5Q_C1_A_Oq_C1 __pyx_string_tab[153]
4208#define __pyx_kp_b_iso88591_A_D_q_A_a_Q_7q_A_EQ_C1_QQR_EQ_vQ __pyx_string_tab[154]
4209#define __pyx_int_0 __pyx_number_tab[0]
4210#define __pyx_int_neg_1 __pyx_number_tab[1]
4211#define __pyx_int_136983863 __pyx_number_tab[2]
4212/* #### Code section: module_state_clear ### */
4213#if CYTHON_USE_MODULE_STATE
4214static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
4215 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
4216 if (!clear_module_state) return 0;
4217 Py_CLEAR(clear_module_state->__pyx_d);
4218 Py_CLEAR(clear_module_state->__pyx_b);
4219 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4220 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4221 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4222 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4223 #if CYTHON_PEP489_MULTI_PHASE_INIT
4224 __Pyx_State_RemoveModule(NULL);
4225 #endif
4226 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4227 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4228 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4229 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4230 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4231 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4232 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4233 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4234 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4235 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4236 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4237 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4238 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4239 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4240 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4241 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4242 Py_CLEAR(clear_module_state->__pyx_ptype_9csparsity_PySparsityInfo);
4243 Py_CLEAR(clear_module_state->__pyx_type_9csparsity_PySparsityInfo);
4244 Py_CLEAR(clear_module_state->__pyx_array_type);
4245 Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
4246 Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
4247 Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
4248 Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4249 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4250 Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4251 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4252 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
4253 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
4254 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
4255 for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
4256 for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
4257 for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
4258 for (int i=0; i<155; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
4259 for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
4260/* #### Code section: module_state_clear_contents ### */
4261/* CommonTypesMetaclass.module_state_clear */
4262Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
4263
4264/* CythonFunctionPerModule.module_state_clear */
4265Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4266
4267/* #### Code section: module_state_clear_end ### */
4268return 0;
4269}
4270#endif
4271/* #### Code section: module_state_traverse ### */
4272#if CYTHON_USE_MODULE_STATE
4273static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4274 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
4275 if (!traverse_module_state) return 0;
4276 Py_VISIT(traverse_module_state->__pyx_d);
4277 Py_VISIT(traverse_module_state->__pyx_b);
4278 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4279 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
4280 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
4281 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
4282 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4283 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4284 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4285 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4286 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4287 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4288 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4289 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4290 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4291 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4292 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4293 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4294 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4295 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4296 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4297 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4298 Py_VISIT(traverse_module_state->__pyx_ptype_9csparsity_PySparsityInfo);
4299 Py_VISIT(traverse_module_state->__pyx_type_9csparsity_PySparsityInfo);
4300 Py_VISIT(traverse_module_state->__pyx_array_type);
4301 Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4302 Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4303 Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4304 Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4305 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4306 Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4307 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4308 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
4309 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
4310 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
4311 for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
4312 for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
4313 for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
4314 for (int i=0; i<155; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4315 for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
4316/* #### Code section: module_state_traverse_contents ### */
4317/* CommonTypesMetaclass.module_state_traverse */
4318Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
4319
4320/* CythonFunctionPerModule.module_state_traverse */
4321Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4322
4323/* #### Code section: module_state_traverse_end ### */
4324return 0;
4325}
4326#endif
4327/* #### Code section: module_code ### */
4328
4329/* "View.MemoryView":147
4330 * cdef bint dtype_is_object
4331 *
4332 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4333 * mode="c", bint allocate_buffer=True):
4334 *
4335*/
4336
4337/* Python wrapper */
4338static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4339#if CYTHON_VECTORCALL_TPNEW
4340PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4341#else
4342PyObject *__pyx_args, PyObject *__pyx_kwds
4343#endif
4344); /*proto*/
4345static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4346#if CYTHON_VECTORCALL_TPNEW
4347PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4348#else
4349PyObject *__pyx_args, PyObject *__pyx_kwds
4350#endif
4351) {
4352 PyObject *__pyx_v_shape = 0;
4353 Py_ssize_t __pyx_v_itemsize;
4354 PyObject *__pyx_v_format = 0;
4355 PyObject *__pyx_v_mode = 0;
4356 int __pyx_v_allocate_buffer;
4357 #if !CYTHON_VECTORCALL_TPNEW
4358 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
4359 #endif
4360 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
4361 PyObject* values[5] = {0,0,0,0,0};
4362 int __pyx_lineno = 0;
4363 const char *__pyx_filename = NULL;
4364 int __pyx_clineno = 0;
4365 int __pyx_r;
4366 __Pyx_RefNannyDeclarations
4367 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4368 #if !CYTHON_VECTORCALL_TPNEW
4369 #if CYTHON_ASSUME_SAFE_SIZE
4370 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
4371 #else
4372 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
4373 #endif
4374 #endif
4375 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
4376 {
4377 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shape,&__pyx_mstate_global->__pyx_n_u_itemsize,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_allocate_buffer,0};
4378 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
4379 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 147, __pyx_L3_error)
4380 if (__pyx_kwds_len > 0) {
4381 switch (__pyx_nargs) {
4382 case 5:
4383 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4384 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4385 CYTHON_FALLTHROUGH;
4386 case 4:
4387 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4388 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4389 CYTHON_FALLTHROUGH;
4390 case 3:
4391 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4392 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4393 CYTHON_FALLTHROUGH;
4394 case 2:
4395 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4396 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4397 CYTHON_FALLTHROUGH;
4398 case 1:
4399 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4400 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4401 CYTHON_FALLTHROUGH;
4402 case 0: break;
4403 default: goto __pyx_L5_argtuple_error;
4404 }
4405 const Py_ssize_t kwd_pos_args = __pyx_nargs;
4406 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(1, 147, __pyx_L3_error)
4407 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4408 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
4409 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, i); __PYX_ERR(1, 147, __pyx_L3_error) }
4410 }
4411 } else {
4412 switch (__pyx_nargs) {
4413 case 5:
4414 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4415 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4416 CYTHON_FALLTHROUGH;
4417 case 4:
4418 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4419 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4420 CYTHON_FALLTHROUGH;
4421 case 3:
4422 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4423 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4424 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4425 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4426 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4427 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4428 break;
4429 default: goto __pyx_L5_argtuple_error;
4430 }
4431 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4432 }
4433 __pyx_v_shape = ((PyObject*)values[0]);
4434 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L3_error)
4435 __pyx_v_format = values[2];
4436 __pyx_v_mode = values[3];
4437 if (values[4]) {
4438 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 148, __pyx_L3_error)
4439 } else {
4440
4441 /* "View.MemoryView":148
4442 *
4443 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
4444 * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
4445 *
4446 * cdef int idx
4447*/
4448 __pyx_v_allocate_buffer = ((int)1);
4449 }
4450 }
4451 goto __pyx_L6_skip;
4452 __pyx_L5_argtuple_error:;
4453 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 147, __pyx_L3_error)
4454 __pyx_L6_skip:;
4455 goto __pyx_L4_argument_unpacking_done;
4456 __pyx_L3_error:;
4457 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4458 Py_XDECREF(values[__pyx_temp]);
4459 }
4460 __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4461 __Pyx_RefNannyFinishContext();
4462 return -1;
4463 __pyx_L4_argument_unpacking_done:;
4464 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 147, __pyx_L1_error)
4465 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
4466 PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 147, __pyx_L1_error)
4467 }
4468 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
4469
4470 /* "View.MemoryView":147
4471 * cdef bint dtype_is_object
4472 *
4473 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4474 * mode="c", bint allocate_buffer=True):
4475 *
4476*/
4477
4478 /* function exit code */
4479 goto __pyx_L0;
4480 __pyx_L1_error:;
4481 __pyx_r = -1;
4482 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4483 Py_XDECREF(values[__pyx_temp]);
4484 }
4485 goto __pyx_L7_cleaned_up;
4486 __pyx_L0:;
4487 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4488 Py_XDECREF(values[__pyx_temp]);
4489 }
4490 __pyx_L7_cleaned_up:;
4491
4492
4493 __Pyx_RefNannyFinishContext();
4494 return __pyx_r;
4495}
4496
4497static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
4498 int __pyx_v_idx;
4499 Py_ssize_t __pyx_v_dim;
4500 char __pyx_v_order;
4501 int __pyx_r;
4502 __Pyx_RefNannyDeclarations
4503 Py_ssize_t __pyx_t_1;
4504 int __pyx_t_2;
4505 int __pyx_t_3;
4506 int __pyx_t_4;
4507 PyObject *__pyx_t_5 = NULL;
4508 PyObject *__pyx_t_6 = NULL;
4509 size_t __pyx_t_7;
4510 char *__pyx_t_8;
4511 Py_ssize_t __pyx_t_9;
4512 PyObject *__pyx_t_10 = NULL;
4513 PyObject *__pyx_t_11[5];
4514 int __pyx_t_12;
4515 PyObject *__pyx_t_13 = NULL;
4516 int __pyx_lineno = 0;
4517 const char *__pyx_filename = NULL;
4518 int __pyx_clineno = 0;
4519 __Pyx_RefNannySetupContext("__cinit__", 0);
4520 __Pyx_INCREF(__pyx_v_format);
4521
4522 /* "View.MemoryView":153
4523 * cdef Py_ssize_t dim
4524 *
4525 * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
4526 * self.itemsize = itemsize
4527 *
4528*/
4529 if (unlikely(__pyx_v_shape == Py_None)) {
4530 PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
4531 __PYX_ERR(1, 153, __pyx_L1_error)
4532 }
4533 __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 153, __pyx_L1_error)
4534 __pyx_v_self->ndim = ((int)__pyx_t_1);
4535
4536
4537 /* "View.MemoryView":154
4538 *
4539 * self.ndim = <int> len(shape)
4540 * self.itemsize = itemsize # <<<<<<<<<<<<<<
4541 *
4542 * if cython.unlikely(not self.ndim):
4543*/
4544 __pyx_v_self->itemsize = __pyx_v_itemsize;
4545
4546 /* "View.MemoryView":156
4547 * self.itemsize = itemsize
4548 *
4549 * if cython.unlikely(not self.ndim): # <<<<<<<<<<<<<<
4550 * _err_ValueError("Empty shape tuple for cython.array")
4551 *
4552*/
4553 __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
4554
4555 if (unlikely(__pyx_t_2)) {
4556
4557
4558 /* "View.MemoryView":157
4559 *
4560 * if cython.unlikely(not self.ndim):
4561 * _err_ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
4562 *
4563 * if cython.unlikely(itemsize <= 0):
4564*/
4565 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_Empty_shape_tuple_for_cython_arr); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 157, __pyx_L1_error)
4566
4567
4568 /* "View.MemoryView":156
4569 * self.itemsize = itemsize
4570 *
4571 * if cython.unlikely(not self.ndim): # <<<<<<<<<<<<<<
4572 * _err_ValueError("Empty shape tuple for cython.array")
4573 *
4574*/
4575 }
4576
4577 /* "View.MemoryView":159
4578 * _err_ValueError("Empty shape tuple for cython.array")
4579 *
4580 * if cython.unlikely(itemsize <= 0): # <<<<<<<<<<<<<<
4581 * _err_ValueError("itemsize <= 0 for cython.array")
4582 *
4583*/
4584 __pyx_t_2 = (__pyx_v_itemsize <= 0);
4585
4586 if (unlikely(__pyx_t_2)) {
4587
4588
4589 /* "View.MemoryView":160
4590 *
4591 * if cython.unlikely(itemsize <= 0):
4592 * _err_ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
4593 *
4594 * if not isinstance(format, bytes):
4595*/
4596 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_itemsize_0_for_cython_array); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 160, __pyx_L1_error)
4597
4598
4599 /* "View.MemoryView":159
4600 * _err_ValueError("Empty shape tuple for cython.array")
4601 *
4602 * if cython.unlikely(itemsize <= 0): # <<<<<<<<<<<<<<
4603 * _err_ValueError("itemsize <= 0 for cython.array")
4604 *
4605*/
4606 }
4607
4608 /* "View.MemoryView":162
4609 * _err_ValueError("itemsize <= 0 for cython.array")
4610 *
4611 * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
4612 * format = format.encode('ASCII')
4613 * self._format = format # keep a reference to the byte string
4614*/
4615 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
4616 __pyx_t_4 = (!__pyx_t_2);
4617
4618
4619 if (__pyx_t_4) {
4620
4621
4622 /* "View.MemoryView":163
4623 *
4624 * if not isinstance(format, bytes):
4625 * format = format.encode('ASCII') # <<<<<<<<<<<<<<
4626 * self._format = format # keep a reference to the byte string
4627 * self.format = self._format
4628*/
4629 __pyx_t_6 = __pyx_v_format;
4630 __Pyx_INCREF(__pyx_t_6);
4631 __pyx_t_7 = 0;
4632 {
4633 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ASCII};
4634 __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
4635 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4636 if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
4637 __Pyx_GOTREF(__pyx_t_5);
4638 }
4639 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
4640 __pyx_t_5 = 0;
4641
4642 /* "View.MemoryView":162
4643 * _err_ValueError("itemsize <= 0 for cython.array")
4644 *
4645 * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
4646 * format = format.encode('ASCII')
4647 * self._format = format # keep a reference to the byte string
4648*/
4649 }
4650
4651 /* "View.MemoryView":164
4652 * if not isinstance(format, bytes):
4653 * format = format.encode('ASCII')
4654 * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
4655 * self.format = self._format
4656 *
4657*/
4658 __pyx_t_5 = __pyx_v_format;
4659 __Pyx_INCREF(__pyx_t_5);
4660 if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(1, 164, __pyx_L1_error)
4661 __Pyx_GIVEREF(__pyx_t_5);
4662 __Pyx_GOTREF(__pyx_v_self->_format);
4663 __Pyx_DECREF(__pyx_v_self->_format);
4664 __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
4665 __pyx_t_5 = 0;
4666
4667 /* "View.MemoryView":165
4668 * format = format.encode('ASCII')
4669 * self._format = format # keep a reference to the byte string
4670 * self.format = self._format # <<<<<<<<<<<<<<
4671 *
4672 *
4673*/
4674 if (unlikely(__pyx_v_self->_format == Py_None)) {
4675 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
4676 __PYX_ERR(1, 165, __pyx_L1_error)
4677 }
4678 __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 165, __pyx_L1_error)
4679 __pyx_v_self->format = __pyx_t_8;
4680
4681 /* "View.MemoryView":168
4682 *
4683 *
4684 * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t> self.ndim) # <<<<<<<<<<<<<<
4685 * self._strides = self._shape + self.ndim
4686 *
4687*/
4688 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_self->ndim))));
4689
4690 /* "View.MemoryView":169
4691 *
4692 * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t> self.ndim)
4693 * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
4694 *
4695 * if not self._shape:
4696*/
4697 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
4698
4699 /* "View.MemoryView":171
4700 * self._strides = self._shape + self.ndim
4701 *
4702 * if not self._shape: # <<<<<<<<<<<<<<
4703 * raise MemoryError, "unable to allocate shape and strides."
4704 *
4705*/
4706 __pyx_t_4 = (!(__pyx_v_self->_shape != 0));
4707
4708 if (unlikely(__pyx_t_4)) {
4709
4710
4711 /* "View.MemoryView":172
4712 *
4713 * if not self._shape:
4714 * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
4715 *
4716 *
4717*/
4718 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_shape_and_str, 0, 0);
4719 __PYX_ERR(1, 172, __pyx_L1_error)
4720
4721 /* "View.MemoryView":171
4722 * self._strides = self._shape + self.ndim
4723 *
4724 * if not self._shape: # <<<<<<<<<<<<<<
4725 * raise MemoryError, "unable to allocate shape and strides."
4726 *
4727*/
4728 }
4729
4730 /* "View.MemoryView":175
4731 *
4732 *
4733 * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
4734 * if dim <= 0:
4735 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
4736*/
4737
4738 __pyx_t_3 = 0;
4739 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5);
4740 __pyx_t_1 = 0;
4741 for (;;) {
4742 {
4743 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
4744 #if !CYTHON_ASSUME_SAFE_SIZE
4745 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 175, __pyx_L1_error)
4746 #endif
4747 if (__pyx_t_1 >= __pyx_temp) break;
4748 }
4749 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4750 __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1));
4751 #else
4752 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_1);
4753 #endif
4754 ++__pyx_t_1;
4755 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 175, __pyx_L1_error)
4756 __Pyx_GOTREF(__pyx_t_6);
4757 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L1_error)
4758 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4759 __pyx_v_dim = __pyx_t_9;
4760 __pyx_v_idx = __pyx_t_3;
4761 __pyx_t_3 = (__pyx_t_3 + 1);
4762
4763 /* "View.MemoryView":176
4764 *
4765 * for idx, dim in enumerate(shape):
4766 * if dim <= 0: # <<<<<<<<<<<<<<
4767 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
4768 * self._shape[idx] = dim
4769*/
4770 __pyx_t_4 = (__pyx_v_dim <= 0);
4771
4772 if (unlikely(__pyx_t_4)) {
4773
4774
4775 /* "View.MemoryView":177
4776 * for idx, dim in enumerate(shape):
4777 * if dim <= 0:
4778 * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
4779 * self._shape[idx] = dim
4780 *
4781*/
4782 __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
4783 __Pyx_GOTREF(__pyx_t_6);
4784 __pyx_t_10 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
4785 __Pyx_GOTREF(__pyx_t_10);
4786 __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis;
4787 __pyx_t_11[1] = __pyx_t_6;
4788 __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u__2;
4789 __pyx_t_11[3] = __pyx_t_10;
4790 __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__3;
4791 __pyx_t_9 = 25;
4792 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
4793 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]);
4794 #endif
4795 __pyx_t_12 = 0;
4796 __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_9, __pyx_t_12);
4797 if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 177, __pyx_L1_error)
4798 __Pyx_GOTREF(__pyx_t_13);
4799 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4800 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4801 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
4802 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4803 __PYX_ERR(1, 177, __pyx_L1_error)
4804
4805 /* "View.MemoryView":176
4806 *
4807 * for idx, dim in enumerate(shape):
4808 * if dim <= 0: # <<<<<<<<<<<<<<
4809 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
4810 * self._shape[idx] = dim
4811*/
4812 }
4813
4814 /* "View.MemoryView":178
4815 * if dim <= 0:
4816 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
4817 * self._shape[idx] = dim # <<<<<<<<<<<<<<
4818 *
4819 * cdef char order
4820*/
4821 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
4822
4823 /* "View.MemoryView":175
4824 *
4825 *
4826 * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
4827 * if dim <= 0:
4828 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
4829*/
4830 }
4831 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4832
4833 /* "View.MemoryView":181
4834 *
4835 * cdef char order
4836 * if mode == 'c': # <<<<<<<<<<<<<<
4837 * order = b'C'
4838 * self.mode = u'c'
4839*/
4840 __pyx_t_4 = (__Pyx_PyObject_Equals_obj_ch99(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 181, __pyx_L1_error)
4841 if (__pyx_t_4) {
4842
4843
4844 /* "View.MemoryView":182
4845 * cdef char order
4846 * if mode == 'c':
4847 * order = b'C' # <<<<<<<<<<<<<<
4848 * self.mode = u'c'
4849 * elif mode == 'fortran':
4850*/
4851 __pyx_v_order = 'C';
4852
4853 /* "View.MemoryView":183
4854 * if mode == 'c':
4855 * order = b'C'
4856 * self.mode = u'c' # <<<<<<<<<<<<<<
4857 * elif mode == 'fortran':
4858 * order = b'F'
4859*/
4860 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
4861 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_c);
4862 __Pyx_GOTREF(__pyx_v_self->mode);
4863 __Pyx_DECREF(__pyx_v_self->mode);
4864 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_c;
4865
4866 /* "View.MemoryView":181
4867 *
4868 * cdef char order
4869 * if mode == 'c': # <<<<<<<<<<<<<<
4870 * order = b'C'
4871 * self.mode = u'c'
4872*/
4873 goto __pyx_L11;
4874 }
4875
4876 /* "View.MemoryView":184
4877 * order = b'C'
4878 * self.mode = u'c'
4879 * elif mode == 'fortran': # <<<<<<<<<<<<<<
4880 * order = b'F'
4881 * self.mode = u'fortran'
4882*/
4883 __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 184, __pyx_L1_error)
4884 if (likely(__pyx_t_4)) {
4885
4886
4887 /* "View.MemoryView":185
4888 * self.mode = u'c'
4889 * elif mode == 'fortran':
4890 * order = b'F' # <<<<<<<<<<<<<<
4891 * self.mode = u'fortran'
4892 * else:
4893*/
4894 __pyx_v_order = 'F';
4895
4896 /* "View.MemoryView":186
4897 * elif mode == 'fortran':
4898 * order = b'F'
4899 * self.mode = u'fortran' # <<<<<<<<<<<<<<
4900 * else:
4901 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
4902*/
4903 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
4904 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fortran);
4905 __Pyx_GOTREF(__pyx_v_self->mode);
4906 __Pyx_DECREF(__pyx_v_self->mode);
4907 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_fortran;
4908
4909 /* "View.MemoryView":184
4910 * order = b'C'
4911 * self.mode = u'c'
4912 * elif mode == 'fortran': # <<<<<<<<<<<<<<
4913 * order = b'F'
4914 * self.mode = u'fortran'
4915*/
4916 goto __pyx_L11;
4917 }
4918
4919 /* "View.MemoryView":188
4920 * self.mode = u'fortran'
4921 * else:
4922 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
4923 *
4924 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
4925*/
4926 /*else*/ {
4927 __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 188, __pyx_L1_error)
4928 __Pyx_GOTREF(__pyx_t_5);
4929 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 188, __pyx_L1_error)
4930 __Pyx_GOTREF(__pyx_t_13);
4931 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4932 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
4933 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4934 __PYX_ERR(1, 188, __pyx_L1_error)
4935 }
4936 __pyx_L11:;
4937
4938 /* "View.MemoryView":190
4939 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
4940 *
4941 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
4942 *
4943 * self.free_data = allocate_buffer
4944*/
4945 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
4946
4947 /* "View.MemoryView":192
4948 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
4949 *
4950 * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
4951 * self.dtype_is_object = format == b'O'
4952 *
4953*/
4954 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
4955
4956 /* "View.MemoryView":193
4957 *
4958 * self.free_data = allocate_buffer
4959 * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
4960 *
4961 * if allocate_buffer:
4962*/
4963 __pyx_t_13 = __Pyx_PyObject_CompareEq_object_bytes(__pyx_v_format, __pyx_mstate_global->__pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 193, __pyx_L1_error)
4964 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 193, __pyx_L1_error)
4965 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4966 __pyx_v_self->dtype_is_object = __pyx_t_4;
4967
4968 /* "View.MemoryView":195
4969 * self.dtype_is_object = format == b'O'
4970 *
4971 * if allocate_buffer: # <<<<<<<<<<<<<<
4972 * _allocate_buffer(self)
4973 *
4974*/
4975 if (__pyx_v_allocate_buffer) {
4976
4977 /* "View.MemoryView":196
4978 *
4979 * if allocate_buffer:
4980 * _allocate_buffer(self) # <<<<<<<<<<<<<<
4981 *
4982 * @cname('getbuffer')
4983*/
4984 __pyx_t_3 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 196, __pyx_L1_error)
4985
4986
4987 /* "View.MemoryView":195
4988 * self.dtype_is_object = format == b'O'
4989 *
4990 * if allocate_buffer: # <<<<<<<<<<<<<<
4991 * _allocate_buffer(self)
4992 *
4993*/
4994 }
4995
4996 /* "View.MemoryView":147
4997 * cdef bint dtype_is_object
4998 *
4999 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5000 * mode="c", bint allocate_buffer=True):
5001 *
5002*/
5003
5004 /* function exit code */
5005 __pyx_r = 0;
5006 goto __pyx_L0;
5007 __pyx_L1_error:;
5008 __Pyx_XDECREF(__pyx_t_5);
5009 __Pyx_XDECREF(__pyx_t_6);
5010 __Pyx_XDECREF(__pyx_t_10);
5011 __Pyx_XDECREF(__pyx_t_13);
5012 __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5013 __pyx_r = -1;
5014 __pyx_L0:;
5015
5016
5017
5018 __Pyx_XDECREF(__pyx_v_format);
5019
5020 __Pyx_RefNannyFinishContext();
5021 return __pyx_r;
5022}
5023
5024/* "View.MemoryView":198
5025 * _allocate_buffer(self)
5026 *
5027 * @cname('getbuffer') # <<<<<<<<<<<<<<
5028 * def __getbuffer__(self, Py_buffer *info, int flags):
5029 * cdef int bufmode = -1
5030*/
5031
5032/* Python wrapper */
5033CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5034CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5035 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5036 int __pyx_r;
5037 __Pyx_RefNannyDeclarations
5038 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5039 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5040 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
5041
5042 /* function exit code */
5043
5044
5045 __Pyx_RefNannyFinishContext();
5046 return __pyx_r;
5047}
5048
5049static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5050 int __pyx_v_bufmode;
5051 int __pyx_r;
5052 __Pyx_RefNannyDeclarations
5053 int __pyx_t_1;
5054 int __pyx_t_2;
5055 char *__pyx_t_3;
5056 Py_ssize_t __pyx_t_4;
5057 Py_ssize_t *__pyx_t_5;
5058 int __pyx_lineno = 0;
5059 const char *__pyx_filename = NULL;
5060 int __pyx_clineno = 0;
5061 if (unlikely(__pyx_v_info == NULL)) {
5062 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5063 return -1;
5064 }
5065 __Pyx_RefNannySetupContext("__getbuffer__", 0);
5066 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5067 __Pyx_GIVEREF(__pyx_v_info->obj);
5068
5069 /* "View.MemoryView":200
5070 * @cname('getbuffer')
5071 * def __getbuffer__(self, Py_buffer *info, int flags):
5072 * cdef int bufmode = -1 # <<<<<<<<<<<<<<
5073 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5074 * if self.mode == u"c":
5075*/
5076 __pyx_v_bufmode = -1;
5077
5078 /* "View.MemoryView":201
5079 * def __getbuffer__(self, Py_buffer *info, int flags):
5080 * cdef int bufmode = -1
5081 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5082 * if self.mode == u"c":
5083 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5084*/
5085 __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
5086
5087 if (__pyx_t_1) {
5088
5089
5090 /* "View.MemoryView":202
5091 * cdef int bufmode = -1
5092 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5093 * if self.mode == u"c": # <<<<<<<<<<<<<<
5094 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5095 * elif self.mode == u"fortran":
5096*/
5097 __pyx_t_1 = (__Pyx_PyObject_Equals_str_ch99(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 202, __pyx_L1_error)
5098 if (__pyx_t_1) {
5099
5100
5101 /* "View.MemoryView":203
5102 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5103 * if self.mode == u"c":
5104 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5105 * elif self.mode == u"fortran":
5106 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5107*/
5108 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5109
5110 /* "View.MemoryView":202
5111 * cdef int bufmode = -1
5112 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5113 * if self.mode == u"c": # <<<<<<<<<<<<<<
5114 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5115 * elif self.mode == u"fortran":
5116*/
5117 goto __pyx_L4;
5118 }
5119
5120 /* "View.MemoryView":204
5121 * if self.mode == u"c":
5122 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5123 * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5124 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5125 * if cython.unlikely(not (flags & bufmode)):
5126*/
5127 __pyx_t_1 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 204, __pyx_L1_error)
5128 if (__pyx_t_1) {
5129
5130
5131 /* "View.MemoryView":205
5132 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5133 * elif self.mode == u"fortran":
5134 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5135 * if cython.unlikely(not (flags & bufmode)):
5136 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5137*/
5138 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5139
5140 /* "View.MemoryView":204
5141 * if self.mode == u"c":
5142 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5143 * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5144 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5145 * if cython.unlikely(not (flags & bufmode)):
5146*/
5147 }
5148 __pyx_L4:;
5149
5150 /* "View.MemoryView":206
5151 * elif self.mode == u"fortran":
5152 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5153 * if cython.unlikely(not (flags & bufmode)): # <<<<<<<<<<<<<<
5154 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5155 * info.buf = self.data
5156*/
5157 __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5158
5159 if (unlikely(__pyx_t_1)) {
5160
5161
5162 /* "View.MemoryView":207
5163 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5164 * if cython.unlikely(not (flags & bufmode)):
5165 * _err_ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
5166 * info.buf = self.data
5167 * info.len = self.len
5168*/
5169 __pyx_t_2 = __pyx_memoryview_err_ValueError(__pyx_k_Can_only_create_a_buffer_that_is); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 207, __pyx_L1_error)
5170
5171
5172 /* "View.MemoryView":206
5173 * elif self.mode == u"fortran":
5174 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5175 * if cython.unlikely(not (flags & bufmode)): # <<<<<<<<<<<<<<
5176 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5177 * info.buf = self.data
5178*/
5179 }
5180
5181 /* "View.MemoryView":201
5182 * def __getbuffer__(self, Py_buffer *info, int flags):
5183 * cdef int bufmode = -1
5184 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5185 * if self.mode == u"c":
5186 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5187*/
5188 }
5189
5190 /* "View.MemoryView":208
5191 * if cython.unlikely(not (flags & bufmode)):
5192 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5193 * info.buf = self.data # <<<<<<<<<<<<<<
5194 * info.len = self.len
5195 *
5196*/
5197 __pyx_t_3 = __pyx_v_self->data;
5198
5199 __pyx_v_info->buf = __pyx_t_3;
5200
5201 /* "View.MemoryView":209
5202 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5203 * info.buf = self.data
5204 * info.len = self.len # <<<<<<<<<<<<<<
5205 *
5206 * if flags & PyBUF_STRIDES:
5207*/
5208 __pyx_t_4 = __pyx_v_self->len;
5209
5210 __pyx_v_info->len = __pyx_t_4;
5211
5212 /* "View.MemoryView":211
5213 * info.len = self.len
5214 *
5215 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5216 * info.ndim = self.ndim
5217 * info.shape = self._shape
5218*/
5219 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5220
5221 if (__pyx_t_1) {
5222
5223
5224 /* "View.MemoryView":212
5225 *
5226 * if flags & PyBUF_STRIDES:
5227 * info.ndim = self.ndim # <<<<<<<<<<<<<<
5228 * info.shape = self._shape
5229 * info.strides = self._strides
5230*/
5231 __pyx_t_2 = __pyx_v_self->ndim;
5232
5233 __pyx_v_info->ndim = __pyx_t_2;
5234
5235 /* "View.MemoryView":213
5236 * if flags & PyBUF_STRIDES:
5237 * info.ndim = self.ndim
5238 * info.shape = self._shape # <<<<<<<<<<<<<<
5239 * info.strides = self._strides
5240 * else:
5241*/
5242 __pyx_t_5 = __pyx_v_self->_shape;
5243
5244 __pyx_v_info->shape = __pyx_t_5;
5245
5246 /* "View.MemoryView":214
5247 * info.ndim = self.ndim
5248 * info.shape = self._shape
5249 * info.strides = self._strides # <<<<<<<<<<<<<<
5250 * else:
5251 * info.ndim = 1
5252*/
5253 __pyx_t_5 = __pyx_v_self->_strides;
5254
5255 __pyx_v_info->strides = __pyx_t_5;
5256
5257 /* "View.MemoryView":211
5258 * info.len = self.len
5259 *
5260 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5261 * info.ndim = self.ndim
5262 * info.shape = self._shape
5263*/
5264 goto __pyx_L6;
5265 }
5266
5267 /* "View.MemoryView":216
5268 * info.strides = self._strides
5269 * else:
5270 * info.ndim = 1 # <<<<<<<<<<<<<<
5271 * info.shape = &self.len if flags & PyBUF_ND else NULL
5272 * info.strides = NULL
5273*/
5274 /*else*/ {
5275 __pyx_v_info->ndim = 1;
5276
5277 /* "View.MemoryView":217
5278 * else:
5279 * info.ndim = 1
5280 * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
5281 * info.strides = NULL
5282 *
5283*/
5284 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5285
5286 if (__pyx_t_1) {
5287
5288 __pyx_t_5 = (&__pyx_v_self->len);
5289 } else {
5290
5291 __pyx_t_5 = NULL;
5292 }
5293
5294 __pyx_v_info->shape = __pyx_t_5;
5295
5296 /* "View.MemoryView":218
5297 * info.ndim = 1
5298 * info.shape = &self.len if flags & PyBUF_ND else NULL
5299 * info.strides = NULL # <<<<<<<<<<<<<<
5300 *
5301 * info.suboffsets = NULL
5302*/
5303 __pyx_v_info->strides = NULL;
5304 }
5305 __pyx_L6:;
5306
5307 /* "View.MemoryView":220
5308 * info.strides = NULL
5309 *
5310 * info.suboffsets = NULL # <<<<<<<<<<<<<<
5311 * info.itemsize = self.itemsize
5312 * info.readonly = 0
5313*/
5314 __pyx_v_info->suboffsets = NULL;
5315
5316 /* "View.MemoryView":221
5317 *
5318 * info.suboffsets = NULL
5319 * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
5320 * info.readonly = 0
5321 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5322*/
5323 __pyx_t_4 = __pyx_v_self->itemsize;
5324
5325 __pyx_v_info->itemsize = __pyx_t_4;
5326
5327 /* "View.MemoryView":222
5328 * info.suboffsets = NULL
5329 * info.itemsize = self.itemsize
5330 * info.readonly = 0 # <<<<<<<<<<<<<<
5331 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5332 * info.obj = self
5333*/
5334 __pyx_v_info->readonly = 0;
5335
5336 /* "View.MemoryView":223
5337 * info.itemsize = self.itemsize
5338 * info.readonly = 0
5339 * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
5340 * info.obj = self
5341 *
5342*/
5343 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5344
5345 if (__pyx_t_1) {
5346
5347 __pyx_t_3 = __pyx_v_self->format;
5348 } else {
5349
5350 __pyx_t_3 = NULL;
5351 }
5352
5353 __pyx_v_info->format = __pyx_t_3;
5354
5355 /* "View.MemoryView":224
5356 * info.readonly = 0
5357 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5358 * info.obj = self # <<<<<<<<<<<<<<
5359 *
5360 * def __dealloc__(array self):
5361*/
5362 __Pyx_INCREF((PyObject *)__pyx_v_self);
5363 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5364 __Pyx_GOTREF(__pyx_v_info->obj);
5365 __Pyx_DECREF(__pyx_v_info->obj);
5366 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5367
5368 /* "View.MemoryView":198
5369 * _allocate_buffer(self)
5370 *
5371 * @cname('getbuffer') # <<<<<<<<<<<<<<
5372 * def __getbuffer__(self, Py_buffer *info, int flags):
5373 * cdef int bufmode = -1
5374*/
5375
5376 /* function exit code */
5377 __pyx_r = 0;
5378 goto __pyx_L0;
5379 __pyx_L1_error:;
5380 __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5381 __pyx_r = -1;
5382 if (__pyx_v_info->obj != NULL) {
5383 __Pyx_GOTREF(__pyx_v_info->obj);
5384 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5385 }
5386 goto __pyx_L2;
5387 __pyx_L0:;
5388 if (__pyx_v_info->obj == Py_None) {
5389 __Pyx_GOTREF(__pyx_v_info->obj);
5390 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5391 }
5392 __pyx_L2:;
5393
5394
5395 __Pyx_RefNannyFinishContext();
5396 return __pyx_r;
5397}
5398
5399/* "View.MemoryView":226
5400 * info.obj = self
5401 *
5402 * def __dealloc__(array self): # <<<<<<<<<<<<<<
5403 * if self.callback_free_data != NULL:
5404 * self.callback_free_data(self.data)
5405*/
5406
5407/* Python wrapper */
5408static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
5409static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
5410 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5411 __Pyx_RefNannyDeclarations
5412 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
5413 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5414 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
5415
5416 /* function exit code */
5417 __Pyx_RefNannyFinishContext();
5418}
5419
5420static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
5421 int __pyx_t_1;
5422 int __pyx_t_2;
5423
5424 /* "View.MemoryView":227
5425 *
5426 * def __dealloc__(array self):
5427 * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
5428 * self.callback_free_data(self.data)
5429 * elif self.free_data and self.data is not NULL:
5430*/
5431 __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
5432
5433 if (__pyx_t_1) {
5434
5435
5436 /* "View.MemoryView":228
5437 * def __dealloc__(array self):
5438 * if self.callback_free_data != NULL:
5439 * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
5440 * elif self.free_data and self.data is not NULL:
5441 * if self.dtype_is_object:
5442*/
5443 __pyx_v_self->callback_free_data(__pyx_v_self->data);
5444
5445 /* "View.MemoryView":227
5446 *
5447 * def __dealloc__(array self):
5448 * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
5449 * self.callback_free_data(self.data)
5450 * elif self.free_data and self.data is not NULL:
5451*/
5452 goto __pyx_L3;
5453 }
5454
5455 /* "View.MemoryView":229
5456 * if self.callback_free_data != NULL:
5457 * self.callback_free_data(self.data)
5458 * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
5459 * if self.dtype_is_object:
5460 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5461*/
5462 if (__pyx_v_self->free_data) {
5463 } else {
5464
5465 __pyx_t_1 = __pyx_v_self->free_data;
5466 goto __pyx_L4_bool_binop_done;
5467 }
5468 __pyx_t_2 = (__pyx_v_self->data != NULL);
5469
5470
5471 __pyx_t_1 = __pyx_t_2;
5472
5473 __pyx_L4_bool_binop_done:;
5474 if (__pyx_t_1) {
5475
5476
5477 /* "View.MemoryView":230
5478 * self.callback_free_data(self.data)
5479 * elif self.free_data and self.data is not NULL:
5480 * if self.dtype_is_object: # <<<<<<<<<<<<<<
5481 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5482 * free(self.data)
5483*/
5484 if (__pyx_v_self->dtype_is_object) {
5485
5486 /* "View.MemoryView":231
5487 * elif self.free_data and self.data is not NULL:
5488 * if self.dtype_is_object:
5489 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
5490 * free(self.data)
5491 * PyObject_Free(self._shape)
5492*/
5493 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
5494
5495 /* "View.MemoryView":230
5496 * self.callback_free_data(self.data)
5497 * elif self.free_data and self.data is not NULL:
5498 * if self.dtype_is_object: # <<<<<<<<<<<<<<
5499 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5500 * free(self.data)
5501*/
5502 }
5503
5504 /* "View.MemoryView":232
5505 * if self.dtype_is_object:
5506 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5507 * free(self.data) # <<<<<<<<<<<<<<
5508 * PyObject_Free(self._shape)
5509 *
5510*/
5511 free(__pyx_v_self->data);
5512
5513 /* "View.MemoryView":229
5514 * if self.callback_free_data != NULL:
5515 * self.callback_free_data(self.data)
5516 * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
5517 * if self.dtype_is_object:
5518 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5519*/
5520 }
5521 __pyx_L3:;
5522
5523 /* "View.MemoryView":233
5524 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5525 * free(self.data)
5526 * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
5527 *
5528 * @property
5529*/
5530 PyObject_Free(__pyx_v_self->_shape);
5531
5532 /* "View.MemoryView":226
5533 * info.obj = self
5534 *
5535 * def __dealloc__(array self): # <<<<<<<<<<<<<<
5536 * if self.callback_free_data != NULL:
5537 * self.callback_free_data(self.data)
5538*/
5539
5540 /* function exit code */
5541
5542}
5543
5544/* "View.MemoryView":235
5545 * PyObject_Free(self._shape)
5546 *
5547 * @property # <<<<<<<<<<<<<<
5548 * def memview(self):
5549 * return array.get_memview(self)
5550*/
5551
5552/* Python wrapper */
5553static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
5554static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
5555 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5556 PyObject *__pyx_r = 0;
5557 __Pyx_RefNannyDeclarations
5558 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5559 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5560 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
5561
5562 /* function exit code */
5563 __Pyx_RefNannyFinishContext();
5564 return __pyx_r;
5565}
5566
5567static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
5568 PyObject *__pyx_r = NULL;
5569 __Pyx_RefNannyDeclarations
5570 PyObject *__pyx_t_1 = NULL;
5571 int __pyx_lineno = 0;
5572 const char *__pyx_filename = NULL;
5573 int __pyx_clineno = 0;
5574 __Pyx_RefNannySetupContext("__get__", 0);
5575
5576 /* "View.MemoryView":237
5577 * @property
5578 * def memview(self):
5579 * return array.get_memview(self) # <<<<<<<<<<<<<<
5580 *
5581 *
5582*/
5583 __pyx_t_1 = __pyx_array_get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
5584 __Pyx_GOTREF(__pyx_t_1);
5585 {
5586 PyObject *__pyx_temp;
5587 {
5588 __pyx_temp = __pyx_r;
5589 __pyx_r = __pyx_t_1;
5590 }
5591 __Pyx_XDECREF(__pyx_temp);
5592 }
5593 __pyx_t_1 = 0;
5594 goto __pyx_L0;
5595
5596 /* "View.MemoryView":235
5597 * PyObject_Free(self._shape)
5598 *
5599 * @property # <<<<<<<<<<<<<<
5600 * def memview(self):
5601 * return array.get_memview(self)
5602*/
5603
5604 /* function exit code */
5605 __pyx_L1_error:;
5606 __Pyx_XDECREF(__pyx_t_1);
5607 __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5608 __pyx_r = NULL;
5609 __pyx_L0:;
5610 __Pyx_XGIVEREF(__pyx_r);
5611 __Pyx_RefNannyFinishContext();
5612 return __pyx_r;
5613}
5614
5615/* "View.MemoryView":240
5616 *
5617 *
5618 * @cname('get_memview') # <<<<<<<<<<<<<<
5619 * cdef get_memview(self):
5620 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5621*/
5622
5623static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
5624 int __pyx_v_flags;
5625 PyObject *__pyx_r = NULL;
5626 __Pyx_RefNannyDeclarations
5627 PyObject *__pyx_t_1 = NULL;
5628 PyObject *__pyx_t_2 = NULL;
5629 PyObject *__pyx_t_3 = NULL;
5630 PyObject *__pyx_t_4 = NULL;
5631 size_t __pyx_t_5;
5632 int __pyx_lineno = 0;
5633 const char *__pyx_filename = NULL;
5634 int __pyx_clineno = 0;
5635 __Pyx_RefNannySetupContext("get_memview", 0);
5636
5637 /* "View.MemoryView":242
5638 * @cname('get_memview')
5639 * cdef get_memview(self):
5640 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
5641 * return memoryview(self, flags, self.dtype_is_object)
5642 *
5643*/
5644 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
5645
5646 /* "View.MemoryView":243
5647 * cdef get_memview(self):
5648 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5649 * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
5650 *
5651 * def __len__(self):
5652*/
5653 __pyx_t_2 = NULL;
5654 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 243, __pyx_L1_error)
5655 __Pyx_GOTREF(__pyx_t_3);
5656 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 243, __pyx_L1_error)
5657 __Pyx_GOTREF(__pyx_t_4);
5658 __pyx_t_5 = 1;
5659 {
5660 PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4};
5661 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5662 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5663 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5664 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5665 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
5666 __Pyx_GOTREF((PyObject *)__pyx_t_1);
5667 }
5668 {
5669 PyObject *__pyx_temp;
5670 {
5671 __pyx_temp = __pyx_r;
5672 __pyx_r = ((PyObject *)__pyx_t_1);
5673 }
5674 __Pyx_XDECREF(__pyx_temp);
5675 }
5676 __pyx_t_1 = 0;
5677 goto __pyx_L0;
5678
5679 /* "View.MemoryView":240
5680 *
5681 *
5682 * @cname('get_memview') # <<<<<<<<<<<<<<
5683 * cdef get_memview(self):
5684 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5685*/
5686
5687 /* function exit code */
5688 __pyx_L1_error:;
5689 __Pyx_XDECREF(__pyx_t_1);
5690 __Pyx_XDECREF(__pyx_t_2);
5691 __Pyx_XDECREF(__pyx_t_3);
5692 __Pyx_XDECREF(__pyx_t_4);
5693 __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
5694 __pyx_r = 0;
5695 __pyx_L0:;
5696
5697 __Pyx_XGIVEREF(__pyx_r);
5698 __Pyx_RefNannyFinishContext();
5699 return __pyx_r;
5700}
5701
5702/* "View.MemoryView":245
5703 * return memoryview(self, flags, self.dtype_is_object)
5704 *
5705 * def __len__(self): # <<<<<<<<<<<<<<
5706 * return self._shape[0]
5707 *
5708*/
5709
5710/* Python wrapper */
5711static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
5712static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
5713 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5714 Py_ssize_t __pyx_r;
5715 __Pyx_RefNannyDeclarations
5716 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
5717 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5718 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
5719
5720 /* function exit code */
5721 __Pyx_RefNannyFinishContext();
5722 return __pyx_r;
5723}
5724
5725static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
5726 Py_ssize_t __pyx_r;
5727
5728 /* "View.MemoryView":246
5729 *
5730 * def __len__(self):
5731 * return self._shape[0] # <<<<<<<<<<<<<<
5732 *
5733 * def __getattr__(self, attr):
5734*/
5735 {
5736
5737 __pyx_r = (__pyx_v_self->_shape[0]);
5738 }
5739 goto __pyx_L0;
5740
5741 /* "View.MemoryView":245
5742 * return memoryview(self, flags, self.dtype_is_object)
5743 *
5744 * def __len__(self): # <<<<<<<<<<<<<<
5745 * return self._shape[0]
5746 *
5747*/
5748
5749 /* function exit code */
5750 __pyx_L0:;
5751
5752 return __pyx_r;
5753}
5754
5755/* "View.MemoryView":248
5756 * return self._shape[0]
5757 *
5758 * def __getattr__(self, attr): # <<<<<<<<<<<<<<
5759 * return getattr(self.memview, attr)
5760 *
5761*/
5762
5763/* Python wrapper */
5764static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
5765static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
5766 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5767 PyObject *__pyx_r = 0;
5768 __Pyx_RefNannyDeclarations
5769 __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
5770 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5771 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
5772
5773 /* function exit code */
5774 __Pyx_RefNannyFinishContext();
5775 return __pyx_r;
5776}
5777
5778static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
5779 PyObject *__pyx_r = NULL;
5780 __Pyx_RefNannyDeclarations
5781 PyObject *__pyx_t_1 = NULL;
5782 PyObject *__pyx_t_2 = NULL;
5783 int __pyx_lineno = 0;
5784 const char *__pyx_filename = NULL;
5785 int __pyx_clineno = 0;
5786 __Pyx_RefNannySetupContext("__getattr__", 0);
5787
5788 /* "View.MemoryView":249
5789 *
5790 * def __getattr__(self, attr):
5791 * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
5792 *
5793 * def __getitem__(self, item):
5794*/
5795 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error)
5796 __Pyx_GOTREF(__pyx_t_1);
5797 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
5798 __Pyx_GOTREF(__pyx_t_2);
5799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5800 {
5801 PyObject *__pyx_temp;
5802 {
5803 __pyx_temp = __pyx_r;
5804 __pyx_r = __pyx_t_2;
5805 }
5806 __Pyx_XDECREF(__pyx_temp);
5807 }
5808 __pyx_t_2 = 0;
5809 goto __pyx_L0;
5810
5811 /* "View.MemoryView":248
5812 * return self._shape[0]
5813 *
5814 * def __getattr__(self, attr): # <<<<<<<<<<<<<<
5815 * return getattr(self.memview, attr)
5816 *
5817*/
5818
5819 /* function exit code */
5820 __pyx_L1_error:;
5821 __Pyx_XDECREF(__pyx_t_1);
5822 __Pyx_XDECREF(__pyx_t_2);
5823 __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5824 __pyx_r = NULL;
5825 __pyx_L0:;
5826 __Pyx_XGIVEREF(__pyx_r);
5827 __Pyx_RefNannyFinishContext();
5828 return __pyx_r;
5829}
5830
5831/* "View.MemoryView":251
5832 * return getattr(self.memview, attr)
5833 *
5834 * def __getitem__(self, item): # <<<<<<<<<<<<<<
5835 * return self.memview[item]
5836 *
5837*/
5838
5839/* Python wrapper */
5840static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
5841static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
5842 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5843 PyObject *__pyx_r = 0;
5844 __Pyx_RefNannyDeclarations
5845 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
5846 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5847 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
5848
5849 /* function exit code */
5850 __Pyx_RefNannyFinishContext();
5851 return __pyx_r;
5852}
5853
5854static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
5855 PyObject *__pyx_r = NULL;
5856 __Pyx_RefNannyDeclarations
5857 PyObject *__pyx_t_1 = NULL;
5858 PyObject *__pyx_t_2 = NULL;
5859 int __pyx_lineno = 0;
5860 const char *__pyx_filename = NULL;
5861 int __pyx_clineno = 0;
5862 __Pyx_RefNannySetupContext("__getitem__", 0);
5863
5864 /* "View.MemoryView":252
5865 *
5866 * def __getitem__(self, item):
5867 * return self.memview[item] # <<<<<<<<<<<<<<
5868 *
5869 * def __setitem__(self, item, value):
5870*/
5871 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 252, __pyx_L1_error)
5872 __Pyx_GOTREF(__pyx_t_1);
5873 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
5874 __Pyx_GOTREF(__pyx_t_2);
5875 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5876 {
5877 PyObject *__pyx_temp;
5878 {
5879 __pyx_temp = __pyx_r;
5880 __pyx_r = __pyx_t_2;
5881 }
5882 __Pyx_XDECREF(__pyx_temp);
5883 }
5884 __pyx_t_2 = 0;
5885 goto __pyx_L0;
5886
5887 /* "View.MemoryView":251
5888 * return getattr(self.memview, attr)
5889 *
5890 * def __getitem__(self, item): # <<<<<<<<<<<<<<
5891 * return self.memview[item]
5892 *
5893*/
5894
5895 /* function exit code */
5896 __pyx_L1_error:;
5897 __Pyx_XDECREF(__pyx_t_1);
5898 __Pyx_XDECREF(__pyx_t_2);
5899 __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5900 __pyx_r = NULL;
5901 __pyx_L0:;
5902 __Pyx_XGIVEREF(__pyx_r);
5903 __Pyx_RefNannyFinishContext();
5904 return __pyx_r;
5905}
5906
5907/* "View.MemoryView":254
5908 * return self.memview[item]
5909 *
5910 * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
5911 * self.memview[item] = value
5912 *
5913*/
5914
5915/* Python wrapper */
5916static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
5917static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
5918 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5919 int __pyx_r;
5920 __Pyx_RefNannyDeclarations
5921 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
5922 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5923 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
5924
5925 /* function exit code */
5926 __Pyx_RefNannyFinishContext();
5927 return __pyx_r;
5928}
5929
5930static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
5931 int __pyx_r;
5932 __Pyx_RefNannyDeclarations
5933 PyObject *__pyx_t_1 = NULL;
5934 int __pyx_lineno = 0;
5935 const char *__pyx_filename = NULL;
5936 int __pyx_clineno = 0;
5937 __Pyx_RefNannySetupContext("__setitem__", 0);
5938
5939 /* "View.MemoryView":255
5940 *
5941 * def __setitem__(self, item, value):
5942 * self.memview[item] = value # <<<<<<<<<<<<<<
5943 *
5944 *
5945*/
5946 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 255, __pyx_L1_error)
5947 __Pyx_GOTREF(__pyx_t_1);
5948 if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 255, __pyx_L1_error)
5949 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5950
5951 /* "View.MemoryView":254
5952 * return self.memview[item]
5953 *
5954 * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
5955 * self.memview[item] = value
5956 *
5957*/
5958
5959 /* function exit code */
5960 __pyx_r = 0;
5961 goto __pyx_L0;
5962 __pyx_L1_error:;
5963 __Pyx_XDECREF(__pyx_t_1);
5964 __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5965 __pyx_r = -1;
5966 __pyx_L0:;
5967
5968 __Pyx_RefNannyFinishContext();
5969 return __pyx_r;
5970}
5971
5972/* "(tree fragment)":1
5973 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5974 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
5975 * def __setstate_cython__(self, __pyx_state):
5976*/
5977
5978/* Python wrapper */
5979static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
5980#if CYTHON_VECTORCALL
5981PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5982#else
5983PyObject *__pyx_args, PyObject *__pyx_kwds
5984#endif
5985); /*proto*/
5986static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
5987#if CYTHON_VECTORCALL
5988PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5989#else
5990PyObject *__pyx_args, PyObject *__pyx_kwds
5991#endif
5992) {
5993 #if !CYTHON_VECTORCALL
5994 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5995 #endif
5996 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5997 PyObject *__pyx_r = 0;
5998 __Pyx_RefNannyDeclarations
5999 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6000 #if !CYTHON_VECTORCALL
6001 #if CYTHON_ASSUME_SAFE_SIZE
6002 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6003 #else
6004 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6005 #endif
6006 #endif
6007 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6008 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
6009 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6010 if (unlikely(__pyx_kwds_len < 0)) return NULL;
6011 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
6012 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
6013
6014 /* function exit code */
6015 __Pyx_RefNannyFinishContext();
6016 return __pyx_r;
6017}
6018
6019static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
6020 PyObject *__pyx_r = NULL;
6021 __Pyx_RefNannyDeclarations
6022 int __pyx_lineno = 0;
6023 const char *__pyx_filename = NULL;
6024 int __pyx_clineno = 0;
6025 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6026
6027 /* "(tree fragment)":2
6028 * def __reduce_cython__(self):
6029 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6030 * def __setstate_cython__(self, __pyx_state):
6031 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6032*/
6033 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6034 __PYX_ERR(1, 2, __pyx_L1_error)
6035
6036 /* "(tree fragment)":1
6037 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6038 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6039 * def __setstate_cython__(self, __pyx_state):
6040*/
6041
6042 /* function exit code */
6043 __pyx_L1_error:;
6044 __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6045 __pyx_r = NULL;
6046 __Pyx_XGIVEREF(__pyx_r);
6047 __Pyx_RefNannyFinishContext();
6048 return __pyx_r;
6049}
6050
6051/* "(tree fragment)":3
6052 * def __reduce_cython__(self):
6053 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6054 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6055 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6056*/
6057
6058/* Python wrapper */
6059static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6060#if CYTHON_VECTORCALL
6061PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6062#else
6063PyObject *__pyx_args, PyObject *__pyx_kwds
6064#endif
6065); /*proto*/
6066static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6067#if CYTHON_VECTORCALL
6068PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6069#else
6070PyObject *__pyx_args, PyObject *__pyx_kwds
6071#endif
6072) {
6073 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6074 #if !CYTHON_VECTORCALL
6075 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6076 #endif
6077 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6078 PyObject* values[1] = {0};
6079 int __pyx_lineno = 0;
6080 const char *__pyx_filename = NULL;
6081 int __pyx_clineno = 0;
6082 PyObject *__pyx_r = 0;
6083 __Pyx_RefNannyDeclarations
6084 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6085 #if !CYTHON_VECTORCALL
6086 #if CYTHON_ASSUME_SAFE_SIZE
6087 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6088 #else
6089 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6090 #endif
6091 #endif
6092 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6093 {
6094 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
6095 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6096 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
6097 if (__pyx_kwds_len > 0) {
6098 switch (__pyx_nargs) {
6099 case 1:
6100 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6101 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6102 CYTHON_FALLTHROUGH;
6103 case 0: break;
6104 default: goto __pyx_L5_argtuple_error;
6105 }
6106 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6107 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
6108 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6109 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
6110 }
6111 } else if (unlikely(__pyx_nargs != 1)) {
6112 goto __pyx_L5_argtuple_error;
6113 } else {
6114 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6115 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6116 }
6117 __pyx_v___pyx_state = values[0];
6118 }
6119 goto __pyx_L6_skip;
6120 __pyx_L5_argtuple_error:;
6121 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6122 __pyx_L6_skip:;
6123 goto __pyx_L4_argument_unpacking_done;
6124 __pyx_L3_error:;
6125 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6126 Py_XDECREF(values[__pyx_temp]);
6127 }
6128 __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6129 __Pyx_RefNannyFinishContext();
6130 return NULL;
6131 __pyx_L4_argument_unpacking_done:;
6132 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
6133
6134 /* function exit code */
6135 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6136 Py_XDECREF(values[__pyx_temp]);
6137 }
6138 __Pyx_RefNannyFinishContext();
6139 return __pyx_r;
6140}
6141
6142static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6143 PyObject *__pyx_r = NULL;
6144 __Pyx_RefNannyDeclarations
6145 int __pyx_lineno = 0;
6146 const char *__pyx_filename = NULL;
6147 int __pyx_clineno = 0;
6148 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6149
6150 /* "(tree fragment)":4
6151 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6152 * def __setstate_cython__(self, __pyx_state):
6153 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6154*/
6155 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6156 __PYX_ERR(1, 4, __pyx_L1_error)
6157
6158 /* "(tree fragment)":3
6159 * def __reduce_cython__(self):
6160 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6161 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6162 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6163*/
6164
6165 /* function exit code */
6166 __pyx_L1_error:;
6167 __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6168 __pyx_r = NULL;
6169 __Pyx_XGIVEREF(__pyx_r);
6170 __Pyx_RefNannyFinishContext();
6171 return __pyx_r;
6172}
6173
6174/* "View.MemoryView":264
6175 * pass
6176 *
6177 * @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
6178 * cdef int _allocate_buffer(array self) except -1:
6179 *
6180*/
6181
6182static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
6183 Py_ssize_t __pyx_v_i;
6184 PyObject **__pyx_v_p;
6185 int __pyx_r;
6186 int __pyx_t_1;
6187 Py_ssize_t __pyx_t_2;
6188 Py_ssize_t __pyx_t_3;
6189 Py_ssize_t __pyx_t_4;
6190 int __pyx_lineno = 0;
6191 const char *__pyx_filename = NULL;
6192 int __pyx_clineno = 0;
6193
6194 /* "View.MemoryView":271
6195 * cdef PyObject **p
6196 *
6197 * self.free_data = True # <<<<<<<<<<<<<<
6198 * self.data = <char *>malloc(<size_t> self.len)
6199 * if not self.data:
6200*/
6201 __pyx_v_self->free_data = 1;
6202
6203 /* "View.MemoryView":272
6204 *
6205 * self.free_data = True
6206 * self.data = <char *>malloc(<size_t> self.len) # <<<<<<<<<<<<<<
6207 * if not self.data:
6208 * raise MemoryError, "unable to allocate array data."
6209*/
6210 __pyx_v_self->data = ((char *)malloc(((size_t)__pyx_v_self->len)));
6211
6212 /* "View.MemoryView":273
6213 * self.free_data = True
6214 * self.data = <char *>malloc(<size_t> self.len)
6215 * if not self.data: # <<<<<<<<<<<<<<
6216 * raise MemoryError, "unable to allocate array data."
6217 *
6218*/
6219 __pyx_t_1 = (!(__pyx_v_self->data != 0));
6220
6221 if (unlikely(__pyx_t_1)) {
6222
6223
6224 /* "View.MemoryView":274
6225 * self.data = <char *>malloc(<size_t> self.len)
6226 * if not self.data:
6227 * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
6228 *
6229 * if self.dtype_is_object:
6230*/
6231 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_array_data, 0, 0);
6232 __PYX_ERR(1, 274, __pyx_L1_error)
6233
6234 /* "View.MemoryView":273
6235 * self.free_data = True
6236 * self.data = <char *>malloc(<size_t> self.len)
6237 * if not self.data: # <<<<<<<<<<<<<<
6238 * raise MemoryError, "unable to allocate array data."
6239 *
6240*/
6241 }
6242
6243 /* "View.MemoryView":276
6244 * raise MemoryError, "unable to allocate array data."
6245 *
6246 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6247 * p = <PyObject **> self.data
6248 * for i in range(self.len // self.itemsize):
6249*/
6250 if (__pyx_v_self->dtype_is_object) {
6251
6252 /* "View.MemoryView":277
6253 *
6254 * if self.dtype_is_object:
6255 * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6256 * for i in range(self.len // self.itemsize):
6257 * p[i] = Py_None
6258*/
6259 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6260
6261 /* "View.MemoryView":278
6262 * if self.dtype_is_object:
6263 * p = <PyObject **> self.data
6264 * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
6265 * p[i] = Py_None
6266 * Py_INCREF(Py_None)
6267*/
6268 if (unlikely(__pyx_v_self->itemsize == 0)) {
6269 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6270 __PYX_ERR(1, 278, __pyx_L1_error)
6271 }
6272 else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6273 PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6274 __PYX_ERR(1, 278, __pyx_L1_error)
6275 }
6276
6277 __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize, 0);
6278 __pyx_t_3 = __pyx_t_2;
6279
6280 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6281 __pyx_v_i = __pyx_t_4;
6282
6283 /* "View.MemoryView":279
6284 * p = <PyObject **> self.data
6285 * for i in range(self.len // self.itemsize):
6286 * p[i] = Py_None # <<<<<<<<<<<<<<
6287 * Py_INCREF(Py_None)
6288 * return 0
6289*/
6290 (__pyx_v_p[__pyx_v_i]) = Py_None;
6291
6292 /* "View.MemoryView":280
6293 * for i in range(self.len // self.itemsize):
6294 * p[i] = Py_None
6295 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6296 * return 0
6297 *
6298*/
6299 Py_INCREF(Py_None);
6300 }
6301
6302
6303 /* "View.MemoryView":276
6304 * raise MemoryError, "unable to allocate array data."
6305 *
6306 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6307 * p = <PyObject **> self.data
6308 * for i in range(self.len // self.itemsize):
6309*/
6310 }
6311
6312 /* "View.MemoryView":281
6313 * p[i] = Py_None
6314 * Py_INCREF(Py_None)
6315 * return 0 # <<<<<<<<<<<<<<
6316 *
6317 *
6318*/
6319 {
6320
6321 __pyx_r = 0;
6322 }
6323 goto __pyx_L0;
6324
6325 /* "View.MemoryView":264
6326 * pass
6327 *
6328 * @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
6329 * cdef int _allocate_buffer(array self) except -1:
6330 *
6331*/
6332
6333 /* function exit code */
6334 __pyx_L1_error:;
6335 __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6336 __pyx_r = -1;
6337 __pyx_L0:;
6338
6339
6340
6341 return __pyx_r;
6342}
6343
6344/* "View.MemoryView":284
6345 *
6346 *
6347 * @cname("__pyx_array_new") # <<<<<<<<<<<<<<
6348 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6349 * cdef array result
6350*/
6351
6352static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char const *__pyx_v_c_mode, char *__pyx_v_buf) {
6353 struct __pyx_array_obj *__pyx_v_result = 0;
6354 PyObject *__pyx_v_mode = 0;
6355 struct __pyx_array_obj *__pyx_r = NULL;
6356 __Pyx_RefNannyDeclarations
6357 PyObject *__pyx_t_1 = NULL;
6358 int __pyx_t_2;
6359 PyObject *__pyx_t_3 = NULL;
6360 PyObject *__pyx_t_4 = NULL;
6361 int __pyx_lineno = 0;
6362 const char *__pyx_filename = NULL;
6363 int __pyx_clineno = 0;
6364 __Pyx_RefNannySetupContext("array_cwrapper", 0);
6365
6366 /* "View.MemoryView":287
6367 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6368 * cdef array result
6369 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
6370 *
6371 * if buf is NULL:
6372*/
6373 __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
6374
6375 if (__pyx_t_2) {
6376 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
6377 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
6378 } else {
6379 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
6380 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
6381 }
6382
6383 __pyx_v_mode = ((PyObject*)__pyx_t_1);
6384 __pyx_t_1 = 0;
6385
6386 /* "View.MemoryView":289
6387 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6388 *
6389 * if buf is NULL: # <<<<<<<<<<<<<<
6390 * result = array.__new__(array, shape, itemsize, format, mode)
6391 * else:
6392*/
6393 __pyx_t_2 = (__pyx_v_buf == NULL);
6394
6395 if (__pyx_t_2) {
6396
6397
6398 /* "View.MemoryView":290
6399 *
6400 * if buf is NULL:
6401 * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
6402 * else:
6403 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6404*/
6405 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
6406 __Pyx_GOTREF(__pyx_t_1);
6407 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
6408 __Pyx_GOTREF(__pyx_t_3);
6409 __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 290, __pyx_L1_error)
6410 __Pyx_GOTREF(__pyx_t_4);
6411 __Pyx_INCREF(__pyx_v_shape);
6412 __Pyx_GIVEREF(__pyx_v_shape);
6413 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6414 __Pyx_GIVEREF(__pyx_t_1);
6415 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6416 __Pyx_GIVEREF(__pyx_t_3);
6417 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6418 __Pyx_INCREF(__pyx_v_mode);
6419 __Pyx_GIVEREF(__pyx_v_mode);
6420 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6421 __pyx_t_1 = 0;
6422 __pyx_t_3 = 0;
6423 __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
6424 __Pyx_GOTREF(__pyx_t_3);
6425 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6426 __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6427 __pyx_t_3 = 0;
6428
6429 /* "View.MemoryView":289
6430 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6431 *
6432 * if buf is NULL: # <<<<<<<<<<<<<<
6433 * result = array.__new__(array, shape, itemsize, format, mode)
6434 * else:
6435*/
6436 goto __pyx_L3;
6437 }
6438
6439 /* "View.MemoryView":292
6440 * result = array.__new__(array, shape, itemsize, format, mode)
6441 * else:
6442 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
6443 * result.data = buf
6444 *
6445*/
6446 /*else*/ {
6447 __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
6448 __Pyx_GOTREF(__pyx_t_3);
6449 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6450 __Pyx_GOTREF(__pyx_t_4);
6451 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
6452 __Pyx_GOTREF(__pyx_t_1);
6453 __Pyx_INCREF(__pyx_v_shape);
6454 __Pyx_GIVEREF(__pyx_v_shape);
6455 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6456 __Pyx_GIVEREF(__pyx_t_3);
6457 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6458 __Pyx_GIVEREF(__pyx_t_4);
6459 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6460 __Pyx_INCREF(__pyx_v_mode);
6461 __Pyx_GIVEREF(__pyx_v_mode);
6462 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6463 __pyx_t_3 = 0;
6464 __pyx_t_4 = 0;
6465 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6466 __Pyx_GOTREF(__pyx_t_4);
6467 if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_allocate_buffer, Py_False) < (0)) __PYX_ERR(1, 292, __pyx_L1_error)
6468 __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
6469 __Pyx_GOTREF(__pyx_t_3);
6470 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6471 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6472 __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6473 __pyx_t_3 = 0;
6474
6475 /* "View.MemoryView":293
6476 * else:
6477 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6478 * result.data = buf # <<<<<<<<<<<<<<
6479 *
6480 * return result
6481*/
6482 __pyx_v_result->data = __pyx_v_buf;
6483 }
6484 __pyx_L3:;
6485
6486 /* "View.MemoryView":295
6487 * result.data = buf
6488 *
6489 * return result # <<<<<<<<<<<<<<
6490 *
6491 *
6492*/
6493 {
6494 struct __pyx_array_obj *__pyx_temp;
6495 {
6496 __pyx_temp = __pyx_r;
6497 __Pyx_INCREF((PyObject *)__pyx_v_result);
6498 __pyx_r = __pyx_v_result;
6499 }
6500 __Pyx_XDECREF((PyObject *)__pyx_temp);
6501 }
6502 goto __pyx_L0;
6503
6504 /* "View.MemoryView":284
6505 *
6506 *
6507 * @cname("__pyx_array_new") # <<<<<<<<<<<<<<
6508 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6509 * cdef array result
6510*/
6511
6512 /* function exit code */
6513 __pyx_L1_error:;
6514 __Pyx_XDECREF(__pyx_t_1);
6515 __Pyx_XDECREF(__pyx_t_3);
6516 __Pyx_XDECREF(__pyx_t_4);
6517 __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
6518 __pyx_r = 0;
6519 __pyx_L0:;
6520 __Pyx_XDECREF((PyObject *)__pyx_v_result);
6521 __Pyx_XDECREF(__pyx_v_mode);
6522 __Pyx_XGIVEREF((PyObject *)__pyx_r);
6523 __Pyx_RefNannyFinishContext();
6524 return __pyx_r;
6525}
6526
6527/* "View.MemoryView":321
6528 * cdef class Enum(object):
6529 * cdef object name
6530 * def __init__(self, name): # <<<<<<<<<<<<<<
6531 * self.name = name
6532 * def __repr__(self):
6533*/
6534
6535/* Python wrapper */
6536static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6537#if CYTHON_VECTORCALL_TPNEW
6538PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6539#else
6540PyObject *__pyx_args, PyObject *__pyx_kwds
6541#endif
6542); /*proto*/
6543static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6544#if CYTHON_VECTORCALL_TPNEW
6545PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6546#else
6547PyObject *__pyx_args, PyObject *__pyx_kwds
6548#endif
6549) {
6550 PyObject *__pyx_v_name = 0;
6551 #if !CYTHON_VECTORCALL_TPNEW
6552 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6553 #endif
6554 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6555 PyObject* values[1] = {0};
6556 int __pyx_lineno = 0;
6557 const char *__pyx_filename = NULL;
6558 int __pyx_clineno = 0;
6559 int __pyx_r;
6560 __Pyx_RefNannyDeclarations
6561 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
6562 #if !CYTHON_VECTORCALL_TPNEW
6563 #if CYTHON_ASSUME_SAFE_SIZE
6564 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6565 #else
6566 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
6567 #endif
6568 #endif
6569 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
6570 {
6571 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
6572 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
6573 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 321, __pyx_L3_error)
6574 if (__pyx_kwds_len > 0) {
6575 switch (__pyx_nargs) {
6576 case 1:
6577 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6578 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6579 CYTHON_FALLTHROUGH;
6580 case 0: break;
6581 default: goto __pyx_L5_argtuple_error;
6582 }
6583 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6584 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(1, 321, __pyx_L3_error)
6585 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6586 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(1, 321, __pyx_L3_error) }
6587 }
6588 } else if (unlikely(__pyx_nargs != 1)) {
6589 goto __pyx_L5_argtuple_error;
6590 } else {
6591 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6592 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6593 }
6594 __pyx_v_name = values[0];
6595 }
6596 goto __pyx_L6_skip;
6597 __pyx_L5_argtuple_error:;
6598 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 321, __pyx_L3_error)
6599 __pyx_L6_skip:;
6600 goto __pyx_L4_argument_unpacking_done;
6601 __pyx_L3_error:;
6602 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6603 Py_XDECREF(values[__pyx_temp]);
6604 }
6605 __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6606 __Pyx_RefNannyFinishContext();
6607 return -1;
6608 __pyx_L4_argument_unpacking_done:;
6609 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
6610
6611 /* function exit code */
6612 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6613 Py_XDECREF(values[__pyx_temp]);
6614 }
6615 __Pyx_RefNannyFinishContext();
6616 return __pyx_r;
6617}
6618
6619static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
6620 int __pyx_r;
6621 __Pyx_RefNannyDeclarations
6622 __Pyx_RefNannySetupContext("__init__", 0);
6623
6624 /* "View.MemoryView":322
6625 * cdef object name
6626 * def __init__(self, name):
6627 * self.name = name # <<<<<<<<<<<<<<
6628 * def __repr__(self):
6629 * return self.name
6630*/
6631 __Pyx_INCREF(__pyx_v_name);
6632 __Pyx_GIVEREF(__pyx_v_name);
6633 __Pyx_GOTREF(__pyx_v_self->name);
6634 __Pyx_DECREF(__pyx_v_self->name);
6635 __pyx_v_self->name = __pyx_v_name;
6636
6637 /* "View.MemoryView":321
6638 * cdef class Enum(object):
6639 * cdef object name
6640 * def __init__(self, name): # <<<<<<<<<<<<<<
6641 * self.name = name
6642 * def __repr__(self):
6643*/
6644
6645 /* function exit code */
6646 __pyx_r = 0;
6647
6648 __Pyx_RefNannyFinishContext();
6649 return __pyx_r;
6650}
6651
6652/* "View.MemoryView":323
6653 * def __init__(self, name):
6654 * self.name = name
6655 * def __repr__(self): # <<<<<<<<<<<<<<
6656 * return self.name
6657 *
6658*/
6659
6660/* Python wrapper */
6661static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
6662static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
6663 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6664 PyObject *__pyx_r = 0;
6665 __Pyx_RefNannyDeclarations
6666 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
6667 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6668 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6669
6670 /* function exit code */
6671 __Pyx_RefNannyFinishContext();
6672 return __pyx_r;
6673}
6674
6675static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6676 PyObject *__pyx_r = NULL;
6677 __Pyx_RefNannyDeclarations
6678 __Pyx_RefNannySetupContext("__repr__", 0);
6679
6680 /* "View.MemoryView":324
6681 * self.name = name
6682 * def __repr__(self):
6683 * return self.name # <<<<<<<<<<<<<<
6684 *
6685 * cdef generic = Enum("<strided and direct or indirect>")
6686*/
6687 {
6688 PyObject *__pyx_temp;
6689 {
6690 __pyx_temp = __pyx_r;
6691 __Pyx_INCREF(__pyx_v_self->name);
6692 __pyx_r = __pyx_v_self->name;
6693 }
6694 __Pyx_XDECREF(__pyx_temp);
6695 }
6696 goto __pyx_L0;
6697
6698 /* "View.MemoryView":323
6699 * def __init__(self, name):
6700 * self.name = name
6701 * def __repr__(self): # <<<<<<<<<<<<<<
6702 * return self.name
6703 *
6704*/
6705
6706 /* function exit code */
6707 __pyx_L0:;
6708 __Pyx_XGIVEREF(__pyx_r);
6709 __Pyx_RefNannyFinishContext();
6710 return __pyx_r;
6711}
6712
6713/* "(tree fragment)":1
6714 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6715 * cdef tuple state
6716 * cdef object _dict
6717*/
6718
6719/* Python wrapper */
6720static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
6721#if CYTHON_VECTORCALL
6722PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6723#else
6724PyObject *__pyx_args, PyObject *__pyx_kwds
6725#endif
6726); /*proto*/
6727static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
6728#if CYTHON_VECTORCALL
6729PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6730#else
6731PyObject *__pyx_args, PyObject *__pyx_kwds
6732#endif
6733) {
6734 #if !CYTHON_VECTORCALL
6735 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6736 #endif
6737 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6738 PyObject *__pyx_r = 0;
6739 __Pyx_RefNannyDeclarations
6740 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6741 #if !CYTHON_VECTORCALL
6742 #if CYTHON_ASSUME_SAFE_SIZE
6743 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6744 #else
6745 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6746 #endif
6747 #endif
6748 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6749 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
6750 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6751 if (unlikely(__pyx_kwds_len < 0)) return NULL;
6752 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
6753 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6754
6755 /* function exit code */
6756 __Pyx_RefNannyFinishContext();
6757 return __pyx_r;
6758}
6759
6760static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6761 PyObject *__pyx_v_state = 0;
6762 PyObject *__pyx_v__dict = 0;
6763 int __pyx_v_use_setstate;
6764 PyObject *__pyx_r = NULL;
6765 __Pyx_RefNannyDeclarations
6766 PyObject *__pyx_t_1 = NULL;
6767 PyObject *__pyx_t_2 = NULL;
6768 int __pyx_t_3;
6769 int __pyx_t_4;
6770 PyObject *__pyx_t_5 = NULL;
6771 int __pyx_lineno = 0;
6772 const char *__pyx_filename = NULL;
6773 int __pyx_clineno = 0;
6774 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6775
6776 /* "(tree fragment)":5
6777 * cdef object _dict
6778 * cdef bint use_setstate
6779 * with CRITICAL_SECTION(self): # <<<<<<<<<<<<<<
6780 * state = (self.name,)
6781 * _dict = getattr(self, '__dict__', None)
6782*/
6783 {
6784 __Pyx_PyCriticalSection __pyx_cs;
6785 __pyx_t_1 = ((PyObject *)__pyx_v_self);
6786 __Pyx_INCREF(__pyx_t_1);
6787 __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
6788 /*try:*/ {
6789
6790 /* "(tree fragment)":6
6791 * cdef bint use_setstate
6792 * with CRITICAL_SECTION(self):
6793 * state = (self.name,) # <<<<<<<<<<<<<<
6794 * _dict = getattr(self, '__dict__', None)
6795 * if _dict is not None and _dict:
6796*/
6797 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L4_error)
6798 __Pyx_GOTREF(__pyx_t_2);
6799 __Pyx_INCREF(__pyx_v_self->name);
6800 __Pyx_GIVEREF(__pyx_v_self->name);
6801 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name) != (0)) __PYX_ERR(1, 6, __pyx_L4_error);
6802 __pyx_v_state = ((PyObject*)__pyx_t_2);
6803 __pyx_t_2 = 0;
6804
6805 /* "(tree fragment)":7
6806 * with CRITICAL_SECTION(self):
6807 * state = (self.name,)
6808 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
6809 * if _dict is not None and _dict:
6810 * state += (_dict,)
6811*/
6812 __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L4_error)
6813 __Pyx_GOTREF(__pyx_t_2);
6814 __pyx_v__dict = __pyx_t_2;
6815 __pyx_t_2 = 0;
6816 }
6817
6818 /* "(tree fragment)":5
6819 * cdef object _dict
6820 * cdef bint use_setstate
6821 * with CRITICAL_SECTION(self): # <<<<<<<<<<<<<<
6822 * state = (self.name,)
6823 * _dict = getattr(self, '__dict__', None)
6824*/
6825 /*finally:*/ {
6826 /*normal exit:*/{
6827 __Pyx_PyCriticalSection_End(&__pyx_cs);
6828 goto __pyx_L5;
6829 }
6830 __pyx_L4_error: {
6831 __Pyx_PyCriticalSection_End(&__pyx_cs);
6832 goto __pyx_L1_error;
6833 }
6834 __pyx_L5:;
6835 }
6836 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6837 }
6838
6839 /* "(tree fragment)":8
6840 * state = (self.name,)
6841 * _dict = getattr(self, '__dict__', None)
6842 * if _dict is not None and _dict: # <<<<<<<<<<<<<<
6843 * state += (_dict,)
6844 * use_setstate = True
6845*/
6846 __pyx_t_4 = (__pyx_v__dict != Py_None);
6847 if (__pyx_t_4) {
6848
6849 } else {
6850
6851 __pyx_t_3 = __pyx_t_4;
6852
6853 goto __pyx_L7_bool_binop_done;
6854 }
6855 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 8, __pyx_L1_error)
6856
6857 __pyx_t_3 = __pyx_t_4;
6858
6859 __pyx_L7_bool_binop_done:;
6860 if (__pyx_t_3) {
6861
6862
6863 /* "(tree fragment)":9
6864 * _dict = getattr(self, '__dict__', None)
6865 * if _dict is not None and _dict:
6866 * state += (_dict,) # <<<<<<<<<<<<<<
6867 * use_setstate = True
6868 * else:
6869*/
6870 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
6871 __Pyx_GOTREF(__pyx_t_1);
6872 __Pyx_INCREF(__pyx_v__dict);
6873 __Pyx_GIVEREF(__pyx_v__dict);
6874 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 9, __pyx_L1_error);
6875 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
6876 __Pyx_GOTREF(__pyx_t_2);
6877 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6878 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
6879 __pyx_t_2 = 0;
6880
6881 /* "(tree fragment)":10
6882 * if _dict is not None and _dict:
6883 * state += (_dict,)
6884 * use_setstate = True # <<<<<<<<<<<<<<
6885 * else:
6886 * use_setstate = self.name is not None
6887*/
6888 __pyx_v_use_setstate = 1;
6889
6890 /* "(tree fragment)":8
6891 * state = (self.name,)
6892 * _dict = getattr(self, '__dict__', None)
6893 * if _dict is not None and _dict: # <<<<<<<<<<<<<<
6894 * state += (_dict,)
6895 * use_setstate = True
6896*/
6897 goto __pyx_L6;
6898 }
6899
6900 /* "(tree fragment)":12
6901 * use_setstate = True
6902 * else:
6903 * use_setstate = self.name is not None # <<<<<<<<<<<<<<
6904 * if use_setstate:
6905 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
6906*/
6907 /*else*/ {
6908 __pyx_t_3 = (__pyx_v_self->name != Py_None);
6909 __pyx_v_use_setstate = __pyx_t_3;
6910 }
6911 __pyx_L6:;
6912
6913 /* "(tree fragment)":13
6914 * else:
6915 * use_setstate = self.name is not None
6916 * if use_setstate: # <<<<<<<<<<<<<<
6917 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
6918 * else:
6919*/
6920 if (__pyx_v_use_setstate) {
6921
6922 /* "(tree fragment)":14
6923 * use_setstate = self.name is not None
6924 * if use_setstate:
6925 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
6926 * else:
6927 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
6928*/
6929 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
6930 __Pyx_GOTREF(__pyx_t_2);
6931 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6932 __Pyx_GOTREF(__pyx_t_1);
6933 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6934 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6935 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6936 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
6937 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
6938 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6939 __Pyx_INCREF(Py_None);
6940 __Pyx_GIVEREF(Py_None);
6941 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6942 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
6943 __Pyx_GOTREF(__pyx_t_5);
6944 __Pyx_GIVEREF(__pyx_t_2);
6945 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6946 __Pyx_GIVEREF(__pyx_t_1);
6947 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6948 __Pyx_INCREF(__pyx_v_state);
6949 __Pyx_GIVEREF(__pyx_v_state);
6950 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
6951 __pyx_t_2 = 0;
6952 __pyx_t_1 = 0;
6953 {
6954 PyObject *__pyx_temp;
6955 {
6956 __pyx_temp = __pyx_r;
6957 __pyx_r = __pyx_t_5;
6958 }
6959 __Pyx_XDECREF(__pyx_temp);
6960 }
6961 __pyx_t_5 = 0;
6962 goto __pyx_L0;
6963
6964 /* "(tree fragment)":13
6965 * else:
6966 * use_setstate = self.name is not None
6967 * if use_setstate: # <<<<<<<<<<<<<<
6968 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
6969 * else:
6970*/
6971 }
6972
6973 /* "(tree fragment)":16
6974 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
6975 * else:
6976 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
6977 * def __setstate_cython__(self, __pyx_state):
6978 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
6979*/
6980 /*else*/ {
6981 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 16, __pyx_L1_error)
6982 __Pyx_GOTREF(__pyx_t_5);
6983 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
6984 __Pyx_GOTREF(__pyx_t_1);
6985 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6986 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6987 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
6988 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
6989 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
6990 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
6991 __Pyx_INCREF(__pyx_v_state);
6992 __Pyx_GIVEREF(__pyx_v_state);
6993 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
6994 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
6995 __Pyx_GOTREF(__pyx_t_2);
6996 __Pyx_GIVEREF(__pyx_t_5);
6997 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
6998 __Pyx_GIVEREF(__pyx_t_1);
6999 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7000 __pyx_t_5 = 0;
7001 __pyx_t_1 = 0;
7002 {
7003 PyObject *__pyx_temp;
7004 {
7005 __pyx_temp = __pyx_r;
7006 __pyx_r = __pyx_t_2;
7007 }
7008 __Pyx_XDECREF(__pyx_temp);
7009 }
7010 __pyx_t_2 = 0;
7011 goto __pyx_L0;
7012 }
7013
7014 /* "(tree fragment)":1
7015 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7016 * cdef tuple state
7017 * cdef object _dict
7018*/
7019
7020 /* function exit code */
7021 __pyx_L1_error:;
7022 __Pyx_XDECREF(__pyx_t_1);
7023 __Pyx_XDECREF(__pyx_t_2);
7024 __Pyx_XDECREF(__pyx_t_5);
7025 __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7026 __pyx_r = NULL;
7027 __pyx_L0:;
7028 __Pyx_XDECREF(__pyx_v_state);
7029 __Pyx_XDECREF(__pyx_v__dict);
7030
7031 __Pyx_XGIVEREF(__pyx_r);
7032 __Pyx_RefNannyFinishContext();
7033 return __pyx_r;
7034}
7035
7036/* "(tree fragment)":17
7037 * else:
7038 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7039 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7040 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7041*/
7042
7043/* Python wrapper */
7044static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7045#if CYTHON_VECTORCALL
7046PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7047#else
7048PyObject *__pyx_args, PyObject *__pyx_kwds
7049#endif
7050); /*proto*/
7051static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7052#if CYTHON_VECTORCALL
7053PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7054#else
7055PyObject *__pyx_args, PyObject *__pyx_kwds
7056#endif
7057) {
7058 PyObject *__pyx_v___pyx_state = 0;
7059 #if !CYTHON_VECTORCALL
7060 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7061 #endif
7062 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7063 PyObject* values[1] = {0};
7064 int __pyx_lineno = 0;
7065 const char *__pyx_filename = NULL;
7066 int __pyx_clineno = 0;
7067 PyObject *__pyx_r = 0;
7068 __Pyx_RefNannyDeclarations
7069 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7070 #if !CYTHON_VECTORCALL
7071 #if CYTHON_ASSUME_SAFE_SIZE
7072 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7073 #else
7074 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7075 #endif
7076 #endif
7077 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7078 {
7079 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
7080 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7081 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 17, __pyx_L3_error)
7082 if (__pyx_kwds_len > 0) {
7083 switch (__pyx_nargs) {
7084 case 1:
7085 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7086 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7087 CYTHON_FALLTHROUGH;
7088 case 0: break;
7089 default: goto __pyx_L5_argtuple_error;
7090 }
7091 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7092 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 17, __pyx_L3_error)
7093 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
7094 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 17, __pyx_L3_error) }
7095 }
7096 } else if (unlikely(__pyx_nargs != 1)) {
7097 goto __pyx_L5_argtuple_error;
7098 } else {
7099 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7100 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7101 }
7102 __pyx_v___pyx_state = values[0];
7103 }
7104 goto __pyx_L6_skip;
7105 __pyx_L5_argtuple_error:;
7106 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 17, __pyx_L3_error)
7107 __pyx_L6_skip:;
7108 goto __pyx_L4_argument_unpacking_done;
7109 __pyx_L3_error:;
7110 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7111 Py_XDECREF(values[__pyx_temp]);
7112 }
7113 __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7114 __Pyx_RefNannyFinishContext();
7115 return NULL;
7116 __pyx_L4_argument_unpacking_done:;
7117 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
7118
7119 /* function exit code */
7120 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7121 Py_XDECREF(values[__pyx_temp]);
7122 }
7123 __Pyx_RefNannyFinishContext();
7124 return __pyx_r;
7125}
7126
7127static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7128 PyObject *__pyx_r = NULL;
7129 __Pyx_RefNannyDeclarations
7130 PyObject *__pyx_t_1 = NULL;
7131 PyObject *__pyx_t_2 = NULL;
7132 int __pyx_lineno = 0;
7133 const char *__pyx_filename = NULL;
7134 int __pyx_clineno = 0;
7135 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7136
7137 /* "(tree fragment)":18
7138 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7139 * def __setstate_cython__(self, __pyx_state):
7140 * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
7141*/
7142 __pyx_t_1 = __pyx_v___pyx_state;
7143 __Pyx_INCREF(__pyx_t_1);
7144 if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 18, __pyx_L1_error)
7145 if (unlikely(__pyx_t_1 == Py_None)) {
7146 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
7147 __PYX_ERR(1, 18, __pyx_L1_error)
7148 }
7149 __pyx_t_2 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 18, __pyx_L1_error)
7150 __Pyx_GOTREF(__pyx_t_2);
7151 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7152 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7153
7154 /* "(tree fragment)":17
7155 * else:
7156 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7157 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7158 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7159*/
7160
7161 /* function exit code */
7162 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7163 goto __pyx_L0;
7164 __pyx_L1_error:;
7165 __Pyx_XDECREF(__pyx_t_1);
7166 __Pyx_XDECREF(__pyx_t_2);
7167 __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7168 __pyx_r = NULL;
7169 __pyx_L0:;
7170 __Pyx_XGIVEREF(__pyx_r);
7171 __Pyx_RefNannyFinishContext();
7172 return __pyx_r;
7173}
7174
7175/* "View.MemoryView":367
7176 * cdef const __Pyx_TypeInfo *typeinfo
7177 *
7178 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7179 * self.obj = obj
7180 * self.flags = flags
7181*/
7182
7183/* Python wrapper */
7184static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7185#if CYTHON_VECTORCALL_TPNEW
7186PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7187#else
7188PyObject *__pyx_args, PyObject *__pyx_kwds
7189#endif
7190); /*proto*/
7191static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7192#if CYTHON_VECTORCALL_TPNEW
7193PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7194#else
7195PyObject *__pyx_args, PyObject *__pyx_kwds
7196#endif
7197) {
7198 PyObject *__pyx_v_obj = 0;
7199 int __pyx_v_flags;
7200 int __pyx_v_dtype_is_object;
7201 #if !CYTHON_VECTORCALL_TPNEW
7202 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7203 #endif
7204 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7205 PyObject* values[3] = {0,0,0};
7206 int __pyx_lineno = 0;
7207 const char *__pyx_filename = NULL;
7208 int __pyx_clineno = 0;
7209 int __pyx_r;
7210 __Pyx_RefNannyDeclarations
7211 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7212 #if !CYTHON_VECTORCALL_TPNEW
7213 #if CYTHON_ASSUME_SAFE_SIZE
7214 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7215 #else
7216 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7217 #endif
7218 #endif
7219 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
7220 {
7221 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_obj,&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_dtype_is_object,0};
7222 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
7223 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 367, __pyx_L3_error)
7224 if (__pyx_kwds_len > 0) {
7225 switch (__pyx_nargs) {
7226 case 3:
7227 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7228 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7229 CYTHON_FALLTHROUGH;
7230 case 2:
7231 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7232 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7233 CYTHON_FALLTHROUGH;
7234 case 1:
7235 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7236 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7237 CYTHON_FALLTHROUGH;
7238 case 0: break;
7239 default: goto __pyx_L5_argtuple_error;
7240 }
7241 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7242 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(1, 367, __pyx_L3_error)
7243 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
7244 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, i); __PYX_ERR(1, 367, __pyx_L3_error) }
7245 }
7246 } else {
7247 switch (__pyx_nargs) {
7248 case 3:
7249 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7250 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7251 CYTHON_FALLTHROUGH;
7252 case 2:
7253 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7254 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7255 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7256 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7257 break;
7258 default: goto __pyx_L5_argtuple_error;
7259 }
7260 }
7261 __pyx_v_obj = values[0];
7262 __pyx_v_flags = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 367, __pyx_L3_error)
7263 if (values[2]) {
7264 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 367, __pyx_L3_error)
7265 } else {
7266 __pyx_v_dtype_is_object = ((int)0);
7267 }
7268 }
7269 goto __pyx_L6_skip;
7270 __pyx_L5_argtuple_error:;
7271 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 367, __pyx_L3_error)
7272 __pyx_L6_skip:;
7273 goto __pyx_L4_argument_unpacking_done;
7274 __pyx_L3_error:;
7275 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7276 Py_XDECREF(values[__pyx_temp]);
7277 }
7278 __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7279 __Pyx_RefNannyFinishContext();
7280 return -1;
7281 __pyx_L4_argument_unpacking_done:;
7282 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
7283
7284 /* function exit code */
7285 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7286 Py_XDECREF(values[__pyx_temp]);
7287 }
7288
7289
7290 __Pyx_RefNannyFinishContext();
7291 return __pyx_r;
7292}
7293
7294static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
7295 int __pyx_r;
7296 __Pyx_RefNannyDeclarations
7297 int __pyx_t_1;
7298 int __pyx_t_2;
7299 int __pyx_t_3;
7300 int __pyx_lineno = 0;
7301 const char *__pyx_filename = NULL;
7302 int __pyx_clineno = 0;
7303 __Pyx_RefNannySetupContext("__cinit__", 0);
7304
7305 /* "View.MemoryView":368
7306 *
7307 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7308 * self.obj = obj # <<<<<<<<<<<<<<
7309 * self.flags = flags
7310 * if type(self) is memoryview or obj is not None:
7311*/
7312 __Pyx_INCREF(__pyx_v_obj);
7313 __Pyx_GIVEREF(__pyx_v_obj);
7314 __Pyx_GOTREF(__pyx_v_self->obj);
7315 __Pyx_DECREF(__pyx_v_self->obj);
7316 __pyx_v_self->obj = __pyx_v_obj;
7317
7318 /* "View.MemoryView":369
7319 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7320 * self.obj = obj
7321 * self.flags = flags # <<<<<<<<<<<<<<
7322 * if type(self) is memoryview or obj is not None:
7323 * PyObject_GetBuffer(obj, &self.view, flags)
7324*/
7325 __pyx_v_self->flags = __pyx_v_flags;
7326
7327 /* "View.MemoryView":370
7328 * self.obj = obj
7329 * self.flags = flags
7330 * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7331 * PyObject_GetBuffer(obj, &self.view, flags)
7332 * if <PyObject *> self.view.obj == NULL:
7333*/
7334 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type));
7335 if (!__pyx_t_2) {
7336
7337 } else {
7338
7339 __pyx_t_1 = __pyx_t_2;
7340
7341 goto __pyx_L4_bool_binop_done;
7342 }
7343 __pyx_t_2 = (__pyx_v_obj != Py_None);
7344
7345 __pyx_t_1 = __pyx_t_2;
7346
7347 __pyx_L4_bool_binop_done:;
7348 if (__pyx_t_1) {
7349
7350
7351 /* "View.MemoryView":371
7352 * self.flags = flags
7353 * if type(self) is memoryview or obj is not None:
7354 * PyObject_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
7355 * if <PyObject *> self.view.obj == NULL:
7356 * (<__pyx_buffer *> &self.view).obj = Py_None
7357*/
7358 __pyx_t_3 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 371, __pyx_L1_error)
7359
7360
7361 /* "View.MemoryView":372
7362 * if type(self) is memoryview or obj is not None:
7363 * PyObject_GetBuffer(obj, &self.view, flags)
7364 * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7365 * (<__pyx_buffer *> &self.view).obj = Py_None
7366 * Py_INCREF(Py_None)
7367*/
7368 __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
7369
7370 if (__pyx_t_1) {
7371
7372
7373 /* "View.MemoryView":373
7374 * PyObject_GetBuffer(obj, &self.view, flags)
7375 * if <PyObject *> self.view.obj == NULL:
7376 * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
7377 * Py_INCREF(Py_None)
7378 *
7379*/
7380 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7381
7382 /* "View.MemoryView":374
7383 * if <PyObject *> self.view.obj == NULL:
7384 * (<__pyx_buffer *> &self.view).obj = Py_None
7385 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7386 *
7387 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7388*/
7389 Py_INCREF(Py_None);
7390
7391 /* "View.MemoryView":372
7392 * if type(self) is memoryview or obj is not None:
7393 * PyObject_GetBuffer(obj, &self.view, flags)
7394 * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7395 * (<__pyx_buffer *> &self.view).obj = Py_None
7396 * Py_INCREF(Py_None)
7397*/
7398 }
7399
7400 /* "View.MemoryView":370
7401 * self.obj = obj
7402 * self.flags = flags
7403 * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7404 * PyObject_GetBuffer(obj, &self.view, flags)
7405 * if <PyObject *> self.view.obj == NULL:
7406*/
7407 }
7408
7409 /* "View.MemoryView":376
7410 * Py_INCREF(Py_None)
7411 *
7412 * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7413 * global __pyx_memoryview_thread_locks_used
7414 * if (__pyx_memoryview_thread_locks_used < 8 and
7415*/
7416 __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
7417
7418 if (__pyx_t_1) {
7419
7420
7421 /* "View.MemoryView":378
7422 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7423 * global __pyx_memoryview_thread_locks_used
7424 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
7425 *
7426 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7427*/
7428 __pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
7429
7430 if (__pyx_t_2) {
7431
7432 } else {
7433
7434 __pyx_t_1 = __pyx_t_2;
7435
7436 goto __pyx_L9_bool_binop_done;
7437 }
7438
7439 /* "View.MemoryView":380
7440 * if (__pyx_memoryview_thread_locks_used < 8 and
7441 *
7442 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()): # <<<<<<<<<<<<<<
7443 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7444 * __pyx_memoryview_thread_locks_used += 1
7445*/
7446 __pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
7447
7448
7449 __pyx_t_1 = __pyx_t_2;
7450
7451 __pyx_L9_bool_binop_done:;
7452
7453 /* "View.MemoryView":378
7454 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7455 * global __pyx_memoryview_thread_locks_used
7456 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
7457 *
7458 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7459*/
7460 if (__pyx_t_1) {
7461
7462
7463 /* "View.MemoryView":381
7464 *
7465 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7466 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
7467 * __pyx_memoryview_thread_locks_used += 1
7468 * if self.lock is NULL:
7469*/
7470 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7471
7472 /* "View.MemoryView":382
7473 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7474 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7475 * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
7476 * if self.lock is NULL:
7477 * self.lock = PyThread_allocate_lock()
7478*/
7479 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
7480
7481 /* "View.MemoryView":378
7482 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7483 * global __pyx_memoryview_thread_locks_used
7484 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
7485 *
7486 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7487*/
7488 }
7489
7490 /* "View.MemoryView":383
7491 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7492 * __pyx_memoryview_thread_locks_used += 1
7493 * if self.lock is NULL: # <<<<<<<<<<<<<<
7494 * self.lock = PyThread_allocate_lock()
7495 * if self.lock is NULL:
7496*/
7497 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7498
7499 if (__pyx_t_1) {
7500
7501
7502 /* "View.MemoryView":384
7503 * __pyx_memoryview_thread_locks_used += 1
7504 * if self.lock is NULL:
7505 * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
7506 * if self.lock is NULL:
7507 * raise MemoryError
7508*/
7509 __pyx_v_self->lock = PyThread_allocate_lock();
7510
7511 /* "View.MemoryView":385
7512 * if self.lock is NULL:
7513 * self.lock = PyThread_allocate_lock()
7514 * if self.lock is NULL: # <<<<<<<<<<<<<<
7515 * raise MemoryError
7516 *
7517*/
7518 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7519
7520 if (unlikely(__pyx_t_1)) {
7521
7522
7523 /* "View.MemoryView":386
7524 * self.lock = PyThread_allocate_lock()
7525 * if self.lock is NULL:
7526 * raise MemoryError # <<<<<<<<<<<<<<
7527 *
7528 * if flags & PyBUF_FORMAT:
7529*/
7530 PyErr_NoMemory(); __PYX_ERR(1, 386, __pyx_L1_error)
7531
7532 /* "View.MemoryView":385
7533 * if self.lock is NULL:
7534 * self.lock = PyThread_allocate_lock()
7535 * if self.lock is NULL: # <<<<<<<<<<<<<<
7536 * raise MemoryError
7537 *
7538*/
7539 }
7540
7541 /* "View.MemoryView":383
7542 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7543 * __pyx_memoryview_thread_locks_used += 1
7544 * if self.lock is NULL: # <<<<<<<<<<<<<<
7545 * self.lock = PyThread_allocate_lock()
7546 * if self.lock is NULL:
7547*/
7548 }
7549
7550 /* "View.MemoryView":376
7551 * Py_INCREF(Py_None)
7552 *
7553 * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7554 * global __pyx_memoryview_thread_locks_used
7555 * if (__pyx_memoryview_thread_locks_used < 8 and
7556*/
7557 }
7558
7559 /* "View.MemoryView":388
7560 * raise MemoryError
7561 *
7562 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7563 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7564 * else:
7565*/
7566 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7567
7568 if (__pyx_t_1) {
7569
7570
7571 /* "View.MemoryView":389
7572 *
7573 * if flags & PyBUF_FORMAT:
7574 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
7575 * else:
7576 * self.dtype_is_object = dtype_is_object
7577*/
7578 __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
7579
7580 if (__pyx_t_2) {
7581
7582 } else {
7583
7584 __pyx_t_1 = __pyx_t_2;
7585
7586 goto __pyx_L14_bool_binop_done;
7587 }
7588 __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
7589
7590
7591 __pyx_t_1 = __pyx_t_2;
7592
7593 __pyx_L14_bool_binop_done:;
7594 __pyx_v_self->dtype_is_object = __pyx_t_1;
7595
7596 /* "View.MemoryView":388
7597 * raise MemoryError
7598 *
7599 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7600 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7601 * else:
7602*/
7603 goto __pyx_L13;
7604 }
7605
7606 /* "View.MemoryView":391
7607 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7608 * else:
7609 * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
7610 *
7611 * with cython.cdivision(True):
7612*/
7613 /*else*/ {
7614 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
7615 }
7616 __pyx_L13:;
7617
7618 /* "View.MemoryView":394
7619 *
7620 * with cython.cdivision(True):
7621 * assert <uintptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
7622 * self.typeinfo = NULL
7623 *
7624*/
7625 #ifndef CYTHON_WITHOUT_ASSERTIONS
7626 if (unlikely(__pyx_assertions_enabled())) {
7627 __pyx_t_1 = ((((__pyx_uintptr_t)(&__pyx_v_self->acquisition_count)) % (sizeof(__pyx_atomic_int_type))) == 0);
7628
7629 if (unlikely(!__pyx_t_1)) {
7630 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
7631 __PYX_ERR(1, 394, __pyx_L1_error)
7632 }
7633
7634 }
7635 #else
7636 if ((1)); else __PYX_ERR(1, 394, __pyx_L1_error)
7637 #endif
7638
7639 /* "View.MemoryView":395
7640 * with cython.cdivision(True):
7641 * assert <uintptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
7642 * self.typeinfo = NULL # <<<<<<<<<<<<<<
7643 *
7644 * def __dealloc__(memoryview self):
7645*/
7646 __pyx_v_self->typeinfo = NULL;
7647
7648 /* "View.MemoryView":367
7649 * cdef const __Pyx_TypeInfo *typeinfo
7650 *
7651 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7652 * self.obj = obj
7653 * self.flags = flags
7654*/
7655
7656 /* function exit code */
7657 __pyx_r = 0;
7658 goto __pyx_L0;
7659 __pyx_L1_error:;
7660 __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7661 __pyx_r = -1;
7662 __pyx_L0:;
7663
7664 __Pyx_RefNannyFinishContext();
7665 return __pyx_r;
7666}
7667
7668/* "View.MemoryView":397
7669 * self.typeinfo = NULL
7670 *
7671 * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
7672 * if self.obj is not None:
7673 * PyBuffer_Release(&self.view)
7674*/
7675
7676/* Python wrapper */
7677static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
7678static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
7679 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7680 __Pyx_RefNannyDeclarations
7681 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7682 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7683 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
7684
7685 /* function exit code */
7686 __Pyx_RefNannyFinishContext();
7687}
7688
7689static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
7690 int __pyx_v_i;
7691 int __pyx_t_1;
7692 Py_ssize_t __pyx_t_2;
7693 Py_ssize_t __pyx_t_3;
7694 int __pyx_t_4;
7695 PyThread_type_lock __pyx_t_5;
7696 PyThread_type_lock __pyx_t_6;
7697
7698 /* "View.MemoryView":398
7699 *
7700 * def __dealloc__(memoryview self):
7701 * if self.obj is not None: # <<<<<<<<<<<<<<
7702 * PyBuffer_Release(&self.view)
7703 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7704*/
7705 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
7706 if (__pyx_t_1) {
7707
7708
7709 /* "View.MemoryView":399
7710 * def __dealloc__(memoryview self):
7711 * if self.obj is not None:
7712 * PyBuffer_Release(&self.view) # <<<<<<<<<<<<<<
7713 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7714 *
7715*/
7716 PyBuffer_Release((&__pyx_v_self->view));
7717
7718 /* "View.MemoryView":398
7719 *
7720 * def __dealloc__(memoryview self):
7721 * if self.obj is not None: # <<<<<<<<<<<<<<
7722 * PyBuffer_Release(&self.view)
7723 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7724*/
7725 goto __pyx_L3;
7726 }
7727
7728 /* "View.MemoryView":400
7729 * if self.obj is not None:
7730 * PyBuffer_Release(&self.view)
7731 * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
7732 *
7733 * (<__pyx_buffer *> &self.view).obj = NULL
7734*/
7735 __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
7736
7737 if (__pyx_t_1) {
7738
7739
7740 /* "View.MemoryView":402
7741 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7742 *
7743 * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
7744 * Py_DECREF(Py_None)
7745 *
7746*/
7747 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
7748
7749 /* "View.MemoryView":403
7750 *
7751 * (<__pyx_buffer *> &self.view).obj = NULL
7752 * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
7753 *
7754 * cdef int i
7755*/
7756 Py_DECREF(Py_None);
7757
7758 /* "View.MemoryView":400
7759 * if self.obj is not None:
7760 * PyBuffer_Release(&self.view)
7761 * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
7762 *
7763 * (<__pyx_buffer *> &self.view).obj = NULL
7764*/
7765 }
7766 __pyx_L3:;
7767
7768 /* "View.MemoryView":407
7769 * cdef int i
7770 * global __pyx_memoryview_thread_locks_used
7771 * if self.lock != NULL: # <<<<<<<<<<<<<<
7772 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
7773 * if __pyx_memoryview_thread_locks[i] is self.lock:
7774*/
7775 __pyx_t_1 = (__pyx_v_self->lock != NULL);
7776
7777 if (__pyx_t_1) {
7778
7779
7780 /* "View.MemoryView":408
7781 * global __pyx_memoryview_thread_locks_used
7782 * if self.lock != NULL:
7783 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
7784 * if __pyx_memoryview_thread_locks[i] is self.lock:
7785 * __pyx_memoryview_thread_locks_used -= 1
7786*/
7787 __pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
7788
7789 if (__pyx_t_1) {
7790
7791 __pyx_t_2 = 0;
7792 } else {
7793
7794 __pyx_t_2 = __pyx_memoryview_thread_locks_used;
7795 }
7796
7797 __pyx_t_3 = __pyx_t_2;
7798
7799 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
7800 __pyx_v_i = __pyx_t_4;
7801
7802 /* "View.MemoryView":409
7803 * if self.lock != NULL:
7804 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
7805 * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
7806 * __pyx_memoryview_thread_locks_used -= 1
7807 * if i != __pyx_memoryview_thread_locks_used:
7808*/
7809 __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
7810
7811 if (__pyx_t_1) {
7812
7813
7814 /* "View.MemoryView":410
7815 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
7816 * if __pyx_memoryview_thread_locks[i] is self.lock:
7817 * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
7818 * if i != __pyx_memoryview_thread_locks_used:
7819 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7820*/
7821 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
7822
7823 /* "View.MemoryView":411
7824 * if __pyx_memoryview_thread_locks[i] is self.lock:
7825 * __pyx_memoryview_thread_locks_used -= 1
7826 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
7827 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7828 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7829*/
7830 __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
7831
7832 if (__pyx_t_1) {
7833
7834
7835 /* "View.MemoryView":413
7836 * if i != __pyx_memoryview_thread_locks_used:
7837 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7838 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
7839 * break
7840 * else:
7841*/
7842 __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7843
7844 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
7845
7846
7847 /* "View.MemoryView":412
7848 * __pyx_memoryview_thread_locks_used -= 1
7849 * if i != __pyx_memoryview_thread_locks_used:
7850 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
7851 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7852 * break
7853*/
7854 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
7855
7856 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
7857
7858
7859 /* "View.MemoryView":411
7860 * if __pyx_memoryview_thread_locks[i] is self.lock:
7861 * __pyx_memoryview_thread_locks_used -= 1
7862 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
7863 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7864 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7865*/
7866 }
7867
7868 /* "View.MemoryView":414
7869 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7870 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7871 * break # <<<<<<<<<<<<<<
7872 * else:
7873 * PyThread_free_lock(self.lock)
7874*/
7875 goto __pyx_L6_break;
7876
7877 /* "View.MemoryView":409
7878 * if self.lock != NULL:
7879 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
7880 * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
7881 * __pyx_memoryview_thread_locks_used -= 1
7882 * if i != __pyx_memoryview_thread_locks_used:
7883*/
7884 }
7885 }
7886 /*else*/ {
7887
7888 /* "View.MemoryView":416
7889 * break
7890 * else:
7891 * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
7892 *
7893 *
7894*/
7895 PyThread_free_lock(__pyx_v_self->lock);
7896 }
7897 __pyx_L6_break:;
7898
7899
7900
7901 /* "View.MemoryView":407
7902 * cdef int i
7903 * global __pyx_memoryview_thread_locks_used
7904 * if self.lock != NULL: # <<<<<<<<<<<<<<
7905 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
7906 * if __pyx_memoryview_thread_locks[i] is self.lock:
7907*/
7908 }
7909
7910 /* "View.MemoryView":397
7911 * self.typeinfo = NULL
7912 *
7913 * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
7914 * if self.obj is not None:
7915 * PyBuffer_Release(&self.view)
7916*/
7917
7918 /* function exit code */
7919
7920
7921}
7922
7923/* "View.MemoryView":419
7924 *
7925 *
7926 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL: # <<<<<<<<<<<<<<
7927 * cdef Py_ssize_t dim
7928 * cdef char *itemp = <char *> self.view.buf
7929*/
7930
7931static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
7932 Py_ssize_t __pyx_v_dim;
7933 char *__pyx_v_itemp;
7934 PyObject *__pyx_v_idx = NULL;
7935 char *__pyx_r;
7936 __Pyx_RefNannyDeclarations
7937 Py_ssize_t __pyx_t_1;
7938 PyObject *__pyx_t_2 = NULL;
7939 Py_ssize_t __pyx_t_3;
7940 PyObject *__pyx_t_4 = NULL;
7941 Py_ssize_t __pyx_t_5;
7942 char *__pyx_t_6;
7943 int __pyx_lineno = 0;
7944 const char *__pyx_filename = NULL;
7945 int __pyx_clineno = 0;
7946 __Pyx_RefNannySetupContext("get_item_pointer", 0);
7947
7948 /* "View.MemoryView":421
7949 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL:
7950 * cdef Py_ssize_t dim
7951 * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
7952 *
7953 * for dim, idx in enumerate(index):
7954*/
7955 __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
7956
7957 /* "View.MemoryView":423
7958 * cdef char *itemp = <char *> self.view.buf
7959 *
7960 * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
7961 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
7962 *
7963*/
7964
7965 __pyx_t_1 = 0;
7966 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
7967 __pyx_t_3 = 0;
7968 for (;;) {
7969 {
7970 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
7971 #if !CYTHON_ASSUME_SAFE_SIZE
7972 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 423, __pyx_L1_error)
7973 #endif
7974 if (__pyx_t_3 >= __pyx_temp) break;
7975 }
7976 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7977 __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
7978 #else
7979 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
7980 #endif
7981 ++__pyx_t_3;
7982 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
7983 __Pyx_GOTREF(__pyx_t_4);
7984 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
7985 __pyx_t_4 = 0;
7986 __pyx_v_dim = __pyx_t_1;
7987 __pyx_t_1 = (__pyx_t_1 + 1);
7988
7989 /* "View.MemoryView":424
7990 *
7991 * for dim, idx in enumerate(index):
7992 * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
7993 *
7994 * return itemp
7995*/
7996 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 424, __pyx_L1_error)
7997 __pyx_t_6 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_5, __pyx_v_dim); if (unlikely(__pyx_t_6 == ((void *)NULL))) __PYX_ERR(1, 424, __pyx_L1_error)
7998 __pyx_v_itemp = __pyx_t_6;
7999
8000
8001 /* "View.MemoryView":423
8002 * cdef char *itemp = <char *> self.view.buf
8003 *
8004 * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8005 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8006 *
8007*/
8008 }
8009 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8010
8011 /* "View.MemoryView":426
8012 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8013 *
8014 * return itemp # <<<<<<<<<<<<<<
8015 *
8016 *
8017*/
8018 {
8019
8020 __pyx_r = __pyx_v_itemp;
8021 }
8022 goto __pyx_L0;
8023
8024 /* "View.MemoryView":419
8025 *
8026 *
8027 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL: # <<<<<<<<<<<<<<
8028 * cdef Py_ssize_t dim
8029 * cdef char *itemp = <char *> self.view.buf
8030*/
8031
8032 /* function exit code */
8033 __pyx_L1_error:;
8034 __Pyx_XDECREF(__pyx_t_2);
8035 __Pyx_XDECREF(__pyx_t_4);
8036 __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8037 __pyx_r = NULL;
8038 __pyx_L0:;
8039
8040
8041 __Pyx_XDECREF(__pyx_v_idx);
8042
8043 __Pyx_RefNannyFinishContext();
8044 return __pyx_r;
8045}
8046
8047/* "View.MemoryView":429
8048 *
8049 *
8050 * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8051 * cdef char *buffer
8052 * if self.view.ndim == 1 and isinstance(index, int):
8053*/
8054
8055/* Python wrapper */
8056static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
8057static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8058 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8059 PyObject *__pyx_r = 0;
8060 __Pyx_RefNannyDeclarations
8061 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8062 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8063 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8064
8065 /* function exit code */
8066 __Pyx_RefNannyFinishContext();
8067 return __pyx_r;
8068}
8069
8070static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8071 char *__pyx_v_buffer;
8072 int __pyx_v_have_slices;
8073 PyObject *__pyx_v_indices = NULL;
8074 char *__pyx_v_itemp;
8075 PyObject *__pyx_r = NULL;
8076 __Pyx_RefNannyDeclarations
8077 int __pyx_t_1;
8078 int __pyx_t_2;
8079 Py_ssize_t __pyx_t_3;
8080 char *__pyx_t_4;
8081 PyObject *__pyx_t_5 = NULL;
8082 PyObject *__pyx_t_6 = NULL;
8083 PyObject *__pyx_t_7 = NULL;
8084 int __pyx_lineno = 0;
8085 const char *__pyx_filename = NULL;
8086 int __pyx_clineno = 0;
8087 __Pyx_RefNannySetupContext("__getitem__", 0);
8088
8089 /* "View.MemoryView":431
8090 * def __getitem__(memoryview self, object index):
8091 * cdef char *buffer
8092 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8093 * buffer = <char *> self.view.buf
8094 * return self.convert_item_to_object(
8095*/
8096 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8097
8098 if (__pyx_t_2) {
8099
8100 } else {
8101
8102 __pyx_t_1 = __pyx_t_2;
8103
8104 goto __pyx_L4_bool_binop_done;
8105 }
8106 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8107
8108 __pyx_t_1 = __pyx_t_2;
8109
8110 __pyx_L4_bool_binop_done:;
8111 if (__pyx_t_1) {
8112
8113
8114 /* "View.MemoryView":432
8115 * cdef char *buffer
8116 * if self.view.ndim == 1 and isinstance(index, int):
8117 * buffer = <char *> self.view.buf # <<<<<<<<<<<<<<
8118 * return self.convert_item_to_object(
8119 * pybuffer_index(&self.view, buffer, index, 0))
8120*/
8121 __pyx_v_buffer = ((char *)__pyx_v_self->view.buf);
8122
8123 /* "View.MemoryView":434
8124 * buffer = <char *> self.view.buf
8125 * return self.convert_item_to_object(
8126 * pybuffer_index(&self.view, buffer, index, 0)) # <<<<<<<<<<<<<<
8127 *
8128 * if index is Ellipsis:
8129*/
8130 __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 434, __pyx_L1_error)
8131 __pyx_t_4 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_buffer, __pyx_t_3, 0); if (unlikely(__pyx_t_4 == ((void *)NULL))) __PYX_ERR(1, 434, __pyx_L1_error)
8132
8133 /* "View.MemoryView":433
8134 * if self.view.ndim == 1 and isinstance(index, int):
8135 * buffer = <char *> self.view.buf
8136 * return self.convert_item_to_object( # <<<<<<<<<<<<<<
8137 * pybuffer_index(&self.view, buffer, index, 0))
8138 *
8139*/
8140 __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 433, __pyx_L1_error)
8141 __Pyx_GOTREF(__pyx_t_5);
8142
8143
8144 {
8145 PyObject *__pyx_temp;
8146 {
8147 __pyx_temp = __pyx_r;
8148 __pyx_r = __pyx_t_5;
8149 }
8150 __Pyx_XDECREF(__pyx_temp);
8151 }
8152 __pyx_t_5 = 0;
8153 goto __pyx_L0;
8154
8155 /* "View.MemoryView":431
8156 * def __getitem__(memoryview self, object index):
8157 * cdef char *buffer
8158 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8159 * buffer = <char *> self.view.buf
8160 * return self.convert_item_to_object(
8161*/
8162 }
8163
8164 /* "View.MemoryView":436
8165 * pybuffer_index(&self.view, buffer, index, 0))
8166 *
8167 * if index is Ellipsis: # <<<<<<<<<<<<<<
8168 * return self
8169 *
8170*/
8171 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8172 if (__pyx_t_1) {
8173
8174
8175 /* "View.MemoryView":437
8176 *
8177 * if index is Ellipsis:
8178 * return self # <<<<<<<<<<<<<<
8179 *
8180 * have_slices, indices = _unellipsify(index, self.view.ndim)
8181*/
8182 {
8183 PyObject *__pyx_temp;
8184 {
8185 __pyx_temp = __pyx_r;
8186 __Pyx_INCREF((PyObject *)__pyx_v_self);
8187 __pyx_r = ((PyObject *)__pyx_v_self);
8188 }
8189 __Pyx_XDECREF(__pyx_temp);
8190 }
8191 goto __pyx_L0;
8192
8193 /* "View.MemoryView":436
8194 * pybuffer_index(&self.view, buffer, index, 0))
8195 *
8196 * if index is Ellipsis: # <<<<<<<<<<<<<<
8197 * return self
8198 *
8199*/
8200 }
8201
8202 /* "View.MemoryView":439
8203 * return self
8204 *
8205 * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8206 *
8207 * cdef char *itemp
8208*/
8209 __pyx_t_5 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 439, __pyx_L1_error)
8210 __Pyx_GOTREF(__pyx_t_5);
8211 if (likely(__pyx_t_5 != Py_None)) {
8212 PyObject* sequence = __pyx_t_5;
8213 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8214 if (unlikely(size != 2)) {
8215 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8216 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8217 __PYX_ERR(1, 439, __pyx_L1_error)
8218 }
8219 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8220 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
8221 __Pyx_INCREF(__pyx_t_6);
8222 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
8223 __Pyx_INCREF(__pyx_t_7);
8224 #else
8225 __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 439, __pyx_L1_error)
8226 __Pyx_GOTREF(__pyx_t_6);
8227 __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L1_error)
8228 __Pyx_GOTREF(__pyx_t_7);
8229 #endif
8230 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8231 } else {
8232 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 439, __pyx_L1_error)
8233 }
8234 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 439, __pyx_L1_error)
8235 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8236 if (!(likely(PyTuple_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_7))) __PYX_ERR(1, 439, __pyx_L1_error)
8237 __pyx_v_have_slices = __pyx_t_1;
8238 __pyx_v_indices = ((PyObject*)__pyx_t_7);
8239 __pyx_t_7 = 0;
8240
8241 /* "View.MemoryView":442
8242 *
8243 * cdef char *itemp
8244 * if have_slices: # <<<<<<<<<<<<<<
8245 * return memview_slice(self, indices)
8246 * else:
8247*/
8248 if (__pyx_v_have_slices) {
8249
8250 /* "View.MemoryView":443
8251 * cdef char *itemp
8252 * if have_slices:
8253 * return memview_slice(self, indices) # <<<<<<<<<<<<<<
8254 * else:
8255 * itemp = memoryview.get_item_pointer(self, <tuple> indices)
8256*/
8257 __pyx_t_5 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 443, __pyx_L1_error)
8258 __Pyx_GOTREF(__pyx_t_5);
8259 {
8260 PyObject *__pyx_temp;
8261 {
8262 __pyx_temp = __pyx_r;
8263 __pyx_r = __pyx_t_5;
8264 }
8265 __Pyx_XDECREF(__pyx_temp);
8266 }
8267 __pyx_t_5 = 0;
8268 goto __pyx_L0;
8269
8270 /* "View.MemoryView":442
8271 *
8272 * cdef char *itemp
8273 * if have_slices: # <<<<<<<<<<<<<<
8274 * return memview_slice(self, indices)
8275 * else:
8276*/
8277 }
8278
8279 /* "View.MemoryView":445
8280 * return memview_slice(self, indices)
8281 * else:
8282 * itemp = memoryview.get_item_pointer(self, <tuple> indices) # <<<<<<<<<<<<<<
8283 * return self.convert_item_to_object(itemp)
8284 *
8285*/
8286 /*else*/ {
8287 if (unlikely(__pyx_v_indices == Py_None)) {
8288 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
8289 __PYX_ERR(1, 445, __pyx_L1_error)
8290 }
8291 __pyx_t_4 = __pyx_memoryview_get_item_pointer(__pyx_v_self, ((PyObject*)__pyx_v_indices)); if (unlikely(__pyx_t_4 == ((void *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
8292 __pyx_v_itemp = __pyx_t_4;
8293
8294 /* "View.MemoryView":446
8295 * else:
8296 * itemp = memoryview.get_item_pointer(self, <tuple> indices)
8297 * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
8298 *
8299 * def __setitem__(memoryview self, object index, object value):
8300*/
8301 __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 446, __pyx_L1_error)
8302 __Pyx_GOTREF(__pyx_t_5);
8303 {
8304 PyObject *__pyx_temp;
8305 {
8306 __pyx_temp = __pyx_r;
8307 __pyx_r = __pyx_t_5;
8308 }
8309 __Pyx_XDECREF(__pyx_temp);
8310 }
8311 __pyx_t_5 = 0;
8312 goto __pyx_L0;
8313 }
8314
8315 /* "View.MemoryView":429
8316 *
8317 *
8318 * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8319 * cdef char *buffer
8320 * if self.view.ndim == 1 and isinstance(index, int):
8321*/
8322
8323 /* function exit code */
8324 __pyx_L1_error:;
8325 __Pyx_XDECREF(__pyx_t_5);
8326 __Pyx_XDECREF(__pyx_t_6);
8327 __Pyx_XDECREF(__pyx_t_7);
8328 __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8329 __pyx_r = NULL;
8330 __pyx_L0:;
8331
8332
8333 __Pyx_XDECREF(__pyx_v_indices);
8334
8335 __Pyx_XGIVEREF(__pyx_r);
8336 __Pyx_RefNannyFinishContext();
8337 return __pyx_r;
8338}
8339
8340/* "View.MemoryView":448
8341 * return self.convert_item_to_object(itemp)
8342 *
8343 * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8344 * if self.view.readonly:
8345 * raise TypeError, "Cannot assign to read-only memoryview"
8346*/
8347
8348/* Python wrapper */
8349static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
8350static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8351 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8352 int __pyx_r;
8353 __Pyx_RefNannyDeclarations
8354 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8355 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8356 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
8357
8358 /* function exit code */
8359 __Pyx_RefNannyFinishContext();
8360 return __pyx_r;
8361}
8362
8363static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8364 int __pyx_v_have_slices;
8365 PyObject *__pyx_v_indices = NULL;
8366 PyObject *__pyx_v_obj = NULL;
8367 struct __pyx_memoryview_obj *__pyx_v_target_slice = NULL;
8368 int __pyx_r;
8369 __Pyx_RefNannyDeclarations
8370 int __pyx_t_1;
8371 int __pyx_t_2;
8372 PyObject *__pyx_t_3 = NULL;
8373 PyObject *__pyx_t_4 = NULL;
8374 PyObject *__pyx_t_5 = NULL;
8375 int __pyx_lineno = 0;
8376 const char *__pyx_filename = NULL;
8377 int __pyx_clineno = 0;
8378 __Pyx_RefNannySetupContext("__setitem__", 0);
8379
8380 /* "View.MemoryView":449
8381 *
8382 * def __setitem__(memoryview self, object index, object value):
8383 * if self.view.readonly: # <<<<<<<<<<<<<<
8384 * raise TypeError, "Cannot assign to read-only memoryview"
8385 *
8386*/
8387 if (unlikely(__pyx_v_self->view.readonly)) {
8388
8389 /* "View.MemoryView":450
8390 * def __setitem__(memoryview self, object index, object value):
8391 * if self.view.readonly:
8392 * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
8393 *
8394 * if self.view.ndim == 1 and isinstance(index, int):
8395*/
8396 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_read_only_memor, 0, 0);
8397 __PYX_ERR(1, 450, __pyx_L1_error)
8398
8399 /* "View.MemoryView":449
8400 *
8401 * def __setitem__(memoryview self, object index, object value):
8402 * if self.view.readonly: # <<<<<<<<<<<<<<
8403 * raise TypeError, "Cannot assign to read-only memoryview"
8404 *
8405*/
8406 }
8407
8408 /* "View.MemoryView":452
8409 * raise TypeError, "Cannot assign to read-only memoryview"
8410 *
8411 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8412 * memoryview.setitem_indexed1(self, index, value)
8413 * return
8414*/
8415 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8416
8417 if (__pyx_t_2) {
8418
8419 } else {
8420
8421 __pyx_t_1 = __pyx_t_2;
8422
8423 goto __pyx_L5_bool_binop_done;
8424 }
8425 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8426
8427 __pyx_t_1 = __pyx_t_2;
8428
8429 __pyx_L5_bool_binop_done:;
8430 if (__pyx_t_1) {
8431
8432
8433 /* "View.MemoryView":453
8434 *
8435 * if self.view.ndim == 1 and isinstance(index, int):
8436 * memoryview.setitem_indexed1(self, index, value) # <<<<<<<<<<<<<<
8437 * return
8438 *
8439*/
8440 __pyx_t_3 = __pyx_memoryview_setitem_indexed1(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 453, __pyx_L1_error)
8441 __Pyx_GOTREF(__pyx_t_3);
8442 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8443
8444 /* "View.MemoryView":454
8445 * if self.view.ndim == 1 and isinstance(index, int):
8446 * memoryview.setitem_indexed1(self, index, value)
8447 * return # <<<<<<<<<<<<<<
8448 *
8449 * have_slices, indices = _unellipsify(index, self.view.ndim)
8450*/
8451 {
8452 __pyx_r = 0;
8453 }
8454 goto __pyx_L0;
8455
8456 /* "View.MemoryView":452
8457 * raise TypeError, "Cannot assign to read-only memoryview"
8458 *
8459 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8460 * memoryview.setitem_indexed1(self, index, value)
8461 * return
8462*/
8463 }
8464
8465 /* "View.MemoryView":456
8466 * return
8467 *
8468 * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8469 *
8470 * if have_slices:
8471*/
8472 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 456, __pyx_L1_error)
8473 __Pyx_GOTREF(__pyx_t_3);
8474 if (likely(__pyx_t_3 != Py_None)) {
8475 PyObject* sequence = __pyx_t_3;
8476 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8477 if (unlikely(size != 2)) {
8478 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8479 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8480 __PYX_ERR(1, 456, __pyx_L1_error)
8481 }
8482 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8483 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
8484 __Pyx_INCREF(__pyx_t_4);
8485 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
8486 __Pyx_INCREF(__pyx_t_5);
8487 #else
8488 __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 456, __pyx_L1_error)
8489 __Pyx_GOTREF(__pyx_t_4);
8490 __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error)
8491 __Pyx_GOTREF(__pyx_t_5);
8492 #endif
8493 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8494 } else {
8495 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 456, __pyx_L1_error)
8496 }
8497 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 456, __pyx_L1_error)
8498 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8499 if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_5))) __PYX_ERR(1, 456, __pyx_L1_error)
8500 __pyx_v_have_slices = __pyx_t_1;
8501 __pyx_v_indices = ((PyObject*)__pyx_t_5);
8502 __pyx_t_5 = 0;
8503
8504 /* "View.MemoryView":458
8505 * have_slices, indices = _unellipsify(index, self.view.ndim)
8506 *
8507 * if have_slices: # <<<<<<<<<<<<<<
8508 * obj = memoryview.is_slice(self, value)
8509 * target_slice = memview_slice(self, indices)
8510*/
8511 if (__pyx_v_have_slices) {
8512
8513 /* "View.MemoryView":459
8514 *
8515 * if have_slices:
8516 * obj = memoryview.is_slice(self, value) # <<<<<<<<<<<<<<
8517 * target_slice = memview_slice(self, indices)
8518 * if obj is not None:
8519*/
8520 __pyx_t_3 = __pyx_memoryview_is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 459, __pyx_L1_error)
8521 __Pyx_GOTREF(__pyx_t_3);
8522 __pyx_v_obj = __pyx_t_3;
8523 __pyx_t_3 = 0;
8524
8525 /* "View.MemoryView":460
8526 * if have_slices:
8527 * obj = memoryview.is_slice(self, value)
8528 * target_slice = memview_slice(self, indices) # <<<<<<<<<<<<<<
8529 * if obj is not None:
8530 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8531*/
8532 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 460, __pyx_L1_error)
8533 __Pyx_GOTREF(__pyx_t_3);
8534 __pyx_v_target_slice = ((struct __pyx_memoryview_obj *)__pyx_t_3);
8535 __pyx_t_3 = 0;
8536
8537 /* "View.MemoryView":461
8538 * obj = memoryview.is_slice(self, value)
8539 * target_slice = memview_slice(self, indices)
8540 * if obj is not None: # <<<<<<<<<<<<<<
8541 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8542 * else:
8543*/
8544 __pyx_t_1 = (__pyx_v_obj != Py_None);
8545 if (__pyx_t_1) {
8546
8547
8548 /* "View.MemoryView":462
8549 * target_slice = memview_slice(self, indices)
8550 * if obj is not None:
8551 * memoryview.setitem_slice_assignment(self, target_slice, obj) # <<<<<<<<<<<<<<
8552 * else:
8553 * memoryview.setitem_slice_assign_scalar(self, target_slice, value)
8554*/
8555 __pyx_t_3 = __pyx_memoryview_setitem_slice_assignment(__pyx_v_self, ((PyObject *)__pyx_v_target_slice), __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 462, __pyx_L1_error)
8556 __Pyx_GOTREF(__pyx_t_3);
8557 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8558
8559 /* "View.MemoryView":461
8560 * obj = memoryview.is_slice(self, value)
8561 * target_slice = memview_slice(self, indices)
8562 * if obj is not None: # <<<<<<<<<<<<<<
8563 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8564 * else:
8565*/
8566 goto __pyx_L8;
8567 }
8568
8569 /* "View.MemoryView":464
8570 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8571 * else:
8572 * memoryview.setitem_slice_assign_scalar(self, target_slice, value) # <<<<<<<<<<<<<<
8573 * else:
8574 * memoryview.setitem_indexed(self, <tuple> indices, value)
8575*/
8576 /*else*/ {
8577 __pyx_t_3 = __pyx_memoryview_setitem_slice_assign_scalar(__pyx_v_self, __pyx_v_target_slice, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 464, __pyx_L1_error)
8578 __Pyx_GOTREF(__pyx_t_3);
8579 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8580 }
8581 __pyx_L8:;
8582
8583 /* "View.MemoryView":458
8584 * have_slices, indices = _unellipsify(index, self.view.ndim)
8585 *
8586 * if have_slices: # <<<<<<<<<<<<<<
8587 * obj = memoryview.is_slice(self, value)
8588 * target_slice = memview_slice(self, indices)
8589*/
8590 goto __pyx_L7;
8591 }
8592
8593 /* "View.MemoryView":466
8594 * memoryview.setitem_slice_assign_scalar(self, target_slice, value)
8595 * else:
8596 * memoryview.setitem_indexed(self, <tuple> indices, value) # <<<<<<<<<<<<<<
8597 *
8598 *
8599*/
8600 /*else*/ {
8601 if (unlikely(__pyx_v_indices == Py_None)) {
8602 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
8603 __PYX_ERR(1, 466, __pyx_L1_error)
8604 }
8605 __pyx_t_3 = __pyx_memoryview_setitem_indexed(__pyx_v_self, ((PyObject*)__pyx_v_indices), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 466, __pyx_L1_error)
8606 __Pyx_GOTREF(__pyx_t_3);
8607 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8608 }
8609 __pyx_L7:;
8610
8611 /* "View.MemoryView":448
8612 * return self.convert_item_to_object(itemp)
8613 *
8614 * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8615 * if self.view.readonly:
8616 * raise TypeError, "Cannot assign to read-only memoryview"
8617*/
8618
8619 /* function exit code */
8620 __pyx_r = 0;
8621 goto __pyx_L0;
8622 __pyx_L1_error:;
8623 __Pyx_XDECREF(__pyx_t_3);
8624 __Pyx_XDECREF(__pyx_t_4);
8625 __Pyx_XDECREF(__pyx_t_5);
8626 __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8627 __pyx_r = -1;
8628 __pyx_L0:;
8629
8630 __Pyx_XDECREF(__pyx_v_indices);
8631 __Pyx_XDECREF(__pyx_v_obj);
8632 __Pyx_XDECREF((PyObject *)__pyx_v_target_slice);
8633
8634 __Pyx_RefNannyFinishContext();
8635 return __pyx_r;
8636}
8637
8638/* "View.MemoryView":469
8639 *
8640 *
8641 * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8642 * if not isinstance(obj, memoryview):
8643 * try:
8644*/
8645
8646static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
8647 PyObject *__pyx_r = NULL;
8648 __Pyx_RefNannyDeclarations
8649 int __pyx_t_1;
8650 int __pyx_t_2;
8651 PyObject *__pyx_t_3 = NULL;
8652 PyObject *__pyx_t_4 = NULL;
8653 PyObject *__pyx_t_5 = NULL;
8654 PyObject *__pyx_t_6 = NULL;
8655 PyObject *__pyx_t_7 = NULL;
8656 PyObject *__pyx_t_8 = NULL;
8657 PyObject *__pyx_t_9 = NULL;
8658 size_t __pyx_t_10;
8659 int __pyx_t_11;
8660 int __pyx_lineno = 0;
8661 const char *__pyx_filename = NULL;
8662 int __pyx_clineno = 0;
8663 __Pyx_RefNannySetupContext("is_slice", 0);
8664 __Pyx_INCREF(__pyx_v_obj);
8665
8666 /* "View.MemoryView":470
8667 *
8668 * cdef is_slice(self, obj):
8669 * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8670 * try:
8671 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8672*/
8673 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_memoryview_type);
8674 __pyx_t_2 = (!__pyx_t_1);
8675
8676
8677 if (__pyx_t_2) {
8678
8679
8680 /* "View.MemoryView":471
8681 * cdef is_slice(self, obj):
8682 * if not isinstance(obj, memoryview):
8683 * try: # <<<<<<<<<<<<<<
8684 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8685 * self.dtype_is_object)
8686*/
8687 {
8688 __Pyx_PyThreadState_declare
8689 __Pyx_PyThreadState_assign
8690 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8691 __Pyx_XGOTREF(__pyx_t_3);
8692 __Pyx_XGOTREF(__pyx_t_4);
8693 __Pyx_XGOTREF(__pyx_t_5);
8694 /*try:*/ {
8695
8696 /* "View.MemoryView":472
8697 * if not isinstance(obj, memoryview):
8698 * try:
8699 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8700 * self.dtype_is_object)
8701 * except TypeError:
8702*/
8703 __pyx_t_7 = NULL;
8704 __pyx_t_8 = __Pyx_PyLong_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 472, __pyx_L4_error)
8705 __Pyx_GOTREF(__pyx_t_8);
8706
8707 /* "View.MemoryView":473
8708 * try:
8709 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8710 * self.dtype_is_object) # <<<<<<<<<<<<<<
8711 * except TypeError:
8712 * return None
8713*/
8714 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 473, __pyx_L4_error)
8715 __Pyx_GOTREF(__pyx_t_9);
8716 __pyx_t_10 = 1;
8717 {
8718 PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_obj, __pyx_t_8, __pyx_t_9};
8719 __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8720 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8721 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8722 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8723 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 472, __pyx_L4_error)
8724 __Pyx_GOTREF((PyObject *)__pyx_t_6);
8725 }
8726 __Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
8727 __pyx_t_6 = 0;
8728
8729 /* "View.MemoryView":471
8730 * cdef is_slice(self, obj):
8731 * if not isinstance(obj, memoryview):
8732 * try: # <<<<<<<<<<<<<<
8733 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8734 * self.dtype_is_object)
8735*/
8736 }
8737 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8738 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8739 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8740 goto __pyx_L9_try_end;
8741 __pyx_L4_error:;
8742 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8743 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8744 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8745 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8746
8747 /* "View.MemoryView":474
8748 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8749 * self.dtype_is_object)
8750 * except TypeError: # <<<<<<<<<<<<<<
8751 * return None
8752 *
8753*/
8754 __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
8755 if (__pyx_t_11) {
8756 __Pyx_ErrRestore(0,0,0);
8757
8758 /* "View.MemoryView":475
8759 * self.dtype_is_object)
8760 * except TypeError:
8761 * return None # <<<<<<<<<<<<<<
8762 *
8763 * return obj
8764*/
8765 {
8766 PyObject *__pyx_temp;
8767 {
8768 __pyx_temp = __pyx_r;
8769 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8770 }
8771 __Pyx_XDECREF(__pyx_temp);
8772 }
8773 goto __pyx_L7_except_return;
8774 }
8775 goto __pyx_L6_except_error;
8776
8777 /* "View.MemoryView":471
8778 * cdef is_slice(self, obj):
8779 * if not isinstance(obj, memoryview):
8780 * try: # <<<<<<<<<<<<<<
8781 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8782 * self.dtype_is_object)
8783*/
8784 __pyx_L6_except_error:;
8785 __Pyx_XGIVEREF(__pyx_t_3);
8786 __Pyx_XGIVEREF(__pyx_t_4);
8787 __Pyx_XGIVEREF(__pyx_t_5);
8788 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8789 goto __pyx_L1_error;
8790 __pyx_L7_except_return:;
8791 __Pyx_XGIVEREF(__pyx_t_3);
8792 __Pyx_XGIVEREF(__pyx_t_4);
8793 __Pyx_XGIVEREF(__pyx_t_5);
8794 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8795 goto __pyx_L0;
8796 __pyx_L9_try_end:;
8797 }
8798
8799 /* "View.MemoryView":470
8800 *
8801 * cdef is_slice(self, obj):
8802 * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8803 * try:
8804 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8805*/
8806 }
8807
8808 /* "View.MemoryView":477
8809 * return None
8810 *
8811 * return obj # <<<<<<<<<<<<<<
8812 *
8813 *
8814*/
8815 {
8816 PyObject *__pyx_temp;
8817 {
8818 __pyx_temp = __pyx_r;
8819 __Pyx_INCREF(__pyx_v_obj);
8820 __pyx_r = __pyx_v_obj;
8821 }
8822 __Pyx_XDECREF(__pyx_temp);
8823 }
8824 goto __pyx_L0;
8825
8826 /* "View.MemoryView":469
8827 *
8828 *
8829 * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8830 * if not isinstance(obj, memoryview):
8831 * try:
8832*/
8833
8834 /* function exit code */
8835 __pyx_L1_error:;
8836 __Pyx_XDECREF(__pyx_t_6);
8837 __Pyx_XDECREF(__pyx_t_7);
8838 __Pyx_XDECREF(__pyx_t_8);
8839 __Pyx_XDECREF(__pyx_t_9);
8840 __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
8841 __pyx_r = 0;
8842 __pyx_L0:;
8843 __Pyx_XDECREF(__pyx_v_obj);
8844 __Pyx_XGIVEREF(__pyx_r);
8845 __Pyx_RefNannyFinishContext();
8846 return __pyx_r;
8847}
8848
8849/* "View.MemoryView":480
8850 *
8851 *
8852 * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
8853 * cdef __Pyx_memviewslice dst_slice
8854 * cdef __Pyx_memviewslice src_slice
8855*/
8856
8857static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
8858 __Pyx_memviewslice __pyx_v_dst_slice;
8859 __Pyx_memviewslice __pyx_v_src_slice;
8860 __Pyx_memviewslice __pyx_v_msrc;
8861 __Pyx_memviewslice __pyx_v_mdst;
8862 PyObject *__pyx_r = NULL;
8863 __Pyx_RefNannyDeclarations
8864 __Pyx_memviewslice *__pyx_t_1;
8865 PyObject *__pyx_t_2 = NULL;
8866 int __pyx_t_3;
8867 int __pyx_t_4;
8868 int __pyx_t_5;
8869 int __pyx_lineno = 0;
8870 const char *__pyx_filename = NULL;
8871 int __pyx_clineno = 0;
8872 __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
8873
8874 /* "View.MemoryView":483
8875 * cdef __Pyx_memviewslice dst_slice
8876 * cdef __Pyx_memviewslice src_slice
8877 * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
8878 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
8879 *
8880*/
8881 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 483, __pyx_L1_error)
8882 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 483, __pyx_L1_error)
8883 __pyx_v_msrc = (__pyx_t_1[0]);
8884
8885
8886 /* "View.MemoryView":484
8887 * cdef __Pyx_memviewslice src_slice
8888 * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
8889 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
8890 *
8891 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
8892*/
8893 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 484, __pyx_L1_error)
8894 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
8895 __pyx_v_mdst = (__pyx_t_1[0]);
8896
8897
8898 /* "View.MemoryView":486
8899 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
8900 *
8901 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
8902 *
8903 *
8904*/
8905 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 486, __pyx_L1_error)
8906 __Pyx_GOTREF(__pyx_t_2);
8907 __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 486, __pyx_L1_error)
8908 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8909 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 486, __pyx_L1_error)
8910 __Pyx_GOTREF(__pyx_t_2);
8911 __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 486, __pyx_L1_error)
8912 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8913 __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 486, __pyx_L1_error)
8914
8915
8916
8917
8918 /* "View.MemoryView":480
8919 *
8920 *
8921 * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
8922 * cdef __Pyx_memviewslice dst_slice
8923 * cdef __Pyx_memviewslice src_slice
8924*/
8925
8926 /* function exit code */
8927 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8928 goto __pyx_L0;
8929 __pyx_L1_error:;
8930 __Pyx_XDECREF(__pyx_t_2);
8931 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
8932 __pyx_r = 0;
8933 __pyx_L0:;
8934
8935
8936
8937
8938 __Pyx_XGIVEREF(__pyx_r);
8939 __Pyx_RefNannyFinishContext();
8940 return __pyx_r;
8941}
8942
8943/* "View.MemoryView":489
8944 *
8945 *
8946 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
8947 * cdef int array[128]
8948 * cdef void *tmp = NULL
8949*/
8950
8951static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
8952 int __pyx_v_array[128];
8953 void *__pyx_v_tmp;
8954 void *__pyx_v_item;
8955 __Pyx_memviewslice *__pyx_v_dst_slice;
8956 __Pyx_memviewslice __pyx_v_tmp_slice;
8957 PyObject *__pyx_r = NULL;
8958 __Pyx_RefNannyDeclarations
8959 __Pyx_memviewslice *__pyx_t_1;
8960 int __pyx_t_2;
8961 PyObject *__pyx_t_3 = NULL;
8962 int __pyx_t_4;
8963 int __pyx_t_5;
8964 char const *__pyx_t_6;
8965 PyObject *__pyx_t_7 = NULL;
8966 PyObject *__pyx_t_8 = NULL;
8967 PyObject *__pyx_t_9 = NULL;
8968 PyObject *__pyx_t_10 = NULL;
8969 PyObject *__pyx_t_11 = NULL;
8970 PyObject *__pyx_t_12 = NULL;
8971 int __pyx_lineno = 0;
8972 const char *__pyx_filename = NULL;
8973 int __pyx_clineno = 0;
8974 __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
8975
8976 /* "View.MemoryView":491
8977 * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
8978 * cdef int array[128]
8979 * cdef void *tmp = NULL # <<<<<<<<<<<<<<
8980 * cdef void *item
8981 *
8982*/
8983 __pyx_v_tmp = NULL;
8984
8985 /* "View.MemoryView":496
8986 * cdef __Pyx_memviewslice *dst_slice
8987 * cdef __Pyx_memviewslice tmp_slice
8988 * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
8989 *
8990 * if <size_t>self.view.itemsize > sizeof(array):
8991*/
8992 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 496, __pyx_L1_error)
8993 __pyx_v_dst_slice = __pyx_t_1;
8994
8995 /* "View.MemoryView":498
8996 * dst_slice = get_slice_from_memview(dst, &tmp_slice)
8997 *
8998 * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
8999 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9000 * if tmp == NULL:
9001*/
9002 __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
9003
9004 if (__pyx_t_2) {
9005
9006
9007 /* "View.MemoryView":499
9008 *
9009 * if <size_t>self.view.itemsize > sizeof(array):
9010 * tmp = PyMem_Malloc(<size_t> self.view.itemsize) # <<<<<<<<<<<<<<
9011 * if tmp == NULL:
9012 * raise MemoryError
9013*/
9014 __pyx_v_tmp = PyMem_Malloc(((size_t)__pyx_v_self->view.itemsize));
9015
9016 /* "View.MemoryView":500
9017 * if <size_t>self.view.itemsize > sizeof(array):
9018 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9019 * if tmp == NULL: # <<<<<<<<<<<<<<
9020 * raise MemoryError
9021 * item = tmp
9022*/
9023 __pyx_t_2 = (__pyx_v_tmp == NULL);
9024
9025 if (unlikely(__pyx_t_2)) {
9026
9027
9028 /* "View.MemoryView":501
9029 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9030 * if tmp == NULL:
9031 * raise MemoryError # <<<<<<<<<<<<<<
9032 * item = tmp
9033 * else:
9034*/
9035 PyErr_NoMemory(); __PYX_ERR(1, 501, __pyx_L1_error)
9036
9037 /* "View.MemoryView":500
9038 * if <size_t>self.view.itemsize > sizeof(array):
9039 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9040 * if tmp == NULL: # <<<<<<<<<<<<<<
9041 * raise MemoryError
9042 * item = tmp
9043*/
9044 }
9045
9046 /* "View.MemoryView":502
9047 * if tmp == NULL:
9048 * raise MemoryError
9049 * item = tmp # <<<<<<<<<<<<<<
9050 * else:
9051 * item = <void *> array
9052*/
9053 __pyx_v_item = __pyx_v_tmp;
9054
9055 /* "View.MemoryView":498
9056 * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9057 *
9058 * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9059 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9060 * if tmp == NULL:
9061*/
9062 goto __pyx_L3;
9063 }
9064
9065 /* "View.MemoryView":504
9066 * item = tmp
9067 * else:
9068 * item = <void *> array # <<<<<<<<<<<<<<
9069 *
9070 * try:
9071*/
9072 /*else*/ {
9073 __pyx_v_item = ((void *)__pyx_v_array);
9074 }
9075 __pyx_L3:;
9076
9077 /* "View.MemoryView":506
9078 * item = <void *> array
9079 *
9080 * try: # <<<<<<<<<<<<<<
9081 * if self.dtype_is_object:
9082 * (<PyObject **> item)[0] = <PyObject *> value
9083*/
9084 /*try:*/ {
9085
9086 /* "View.MemoryView":507
9087 *
9088 * try:
9089 * if self.dtype_is_object: # <<<<<<<<<<<<<<
9090 * (<PyObject **> item)[0] = <PyObject *> value
9091 * else:
9092*/
9093 if (__pyx_v_self->dtype_is_object) {
9094
9095 /* "View.MemoryView":508
9096 * try:
9097 * if self.dtype_is_object:
9098 * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
9099 * else:
9100 * self.assign_item_from_object(<char *> item, value)
9101*/
9102 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9103
9104 /* "View.MemoryView":507
9105 *
9106 * try:
9107 * if self.dtype_is_object: # <<<<<<<<<<<<<<
9108 * (<PyObject **> item)[0] = <PyObject *> value
9109 * else:
9110*/
9111 goto __pyx_L8;
9112 }
9113
9114 /* "View.MemoryView":510
9115 * (<PyObject **> item)[0] = <PyObject *> value
9116 * else:
9117 * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
9118 *
9119 *
9120*/
9121 /*else*/ {
9122 __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 510, __pyx_L6_error)
9123 __Pyx_GOTREF(__pyx_t_3);
9124 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9125 }
9126 __pyx_L8:;
9127
9128 /* "View.MemoryView":514
9129 *
9130 *
9131 * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9132 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9133 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9134*/
9135 __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9136
9137 if (__pyx_t_2) {
9138
9139
9140 /* "View.MemoryView":515
9141 *
9142 * if self.view.suboffsets != NULL:
9143 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
9144 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9145 * item, self.dtype_is_object)
9146*/
9147 __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 515, __pyx_L6_error)
9148
9149
9150 /* "View.MemoryView":514
9151 *
9152 *
9153 * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9154 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9155 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9156*/
9157 }
9158
9159 /* "View.MemoryView":516
9160 * if self.view.suboffsets != NULL:
9161 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9162 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize, # <<<<<<<<<<<<<<
9163 * item, self.dtype_is_object)
9164 * finally:
9165*/
9166 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, ((size_t)__pyx_v_self->view.itemsize), __pyx_v_item, __pyx_v_self->dtype_is_object);
9167 }
9168
9169 /* "View.MemoryView":519
9170 * item, self.dtype_is_object)
9171 * finally:
9172 * PyMem_Free(tmp) # <<<<<<<<<<<<<<
9173 *
9174 *
9175*/
9176 /*finally:*/ {
9177 /*normal exit:*/{
9178 PyMem_Free(__pyx_v_tmp);
9179 goto __pyx_L7;
9180 }
9181 __pyx_L6_error:;
9182 /*exception exit:*/{
9183 __Pyx_PyThreadState_declare
9184 __Pyx_PyThreadState_assign
9185 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9186 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9187 __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9188 if ( unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
9189 __Pyx_XGOTREF(__pyx_t_7);
9190 __Pyx_XGOTREF(__pyx_t_8);
9191 __Pyx_XGOTREF(__pyx_t_9);
9192 __Pyx_XGOTREF(__pyx_t_10);
9193 __Pyx_XGOTREF(__pyx_t_11);
9194 __Pyx_XGOTREF(__pyx_t_12);
9195 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9196 {
9197 PyMem_Free(__pyx_v_tmp);
9198 }
9199 __Pyx_XGIVEREF(__pyx_t_10);
9200 __Pyx_XGIVEREF(__pyx_t_11);
9201 __Pyx_XGIVEREF(__pyx_t_12);
9202 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9203 __Pyx_XGIVEREF(__pyx_t_7);
9204 __Pyx_XGIVEREF(__pyx_t_8);
9205 __Pyx_XGIVEREF(__pyx_t_9);
9206 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9207 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9208 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9209 goto __pyx_L1_error;
9210 }
9211 __pyx_L7:;
9212 }
9213
9214 /* "View.MemoryView":489
9215 *
9216 *
9217 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9218 * cdef int array[128]
9219 * cdef void *tmp = NULL
9220*/
9221
9222 /* function exit code */
9223 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9224 goto __pyx_L0;
9225 __pyx_L1_error:;
9226 __Pyx_XDECREF(__pyx_t_3);
9227 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9228 __pyx_r = 0;
9229 __pyx_L0:;
9230
9231
9232
9233
9234
9235 __Pyx_XGIVEREF(__pyx_r);
9236 __Pyx_RefNannyFinishContext();
9237 return __pyx_r;
9238}
9239
9240/* "View.MemoryView":522
9241 *
9242 *
9243 * cdef setitem_indexed(self, indices: tuple, value): # <<<<<<<<<<<<<<
9244 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9245 * self.assign_item_from_object(itemp, value)
9246*/
9247
9248static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value) {
9249 char *__pyx_v_itemp;
9250 PyObject *__pyx_r = NULL;
9251 __Pyx_RefNannyDeclarations
9252 char *__pyx_t_1;
9253 PyObject *__pyx_t_2 = NULL;
9254 int __pyx_lineno = 0;
9255 const char *__pyx_filename = NULL;
9256 int __pyx_clineno = 0;
9257 __Pyx_RefNannySetupContext("setitem_indexed", 0);
9258
9259 /* "View.MemoryView":523
9260 *
9261 * cdef setitem_indexed(self, indices: tuple, value):
9262 * cdef char *itemp = memoryview.get_item_pointer(self, indices) # <<<<<<<<<<<<<<
9263 * self.assign_item_from_object(itemp, value)
9264 *
9265*/
9266 __pyx_t_1 = __pyx_memoryview_get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 523, __pyx_L1_error)
9267 __pyx_v_itemp = __pyx_t_1;
9268
9269 /* "View.MemoryView":524
9270 * cdef setitem_indexed(self, indices: tuple, value):
9271 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9272 * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9273 *
9274 *
9275*/
9276 __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error)
9277 __Pyx_GOTREF(__pyx_t_2);
9278 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9279
9280 /* "View.MemoryView":522
9281 *
9282 *
9283 * cdef setitem_indexed(self, indices: tuple, value): # <<<<<<<<<<<<<<
9284 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9285 * self.assign_item_from_object(itemp, value)
9286*/
9287
9288 /* function exit code */
9289 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9290 goto __pyx_L0;
9291 __pyx_L1_error:;
9292 __Pyx_XDECREF(__pyx_t_2);
9293 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9294 __pyx_r = 0;
9295 __pyx_L0:;
9296
9297 __Pyx_XGIVEREF(__pyx_r);
9298 __Pyx_RefNannyFinishContext();
9299 return __pyx_r;
9300}
9301
9302/* "View.MemoryView":527
9303 *
9304 *
9305 * cdef setitem_indexed1(self, index, value): # <<<<<<<<<<<<<<
9306 * cdef char *buffer = <char *> self.view.buf
9307 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9308*/
9309
9310static PyObject *__pyx_memoryview_setitem_indexed1(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9311 char *__pyx_v_buffer;
9312 char *__pyx_v_itemp;
9313 PyObject *__pyx_r = NULL;
9314 __Pyx_RefNannyDeclarations
9315 Py_ssize_t __pyx_t_1;
9316 char *__pyx_t_2;
9317 PyObject *__pyx_t_3 = NULL;
9318 int __pyx_lineno = 0;
9319 const char *__pyx_filename = NULL;
9320 int __pyx_clineno = 0;
9321 __Pyx_RefNannySetupContext("setitem_indexed1", 0);
9322
9323 /* "View.MemoryView":528
9324 *
9325 * cdef setitem_indexed1(self, index, value):
9326 * cdef char *buffer = <char *> self.view.buf # <<<<<<<<<<<<<<
9327 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9328 * self.assign_item_from_object(itemp, value)
9329*/
9330 __pyx_v_buffer = ((char *)__pyx_v_self->view.buf);
9331
9332 /* "View.MemoryView":529
9333 * cdef setitem_indexed1(self, index, value):
9334 * cdef char *buffer = <char *> self.view.buf
9335 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0) # <<<<<<<<<<<<<<
9336 * self.assign_item_from_object(itemp, value)
9337 *
9338*/
9339 __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 529, __pyx_L1_error)
9340 __pyx_t_2 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_buffer, __pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((void *)NULL))) __PYX_ERR(1, 529, __pyx_L1_error)
9341 __pyx_v_itemp = __pyx_t_2;
9342
9343
9344 /* "View.MemoryView":530
9345 * cdef char *buffer = <char *> self.view.buf
9346 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9347 * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9348 *
9349 * cdef convert_item_to_object(self, char *itemp):
9350*/
9351 __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 530, __pyx_L1_error)
9352 __Pyx_GOTREF(__pyx_t_3);
9353 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9354
9355 /* "View.MemoryView":527
9356 *
9357 *
9358 * cdef setitem_indexed1(self, index, value): # <<<<<<<<<<<<<<
9359 * cdef char *buffer = <char *> self.view.buf
9360 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9361*/
9362
9363 /* function exit code */
9364 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9365 goto __pyx_L0;
9366 __pyx_L1_error:;
9367 __Pyx_XDECREF(__pyx_t_3);
9368 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed1", __pyx_clineno, __pyx_lineno, __pyx_filename);
9369 __pyx_r = 0;
9370 __pyx_L0:;
9371
9372
9373 __Pyx_XGIVEREF(__pyx_r);
9374 __Pyx_RefNannyFinishContext();
9375 return __pyx_r;
9376}
9377
9378/* "View.MemoryView":532
9379 * self.assign_item_from_object(itemp, value)
9380 *
9381 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9382 * """Only used if instantiated manually by the user, or if Cython doesn't
9383 * know how to convert the type"""
9384*/
9385
9386static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
9387 PyObject *__pyx_v_struct = NULL;
9388 PyObject *__pyx_v_bytesitem = 0;
9389 PyObject *__pyx_v_result = NULL;
9390 PyObject *__pyx_r = NULL;
9391 __Pyx_RefNannyDeclarations
9392 PyObject *__pyx_t_1 = NULL;
9393 PyObject *__pyx_t_2 = NULL;
9394 PyObject *__pyx_t_3 = NULL;
9395 PyObject *__pyx_t_4 = NULL;
9396 PyObject *__pyx_t_5 = NULL;
9397 PyObject *__pyx_t_6 = NULL;
9398 size_t __pyx_t_7;
9399 Py_ssize_t __pyx_t_8;
9400 int __pyx_t_9;
9401 PyObject *__pyx_t_10 = NULL;
9402 int __pyx_t_11;
9403 int __pyx_lineno = 0;
9404 const char *__pyx_filename = NULL;
9405 int __pyx_clineno = 0;
9406 __Pyx_RefNannySetupContext("convert_item_to_object", 0);
9407
9408 /* "View.MemoryView":535
9409 * """Only used if instantiated manually by the user, or if Cython doesn't
9410 * know how to convert the type"""
9411 * import struct # <<<<<<<<<<<<<<
9412 * cdef bytes bytesitem
9413 *
9414*/
9415 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error)
9416 __pyx_t_1 = __pyx_t_2;
9417 __Pyx_GOTREF(__pyx_t_1);
9418 __pyx_v_struct = __pyx_t_1;
9419 __pyx_t_1 = 0;
9420
9421 /* "View.MemoryView":538
9422 * cdef bytes bytesitem
9423 *
9424 * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
9425 * try:
9426 * result = struct.unpack(self.view.format, bytesitem)
9427*/
9428 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 538, __pyx_L1_error)
9429 __Pyx_GOTREF(__pyx_t_1);
9430 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9431 __pyx_t_1 = 0;
9432
9433 /* "View.MemoryView":539
9434 *
9435 * bytesitem = itemp[:self.view.itemsize]
9436 * try: # <<<<<<<<<<<<<<
9437 * result = struct.unpack(self.view.format, bytesitem)
9438 * except struct.error:
9439*/
9440 {
9441 __Pyx_PyThreadState_declare
9442 __Pyx_PyThreadState_assign
9443 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9444 __Pyx_XGOTREF(__pyx_t_2);
9445 __Pyx_XGOTREF(__pyx_t_3);
9446 __Pyx_XGOTREF(__pyx_t_4);
9447 /*try:*/ {
9448
9449 /* "View.MemoryView":540
9450 * bytesitem = itemp[:self.view.itemsize]
9451 * try:
9452 * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
9453 * except struct.error:
9454 * _err_ValueError("Unable to convert item to object")
9455*/
9456 __pyx_t_5 = __pyx_v_struct;
9457 __Pyx_INCREF(__pyx_t_5);
9458 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 540, __pyx_L3_error)
9459 __Pyx_GOTREF(__pyx_t_6);
9460 __pyx_t_7 = 0;
9461 {
9462 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_bytesitem};
9463 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_unpack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
9464 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9465 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9466 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L3_error)
9467 __Pyx_GOTREF(__pyx_t_1);
9468 }
9469 __pyx_v_result = __pyx_t_1;
9470 __pyx_t_1 = 0;
9471
9472 /* "View.MemoryView":539
9473 *
9474 * bytesitem = itemp[:self.view.itemsize]
9475 * try: # <<<<<<<<<<<<<<
9476 * result = struct.unpack(self.view.format, bytesitem)
9477 * except struct.error:
9478*/
9479 }
9480
9481 /* "View.MemoryView":544
9482 * _err_ValueError("Unable to convert item to object")
9483 * else:
9484 * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9485 * return result[0]
9486 * return result
9487*/
9488 /*else:*/ {
9489 __pyx_t_8 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 544, __pyx_L5_except_error)
9490 __pyx_t_9 = (__pyx_t_8 == 1);
9491
9492
9493 if (__pyx_t_9) {
9494
9495
9496 /* "View.MemoryView":545
9497 * else:
9498 * if len(self.view.format) == 1:
9499 * return result[0] # <<<<<<<<<<<<<<
9500 * return result
9501 *
9502*/
9503 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L5_except_error)
9504 __Pyx_GOTREF(__pyx_t_1);
9505 {
9506 PyObject *__pyx_temp;
9507 {
9508 __pyx_temp = __pyx_r;
9509 __pyx_r = __pyx_t_1;
9510 }
9511 __Pyx_XDECREF(__pyx_temp);
9512 }
9513 __pyx_t_1 = 0;
9514 goto __pyx_L6_except_return;
9515
9516 /* "View.MemoryView":544
9517 * _err_ValueError("Unable to convert item to object")
9518 * else:
9519 * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9520 * return result[0]
9521 * return result
9522*/
9523 }
9524
9525 /* "View.MemoryView":546
9526 * if len(self.view.format) == 1:
9527 * return result[0]
9528 * return result # <<<<<<<<<<<<<<
9529 *
9530 * cdef assign_item_from_object(self, char *itemp, object value):
9531*/
9532 {
9533 PyObject *__pyx_temp;
9534 {
9535 __pyx_temp = __pyx_r;
9536 __Pyx_INCREF(__pyx_v_result);
9537 __pyx_r = __pyx_v_result;
9538 }
9539 __Pyx_XDECREF(__pyx_temp);
9540 }
9541 goto __pyx_L6_except_return;
9542 }
9543 __pyx_L3_error:;
9544 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9545 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9546 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9547
9548 /* "View.MemoryView":541
9549 * try:
9550 * result = struct.unpack(self.view.format, bytesitem)
9551 * except struct.error: # <<<<<<<<<<<<<<
9552 * _err_ValueError("Unable to convert item to object")
9553 * else:
9554*/
9555 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5);
9556 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 541, __pyx_L5_except_error)
9557 __Pyx_GOTREF(__pyx_t_10);
9558 __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_10);
9559 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9560 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5);
9561 __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
9562 if (__pyx_t_11) {
9563 __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9564 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(1, 541, __pyx_L5_except_error)
9565 __Pyx_XGOTREF(__pyx_t_5);
9566 __Pyx_XGOTREF(__pyx_t_6);
9567 __Pyx_XGOTREF(__pyx_t_1);
9568
9569 /* "View.MemoryView":542
9570 * result = struct.unpack(self.view.format, bytesitem)
9571 * except struct.error:
9572 * _err_ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
9573 * else:
9574 * if len(self.view.format) == 1:
9575*/
9576 __pyx_t_11 = __pyx_memoryview_err_ValueError(__pyx_k_Unable_to_convert_item_to_object); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 542, __pyx_L5_except_error)
9577
9578 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9579 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9580 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9581 goto __pyx_L4_exception_handled;
9582 }
9583 goto __pyx_L5_except_error;
9584
9585 /* "View.MemoryView":539
9586 *
9587 * bytesitem = itemp[:self.view.itemsize]
9588 * try: # <<<<<<<<<<<<<<
9589 * result = struct.unpack(self.view.format, bytesitem)
9590 * except struct.error:
9591*/
9592 __pyx_L5_except_error:;
9593 __Pyx_XGIVEREF(__pyx_t_2);
9594 __Pyx_XGIVEREF(__pyx_t_3);
9595 __Pyx_XGIVEREF(__pyx_t_4);
9596 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9597 goto __pyx_L1_error;
9598 __pyx_L6_except_return:;
9599 __Pyx_XGIVEREF(__pyx_t_2);
9600 __Pyx_XGIVEREF(__pyx_t_3);
9601 __Pyx_XGIVEREF(__pyx_t_4);
9602 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9603 goto __pyx_L0;
9604 __pyx_L4_exception_handled:;
9605 __Pyx_XGIVEREF(__pyx_t_2);
9606 __Pyx_XGIVEREF(__pyx_t_3);
9607 __Pyx_XGIVEREF(__pyx_t_4);
9608 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9609 }
9610
9611 /* "View.MemoryView":532
9612 * self.assign_item_from_object(itemp, value)
9613 *
9614 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9615 * """Only used if instantiated manually by the user, or if Cython doesn't
9616 * know how to convert the type"""
9617*/
9618
9619 /* function exit code */
9620 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9621 goto __pyx_L0;
9622 __pyx_L1_error:;
9623 __Pyx_XDECREF(__pyx_t_1);
9624 __Pyx_XDECREF(__pyx_t_5);
9625 __Pyx_XDECREF(__pyx_t_6);
9626 __Pyx_XDECREF(__pyx_t_10);
9627 __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9628 __pyx_r = 0;
9629 __pyx_L0:;
9630 __Pyx_XDECREF(__pyx_v_struct);
9631 __Pyx_XDECREF(__pyx_v_bytesitem);
9632 __Pyx_XDECREF(__pyx_v_result);
9633 __Pyx_XGIVEREF(__pyx_r);
9634 __Pyx_RefNannyFinishContext();
9635 return __pyx_r;
9636}
9637
9638/* "View.MemoryView":548
9639 * return result
9640 *
9641 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9642 * """Only used if instantiated manually by the user, or if Cython doesn't
9643 * know how to convert the type"""
9644*/
9645
9646static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
9647 PyObject *__pyx_v_struct = NULL;
9648 char __pyx_v_c;
9649 PyObject *__pyx_v_bytesvalue = 0;
9650 Py_ssize_t __pyx_v_i;
9651 PyObject *__pyx_r = NULL;
9652 __Pyx_RefNannyDeclarations
9653 PyObject *__pyx_t_1 = NULL;
9654 PyObject *__pyx_t_2 = NULL;
9655 int __pyx_t_3;
9656 PyObject *__pyx_t_4 = NULL;
9657 PyObject *__pyx_t_5 = NULL;
9658 PyObject *__pyx_t_6 = NULL;
9659 size_t __pyx_t_7;
9660 Py_ssize_t __pyx_t_8;
9661 PyObject *__pyx_t_9 = NULL;
9662 char *__pyx_t_10;
9663 char *__pyx_t_11;
9664 Py_ssize_t __pyx_t_12;
9665 char *__pyx_t_13;
9666 char *__pyx_t_14;
9667 int __pyx_lineno = 0;
9668 const char *__pyx_filename = NULL;
9669 int __pyx_clineno = 0;
9670 __Pyx_RefNannySetupContext("assign_item_from_object", 0);
9671
9672 /* "View.MemoryView":551
9673 * """Only used if instantiated manually by the user, or if Cython doesn't
9674 * know how to convert the type"""
9675 * import struct # <<<<<<<<<<<<<<
9676 * cdef char c
9677 * cdef bytes bytesvalue
9678*/
9679 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
9680 __pyx_t_1 = __pyx_t_2;
9681 __Pyx_GOTREF(__pyx_t_1);
9682 __pyx_v_struct = __pyx_t_1;
9683 __pyx_t_1 = 0;
9684
9685 /* "View.MemoryView":556
9686 * cdef Py_ssize_t i
9687 *
9688 * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9689 * bytesvalue = struct.pack(self.view.format, *value)
9690 * else:
9691*/
9692 __pyx_t_3 = PyTuple_Check(__pyx_v_value);
9693 if (__pyx_t_3) {
9694
9695
9696 /* "View.MemoryView":557
9697 *
9698 * if isinstance(value, tuple):
9699 * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
9700 * else:
9701 * bytesvalue = struct.pack(self.view.format, value)
9702*/
9703 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 557, __pyx_L1_error)
9704 __Pyx_GOTREF(__pyx_t_1);
9705 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
9706 __Pyx_GOTREF(__pyx_t_4);
9707 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
9708 __Pyx_GOTREF(__pyx_t_5);
9709 __Pyx_GIVEREF(__pyx_t_4);
9710 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 557, __pyx_L1_error);
9711 __pyx_t_4 = 0;
9712 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
9713 __Pyx_GOTREF(__pyx_t_4);
9714 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 557, __pyx_L1_error)
9715 __Pyx_GOTREF(__pyx_t_6);
9716 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9717 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9718 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
9719 __Pyx_GOTREF(__pyx_t_4);
9720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9721 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9722 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(1, 557, __pyx_L1_error)
9723 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
9724 __pyx_t_4 = 0;
9725
9726 /* "View.MemoryView":556
9727 * cdef Py_ssize_t i
9728 *
9729 * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9730 * bytesvalue = struct.pack(self.view.format, *value)
9731 * else:
9732*/
9733 goto __pyx_L3;
9734 }
9735
9736 /* "View.MemoryView":559
9737 * bytesvalue = struct.pack(self.view.format, *value)
9738 * else:
9739 * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
9740 *
9741 * for i, c in enumerate(bytesvalue):
9742*/
9743 /*else*/ {
9744 __pyx_t_6 = __pyx_v_struct;
9745 __Pyx_INCREF(__pyx_t_6);
9746 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
9747 __Pyx_GOTREF(__pyx_t_1);
9748 __pyx_t_7 = 0;
9749 {
9750 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_value};
9751 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_pack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
9752 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9753 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9754 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 559, __pyx_L1_error)
9755 __Pyx_GOTREF(__pyx_t_4);
9756 }
9757 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(1, 559, __pyx_L1_error)
9758 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
9759 __pyx_t_4 = 0;
9760 }
9761 __pyx_L3:;
9762
9763 /* "View.MemoryView":561
9764 * bytesvalue = struct.pack(self.view.format, value)
9765 *
9766 * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9767 * itemp[i] = c
9768 *
9769*/
9770
9771 __pyx_t_8 = 0;
9772 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
9773 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 is not iterable");
9774 __PYX_ERR(1, 561, __pyx_L1_error)
9775 }
9776 __Pyx_INCREF(__pyx_v_bytesvalue);
9777 __pyx_t_9 = __pyx_v_bytesvalue;
9778 __pyx_t_11 = __Pyx_PyBytes_AsWritableString(__pyx_t_9); if (unlikely(__pyx_t_11 == ((char *)NULL))) __PYX_ERR(1, 561, __pyx_L1_error)
9779 __pyx_t_12 = __Pyx_PyBytes_GET_SIZE(__pyx_t_9); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(1, 561, __pyx_L1_error)
9780 __pyx_t_13 = (__pyx_t_11 + __pyx_t_12);
9781
9782 for (__pyx_t_14 = __pyx_t_11; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
9783 __pyx_t_10 = __pyx_t_14;
9784 __pyx_v_c = (__pyx_t_10[0]);
9785
9786 /* "View.MemoryView":562
9787 *
9788 * for i, c in enumerate(bytesvalue):
9789 * itemp[i] = c # <<<<<<<<<<<<<<
9790 *
9791 * @cname('getbuffer')
9792*/
9793 __pyx_v_i = __pyx_t_8;
9794
9795 /* "View.MemoryView":561
9796 * bytesvalue = struct.pack(self.view.format, value)
9797 *
9798 * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9799 * itemp[i] = c
9800 *
9801*/
9802 __pyx_t_8 = (__pyx_t_8 + 1);
9803
9804 /* "View.MemoryView":562
9805 *
9806 * for i, c in enumerate(bytesvalue):
9807 * itemp[i] = c # <<<<<<<<<<<<<<
9808 *
9809 * @cname('getbuffer')
9810*/
9811 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
9812 }
9813
9814
9815
9816 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9817
9818 /* "View.MemoryView":548
9819 * return result
9820 *
9821 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9822 * """Only used if instantiated manually by the user, or if Cython doesn't
9823 * know how to convert the type"""
9824*/
9825
9826 /* function exit code */
9827 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9828 goto __pyx_L0;
9829 __pyx_L1_error:;
9830 __Pyx_XDECREF(__pyx_t_1);
9831 __Pyx_XDECREF(__pyx_t_4);
9832 __Pyx_XDECREF(__pyx_t_5);
9833 __Pyx_XDECREF(__pyx_t_6);
9834 __Pyx_XDECREF(__pyx_t_9);
9835 __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9836 __pyx_r = 0;
9837 __pyx_L0:;
9838 __Pyx_XDECREF(__pyx_v_struct);
9839
9840 __Pyx_XDECREF(__pyx_v_bytesvalue);
9841
9842 __Pyx_XGIVEREF(__pyx_r);
9843 __Pyx_RefNannyFinishContext();
9844 return __pyx_r;
9845}
9846
9847/* "View.MemoryView":564
9848 * itemp[i] = c
9849 *
9850 * @cname('getbuffer') # <<<<<<<<<<<<<<
9851 * def __getbuffer__(self, Py_buffer *info, int flags):
9852 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
9853*/
9854
9855/* Python wrapper */
9856CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9857CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9858 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9859 int __pyx_r;
9860 __Pyx_RefNannyDeclarations
9861 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9862 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9863 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9864
9865 /* function exit code */
9866
9867
9868 __Pyx_RefNannyFinishContext();
9869 return __pyx_r;
9870}
9871
9872static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9873 int __pyx_r;
9874 __Pyx_RefNannyDeclarations
9875 int __pyx_t_1;
9876 int __pyx_t_2;
9877 int __pyx_t_3;
9878 Py_ssize_t *__pyx_t_4;
9879 char *__pyx_t_5;
9880 void *__pyx_t_6;
9881 Py_ssize_t __pyx_t_7;
9882 int __pyx_lineno = 0;
9883 const char *__pyx_filename = NULL;
9884 int __pyx_clineno = 0;
9885 if (unlikely(__pyx_v_info == NULL)) {
9886 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9887 return -1;
9888 }
9889 __Pyx_RefNannySetupContext("__getbuffer__", 0);
9890 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9891 __Pyx_GIVEREF(__pyx_v_info->obj);
9892
9893 /* "View.MemoryView":566
9894 * @cname('getbuffer')
9895 * def __getbuffer__(self, Py_buffer *info, int flags):
9896 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly): # <<<<<<<<<<<<<<
9897 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
9898 *
9899*/
9900 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
9901
9902 if (__pyx_t_2) {
9903
9904 } else {
9905
9906 __pyx_t_1 = __pyx_t_2;
9907
9908 goto __pyx_L4_bool_binop_done;
9909 }
9910
9911 __pyx_t_1 = __pyx_v_self->view.readonly;
9912 __pyx_L4_bool_binop_done:;
9913 if (unlikely(__pyx_t_1)) {
9914
9915
9916 /* "View.MemoryView":567
9917 * def __getbuffer__(self, Py_buffer *info, int flags):
9918 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
9919 * _err_ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
9920 *
9921 * if flags & PyBUF_ND:
9922*/
9923 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_Cannot_create_writable_memory_vi); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 567, __pyx_L1_error)
9924
9925
9926 /* "View.MemoryView":566
9927 * @cname('getbuffer')
9928 * def __getbuffer__(self, Py_buffer *info, int flags):
9929 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly): # <<<<<<<<<<<<<<
9930 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
9931 *
9932*/
9933 }
9934
9935 /* "View.MemoryView":569
9936 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
9937 *
9938 * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
9939 * info.shape = self.view.shape
9940 * else:
9941*/
9942 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
9943
9944 if (__pyx_t_1) {
9945
9946
9947 /* "View.MemoryView":570
9948 *
9949 * if flags & PyBUF_ND:
9950 * info.shape = self.view.shape # <<<<<<<<<<<<<<
9951 * else:
9952 * info.shape = NULL
9953*/
9954 __pyx_t_4 = __pyx_v_self->view.shape;
9955
9956 __pyx_v_info->shape = __pyx_t_4;
9957
9958 /* "View.MemoryView":569
9959 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
9960 *
9961 * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
9962 * info.shape = self.view.shape
9963 * else:
9964*/
9965 goto __pyx_L6;
9966 }
9967
9968 /* "View.MemoryView":572
9969 * info.shape = self.view.shape
9970 * else:
9971 * info.shape = NULL # <<<<<<<<<<<<<<
9972 *
9973 * if flags & PyBUF_STRIDES:
9974*/
9975 /*else*/ {
9976 __pyx_v_info->shape = NULL;
9977 }
9978 __pyx_L6:;
9979
9980 /* "View.MemoryView":574
9981 * info.shape = NULL
9982 *
9983 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
9984 * info.strides = self.view.strides
9985 * else:
9986*/
9987 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
9988
9989 if (__pyx_t_1) {
9990
9991
9992 /* "View.MemoryView":575
9993 *
9994 * if flags & PyBUF_STRIDES:
9995 * info.strides = self.view.strides # <<<<<<<<<<<<<<
9996 * else:
9997 * info.strides = NULL
9998*/
9999 __pyx_t_4 = __pyx_v_self->view.strides;
10000
10001 __pyx_v_info->strides = __pyx_t_4;
10002
10003 /* "View.MemoryView":574
10004 * info.shape = NULL
10005 *
10006 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10007 * info.strides = self.view.strides
10008 * else:
10009*/
10010 goto __pyx_L7;
10011 }
10012
10013 /* "View.MemoryView":577
10014 * info.strides = self.view.strides
10015 * else:
10016 * info.strides = NULL # <<<<<<<<<<<<<<
10017 *
10018 * if flags & PyBUF_INDIRECT:
10019*/
10020 /*else*/ {
10021 __pyx_v_info->strides = NULL;
10022 }
10023 __pyx_L7:;
10024
10025 /* "View.MemoryView":579
10026 * info.strides = NULL
10027 *
10028 * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10029 * info.suboffsets = self.view.suboffsets
10030 * else:
10031*/
10032 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10033
10034 if (__pyx_t_1) {
10035
10036
10037 /* "View.MemoryView":580
10038 *
10039 * if flags & PyBUF_INDIRECT:
10040 * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
10041 * else:
10042 * info.suboffsets = NULL
10043*/
10044 __pyx_t_4 = __pyx_v_self->view.suboffsets;
10045
10046 __pyx_v_info->suboffsets = __pyx_t_4;
10047
10048 /* "View.MemoryView":579
10049 * info.strides = NULL
10050 *
10051 * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10052 * info.suboffsets = self.view.suboffsets
10053 * else:
10054*/
10055 goto __pyx_L8;
10056 }
10057
10058 /* "View.MemoryView":582
10059 * info.suboffsets = self.view.suboffsets
10060 * else:
10061 * info.suboffsets = NULL # <<<<<<<<<<<<<<
10062 *
10063 * if flags & PyBUF_FORMAT:
10064*/
10065 /*else*/ {
10066 __pyx_v_info->suboffsets = NULL;
10067 }
10068 __pyx_L8:;
10069
10070 /* "View.MemoryView":584
10071 * info.suboffsets = NULL
10072 *
10073 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10074 * info.format = self.view.format
10075 * else:
10076*/
10077 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10078
10079 if (__pyx_t_1) {
10080
10081
10082 /* "View.MemoryView":585
10083 *
10084 * if flags & PyBUF_FORMAT:
10085 * info.format = self.view.format # <<<<<<<<<<<<<<
10086 * else:
10087 * info.format = NULL
10088*/
10089 __pyx_t_5 = __pyx_v_self->view.format;
10090
10091 __pyx_v_info->format = __pyx_t_5;
10092
10093 /* "View.MemoryView":584
10094 * info.suboffsets = NULL
10095 *
10096 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10097 * info.format = self.view.format
10098 * else:
10099*/
10100 goto __pyx_L9;
10101 }
10102
10103 /* "View.MemoryView":587
10104 * info.format = self.view.format
10105 * else:
10106 * info.format = NULL # <<<<<<<<<<<<<<
10107 *
10108 * info.buf = self.view.buf
10109*/
10110 /*else*/ {
10111 __pyx_v_info->format = NULL;
10112 }
10113 __pyx_L9:;
10114
10115 /* "View.MemoryView":589
10116 * info.format = NULL
10117 *
10118 * info.buf = self.view.buf # <<<<<<<<<<<<<<
10119 * info.ndim = self.view.ndim
10120 * info.itemsize = self.view.itemsize
10121*/
10122 __pyx_t_6 = __pyx_v_self->view.buf;
10123
10124 __pyx_v_info->buf = __pyx_t_6;
10125
10126 /* "View.MemoryView":590
10127 *
10128 * info.buf = self.view.buf
10129 * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
10130 * info.itemsize = self.view.itemsize
10131 * info.len = self.view.len
10132*/
10133 __pyx_t_3 = __pyx_v_self->view.ndim;
10134
10135 __pyx_v_info->ndim = __pyx_t_3;
10136
10137 /* "View.MemoryView":591
10138 * info.buf = self.view.buf
10139 * info.ndim = self.view.ndim
10140 * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
10141 * info.len = self.view.len
10142 * info.readonly = self.view.readonly
10143*/
10144 __pyx_t_7 = __pyx_v_self->view.itemsize;
10145
10146 __pyx_v_info->itemsize = __pyx_t_7;
10147
10148 /* "View.MemoryView":592
10149 * info.ndim = self.view.ndim
10150 * info.itemsize = self.view.itemsize
10151 * info.len = self.view.len # <<<<<<<<<<<<<<
10152 * info.readonly = self.view.readonly
10153 * info.obj = self
10154*/
10155 __pyx_t_7 = __pyx_v_self->view.len;
10156
10157 __pyx_v_info->len = __pyx_t_7;
10158
10159 /* "View.MemoryView":593
10160 * info.itemsize = self.view.itemsize
10161 * info.len = self.view.len
10162 * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
10163 * info.obj = self
10164 *
10165*/
10166 __pyx_t_1 = __pyx_v_self->view.readonly;
10167
10168 __pyx_v_info->readonly = __pyx_t_1;
10169
10170 /* "View.MemoryView":594
10171 * info.len = self.view.len
10172 * info.readonly = self.view.readonly
10173 * info.obj = self # <<<<<<<<<<<<<<
10174 *
10175 *
10176*/
10177 __Pyx_INCREF((PyObject *)__pyx_v_self);
10178 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10179 __Pyx_GOTREF(__pyx_v_info->obj);
10180 __Pyx_DECREF(__pyx_v_info->obj);
10181 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10182
10183 /* "View.MemoryView":564
10184 * itemp[i] = c
10185 *
10186 * @cname('getbuffer') # <<<<<<<<<<<<<<
10187 * def __getbuffer__(self, Py_buffer *info, int flags):
10188 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
10189*/
10190
10191 /* function exit code */
10192 __pyx_r = 0;
10193 goto __pyx_L0;
10194 __pyx_L1_error:;
10195 __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10196 __pyx_r = -1;
10197 if (__pyx_v_info->obj != NULL) {
10198 __Pyx_GOTREF(__pyx_v_info->obj);
10199 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10200 }
10201 goto __pyx_L2;
10202 __pyx_L0:;
10203 if (__pyx_v_info->obj == Py_None) {
10204 __Pyx_GOTREF(__pyx_v_info->obj);
10205 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10206 }
10207 __pyx_L2:;
10208
10209 __Pyx_RefNannyFinishContext();
10210 return __pyx_r;
10211}
10212
10213/* "View.MemoryView":597
10214 *
10215 *
10216 * @property # <<<<<<<<<<<<<<
10217 * def T(self):
10218 * cdef _memoryviewslice result = memoryview_copy(self)
10219*/
10220
10221/* Python wrapper */
10222static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
10223static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10224 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10225 PyObject *__pyx_r = 0;
10226 __Pyx_RefNannyDeclarations
10227 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10228 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10229 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10230
10231 /* function exit code */
10232 __Pyx_RefNannyFinishContext();
10233 return __pyx_r;
10234}
10235
10236static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10237 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10238 PyObject *__pyx_r = NULL;
10239 __Pyx_RefNannyDeclarations
10240 PyObject *__pyx_t_1 = NULL;
10241 int __pyx_t_2;
10242 int __pyx_lineno = 0;
10243 const char *__pyx_filename = NULL;
10244 int __pyx_clineno = 0;
10245 __Pyx_RefNannySetupContext("__get__", 0);
10246
10247 /* "View.MemoryView":599
10248 * @property
10249 * def T(self):
10250 * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
10251 * transpose_memslice(&result.from_slice)
10252 * return result
10253*/
10254 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 599, __pyx_L1_error)
10255 __Pyx_GOTREF(__pyx_t_1);
10256 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 599, __pyx_L1_error)
10257 __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10258 __pyx_t_1 = 0;
10259
10260 /* "View.MemoryView":600
10261 * def T(self):
10262 * cdef _memoryviewslice result = memoryview_copy(self)
10263 * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
10264 * return result
10265 *
10266*/
10267 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 600, __pyx_L1_error)
10268
10269
10270 /* "View.MemoryView":601
10271 * cdef _memoryviewslice result = memoryview_copy(self)
10272 * transpose_memslice(&result.from_slice)
10273 * return result # <<<<<<<<<<<<<<
10274 *
10275 * @property
10276*/
10277 {
10278 PyObject *__pyx_temp;
10279 {
10280 __pyx_temp = __pyx_r;
10281 __Pyx_INCREF((PyObject *)__pyx_v_result);
10282 __pyx_r = ((PyObject *)__pyx_v_result);
10283 }
10284 __Pyx_XDECREF(__pyx_temp);
10285 }
10286 goto __pyx_L0;
10287
10288 /* "View.MemoryView":597
10289 *
10290 *
10291 * @property # <<<<<<<<<<<<<<
10292 * def T(self):
10293 * cdef _memoryviewslice result = memoryview_copy(self)
10294*/
10295
10296 /* function exit code */
10297 __pyx_L1_error:;
10298 __Pyx_XDECREF(__pyx_t_1);
10299 __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10300 __pyx_r = NULL;
10301 __pyx_L0:;
10302 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10303 __Pyx_XGIVEREF(__pyx_r);
10304 __Pyx_RefNannyFinishContext();
10305 return __pyx_r;
10306}
10307
10308/* "View.MemoryView":603
10309 * return result
10310 *
10311 * @property # <<<<<<<<<<<<<<
10312 * def base(self):
10313 * return self._get_base()
10314*/
10315
10316/* Python wrapper */
10317static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
10318static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10319 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10320 PyObject *__pyx_r = 0;
10321 __Pyx_RefNannyDeclarations
10322 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10323 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10324 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10325
10326 /* function exit code */
10327 __Pyx_RefNannyFinishContext();
10328 return __pyx_r;
10329}
10330
10331static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10332 PyObject *__pyx_r = NULL;
10333 __Pyx_RefNannyDeclarations
10334 PyObject *__pyx_t_1 = NULL;
10335 int __pyx_lineno = 0;
10336 const char *__pyx_filename = NULL;
10337 int __pyx_clineno = 0;
10338 __Pyx_RefNannySetupContext("__get__", 0);
10339
10340 /* "View.MemoryView":605
10341 * @property
10342 * def base(self):
10343 * return self._get_base() # <<<<<<<<<<<<<<
10344 *
10345 * cdef _get_base(self):
10346*/
10347 __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 605, __pyx_L1_error)
10348 __Pyx_GOTREF(__pyx_t_1);
10349 {
10350 PyObject *__pyx_temp;
10351 {
10352 __pyx_temp = __pyx_r;
10353 __pyx_r = __pyx_t_1;
10354 }
10355 __Pyx_XDECREF(__pyx_temp);
10356 }
10357 __pyx_t_1 = 0;
10358 goto __pyx_L0;
10359
10360 /* "View.MemoryView":603
10361 * return result
10362 *
10363 * @property # <<<<<<<<<<<<<<
10364 * def base(self):
10365 * return self._get_base()
10366*/
10367
10368 /* function exit code */
10369 __pyx_L1_error:;
10370 __Pyx_XDECREF(__pyx_t_1);
10371 __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10372 __pyx_r = NULL;
10373 __pyx_L0:;
10374 __Pyx_XGIVEREF(__pyx_r);
10375 __Pyx_RefNannyFinishContext();
10376 return __pyx_r;
10377}
10378
10379/* "View.MemoryView":607
10380 * return self._get_base()
10381 *
10382 * cdef _get_base(self): # <<<<<<<<<<<<<<
10383 * return self.obj
10384 *
10385*/
10386
10387static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
10388 PyObject *__pyx_r = NULL;
10389 __Pyx_RefNannyDeclarations
10390 __Pyx_RefNannySetupContext("_get_base", 0);
10391
10392 /* "View.MemoryView":608
10393 *
10394 * cdef _get_base(self):
10395 * return self.obj # <<<<<<<<<<<<<<
10396 *
10397 * @property
10398*/
10399 {
10400 PyObject *__pyx_temp;
10401 {
10402 __pyx_temp = __pyx_r;
10403 __Pyx_INCREF(__pyx_v_self->obj);
10404 __pyx_r = __pyx_v_self->obj;
10405 }
10406 __Pyx_XDECREF(__pyx_temp);
10407 }
10408 goto __pyx_L0;
10409
10410 /* "View.MemoryView":607
10411 * return self._get_base()
10412 *
10413 * cdef _get_base(self): # <<<<<<<<<<<<<<
10414 * return self.obj
10415 *
10416*/
10417
10418 /* function exit code */
10419 __pyx_L0:;
10420 __Pyx_XGIVEREF(__pyx_r);
10421 __Pyx_RefNannyFinishContext();
10422 return __pyx_r;
10423}
10424
10425/* "View.MemoryView":610
10426 * return self.obj
10427 *
10428 * @property # <<<<<<<<<<<<<<
10429 * def shape(self):
10430 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10431*/
10432
10433/* Python wrapper */
10434static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
10435static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10436 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10437 PyObject *__pyx_r = 0;
10438 __Pyx_RefNannyDeclarations
10439 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10440 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10441 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10442
10443 /* function exit code */
10444 __Pyx_RefNannyFinishContext();
10445 return __pyx_r;
10446}
10447
10448static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10449 Py_ssize_t __pyx_7genexpr__pyx_v_length;
10450 PyObject *__pyx_r = NULL;
10451 __Pyx_RefNannyDeclarations
10452 PyObject *__pyx_t_1 = NULL;
10453 Py_ssize_t *__pyx_t_2;
10454 Py_ssize_t *__pyx_t_3;
10455 Py_ssize_t *__pyx_t_4;
10456 PyObject *__pyx_t_5 = NULL;
10457 int __pyx_lineno = 0;
10458 const char *__pyx_filename = NULL;
10459 int __pyx_clineno = 0;
10460 __Pyx_RefNannySetupContext("__get__", 0);
10461
10462 /* "View.MemoryView":612
10463 * @property
10464 * def shape(self):
10465 * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
10466 *
10467 * @property
10468*/
10469 { /* enter inner scope */
10470 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
10471 __Pyx_GOTREF(__pyx_t_1);
10472 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10473
10474 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10475 __pyx_t_2 = __pyx_t_4;
10476 __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
10477 __pyx_t_5 = PyLong_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10478 __Pyx_GOTREF(__pyx_t_5);
10479 __Pyx_GIVEREF(__pyx_t_5);
10480 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, __pyx_t_5))) __PYX_ERR(1, 612, __pyx_L1_error)
10481 __pyx_t_5 = 0;
10482 }
10483
10484 } /* exit inner scope */
10485 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10486 __Pyx_GOTREF(__pyx_t_5);
10487 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10488 {
10489 PyObject *__pyx_temp;
10490 {
10491 __pyx_temp = __pyx_r;
10492 __pyx_r = __pyx_t_5;
10493 }
10494 __Pyx_XDECREF(__pyx_temp);
10495 }
10496 __pyx_t_5 = 0;
10497 goto __pyx_L0;
10498
10499 /* "View.MemoryView":610
10500 * return self.obj
10501 *
10502 * @property # <<<<<<<<<<<<<<
10503 * def shape(self):
10504 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10505*/
10506
10507 /* function exit code */
10508 __pyx_L1_error:;
10509 __Pyx_XDECREF(__pyx_t_1);
10510 __Pyx_XDECREF(__pyx_t_5);
10511 __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10512 __pyx_r = NULL;
10513 __pyx_L0:;
10514
10515 __Pyx_XGIVEREF(__pyx_r);
10516 __Pyx_RefNannyFinishContext();
10517 return __pyx_r;
10518}
10519
10520/* "View.MemoryView":614
10521 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10522 *
10523 * @property # <<<<<<<<<<<<<<
10524 * def strides(self):
10525 * if cython.unlikely(self.view.strides == NULL):
10526*/
10527
10528/* Python wrapper */
10529static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
10530static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10531 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10532 PyObject *__pyx_r = 0;
10533 __Pyx_RefNannyDeclarations
10534 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10535 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10536 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10537
10538 /* function exit code */
10539 __Pyx_RefNannyFinishContext();
10540 return __pyx_r;
10541}
10542
10543static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10544 Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
10545 PyObject *__pyx_r = NULL;
10546 __Pyx_RefNannyDeclarations
10547 int __pyx_t_1;
10548 int __pyx_t_2;
10549 PyObject *__pyx_t_3 = NULL;
10550 Py_ssize_t *__pyx_t_4;
10551 Py_ssize_t *__pyx_t_5;
10552 Py_ssize_t *__pyx_t_6;
10553 PyObject *__pyx_t_7 = NULL;
10554 int __pyx_lineno = 0;
10555 const char *__pyx_filename = NULL;
10556 int __pyx_clineno = 0;
10557 __Pyx_RefNannySetupContext("__get__", 0);
10558
10559 /* "View.MemoryView":616
10560 * @property
10561 * def strides(self):
10562 * if cython.unlikely(self.view.strides == NULL): # <<<<<<<<<<<<<<
10563 *
10564 * _err_ValueError("Buffer view does not expose strides")
10565*/
10566 __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
10567
10568 if (unlikely(__pyx_t_1)) {
10569
10570
10571 /* "View.MemoryView":618
10572 * if cython.unlikely(self.view.strides == NULL):
10573 *
10574 * _err_ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
10575 *
10576 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10577*/
10578 __pyx_t_2 = __pyx_memoryview_err_ValueError(__pyx_k_Buffer_view_does_not_expose_stri); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 618, __pyx_L1_error)
10579
10580
10581 /* "View.MemoryView":616
10582 * @property
10583 * def strides(self):
10584 * if cython.unlikely(self.view.strides == NULL): # <<<<<<<<<<<<<<
10585 *
10586 * _err_ValueError("Buffer view does not expose strides")
10587*/
10588 }
10589
10590 /* "View.MemoryView":620
10591 * _err_ValueError("Buffer view does not expose strides")
10592 *
10593 * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
10594 *
10595 * @property
10596*/
10597 { /* enter inner scope */
10598 __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 620, __pyx_L1_error)
10599 __Pyx_GOTREF(__pyx_t_3);
10600 __pyx_t_5 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
10601
10602 for (__pyx_t_6 = __pyx_v_self->view.strides; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
10603 __pyx_t_4 = __pyx_t_6;
10604 __pyx_8genexpr1__pyx_v_stride = (__pyx_t_4[0]);
10605 __pyx_t_7 = PyLong_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10606 __Pyx_GOTREF(__pyx_t_7);
10607 __Pyx_GIVEREF(__pyx_t_7);
10608 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_3, __pyx_t_7))) __PYX_ERR(1, 620, __pyx_L1_error)
10609 __pyx_t_7 = 0;
10610 }
10611
10612 } /* exit inner scope */
10613 __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10614 __Pyx_GOTREF(__pyx_t_7);
10615 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10616 {
10617 PyObject *__pyx_temp;
10618 {
10619 __pyx_temp = __pyx_r;
10620 __pyx_r = __pyx_t_7;
10621 }
10622 __Pyx_XDECREF(__pyx_temp);
10623 }
10624 __pyx_t_7 = 0;
10625 goto __pyx_L0;
10626
10627 /* "View.MemoryView":614
10628 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10629 *
10630 * @property # <<<<<<<<<<<<<<
10631 * def strides(self):
10632 * if cython.unlikely(self.view.strides == NULL):
10633*/
10634
10635 /* function exit code */
10636 __pyx_L1_error:;
10637 __Pyx_XDECREF(__pyx_t_3);
10638 __Pyx_XDECREF(__pyx_t_7);
10639 __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10640 __pyx_r = NULL;
10641 __pyx_L0:;
10642
10643 __Pyx_XGIVEREF(__pyx_r);
10644 __Pyx_RefNannyFinishContext();
10645 return __pyx_r;
10646}
10647
10648/* "View.MemoryView":622
10649 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10650 *
10651 * @property # <<<<<<<<<<<<<<
10652 * def suboffsets(self):
10653 * if self.view.suboffsets == NULL:
10654*/
10655
10656/* Python wrapper */
10657static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
10658static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
10659 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10660 PyObject *__pyx_r = 0;
10661 __Pyx_RefNannyDeclarations
10662 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10663 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10664 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10665
10666 /* function exit code */
10667 __Pyx_RefNannyFinishContext();
10668 return __pyx_r;
10669}
10670
10671static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10672 Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
10673 PyObject *__pyx_r = NULL;
10674 __Pyx_RefNannyDeclarations
10675 int __pyx_t_1;
10676 PyObject *__pyx_t_2 = NULL;
10677 Py_ssize_t *__pyx_t_3;
10678 Py_ssize_t *__pyx_t_4;
10679 Py_ssize_t *__pyx_t_5;
10680 PyObject *__pyx_t_6 = NULL;
10681 int __pyx_lineno = 0;
10682 const char *__pyx_filename = NULL;
10683 int __pyx_clineno = 0;
10684 __Pyx_RefNannySetupContext("__get__", 0);
10685
10686 /* "View.MemoryView":624
10687 * @property
10688 * def suboffsets(self):
10689 * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10690 * return (-1,) * self.view.ndim
10691 *
10692*/
10693 __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
10694
10695 if (__pyx_t_1) {
10696
10697
10698 /* "View.MemoryView":625
10699 * def suboffsets(self):
10700 * if self.view.suboffsets == NULL:
10701 * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
10702 *
10703 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10704*/
10705 __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[0], __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
10706 __Pyx_GOTREF(__pyx_t_2);
10707 {
10708 PyObject *__pyx_temp;
10709 {
10710 __pyx_temp = __pyx_r;
10711 __pyx_r = __pyx_t_2;
10712 }
10713 __Pyx_XDECREF(__pyx_temp);
10714 }
10715 __pyx_t_2 = 0;
10716 goto __pyx_L0;
10717
10718 /* "View.MemoryView":624
10719 * @property
10720 * def suboffsets(self):
10721 * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10722 * return (-1,) * self.view.ndim
10723 *
10724*/
10725 }
10726
10727 /* "View.MemoryView":627
10728 * return (-1,) * self.view.ndim
10729 *
10730 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
10731 *
10732 * @property
10733*/
10734 { /* enter inner scope */
10735 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error)
10736 __Pyx_GOTREF(__pyx_t_2);
10737 __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
10738
10739 for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10740 __pyx_t_3 = __pyx_t_5;
10741 __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
10742 __pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
10743 __Pyx_GOTREF(__pyx_t_6);
10744 __Pyx_GIVEREF(__pyx_t_6);
10745 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_2, __pyx_t_6))) __PYX_ERR(1, 627, __pyx_L1_error)
10746 __pyx_t_6 = 0;
10747 }
10748
10749 } /* exit inner scope */
10750 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
10751 __Pyx_GOTREF(__pyx_t_6);
10752 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10753 {
10754 PyObject *__pyx_temp;
10755 {
10756 __pyx_temp = __pyx_r;
10757 __pyx_r = __pyx_t_6;
10758 }
10759 __Pyx_XDECREF(__pyx_temp);
10760 }
10761 __pyx_t_6 = 0;
10762 goto __pyx_L0;
10763
10764 /* "View.MemoryView":622
10765 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10766 *
10767 * @property # <<<<<<<<<<<<<<
10768 * def suboffsets(self):
10769 * if self.view.suboffsets == NULL:
10770*/
10771
10772 /* function exit code */
10773 __pyx_L1_error:;
10774 __Pyx_XDECREF(__pyx_t_2);
10775 __Pyx_XDECREF(__pyx_t_6);
10776 __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10777 __pyx_r = NULL;
10778 __pyx_L0:;
10779
10780 __Pyx_XGIVEREF(__pyx_r);
10781 __Pyx_RefNannyFinishContext();
10782 return __pyx_r;
10783}
10784
10785/* "View.MemoryView":629
10786 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10787 *
10788 * @property # <<<<<<<<<<<<<<
10789 * def ndim(self):
10790 * return self.view.ndim
10791*/
10792
10793/* Python wrapper */
10794static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
10795static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
10796 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10797 PyObject *__pyx_r = 0;
10798 __Pyx_RefNannyDeclarations
10799 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10800 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10801 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10802
10803 /* function exit code */
10804 __Pyx_RefNannyFinishContext();
10805 return __pyx_r;
10806}
10807
10808static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10809 PyObject *__pyx_r = NULL;
10810 __Pyx_RefNannyDeclarations
10811 PyObject *__pyx_t_1 = NULL;
10812 int __pyx_lineno = 0;
10813 const char *__pyx_filename = NULL;
10814 int __pyx_clineno = 0;
10815 __Pyx_RefNannySetupContext("__get__", 0);
10816
10817 /* "View.MemoryView":631
10818 * @property
10819 * def ndim(self):
10820 * return self.view.ndim # <<<<<<<<<<<<<<
10821 *
10822 * @property
10823*/
10824 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 631, __pyx_L1_error)
10825 __Pyx_GOTREF(__pyx_t_1);
10826 {
10827 PyObject *__pyx_temp;
10828 {
10829 __pyx_temp = __pyx_r;
10830 __pyx_r = __pyx_t_1;
10831 }
10832 __Pyx_XDECREF(__pyx_temp);
10833 }
10834 __pyx_t_1 = 0;
10835 goto __pyx_L0;
10836
10837 /* "View.MemoryView":629
10838 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10839 *
10840 * @property # <<<<<<<<<<<<<<
10841 * def ndim(self):
10842 * return self.view.ndim
10843*/
10844
10845 /* function exit code */
10846 __pyx_L1_error:;
10847 __Pyx_XDECREF(__pyx_t_1);
10848 __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10849 __pyx_r = NULL;
10850 __pyx_L0:;
10851 __Pyx_XGIVEREF(__pyx_r);
10852 __Pyx_RefNannyFinishContext();
10853 return __pyx_r;
10854}
10855
10856/* "View.MemoryView":633
10857 * return self.view.ndim
10858 *
10859 * @property # <<<<<<<<<<<<<<
10860 * def itemsize(self):
10861 * return self.view.itemsize
10862*/
10863
10864/* Python wrapper */
10865static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
10866static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
10867 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10868 PyObject *__pyx_r = 0;
10869 __Pyx_RefNannyDeclarations
10870 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10871 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10872 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10873
10874 /* function exit code */
10875 __Pyx_RefNannyFinishContext();
10876 return __pyx_r;
10877}
10878
10879static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10880 PyObject *__pyx_r = NULL;
10881 __Pyx_RefNannyDeclarations
10882 PyObject *__pyx_t_1 = NULL;
10883 int __pyx_lineno = 0;
10884 const char *__pyx_filename = NULL;
10885 int __pyx_clineno = 0;
10886 __Pyx_RefNannySetupContext("__get__", 0);
10887
10888 /* "View.MemoryView":635
10889 * @property
10890 * def itemsize(self):
10891 * return self.view.itemsize # <<<<<<<<<<<<<<
10892 *
10893 * @property
10894*/
10895 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 635, __pyx_L1_error)
10896 __Pyx_GOTREF(__pyx_t_1);
10897 {
10898 PyObject *__pyx_temp;
10899 {
10900 __pyx_temp = __pyx_r;
10901 __pyx_r = __pyx_t_1;
10902 }
10903 __Pyx_XDECREF(__pyx_temp);
10904 }
10905 __pyx_t_1 = 0;
10906 goto __pyx_L0;
10907
10908 /* "View.MemoryView":633
10909 * return self.view.ndim
10910 *
10911 * @property # <<<<<<<<<<<<<<
10912 * def itemsize(self):
10913 * return self.view.itemsize
10914*/
10915
10916 /* function exit code */
10917 __pyx_L1_error:;
10918 __Pyx_XDECREF(__pyx_t_1);
10919 __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10920 __pyx_r = NULL;
10921 __pyx_L0:;
10922 __Pyx_XGIVEREF(__pyx_r);
10923 __Pyx_RefNannyFinishContext();
10924 return __pyx_r;
10925}
10926
10927/* "View.MemoryView":637
10928 * return self.view.itemsize
10929 *
10930 * @property # <<<<<<<<<<<<<<
10931 * def nbytes(self):
10932 * return self.size * self.view.itemsize
10933*/
10934
10935/* Python wrapper */
10936static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
10937static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
10938 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10939 PyObject *__pyx_r = 0;
10940 __Pyx_RefNannyDeclarations
10941 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10942 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10943 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10944
10945 /* function exit code */
10946 __Pyx_RefNannyFinishContext();
10947 return __pyx_r;
10948}
10949
10950static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10951 PyObject *__pyx_r = NULL;
10952 __Pyx_RefNannyDeclarations
10953 PyObject *__pyx_t_1 = NULL;
10954 PyObject *__pyx_t_2 = NULL;
10955 PyObject *__pyx_t_3 = NULL;
10956 int __pyx_lineno = 0;
10957 const char *__pyx_filename = NULL;
10958 int __pyx_clineno = 0;
10959 __Pyx_RefNannySetupContext("__get__", 0);
10960
10961 /* "View.MemoryView":639
10962 * @property
10963 * def nbytes(self):
10964 * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
10965 *
10966 * @property
10967*/
10968 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 639, __pyx_L1_error)
10969 __Pyx_GOTREF(__pyx_t_1);
10970 __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
10971 __Pyx_GOTREF(__pyx_t_2);
10972 __pyx_t_3 = __Pyx_PyNumber_Multiply_object_int(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 639, __pyx_L1_error)
10973 __Pyx_GOTREF(__pyx_t_3);
10974 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10975 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10976 {
10977 PyObject *__pyx_temp;
10978 {
10979 __pyx_temp = __pyx_r;
10980 __pyx_r = __pyx_t_3;
10981 }
10982 __Pyx_XDECREF(__pyx_temp);
10983 }
10984 __pyx_t_3 = 0;
10985 goto __pyx_L0;
10986
10987 /* "View.MemoryView":637
10988 * return self.view.itemsize
10989 *
10990 * @property # <<<<<<<<<<<<<<
10991 * def nbytes(self):
10992 * return self.size * self.view.itemsize
10993*/
10994
10995 /* function exit code */
10996 __pyx_L1_error:;
10997 __Pyx_XDECREF(__pyx_t_1);
10998 __Pyx_XDECREF(__pyx_t_2);
10999 __Pyx_XDECREF(__pyx_t_3);
11000 __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11001 __pyx_r = NULL;
11002 __pyx_L0:;
11003 __Pyx_XGIVEREF(__pyx_r);
11004 __Pyx_RefNannyFinishContext();
11005 return __pyx_r;
11006}
11007
11008/* "View.MemoryView":641
11009 * return self.size * self.view.itemsize
11010 *
11011 * @property # <<<<<<<<<<<<<<
11012 * def size(self):
11013 * cdef size_t result
11014*/
11015
11016/* Python wrapper */
11017static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
11018static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11019 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11020 PyObject *__pyx_r = 0;
11021 __Pyx_RefNannyDeclarations
11022 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11023 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11024 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11025
11026 /* function exit code */
11027 __Pyx_RefNannyFinishContext();
11028 return __pyx_r;
11029}
11030
11031static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11032 size_t __pyx_v_result;
11033 Py_ssize_t __pyx_v_length;
11034 PyObject *__pyx_r = NULL;
11035 __Pyx_RefNannyDeclarations
11036 int __pyx_t_1;
11037 Py_ssize_t *__pyx_t_2;
11038 Py_ssize_t *__pyx_t_3;
11039 Py_ssize_t *__pyx_t_4;
11040 PyObject *__pyx_t_5 = NULL;
11041 int __pyx_lineno = 0;
11042 const char *__pyx_filename = NULL;
11043 int __pyx_clineno = 0;
11044 __Pyx_RefNannySetupContext("__get__", 0);
11045
11046 /* "View.MemoryView":644
11047 * def size(self):
11048 * cdef size_t result
11049 * if self._size is None: # <<<<<<<<<<<<<<
11050 * result = 1
11051 *
11052*/
11053 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11054 if (__pyx_t_1) {
11055
11056
11057 /* "View.MemoryView":645
11058 * cdef size_t result
11059 * if self._size is None:
11060 * result = 1 # <<<<<<<<<<<<<<
11061 *
11062 * for length in self.view.shape[:self.view.ndim]:
11063*/
11064 __pyx_v_result = 1;
11065
11066 /* "View.MemoryView":647
11067 * result = 1
11068 *
11069 * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
11070 * result *= <size_t> length
11071 *
11072*/
11073 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11074
11075 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11076 __pyx_t_2 = __pyx_t_4;
11077 __pyx_v_length = (__pyx_t_2[0]);
11078
11079 /* "View.MemoryView":648
11080 *
11081 * for length in self.view.shape[:self.view.ndim]:
11082 * result *= <size_t> length # <<<<<<<<<<<<<<
11083 *
11084 * self._size = result
11085*/
11086 __pyx_v_result = (__pyx_v_result * ((size_t)__pyx_v_length));
11087 }
11088
11089
11090 /* "View.MemoryView":650
11091 * result *= <size_t> length
11092 *
11093 * self._size = result # <<<<<<<<<<<<<<
11094 *
11095 * return self._size
11096*/
11097 __pyx_t_5 = __Pyx_PyLong_FromSize_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 650, __pyx_L1_error)
11098 __Pyx_GOTREF(__pyx_t_5);
11099 __Pyx_GIVEREF(__pyx_t_5);
11100 __Pyx_GOTREF(__pyx_v_self->_size);
11101 __Pyx_DECREF(__pyx_v_self->_size);
11102 __pyx_v_self->_size = __pyx_t_5;
11103 __pyx_t_5 = 0;
11104
11105 /* "View.MemoryView":644
11106 * def size(self):
11107 * cdef size_t result
11108 * if self._size is None: # <<<<<<<<<<<<<<
11109 * result = 1
11110 *
11111*/
11112 }
11113
11114 /* "View.MemoryView":652
11115 * self._size = result
11116 *
11117 * return self._size # <<<<<<<<<<<<<<
11118 *
11119 * def __len__(self):
11120*/
11121 {
11122 PyObject *__pyx_temp;
11123 {
11124 __pyx_temp = __pyx_r;
11125 __Pyx_INCREF(__pyx_v_self->_size);
11126 __pyx_r = __pyx_v_self->_size;
11127 }
11128 __Pyx_XDECREF(__pyx_temp);
11129 }
11130 goto __pyx_L0;
11131
11132 /* "View.MemoryView":641
11133 * return self.size * self.view.itemsize
11134 *
11135 * @property # <<<<<<<<<<<<<<
11136 * def size(self):
11137 * cdef size_t result
11138*/
11139
11140 /* function exit code */
11141 __pyx_L1_error:;
11142 __Pyx_XDECREF(__pyx_t_5);
11143 __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11144 __pyx_r = NULL;
11145 __pyx_L0:;
11146
11147
11148 __Pyx_XGIVEREF(__pyx_r);
11149 __Pyx_RefNannyFinishContext();
11150 return __pyx_r;
11151}
11152
11153/* "View.MemoryView":654
11154 * return self._size
11155 *
11156 * def __len__(self): # <<<<<<<<<<<<<<
11157 * if self.view.ndim >= 1:
11158 * return self.view.shape[0]
11159*/
11160
11161/* Python wrapper */
11162static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
11163static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11164 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11165 Py_ssize_t __pyx_r;
11166 __Pyx_RefNannyDeclarations
11167 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
11168 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11169 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11170
11171 /* function exit code */
11172 __Pyx_RefNannyFinishContext();
11173 return __pyx_r;
11174}
11175
11176static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
11177 Py_ssize_t __pyx_r;
11178 int __pyx_t_1;
11179
11180 /* "View.MemoryView":655
11181 *
11182 * def __len__(self):
11183 * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11184 * return self.view.shape[0]
11185 *
11186*/
11187 __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11188
11189 if (__pyx_t_1) {
11190
11191
11192 /* "View.MemoryView":656
11193 * def __len__(self):
11194 * if self.view.ndim >= 1:
11195 * return self.view.shape[0] # <<<<<<<<<<<<<<
11196 *
11197 * return 0
11198*/
11199 {
11200
11201 __pyx_r = (__pyx_v_self->view.shape[0]);
11202 }
11203 goto __pyx_L0;
11204
11205 /* "View.MemoryView":655
11206 *
11207 * def __len__(self):
11208 * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11209 * return self.view.shape[0]
11210 *
11211*/
11212 }
11213
11214 /* "View.MemoryView":658
11215 * return self.view.shape[0]
11216 *
11217 * return 0 # <<<<<<<<<<<<<<
11218 *
11219 * def __repr__(self):
11220*/
11221 {
11222
11223 __pyx_r = 0;
11224 }
11225 goto __pyx_L0;
11226
11227 /* "View.MemoryView":654
11228 * return self._size
11229 *
11230 * def __len__(self): # <<<<<<<<<<<<<<
11231 * if self.view.ndim >= 1:
11232 * return self.view.shape[0]
11233*/
11234
11235 /* function exit code */
11236 __pyx_L0:;
11237
11238 return __pyx_r;
11239}
11240
11241/* "View.MemoryView":660
11242 * return 0
11243 *
11244 * def __repr__(self): # <<<<<<<<<<<<<<
11245 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11246 * id(self))
11247*/
11248
11249/* Python wrapper */
11250static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
11251static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11252 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11253 PyObject *__pyx_r = 0;
11254 __Pyx_RefNannyDeclarations
11255 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11256 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11257 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11258
11259 /* function exit code */
11260 __Pyx_RefNannyFinishContext();
11261 return __pyx_r;
11262}
11263
11264static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
11265 PyObject *__pyx_r = NULL;
11266 __Pyx_RefNannyDeclarations
11267 PyObject *__pyx_t_1 = NULL;
11268 PyObject *__pyx_t_2 = NULL;
11269 PyObject *__pyx_t_3 = NULL;
11270 PyObject *__pyx_t_4[5];
11271 Py_ssize_t __pyx_t_5;
11272 int __pyx_t_6;
11273 int __pyx_lineno = 0;
11274 const char *__pyx_filename = NULL;
11275 int __pyx_clineno = 0;
11276 __Pyx_RefNannySetupContext("__repr__", 0);
11277
11278 /* "View.MemoryView":661
11279 *
11280 * def __repr__(self):
11281 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11282 * id(self))
11283 *
11284*/
11285 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11286 __Pyx_GOTREF(__pyx_t_1);
11287 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error)
11288 __Pyx_GOTREF(__pyx_t_2);
11289 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11290 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11291 __Pyx_GOTREF(__pyx_t_1);
11292 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11293 __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error)
11294 __Pyx_GOTREF(__pyx_t_2);
11295 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11296
11297 /* "View.MemoryView":662
11298 * def __repr__(self):
11299 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11300 * id(self)) # <<<<<<<<<<<<<<
11301 *
11302 * def __str__(self):
11303*/
11304 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 662, __pyx_L1_error)
11305 __Pyx_GOTREF(__pyx_t_1);
11306 __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error)
11307 __Pyx_GOTREF(__pyx_t_3);
11308 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11309 __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11310 __pyx_t_4[1] = __pyx_t_2;
11311 __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
11312 __pyx_t_4[3] = __pyx_t_3;
11313 __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__4;
11314
11315 /* "View.MemoryView":661
11316 *
11317 * def __repr__(self):
11318 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11319 * id(self))
11320 *
11321*/
11322 __pyx_t_5 = 22;
11323 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11324 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[3]);
11325 #endif
11326 __pyx_t_6 = 0;
11327 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11328 __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[3]);
11329 #endif
11330 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6);
11331 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11332 __Pyx_GOTREF(__pyx_t_1);
11333 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11334 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11335 {
11336 PyObject *__pyx_temp;
11337 {
11338 __pyx_temp = __pyx_r;
11339 __pyx_r = __pyx_t_1;
11340 }
11341 __Pyx_XDECREF(__pyx_temp);
11342 }
11343 __pyx_t_1 = 0;
11344 goto __pyx_L0;
11345
11346 /* "View.MemoryView":660
11347 * return 0
11348 *
11349 * def __repr__(self): # <<<<<<<<<<<<<<
11350 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11351 * id(self))
11352*/
11353
11354 /* function exit code */
11355 __pyx_L1_error:;
11356 __Pyx_XDECREF(__pyx_t_1);
11357 __Pyx_XDECREF(__pyx_t_2);
11358 __Pyx_XDECREF(__pyx_t_3);
11359 __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11360 __pyx_r = NULL;
11361 __pyx_L0:;
11362 __Pyx_XGIVEREF(__pyx_r);
11363 __Pyx_RefNannyFinishContext();
11364 return __pyx_r;
11365}
11366
11367/* "View.MemoryView":664
11368 * id(self))
11369 *
11370 * def __str__(self): # <<<<<<<<<<<<<<
11371 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11372 *
11373*/
11374
11375/* Python wrapper */
11376static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
11377static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11378 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11379 PyObject *__pyx_r = 0;
11380 __Pyx_RefNannyDeclarations
11381 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
11382 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11383 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11384
11385 /* function exit code */
11386 __Pyx_RefNannyFinishContext();
11387 return __pyx_r;
11388}
11389
11390static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
11391 PyObject *__pyx_r = NULL;
11392 __Pyx_RefNannyDeclarations
11393 PyObject *__pyx_t_1 = NULL;
11394 PyObject *__pyx_t_2 = NULL;
11395 PyObject *__pyx_t_3[3];
11396 Py_ssize_t __pyx_t_4;
11397 int __pyx_t_5;
11398 int __pyx_lineno = 0;
11399 const char *__pyx_filename = NULL;
11400 int __pyx_clineno = 0;
11401 __Pyx_RefNannySetupContext("__str__", 0);
11402
11403 /* "View.MemoryView":665
11404 *
11405 * def __str__(self):
11406 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
11407 *
11408 *
11409*/
11410 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11411 __Pyx_GOTREF(__pyx_t_1);
11412 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 665, __pyx_L1_error)
11413 __Pyx_GOTREF(__pyx_t_2);
11414 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11415 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11416 __Pyx_GOTREF(__pyx_t_1);
11417 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11418 __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 665, __pyx_L1_error)
11419 __Pyx_GOTREF(__pyx_t_2);
11420 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11421 __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11422 __pyx_t_3[1] = __pyx_t_2;
11423 __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object;
11424 __pyx_t_4 = 23;
11425 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11426 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]);
11427 #endif
11428 __pyx_t_5 = 0;
11429 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11430 __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]);
11431 #endif
11432 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5);
11433 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11434 __Pyx_GOTREF(__pyx_t_1);
11435 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11436 {
11437 PyObject *__pyx_temp;
11438 {
11439 __pyx_temp = __pyx_r;
11440 __pyx_r = __pyx_t_1;
11441 }
11442 __Pyx_XDECREF(__pyx_temp);
11443 }
11444 __pyx_t_1 = 0;
11445 goto __pyx_L0;
11446
11447 /* "View.MemoryView":664
11448 * id(self))
11449 *
11450 * def __str__(self): # <<<<<<<<<<<<<<
11451 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11452 *
11453*/
11454
11455 /* function exit code */
11456 __pyx_L1_error:;
11457 __Pyx_XDECREF(__pyx_t_1);
11458 __Pyx_XDECREF(__pyx_t_2);
11459 __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11460 __pyx_r = NULL;
11461 __pyx_L0:;
11462 __Pyx_XGIVEREF(__pyx_r);
11463 __Pyx_RefNannyFinishContext();
11464 return __pyx_r;
11465}
11466
11467/* "View.MemoryView":668
11468 *
11469 *
11470 * def is_c_contig(self): # <<<<<<<<<<<<<<
11471 * cdef __Pyx_memviewslice *mslice
11472 * cdef __Pyx_memviewslice tmp
11473*/
11474
11475/* Python wrapper */
11476static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11477#if CYTHON_VECTORCALL
11478PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11479#else
11480PyObject *__pyx_args, PyObject *__pyx_kwds
11481#endif
11482); /*proto*/
11483static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11484#if CYTHON_VECTORCALL
11485PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11486#else
11487PyObject *__pyx_args, PyObject *__pyx_kwds
11488#endif
11489) {
11490 #if !CYTHON_VECTORCALL
11491 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11492 #endif
11493 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11494 PyObject *__pyx_r = 0;
11495 __Pyx_RefNannyDeclarations
11496 __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
11497 #if !CYTHON_VECTORCALL
11498 #if CYTHON_ASSUME_SAFE_SIZE
11499 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11500 #else
11501 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11502 #endif
11503 #endif
11504 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11505 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL; }
11506 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11507 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11508 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_c_contig", __pyx_kwds); return NULL;}
11509 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11510
11511 /* function exit code */
11512 __Pyx_RefNannyFinishContext();
11513 return __pyx_r;
11514}
11515
11516static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11517 __Pyx_memviewslice *__pyx_v_mslice;
11518 __Pyx_memviewslice __pyx_v_tmp;
11519 PyObject *__pyx_r = NULL;
11520 __Pyx_RefNannyDeclarations
11521 __Pyx_memviewslice *__pyx_t_1;
11522 PyObject *__pyx_t_2 = NULL;
11523 int __pyx_lineno = 0;
11524 const char *__pyx_filename = NULL;
11525 int __pyx_clineno = 0;
11526 __Pyx_RefNannySetupContext("is_c_contig", 0);
11527
11528 /* "View.MemoryView":671
11529 * cdef __Pyx_memviewslice *mslice
11530 * cdef __Pyx_memviewslice tmp
11531 * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11532 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11533 *
11534*/
11535 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 671, __pyx_L1_error)
11536 __pyx_v_mslice = __pyx_t_1;
11537
11538 /* "View.MemoryView":672
11539 * cdef __Pyx_memviewslice tmp
11540 * mslice = get_slice_from_memview(self, &tmp)
11541 * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
11542 *
11543 * def is_f_contig(self):
11544*/
11545 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 672, __pyx_L1_error)
11546 __Pyx_GOTREF(__pyx_t_2);
11547 {
11548 PyObject *__pyx_temp;
11549 {
11550 __pyx_temp = __pyx_r;
11551 __pyx_r = __pyx_t_2;
11552 }
11553 __Pyx_XDECREF(__pyx_temp);
11554 }
11555 __pyx_t_2 = 0;
11556 goto __pyx_L0;
11557
11558 /* "View.MemoryView":668
11559 *
11560 *
11561 * def is_c_contig(self): # <<<<<<<<<<<<<<
11562 * cdef __Pyx_memviewslice *mslice
11563 * cdef __Pyx_memviewslice tmp
11564*/
11565
11566 /* function exit code */
11567 __pyx_L1_error:;
11568 __Pyx_XDECREF(__pyx_t_2);
11569 __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11570 __pyx_r = NULL;
11571 __pyx_L0:;
11572
11573
11574 __Pyx_XGIVEREF(__pyx_r);
11575 __Pyx_RefNannyFinishContext();
11576 return __pyx_r;
11577}
11578
11579/* "View.MemoryView":674
11580 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11581 *
11582 * def is_f_contig(self): # <<<<<<<<<<<<<<
11583 * cdef __Pyx_memviewslice *mslice
11584 * cdef __Pyx_memviewslice tmp
11585*/
11586
11587/* Python wrapper */
11588static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11589#if CYTHON_VECTORCALL
11590PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11591#else
11592PyObject *__pyx_args, PyObject *__pyx_kwds
11593#endif
11594); /*proto*/
11595static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11596#if CYTHON_VECTORCALL
11597PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11598#else
11599PyObject *__pyx_args, PyObject *__pyx_kwds
11600#endif
11601) {
11602 #if !CYTHON_VECTORCALL
11603 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11604 #endif
11605 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11606 PyObject *__pyx_r = 0;
11607 __Pyx_RefNannyDeclarations
11608 __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
11609 #if !CYTHON_VECTORCALL
11610 #if CYTHON_ASSUME_SAFE_SIZE
11611 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11612 #else
11613 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11614 #endif
11615 #endif
11616 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11617 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL; }
11618 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11619 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11620 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_f_contig", __pyx_kwds); return NULL;}
11621 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11622
11623 /* function exit code */
11624 __Pyx_RefNannyFinishContext();
11625 return __pyx_r;
11626}
11627
11628static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11629 __Pyx_memviewslice *__pyx_v_mslice;
11630 __Pyx_memviewslice __pyx_v_tmp;
11631 PyObject *__pyx_r = NULL;
11632 __Pyx_RefNannyDeclarations
11633 __Pyx_memviewslice *__pyx_t_1;
11634 PyObject *__pyx_t_2 = NULL;
11635 int __pyx_lineno = 0;
11636 const char *__pyx_filename = NULL;
11637 int __pyx_clineno = 0;
11638 __Pyx_RefNannySetupContext("is_f_contig", 0);
11639
11640 /* "View.MemoryView":677
11641 * cdef __Pyx_memviewslice *mslice
11642 * cdef __Pyx_memviewslice tmp
11643 * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11644 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11645 *
11646*/
11647 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 677, __pyx_L1_error)
11648 __pyx_v_mslice = __pyx_t_1;
11649
11650 /* "View.MemoryView":678
11651 * cdef __Pyx_memviewslice tmp
11652 * mslice = get_slice_from_memview(self, &tmp)
11653 * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
11654 *
11655 * def copy(self):
11656*/
11657 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 678, __pyx_L1_error)
11658 __Pyx_GOTREF(__pyx_t_2);
11659 {
11660 PyObject *__pyx_temp;
11661 {
11662 __pyx_temp = __pyx_r;
11663 __pyx_r = __pyx_t_2;
11664 }
11665 __Pyx_XDECREF(__pyx_temp);
11666 }
11667 __pyx_t_2 = 0;
11668 goto __pyx_L0;
11669
11670 /* "View.MemoryView":674
11671 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11672 *
11673 * def is_f_contig(self): # <<<<<<<<<<<<<<
11674 * cdef __Pyx_memviewslice *mslice
11675 * cdef __Pyx_memviewslice tmp
11676*/
11677
11678 /* function exit code */
11679 __pyx_L1_error:;
11680 __Pyx_XDECREF(__pyx_t_2);
11681 __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11682 __pyx_r = NULL;
11683 __pyx_L0:;
11684
11685
11686 __Pyx_XGIVEREF(__pyx_r);
11687 __Pyx_RefNannyFinishContext();
11688 return __pyx_r;
11689}
11690
11691/* "View.MemoryView":680
11692 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11693 *
11694 * def copy(self): # <<<<<<<<<<<<<<
11695 * cdef __Pyx_memviewslice mslice
11696 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11697*/
11698
11699/* Python wrapper */
11700static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11701#if CYTHON_VECTORCALL
11702PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11703#else
11704PyObject *__pyx_args, PyObject *__pyx_kwds
11705#endif
11706); /*proto*/
11707static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11708#if CYTHON_VECTORCALL
11709PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11710#else
11711PyObject *__pyx_args, PyObject *__pyx_kwds
11712#endif
11713) {
11714 #if !CYTHON_VECTORCALL
11715 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11716 #endif
11717 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11718 PyObject *__pyx_r = 0;
11719 __Pyx_RefNannyDeclarations
11720 __Pyx_RefNannySetupContext("copy (wrapper)", 0);
11721 #if !CYTHON_VECTORCALL
11722 #if CYTHON_ASSUME_SAFE_SIZE
11723 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11724 #else
11725 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11726 #endif
11727 #endif
11728 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11729 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
11730 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11731 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11732 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
11733 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
11734
11735 /* function exit code */
11736 __Pyx_RefNannyFinishContext();
11737 return __pyx_r;
11738}
11739
11740static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
11741 __Pyx_memviewslice __pyx_v_mslice;
11742 int __pyx_v_flags;
11743 PyObject *__pyx_r = NULL;
11744 __Pyx_RefNannyDeclarations
11745 __Pyx_memviewslice __pyx_t_1;
11746 PyObject *__pyx_t_2 = NULL;
11747 int __pyx_lineno = 0;
11748 const char *__pyx_filename = NULL;
11749 int __pyx_clineno = 0;
11750 __Pyx_RefNannySetupContext("copy", 0);
11751
11752 /* "View.MemoryView":682
11753 * def copy(self):
11754 * cdef __Pyx_memviewslice mslice
11755 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
11756 *
11757 * slice_copy(self, &mslice)
11758*/
11759 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
11760
11761 /* "View.MemoryView":684
11762 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11763 *
11764 * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
11765 * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
11766 * self.view.itemsize,
11767*/
11768 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
11769
11770 /* "View.MemoryView":685
11771 *
11772 * slice_copy(self, &mslice)
11773 * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
11774 * self.view.itemsize,
11775 * flags|PyBUF_C_CONTIGUOUS,
11776*/
11777 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 685, __pyx_L1_error)
11778 __pyx_v_mslice = __pyx_t_1;
11779
11780 /* "View.MemoryView":690
11781 * self.dtype_is_object)
11782 *
11783 * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
11784 *
11785 * def copy_fortran(self):
11786*/
11787 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 690, __pyx_L1_error)
11788 __Pyx_GOTREF(__pyx_t_2);
11789 {
11790 PyObject *__pyx_temp;
11791 {
11792 __pyx_temp = __pyx_r;
11793 __pyx_r = __pyx_t_2;
11794 }
11795 __Pyx_XDECREF(__pyx_temp);
11796 }
11797 __pyx_t_2 = 0;
11798 goto __pyx_L0;
11799
11800 /* "View.MemoryView":680
11801 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11802 *
11803 * def copy(self): # <<<<<<<<<<<<<<
11804 * cdef __Pyx_memviewslice mslice
11805 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11806*/
11807
11808 /* function exit code */
11809 __pyx_L1_error:;
11810 __Pyx_XDECREF(__pyx_t_2);
11811 __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
11812 __pyx_r = NULL;
11813 __pyx_L0:;
11814
11815
11816 __Pyx_XGIVEREF(__pyx_r);
11817 __Pyx_RefNannyFinishContext();
11818 return __pyx_r;
11819}
11820
11821/* "View.MemoryView":692
11822 * return memoryview_copy_from_slice(self, &mslice)
11823 *
11824 * def copy_fortran(self): # <<<<<<<<<<<<<<
11825 * cdef __Pyx_memviewslice src, dst
11826 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11827*/
11828
11829/* Python wrapper */
11830static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11831#if CYTHON_VECTORCALL
11832PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11833#else
11834PyObject *__pyx_args, PyObject *__pyx_kwds
11835#endif
11836); /*proto*/
11837static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11838#if CYTHON_VECTORCALL
11839PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11840#else
11841PyObject *__pyx_args, PyObject *__pyx_kwds
11842#endif
11843) {
11844 #if !CYTHON_VECTORCALL
11845 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11846 #endif
11847 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11848 PyObject *__pyx_r = 0;
11849 __Pyx_RefNannyDeclarations
11850 __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
11851 #if !CYTHON_VECTORCALL
11852 #if CYTHON_ASSUME_SAFE_SIZE
11853 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11854 #else
11855 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11856 #endif
11857 #endif
11858 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11859 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL; }
11860 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11861 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11862 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy_fortran", __pyx_kwds); return NULL;}
11863 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
11864
11865 /* function exit code */
11866 __Pyx_RefNannyFinishContext();
11867 return __pyx_r;
11868}
11869
11870static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
11871 __Pyx_memviewslice __pyx_v_src;
11872 __Pyx_memviewslice __pyx_v_dst;
11873 int __pyx_v_flags;
11874 PyObject *__pyx_r = NULL;
11875 __Pyx_RefNannyDeclarations
11876 __Pyx_memviewslice __pyx_t_1;
11877 PyObject *__pyx_t_2 = NULL;
11878 int __pyx_lineno = 0;
11879 const char *__pyx_filename = NULL;
11880 int __pyx_clineno = 0;
11881 __Pyx_RefNannySetupContext("copy_fortran", 0);
11882
11883 /* "View.MemoryView":694
11884 * def copy_fortran(self):
11885 * cdef __Pyx_memviewslice src, dst
11886 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
11887 *
11888 * slice_copy(self, &src)
11889*/
11890 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
11891
11892 /* "View.MemoryView":696
11893 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11894 *
11895 * slice_copy(self, &src) # <<<<<<<<<<<<<<
11896 * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
11897 * self.view.itemsize,
11898*/
11899 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
11900
11901 /* "View.MemoryView":697
11902 *
11903 * slice_copy(self, &src)
11904 * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
11905 * self.view.itemsize,
11906 * flags|PyBUF_F_CONTIGUOUS,
11907*/
11908 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 697, __pyx_L1_error)
11909 __pyx_v_dst = __pyx_t_1;
11910
11911 /* "View.MemoryView":702
11912 * self.dtype_is_object)
11913 *
11914 * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
11915 *
11916 *
11917*/
11918 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 702, __pyx_L1_error)
11919 __Pyx_GOTREF(__pyx_t_2);
11920 {
11921 PyObject *__pyx_temp;
11922 {
11923 __pyx_temp = __pyx_r;
11924 __pyx_r = __pyx_t_2;
11925 }
11926 __Pyx_XDECREF(__pyx_temp);
11927 }
11928 __pyx_t_2 = 0;
11929 goto __pyx_L0;
11930
11931 /* "View.MemoryView":692
11932 * return memoryview_copy_from_slice(self, &mslice)
11933 *
11934 * def copy_fortran(self): # <<<<<<<<<<<<<<
11935 * cdef __Pyx_memviewslice src, dst
11936 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11937*/
11938
11939 /* function exit code */
11940 __pyx_L1_error:;
11941 __Pyx_XDECREF(__pyx_t_2);
11942 __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
11943 __pyx_r = NULL;
11944 __pyx_L0:;
11945
11946
11947
11948 __Pyx_XGIVEREF(__pyx_r);
11949 __Pyx_RefNannyFinishContext();
11950 return __pyx_r;
11951}
11952
11953/* "(tree fragment)":1
11954 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11955 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11956 * def __setstate_cython__(self, __pyx_state):
11957*/
11958
11959/* Python wrapper */
11960static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11961#if CYTHON_VECTORCALL
11962PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11963#else
11964PyObject *__pyx_args, PyObject *__pyx_kwds
11965#endif
11966); /*proto*/
11967static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11968#if CYTHON_VECTORCALL
11969PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11970#else
11971PyObject *__pyx_args, PyObject *__pyx_kwds
11972#endif
11973) {
11974 #if !CYTHON_VECTORCALL
11975 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11976 #endif
11977 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11978 PyObject *__pyx_r = 0;
11979 __Pyx_RefNannyDeclarations
11980 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11981 #if !CYTHON_VECTORCALL
11982 #if CYTHON_ASSUME_SAFE_SIZE
11983 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11984 #else
11985 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11986 #endif
11987 #endif
11988 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11989 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
11990 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11991 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11992 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
11993 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11994
11995 /* function exit code */
11996 __Pyx_RefNannyFinishContext();
11997 return __pyx_r;
11998}
11999
12000static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
12001 PyObject *__pyx_r = NULL;
12002 __Pyx_RefNannyDeclarations
12003 int __pyx_lineno = 0;
12004 const char *__pyx_filename = NULL;
12005 int __pyx_clineno = 0;
12006 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12007
12008 /* "(tree fragment)":2
12009 * def __reduce_cython__(self):
12010 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12011 * def __setstate_cython__(self, __pyx_state):
12012 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12013*/
12014 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12015 __PYX_ERR(1, 2, __pyx_L1_error)
12016
12017 /* "(tree fragment)":1
12018 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12019 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12020 * def __setstate_cython__(self, __pyx_state):
12021*/
12022
12023 /* function exit code */
12024 __pyx_L1_error:;
12025 __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12026 __pyx_r = NULL;
12027 __Pyx_XGIVEREF(__pyx_r);
12028 __Pyx_RefNannyFinishContext();
12029 return __pyx_r;
12030}
12031
12032/* "(tree fragment)":3
12033 * def __reduce_cython__(self):
12034 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12035 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12036 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12037*/
12038
12039/* Python wrapper */
12040static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12041#if CYTHON_VECTORCALL
12042PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12043#else
12044PyObject *__pyx_args, PyObject *__pyx_kwds
12045#endif
12046); /*proto*/
12047static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12048#if CYTHON_VECTORCALL
12049PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12050#else
12051PyObject *__pyx_args, PyObject *__pyx_kwds
12052#endif
12053) {
12054 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
12055 #if !CYTHON_VECTORCALL
12056 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12057 #endif
12058 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12059 PyObject* values[1] = {0};
12060 int __pyx_lineno = 0;
12061 const char *__pyx_filename = NULL;
12062 int __pyx_clineno = 0;
12063 PyObject *__pyx_r = 0;
12064 __Pyx_RefNannyDeclarations
12065 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12066 #if !CYTHON_VECTORCALL
12067 #if CYTHON_ASSUME_SAFE_SIZE
12068 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12069 #else
12070 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12071 #endif
12072 #endif
12073 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12074 {
12075 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
12076 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12077 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
12078 if (__pyx_kwds_len > 0) {
12079 switch (__pyx_nargs) {
12080 case 1:
12081 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12082 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12083 CYTHON_FALLTHROUGH;
12084 case 0: break;
12085 default: goto __pyx_L5_argtuple_error;
12086 }
12087 const Py_ssize_t kwd_pos_args = __pyx_nargs;
12088 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
12089 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
12090 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
12091 }
12092 } else if (unlikely(__pyx_nargs != 1)) {
12093 goto __pyx_L5_argtuple_error;
12094 } else {
12095 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12096 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12097 }
12098 __pyx_v___pyx_state = values[0];
12099 }
12100 goto __pyx_L6_skip;
12101 __pyx_L5_argtuple_error:;
12102 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
12103 __pyx_L6_skip:;
12104 goto __pyx_L4_argument_unpacking_done;
12105 __pyx_L3_error:;
12106 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12107 Py_XDECREF(values[__pyx_temp]);
12108 }
12109 __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12110 __Pyx_RefNannyFinishContext();
12111 return NULL;
12112 __pyx_L4_argument_unpacking_done:;
12113 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
12114
12115 /* function exit code */
12116 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12117 Py_XDECREF(values[__pyx_temp]);
12118 }
12119 __Pyx_RefNannyFinishContext();
12120 return __pyx_r;
12121}
12122
12123static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12124 PyObject *__pyx_r = NULL;
12125 __Pyx_RefNannyDeclarations
12126 int __pyx_lineno = 0;
12127 const char *__pyx_filename = NULL;
12128 int __pyx_clineno = 0;
12129 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12130
12131 /* "(tree fragment)":4
12132 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12133 * def __setstate_cython__(self, __pyx_state):
12134 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12135*/
12136 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12137 __PYX_ERR(1, 4, __pyx_L1_error)
12138
12139 /* "(tree fragment)":3
12140 * def __reduce_cython__(self):
12141 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12142 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12143 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12144*/
12145
12146 /* function exit code */
12147 __pyx_L1_error:;
12148 __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12149 __pyx_r = NULL;
12150 __Pyx_XGIVEREF(__pyx_r);
12151 __Pyx_RefNannyFinishContext();
12152 return __pyx_r;
12153}
12154
12155/* "View.MemoryView":705
12156 *
12157 *
12158 * @cname('__pyx_memoryview_new') # <<<<<<<<<<<<<<
12159 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12160 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12161*/
12162
12163static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo const *__pyx_v_typeinfo) {
12164 struct __pyx_memoryview_obj *__pyx_v_result = 0;
12165 PyObject *__pyx_r = NULL;
12166 __Pyx_RefNannyDeclarations
12167 PyObject *__pyx_t_1 = NULL;
12168 PyObject *__pyx_t_2 = NULL;
12169 PyObject *__pyx_t_3 = NULL;
12170 PyObject *__pyx_t_4 = NULL;
12171 size_t __pyx_t_5;
12172 int __pyx_lineno = 0;
12173 const char *__pyx_filename = NULL;
12174 int __pyx_clineno = 0;
12175 __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
12176
12177 /* "View.MemoryView":707
12178 * @cname('__pyx_memoryview_new')
12179 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12180 * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
12181 * result.typeinfo = typeinfo
12182 * return result
12183*/
12184 __pyx_t_2 = NULL;
12185 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 707, __pyx_L1_error)
12186 __Pyx_GOTREF(__pyx_t_3);
12187 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 707, __pyx_L1_error)
12188 __Pyx_GOTREF(__pyx_t_4);
12189 __pyx_t_5 = 1;
12190 {
12191 PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_o, __pyx_t_3, __pyx_t_4};
12192 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
12193 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12194 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12195 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12196 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 707, __pyx_L1_error)
12197 __Pyx_GOTREF((PyObject *)__pyx_t_1);
12198 }
12199 __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_1);
12200 __pyx_t_1 = 0;
12201
12202 /* "View.MemoryView":708
12203 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12204 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12205 * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
12206 * return result
12207 *
12208*/
12209 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12210
12211 /* "View.MemoryView":709
12212 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12213 * result.typeinfo = typeinfo
12214 * return result # <<<<<<<<<<<<<<
12215 *
12216 * @cname('__pyx_memoryview_check')
12217*/
12218 {
12219 PyObject *__pyx_temp;
12220 {
12221 __pyx_temp = __pyx_r;
12222 __Pyx_INCREF((PyObject *)__pyx_v_result);
12223 __pyx_r = ((PyObject *)__pyx_v_result);
12224 }
12225 __Pyx_XDECREF(__pyx_temp);
12226 }
12227 goto __pyx_L0;
12228
12229 /* "View.MemoryView":705
12230 *
12231 *
12232 * @cname('__pyx_memoryview_new') # <<<<<<<<<<<<<<
12233 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12234 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12235*/
12236
12237 /* function exit code */
12238 __pyx_L1_error:;
12239 __Pyx_XDECREF(__pyx_t_1);
12240 __Pyx_XDECREF(__pyx_t_2);
12241 __Pyx_XDECREF(__pyx_t_3);
12242 __Pyx_XDECREF(__pyx_t_4);
12243 __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12244 __pyx_r = 0;
12245 __pyx_L0:;
12246 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12247 __Pyx_XGIVEREF(__pyx_r);
12248 __Pyx_RefNannyFinishContext();
12249 return __pyx_r;
12250}
12251
12252/* "View.MemoryView":711
12253 * return result
12254 *
12255 * @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
12256 * cdef inline bint memoryview_check(object o) noexcept:
12257 * return isinstance(o, memoryview)
12258*/
12259
12260static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12261 int __pyx_r;
12262 int __pyx_t_1;
12263
12264 /* "View.MemoryView":713
12265 * @cname('__pyx_memoryview_check')
12266 * cdef inline bint memoryview_check(object o) noexcept:
12267 * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
12268 *
12269 *
12270*/
12271 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type);
12272 {
12273 __pyx_r = __pyx_t_1;
12274 }
12275 goto __pyx_L0;
12276
12277 /* "View.MemoryView":711
12278 * return result
12279 *
12280 * @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
12281 * cdef inline bint memoryview_check(object o) noexcept:
12282 * return isinstance(o, memoryview)
12283*/
12284
12285 /* function exit code */
12286 __pyx_L0:;
12287
12288 return __pyx_r;
12289}
12290
12291/* "View.MemoryView":716
12292 *
12293 *
12294 * @cname('__pyx_memoryview_err_invalid_index') # <<<<<<<<<<<<<<
12295 * cdef int _err_invalid_index(item) except -1:
12296 * type_name = str(type(item))
12297*/
12298
12299static int __pyx_memoryview_err_invalid_index(PyObject *__pyx_v_item) {
12300 PyObject *__pyx_v_type_name = NULL;
12301 int __pyx_r;
12302 __Pyx_RefNannyDeclarations
12303 PyObject *__pyx_t_1 = NULL;
12304 int __pyx_lineno = 0;
12305 const char *__pyx_filename = NULL;
12306 int __pyx_clineno = 0;
12307 __Pyx_RefNannySetupContext("_err_invalid_index", 0);
12308
12309 /* "View.MemoryView":718
12310 * @cname('__pyx_memoryview_err_invalid_index')
12311 * cdef int _err_invalid_index(item) except -1:
12312 * type_name = str(type(item)) # <<<<<<<<<<<<<<
12313 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name)
12314 * return -1
12315*/
12316 __pyx_t_1 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
12317 __Pyx_GOTREF(__pyx_t_1);
12318 __pyx_v_type_name = ((PyObject*)__pyx_t_1);
12319 __pyx_t_1 = 0;
12320
12321 /* "View.MemoryView":719
12322 * cdef int _err_invalid_index(item) except -1:
12323 * type_name = str(type(item))
12324 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name) # <<<<<<<<<<<<<<
12325 * return -1
12326 *
12327*/
12328 (void)(PyErr_Format(PyExc_TypeError, __pyx_k_Cannot_index_with_type_200U, ((PyObject *)__pyx_v_type_name)));
12329
12330 /* "View.MemoryView":720
12331 * type_name = str(type(item))
12332 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name)
12333 * return -1 # <<<<<<<<<<<<<<
12334 *
12335 *
12336*/
12337 {
12338
12339 __pyx_r = -1;
12340 }
12341 goto __pyx_L0;
12342
12343 /* "View.MemoryView":716
12344 *
12345 *
12346 * @cname('__pyx_memoryview_err_invalid_index') # <<<<<<<<<<<<<<
12347 * cdef int _err_invalid_index(item) except -1:
12348 * type_name = str(type(item))
12349*/
12350
12351 /* function exit code */
12352 __pyx_L1_error:;
12353 __Pyx_XDECREF(__pyx_t_1);
12354 __Pyx_AddTraceback("View.MemoryView._err_invalid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
12355 __pyx_r = -1;
12356 __pyx_L0:;
12357 __Pyx_XDECREF(__pyx_v_type_name);
12358
12359 __Pyx_RefNannyFinishContext();
12360 return __pyx_r;
12361}
12362
12363/* "View.MemoryView":723
12364 *
12365 *
12366 * cdef tuple[bint, tuple] _unellipsify_index_tuple(index_tuple: tuple, int ndim): # <<<<<<<<<<<<<<
12367 * """
12368 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12369*/
12370
12371static PyObject *_unellipsify_index_tuple(PyObject *__pyx_v_index_tuple, int __pyx_v_ndim) {
12372 Py_ssize_t __pyx_v_first_ellipsis_index;
12373 Py_ssize_t __pyx_v_idx;
12374 Py_ssize_t __pyx_v_ellipsis_end;
12375 Py_ssize_t __pyx_v_indices_from_ellipsis;
12376 int __pyx_v_have_slices;
12377 PyObject *__pyx_v_item = NULL;
12378 PyObject *__pyx_v_result = NULL;
12379 PyObject *__pyx_r = NULL;
12380 __Pyx_RefNannyDeclarations
12381 PyObject *__pyx_t_1 = NULL;
12382 Py_ssize_t __pyx_t_2;
12383 PyObject *__pyx_t_3 = NULL;
12384 int __pyx_t_4;
12385 int __pyx_t_5;
12386 Py_ssize_t __pyx_t_6;
12387 Py_ssize_t __pyx_t_7;
12388 Py_ssize_t __pyx_t_8;
12389 int __pyx_lineno = 0;
12390 const char *__pyx_filename = NULL;
12391 int __pyx_clineno = 0;
12392 __Pyx_RefNannySetupContext("_unellipsify_index_tuple", 0);
12393 __Pyx_INCREF(__pyx_v_index_tuple);
12394
12395 /* "View.MemoryView":727
12396 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12397 * """
12398 * cdef Py_ssize_t first_ellipsis_index = -1 # <<<<<<<<<<<<<<
12399 * cdef Py_ssize_t idx, ellipsis_end, indices_from_ellipsis
12400 *
12401*/
12402 __pyx_v_first_ellipsis_index = -1L;
12403
12404 /* "View.MemoryView":730
12405 * cdef Py_ssize_t idx, ellipsis_end, indices_from_ellipsis
12406 *
12407 * have_slices = False # <<<<<<<<<<<<<<
12408 *
12409 * idx = 0
12410*/
12411 __pyx_v_have_slices = 0;
12412
12413 /* "View.MemoryView":732
12414 * have_slices = False
12415 *
12416 * idx = 0 # <<<<<<<<<<<<<<
12417 * for item in index_tuple:
12418 * if item is Ellipsis:
12419*/
12420 __pyx_v_idx = 0;
12421
12422 /* "View.MemoryView":733
12423 *
12424 * idx = 0
12425 * for item in index_tuple: # <<<<<<<<<<<<<<
12426 * if item is Ellipsis:
12427 * have_slices = True
12428*/
12429 __pyx_t_1 = __pyx_v_index_tuple; __Pyx_INCREF(__pyx_t_1);
12430 __pyx_t_2 = 0;
12431 for (;;) {
12432 {
12433 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
12434 #if !CYTHON_ASSUME_SAFE_SIZE
12435 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 733, __pyx_L1_error)
12436 #endif
12437 if (__pyx_t_2 >= __pyx_temp) break;
12438 }
12439 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12440 __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
12441 #else
12442 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
12443 #endif
12444 ++__pyx_t_2;
12445 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 733, __pyx_L1_error)
12446 __Pyx_GOTREF(__pyx_t_3);
12447 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
12448 __pyx_t_3 = 0;
12449
12450 /* "View.MemoryView":734
12451 * idx = 0
12452 * for item in index_tuple:
12453 * if item is Ellipsis: # <<<<<<<<<<<<<<
12454 * have_slices = True
12455 * if first_ellipsis_index == -1:
12456*/
12457 __pyx_t_4 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12458 if (__pyx_t_4) {
12459
12460
12461 /* "View.MemoryView":735
12462 * for item in index_tuple:
12463 * if item is Ellipsis:
12464 * have_slices = True # <<<<<<<<<<<<<<
12465 * if first_ellipsis_index == -1:
12466 * first_ellipsis_index = idx
12467*/
12468 __pyx_v_have_slices = 1;
12469
12470 /* "View.MemoryView":736
12471 * if item is Ellipsis:
12472 * have_slices = True
12473 * if first_ellipsis_index == -1: # <<<<<<<<<<<<<<
12474 * first_ellipsis_index = idx
12475 * elif isinstance(item, slice):
12476*/
12477 __pyx_t_4 = (__pyx_v_first_ellipsis_index == -1L);
12478
12479 if (__pyx_t_4) {
12480
12481
12482 /* "View.MemoryView":737
12483 * have_slices = True
12484 * if first_ellipsis_index == -1:
12485 * first_ellipsis_index = idx # <<<<<<<<<<<<<<
12486 * elif isinstance(item, slice):
12487 * have_slices = True
12488*/
12489 __pyx_v_first_ellipsis_index = __pyx_v_idx;
12490
12491 /* "View.MemoryView":736
12492 * if item is Ellipsis:
12493 * have_slices = True
12494 * if first_ellipsis_index == -1: # <<<<<<<<<<<<<<
12495 * first_ellipsis_index = idx
12496 * elif isinstance(item, slice):
12497*/
12498 }
12499
12500 /* "View.MemoryView":734
12501 * idx = 0
12502 * for item in index_tuple:
12503 * if item is Ellipsis: # <<<<<<<<<<<<<<
12504 * have_slices = True
12505 * if first_ellipsis_index == -1:
12506*/
12507 goto __pyx_L5;
12508 }
12509
12510 /* "View.MemoryView":738
12511 * if first_ellipsis_index == -1:
12512 * first_ellipsis_index = idx
12513 * elif isinstance(item, slice): # <<<<<<<<<<<<<<
12514 * have_slices = True
12515 * elif cython.unlikely(not PyIndex_Check(item)):
12516*/
12517 __pyx_t_4 = PySlice_Check(__pyx_v_item);
12518 if (__pyx_t_4) {
12519
12520
12521 /* "View.MemoryView":739
12522 * first_ellipsis_index = idx
12523 * elif isinstance(item, slice):
12524 * have_slices = True # <<<<<<<<<<<<<<
12525 * elif cython.unlikely(not PyIndex_Check(item)):
12526 * _err_invalid_index(item)
12527*/
12528 __pyx_v_have_slices = 1;
12529
12530 /* "View.MemoryView":738
12531 * if first_ellipsis_index == -1:
12532 * first_ellipsis_index = idx
12533 * elif isinstance(item, slice): # <<<<<<<<<<<<<<
12534 * have_slices = True
12535 * elif cython.unlikely(not PyIndex_Check(item)):
12536*/
12537 goto __pyx_L5;
12538 }
12539
12540 /* "View.MemoryView":740
12541 * elif isinstance(item, slice):
12542 * have_slices = True
12543 * elif cython.unlikely(not PyIndex_Check(item)): # <<<<<<<<<<<<<<
12544 * _err_invalid_index(item)
12545 * idx += 1
12546*/
12547 __pyx_t_4 = (!(PyIndex_Check(__pyx_v_item) != 0));
12548
12549 if (unlikely(__pyx_t_4)) {
12550
12551
12552 /* "View.MemoryView":741
12553 * have_slices = True
12554 * elif cython.unlikely(not PyIndex_Check(item)):
12555 * _err_invalid_index(item) # <<<<<<<<<<<<<<
12556 * idx += 1
12557 *
12558*/
12559 __pyx_t_5 = __pyx_memoryview_err_invalid_index(__pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 741, __pyx_L1_error)
12560
12561
12562 /* "View.MemoryView":740
12563 * elif isinstance(item, slice):
12564 * have_slices = True
12565 * elif cython.unlikely(not PyIndex_Check(item)): # <<<<<<<<<<<<<<
12566 * _err_invalid_index(item)
12567 * idx += 1
12568*/
12569 }
12570 __pyx_L5:;
12571
12572 /* "View.MemoryView":742
12573 * elif cython.unlikely(not PyIndex_Check(item)):
12574 * _err_invalid_index(item)
12575 * idx += 1 # <<<<<<<<<<<<<<
12576 *
12577 * if first_ellipsis_index >= 0:
12578*/
12579 __pyx_v_idx = (__pyx_v_idx + 1);
12580
12581 /* "View.MemoryView":733
12582 *
12583 * idx = 0
12584 * for item in index_tuple: # <<<<<<<<<<<<<<
12585 * if item is Ellipsis:
12586 * have_slices = True
12587*/
12588 }
12589 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12590
12591 /* "View.MemoryView":744
12592 * idx += 1
12593 *
12594 * if first_ellipsis_index >= 0: # <<<<<<<<<<<<<<
12595 * result = [slice(None)] * ndim
12596 *
12597*/
12598 __pyx_t_4 = (__pyx_v_first_ellipsis_index >= 0);
12599
12600 if (__pyx_t_4) {
12601
12602
12603 /* "View.MemoryView":745
12604 *
12605 * if first_ellipsis_index >= 0:
12606 * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
12607 *
12608 * for idx in range(first_ellipsis_index):
12609*/
12610 __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
12611 __Pyx_GOTREF(__pyx_t_1);
12612 { Py_ssize_t __pyx_temp;
12613 for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
12614 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
12615 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
12616 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 745, __pyx_L1_error);
12617 }
12618 }
12619 __pyx_v_result = ((PyObject*)__pyx_t_1);
12620 __pyx_t_1 = 0;
12621
12622 /* "View.MemoryView":747
12623 * result = [slice(None)] * ndim
12624 *
12625 * for idx in range(first_ellipsis_index): # <<<<<<<<<<<<<<
12626 * result[idx] = index_tuple[idx]
12627 *
12628*/
12629
12630 __pyx_t_2 = __pyx_v_first_ellipsis_index;
12631 __pyx_t_6 = __pyx_t_2;
12632
12633 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12634 __pyx_v_idx = __pyx_t_7;
12635
12636 /* "View.MemoryView":748
12637 *
12638 * for idx in range(first_ellipsis_index):
12639 * result[idx] = index_tuple[idx] # <<<<<<<<<<<<<<
12640 *
12641 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index
12642*/
12643 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_index_tuple, __pyx_v_idx, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
12644 __Pyx_GOTREF(__pyx_t_1);
12645 if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_t_1, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(1, 748, __pyx_L1_error)
12646 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12647 }
12648
12649
12650 /* "View.MemoryView":750
12651 * result[idx] = index_tuple[idx]
12652 *
12653 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index # <<<<<<<<<<<<<<
12654 * ellipsis_end = ndim - indices_from_ellipsis
12655 *
12656*/
12657 __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_v_index_tuple); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
12658 __pyx_v_indices_from_ellipsis = (__pyx_t_2 - __pyx_v_first_ellipsis_index);
12659
12660
12661 /* "View.MemoryView":751
12662 *
12663 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index
12664 * ellipsis_end = ndim - indices_from_ellipsis # <<<<<<<<<<<<<<
12665 *
12666 * for idx in range(1, indices_from_ellipsis):
12667*/
12668 __pyx_v_ellipsis_end = (__pyx_v_ndim - __pyx_v_indices_from_ellipsis);
12669
12670 /* "View.MemoryView":753
12671 * ellipsis_end = ndim - indices_from_ellipsis
12672 *
12673 * for idx in range(1, indices_from_ellipsis): # <<<<<<<<<<<<<<
12674 * item = index_tuple[first_ellipsis_index + idx]
12675 * if item is not Ellipsis:
12676*/
12677
12678 __pyx_t_2 = __pyx_v_indices_from_ellipsis;
12679 __pyx_t_6 = __pyx_t_2;
12680
12681 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12682 __pyx_v_idx = __pyx_t_7;
12683
12684 /* "View.MemoryView":754
12685 *
12686 * for idx in range(1, indices_from_ellipsis):
12687 * item = index_tuple[first_ellipsis_index + idx] # <<<<<<<<<<<<<<
12688 * if item is not Ellipsis:
12689 * result[ellipsis_end + idx] = item
12690*/
12691 __pyx_t_8 = (__pyx_v_first_ellipsis_index + __pyx_v_idx);
12692
12693 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_index_tuple, __pyx_t_8, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 754, __pyx_L1_error)
12694 __Pyx_GOTREF(__pyx_t_1);
12695
12696 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
12697 __pyx_t_1 = 0;
12698
12699 /* "View.MemoryView":755
12700 * for idx in range(1, indices_from_ellipsis):
12701 * item = index_tuple[first_ellipsis_index + idx]
12702 * if item is not Ellipsis: # <<<<<<<<<<<<<<
12703 * result[ellipsis_end + idx] = item
12704 *
12705*/
12706 __pyx_t_4 = (__pyx_v_item != __pyx_builtin_Ellipsis);
12707 if (__pyx_t_4) {
12708
12709
12710 /* "View.MemoryView":756
12711 * item = index_tuple[first_ellipsis_index + idx]
12712 * if item is not Ellipsis:
12713 * result[ellipsis_end + idx] = item # <<<<<<<<<<<<<<
12714 *
12715 * index_tuple = tuple(result)
12716*/
12717 __pyx_t_8 = (__pyx_v_ellipsis_end + __pyx_v_idx);
12718
12719 if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_t_8, __pyx_v_item, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(1, 756, __pyx_L1_error)
12720
12721
12722 /* "View.MemoryView":755
12723 * for idx in range(1, indices_from_ellipsis):
12724 * item = index_tuple[first_ellipsis_index + idx]
12725 * if item is not Ellipsis: # <<<<<<<<<<<<<<
12726 * result[ellipsis_end + idx] = item
12727 *
12728*/
12729 }
12730 }
12731
12732
12733 /* "View.MemoryView":758
12734 * result[ellipsis_end + idx] = item
12735 *
12736 * index_tuple = tuple(result) # <<<<<<<<<<<<<<
12737 *
12738 * elif ndim > idx:
12739*/
12740 __pyx_t_1 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 758, __pyx_L1_error)
12741 __Pyx_GOTREF(__pyx_t_1);
12742 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_1));
12743 __pyx_t_1 = 0;
12744
12745 /* "View.MemoryView":744
12746 * idx += 1
12747 *
12748 * if first_ellipsis_index >= 0: # <<<<<<<<<<<<<<
12749 * result = [slice(None)] * ndim
12750 *
12751*/
12752 goto __pyx_L8;
12753 }
12754
12755 /* "View.MemoryView":760
12756 * index_tuple = tuple(result)
12757 *
12758 * elif ndim > idx: # <<<<<<<<<<<<<<
12759 *
12760 * have_slices = True
12761*/
12762 __pyx_t_4 = (__pyx_v_ndim > __pyx_v_idx);
12763
12764 if (__pyx_t_4) {
12765
12766
12767 /* "View.MemoryView":762
12768 * elif ndim > idx:
12769 *
12770 * have_slices = True # <<<<<<<<<<<<<<
12771 * index_tuple += (slice(None),) * (ndim - idx)
12772 *
12773*/
12774 __pyx_v_have_slices = 1;
12775
12776 /* "View.MemoryView":763
12777 *
12778 * have_slices = True
12779 * index_tuple += (slice(None),) * (ndim - idx) # <<<<<<<<<<<<<<
12780 *
12781 * return have_slices, index_tuple
12782*/
12783 __pyx_t_2 = (__pyx_v_ndim - __pyx_v_idx);
12784
12785 __pyx_t_1 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 763, __pyx_L1_error)
12786 __Pyx_GOTREF(__pyx_t_1);
12787
12788 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_index_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error)
12789 __Pyx_GOTREF(__pyx_t_3);
12790 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12791 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_3));
12792 __pyx_t_3 = 0;
12793
12794 /* "View.MemoryView":760
12795 * index_tuple = tuple(result)
12796 *
12797 * elif ndim > idx: # <<<<<<<<<<<<<<
12798 *
12799 * have_slices = True
12800*/
12801 }
12802 __pyx_L8:;
12803
12804 /* "View.MemoryView":765
12805 * index_tuple += (slice(None),) * (ndim - idx)
12806 *
12807 * return have_slices, index_tuple # <<<<<<<<<<<<<<
12808 *
12809 *
12810*/
12811 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 765, __pyx_L1_error)
12812 __Pyx_GOTREF(__pyx_t_3);
12813 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 765, __pyx_L1_error)
12814 __Pyx_GOTREF(__pyx_t_1);
12815 __Pyx_GIVEREF(__pyx_t_3);
12816 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
12817 __Pyx_INCREF(__pyx_v_index_tuple);
12818 __Pyx_GIVEREF(__pyx_v_index_tuple);
12819 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_index_tuple) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
12820 __pyx_t_3 = 0;
12821 {
12822 PyObject *__pyx_temp;
12823 {
12824 __pyx_temp = __pyx_r;
12825 __pyx_r = ((PyObject*)__pyx_t_1);
12826 }
12827 __Pyx_XDECREF(__pyx_temp);
12828 }
12829 __pyx_t_1 = 0;
12830 goto __pyx_L0;
12831
12832 /* "View.MemoryView":723
12833 *
12834 *
12835 * cdef tuple[bint, tuple] _unellipsify_index_tuple(index_tuple: tuple, int ndim): # <<<<<<<<<<<<<<
12836 * """
12837 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12838*/
12839
12840 /* function exit code */
12841 __pyx_L1_error:;
12842 __Pyx_XDECREF(__pyx_t_1);
12843 __Pyx_XDECREF(__pyx_t_3);
12844 __Pyx_AddTraceback("View.MemoryView._unellipsify_index_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
12845 __pyx_r = 0;
12846 __pyx_L0:;
12847
12848
12849
12850
12851
12852 __Pyx_XDECREF(__pyx_v_item);
12853 __Pyx_XDECREF(__pyx_v_result);
12854 __Pyx_XDECREF(__pyx_v_index_tuple);
12855 __Pyx_XGIVEREF(__pyx_r);
12856 __Pyx_RefNannyFinishContext();
12857 return __pyx_r;
12858}
12859
12860/* "View.MemoryView":768
12861 *
12862 *
12863 * cdef tuple[bint, tuple] _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12864 * """
12865 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12866*/
12867
12868static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
12869 PyObject *__pyx_v_result = 0;
12870 int __pyx_v_have_slices;
12871 PyObject *__pyx_r = NULL;
12872 __Pyx_RefNannyDeclarations
12873 int __pyx_t_1;
12874 PyObject *__pyx_t_2 = NULL;
12875 int __pyx_t_3;
12876 long __pyx_t_4;
12877 PyObject *__pyx_t_5 = NULL;
12878 PyObject *__pyx_t_6 = NULL;
12879 int __pyx_lineno = 0;
12880 const char *__pyx_filename = NULL;
12881 int __pyx_clineno = 0;
12882 __Pyx_RefNannySetupContext("_unellipsify", 0);
12883
12884 /* "View.MemoryView":773
12885 * """
12886 * result: tuple
12887 * have_slices = False # <<<<<<<<<<<<<<
12888 *
12889 * if index is Ellipsis:
12890*/
12891 __pyx_v_have_slices = 0;
12892
12893 /* "View.MemoryView":775
12894 * have_slices = False
12895 *
12896 * if index is Ellipsis: # <<<<<<<<<<<<<<
12897 * have_slices = True
12898 * result = (slice(None),) * ndim
12899*/
12900 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
12901 if (__pyx_t_1) {
12902
12903
12904 /* "View.MemoryView":776
12905 *
12906 * if index is Ellipsis:
12907 * have_slices = True # <<<<<<<<<<<<<<
12908 * result = (slice(None),) * ndim
12909 *
12910*/
12911 __pyx_v_have_slices = 1;
12912
12913 /* "View.MemoryView":777
12914 * if index is Ellipsis:
12915 * have_slices = True
12916 * result = (slice(None),) * ndim # <<<<<<<<<<<<<<
12917 *
12918 * elif isinstance(index, tuple):
12919*/
12920 __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 777, __pyx_L1_error)
12921 __Pyx_GOTREF(__pyx_t_2);
12922 __pyx_v_result = ((PyObject*)__pyx_t_2);
12923 __pyx_t_2 = 0;
12924
12925 /* "View.MemoryView":775
12926 * have_slices = False
12927 *
12928 * if index is Ellipsis: # <<<<<<<<<<<<<<
12929 * have_slices = True
12930 * result = (slice(None),) * ndim
12931*/
12932 goto __pyx_L3;
12933 }
12934
12935 /* "View.MemoryView":779
12936 * result = (slice(None),) * ndim
12937 *
12938 * elif isinstance(index, tuple): # <<<<<<<<<<<<<<
12939 * return _unellipsify_index_tuple(<tuple> index, ndim)
12940 *
12941*/
12942 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
12943 if (__pyx_t_1) {
12944
12945
12946 /* "View.MemoryView":780
12947 *
12948 * elif isinstance(index, tuple):
12949 * return _unellipsify_index_tuple(<tuple> index, ndim) # <<<<<<<<<<<<<<
12950 *
12951 * else:
12952*/
12953 if (unlikely(__pyx_v_index == Py_None)) {
12954 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
12955 __PYX_ERR(1, 780, __pyx_L1_error)
12956 }
12957 __pyx_t_2 = _unellipsify_index_tuple(((PyObject*)__pyx_v_index), __pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 780, __pyx_L1_error)
12958 __Pyx_GOTREF(__pyx_t_2);
12959 {
12960 PyObject *__pyx_temp;
12961 {
12962 __pyx_temp = __pyx_r;
12963 __pyx_r = ((PyObject*)__pyx_t_2);
12964 }
12965 __Pyx_XDECREF(__pyx_temp);
12966 }
12967 __pyx_t_2 = 0;
12968 goto __pyx_L0;
12969
12970 /* "View.MemoryView":779
12971 * result = (slice(None),) * ndim
12972 *
12973 * elif isinstance(index, tuple): # <<<<<<<<<<<<<<
12974 * return _unellipsify_index_tuple(<tuple> index, ndim)
12975 *
12976*/
12977 }
12978
12979 /* "View.MemoryView":783
12980 *
12981 * else:
12982 * if isinstance(index, slice): # <<<<<<<<<<<<<<
12983 * have_slices = True
12984 * elif cython.unlikely(not PyIndex_Check(index)):
12985*/
12986 /*else*/ {
12987 __pyx_t_1 = PySlice_Check(__pyx_v_index);
12988 if (__pyx_t_1) {
12989
12990
12991 /* "View.MemoryView":784
12992 * else:
12993 * if isinstance(index, slice):
12994 * have_slices = True # <<<<<<<<<<<<<<
12995 * elif cython.unlikely(not PyIndex_Check(index)):
12996 * _err_invalid_index(index)
12997*/
12998 __pyx_v_have_slices = 1;
12999
13000 /* "View.MemoryView":783
13001 *
13002 * else:
13003 * if isinstance(index, slice): # <<<<<<<<<<<<<<
13004 * have_slices = True
13005 * elif cython.unlikely(not PyIndex_Check(index)):
13006*/
13007 goto __pyx_L4;
13008 }
13009
13010 /* "View.MemoryView":785
13011 * if isinstance(index, slice):
13012 * have_slices = True
13013 * elif cython.unlikely(not PyIndex_Check(index)): # <<<<<<<<<<<<<<
13014 * _err_invalid_index(index)
13015 *
13016*/
13017 __pyx_t_1 = (!(PyIndex_Check(__pyx_v_index) != 0));
13018
13019 if (unlikely(__pyx_t_1)) {
13020
13021
13022 /* "View.MemoryView":786
13023 * have_slices = True
13024 * elif cython.unlikely(not PyIndex_Check(index)):
13025 * _err_invalid_index(index) # <<<<<<<<<<<<<<
13026 *
13027 *
13028*/
13029 __pyx_t_3 = __pyx_memoryview_err_invalid_index(__pyx_v_index); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 786, __pyx_L1_error)
13030
13031
13032 /* "View.MemoryView":785
13033 * if isinstance(index, slice):
13034 * have_slices = True
13035 * elif cython.unlikely(not PyIndex_Check(index)): # <<<<<<<<<<<<<<
13036 * _err_invalid_index(index)
13037 *
13038*/
13039 }
13040 __pyx_L4:;
13041
13042 /* "View.MemoryView":789
13043 *
13044 *
13045 * if ndim == 1: # <<<<<<<<<<<<<<
13046 * result = (index,)
13047 * elif ndim == 2:
13048*/
13049 switch (__pyx_v_ndim) {
13050 case 1:
13051
13052 /* "View.MemoryView":790
13053 *
13054 * if ndim == 1:
13055 * result = (index,) # <<<<<<<<<<<<<<
13056 * elif ndim == 2:
13057 * have_slices = True
13058*/
13059 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
13060 __Pyx_GOTREF(__pyx_t_2);
13061 __Pyx_INCREF(__pyx_v_index);
13062 __Pyx_GIVEREF(__pyx_v_index);
13063 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 790, __pyx_L1_error);
13064 __pyx_v_result = ((PyObject*)__pyx_t_2);
13065 __pyx_t_2 = 0;
13066
13067 /* "View.MemoryView":789
13068 *
13069 *
13070 * if ndim == 1: # <<<<<<<<<<<<<<
13071 * result = (index,)
13072 * elif ndim == 2:
13073*/
13074 break;
13075 case 2:
13076
13077 /* "View.MemoryView":792
13078 * result = (index,)
13079 * elif ndim == 2:
13080 * have_slices = True # <<<<<<<<<<<<<<
13081 * result = (index, slice(None))
13082 * else:
13083*/
13084 __pyx_v_have_slices = 1;
13085
13086 /* "View.MemoryView":793
13087 * elif ndim == 2:
13088 * have_slices = True
13089 * result = (index, slice(None)) # <<<<<<<<<<<<<<
13090 * else:
13091 * have_slices = True
13092*/
13093 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __pyx_L1_error)
13094 __Pyx_GOTREF(__pyx_t_2);
13095 __Pyx_INCREF(__pyx_v_index);
13096 __Pyx_GIVEREF(__pyx_v_index);
13097 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13098 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
13099 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
13100 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13101 __pyx_v_result = ((PyObject*)__pyx_t_2);
13102 __pyx_t_2 = 0;
13103
13104 /* "View.MemoryView":791
13105 * if ndim == 1:
13106 * result = (index,)
13107 * elif ndim == 2: # <<<<<<<<<<<<<<
13108 * have_slices = True
13109 * result = (index, slice(None))
13110*/
13111 break;
13112 default:
13113
13114 /* "View.MemoryView":795
13115 * result = (index, slice(None))
13116 * else:
13117 * have_slices = True # <<<<<<<<<<<<<<
13118 * result = (index,) + (slice(None),) * (ndim - 1)
13119 *
13120*/
13121 __pyx_v_have_slices = 1;
13122
13123 /* "View.MemoryView":796
13124 * else:
13125 * have_slices = True
13126 * result = (index,) + (slice(None),) * (ndim - 1) # <<<<<<<<<<<<<<
13127 *
13128 * return have_slices, result
13129*/
13130 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 796, __pyx_L1_error)
13131 __Pyx_GOTREF(__pyx_t_2);
13132 __Pyx_INCREF(__pyx_v_index);
13133 __Pyx_GIVEREF(__pyx_v_index);
13134 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 796, __pyx_L1_error);
13135 __pyx_t_4 = (__pyx_v_ndim - 1);
13136
13137 __pyx_t_5 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 796, __pyx_L1_error)
13138 __Pyx_GOTREF(__pyx_t_5);
13139
13140 __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 796, __pyx_L1_error)
13141 __Pyx_GOTREF(__pyx_t_6);
13142 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13143 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13144 __pyx_v_result = ((PyObject*)__pyx_t_6);
13145 __pyx_t_6 = 0;
13146 break;
13147 }
13148 }
13149 __pyx_L3:;
13150
13151 /* "View.MemoryView":798
13152 * result = (index,) + (slice(None),) * (ndim - 1)
13153 *
13154 * return have_slices, result # <<<<<<<<<<<<<<
13155 *
13156 *
13157*/
13158 __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 798, __pyx_L1_error)
13159 __Pyx_GOTREF(__pyx_t_6);
13160 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 798, __pyx_L1_error)
13161 __Pyx_GOTREF(__pyx_t_5);
13162 __Pyx_GIVEREF(__pyx_t_6);
13163 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13164 __Pyx_INCREF(__pyx_v_result);
13165 __Pyx_GIVEREF(__pyx_v_result);
13166 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_result) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13167 __pyx_t_6 = 0;
13168 {
13169 PyObject *__pyx_temp;
13170 {
13171 __pyx_temp = __pyx_r;
13172 __pyx_r = ((PyObject*)__pyx_t_5);
13173 }
13174 __Pyx_XDECREF(__pyx_temp);
13175 }
13176 __pyx_t_5 = 0;
13177 goto __pyx_L0;
13178
13179 /* "View.MemoryView":768
13180 *
13181 *
13182 * cdef tuple[bint, tuple] _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13183 * """
13184 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13185*/
13186
13187 /* function exit code */
13188 __pyx_L1_error:;
13189 __Pyx_XDECREF(__pyx_t_2);
13190 __Pyx_XDECREF(__pyx_t_5);
13191 __Pyx_XDECREF(__pyx_t_6);
13192 __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13193 __pyx_r = 0;
13194 __pyx_L0:;
13195 __Pyx_XDECREF(__pyx_v_result);
13196
13197 __Pyx_XGIVEREF(__pyx_r);
13198 __Pyx_RefNannyFinishContext();
13199 return __pyx_r;
13200}
13201
13202/* "View.MemoryView":801
13203 *
13204 *
13205 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13206 * for suboffset in suboffsets[:ndim]:
13207 * if cython.unlikely(suboffset >= 0):
13208*/
13209
13210static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13211 Py_ssize_t __pyx_v_suboffset;
13212 int __pyx_r;
13213 Py_ssize_t *__pyx_t_1;
13214 Py_ssize_t *__pyx_t_2;
13215 Py_ssize_t *__pyx_t_3;
13216 int __pyx_t_4;
13217 int __pyx_t_5;
13218 int __pyx_lineno = 0;
13219 const char *__pyx_filename = NULL;
13220 int __pyx_clineno = 0;
13221
13222 /* "View.MemoryView":802
13223 *
13224 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13225 * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
13226 * if cython.unlikely(suboffset >= 0):
13227 * _err_ValueError("Indirect dimensions not supported")
13228*/
13229 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13230
13231 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13232 __pyx_t_1 = __pyx_t_3;
13233 __pyx_v_suboffset = (__pyx_t_1[0]);
13234
13235 /* "View.MemoryView":803
13236 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13237 * for suboffset in suboffsets[:ndim]:
13238 * if cython.unlikely(suboffset >= 0): # <<<<<<<<<<<<<<
13239 * _err_ValueError("Indirect dimensions not supported")
13240 * return 0 # return type just used as an error flag
13241*/
13242 __pyx_t_4 = (__pyx_v_suboffset >= 0);
13243
13244 if (unlikely(__pyx_t_4)) {
13245
13246
13247 /* "View.MemoryView":804
13248 * for suboffset in suboffsets[:ndim]:
13249 * if cython.unlikely(suboffset >= 0):
13250 * _err_ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
13251 * return 0 # return type just used as an error flag
13252 *
13253*/
13254 __pyx_t_5 = __pyx_memoryview_err_ValueError(__pyx_k_Indirect_dimensions_not_supporte); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 804, __pyx_L1_error)
13255
13256
13257 /* "View.MemoryView":803
13258 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13259 * for suboffset in suboffsets[:ndim]:
13260 * if cython.unlikely(suboffset >= 0): # <<<<<<<<<<<<<<
13261 * _err_ValueError("Indirect dimensions not supported")
13262 * return 0 # return type just used as an error flag
13263*/
13264 }
13265 }
13266
13267
13268 /* "View.MemoryView":805
13269 * if cython.unlikely(suboffset >= 0):
13270 * _err_ValueError("Indirect dimensions not supported")
13271 * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
13272 *
13273 *
13274*/
13275 {
13276
13277 __pyx_r = 0;
13278 }
13279 goto __pyx_L0;
13280
13281 /* "View.MemoryView":801
13282 *
13283 *
13284 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13285 * for suboffset in suboffsets[:ndim]:
13286 * if cython.unlikely(suboffset >= 0):
13287*/
13288
13289 /* function exit code */
13290 __pyx_L1_error:;
13291 __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13292 __pyx_r = -1;
13293 __pyx_L0:;
13294
13295
13296 return __pyx_r;
13297}
13298
13299/* "View.MemoryView":811
13300 *
13301 *
13302 * @cname('__pyx_memview_slice') # <<<<<<<<<<<<<<
13303 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13304 * cdef int new_ndim = 0, suboffset_dim = -1, dim
13305*/
13306
13307static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13308 int __pyx_v_new_ndim;
13309 int __pyx_v_suboffset_dim;
13310 int __pyx_v_dim;
13311 __Pyx_memviewslice __pyx_v_src;
13312 __Pyx_memviewslice __pyx_v_dst;
13313 __Pyx_memviewslice *__pyx_v_p_src;
13314 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13315 __Pyx_memviewslice *__pyx_v_p_dst;
13316 int *__pyx_v_p_suboffset_dim;
13317 Py_ssize_t __pyx_v_start;
13318 Py_ssize_t __pyx_v_stop;
13319 Py_ssize_t __pyx_v_step;
13320 Py_ssize_t __pyx_v_cindex;
13321 int __pyx_v_have_start;
13322 int __pyx_v_have_stop;
13323 int __pyx_v_have_step;
13324 PyObject *__pyx_v_index = NULL;
13325 struct __pyx_memoryview_obj *__pyx_r = NULL;
13326 __Pyx_RefNannyDeclarations
13327 int __pyx_t_1;
13328 PyObject *__pyx_t_2 = NULL;
13329 struct __pyx_memoryview_obj *__pyx_t_3;
13330 char *__pyx_t_4;
13331 int __pyx_t_5;
13332 Py_ssize_t __pyx_t_6;
13333 PyObject *__pyx_t_7 = NULL;
13334 Py_ssize_t __pyx_t_8;
13335 int __pyx_t_9;
13336 Py_ssize_t __pyx_t_10;
13337 int __pyx_lineno = 0;
13338 const char *__pyx_filename = NULL;
13339 int __pyx_clineno = 0;
13340 __Pyx_RefNannySetupContext("memview_slice", 0);
13341
13342 /* "View.MemoryView":813
13343 * @cname('__pyx_memview_slice')
13344 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13345 * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
13346 * cdef bint negative_step
13347 * cdef __Pyx_memviewslice src, dst
13348*/
13349 __pyx_v_new_ndim = 0;
13350 __pyx_v_suboffset_dim = -1;
13351
13352 /* "View.MemoryView":820
13353 *
13354 *
13355 * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
13356 *
13357 * cdef _memoryviewslice memviewsliceobj
13358*/
13359 (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
13360
13361 /* "View.MemoryView":824
13362 * cdef _memoryviewslice memviewsliceobj
13363 *
13364 * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
13365 *
13366 * if isinstance(memview, _memoryviewslice):
13367*/
13368 #ifndef CYTHON_WITHOUT_ASSERTIONS
13369 if (unlikely(__pyx_assertions_enabled())) {
13370 __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
13371
13372 if (unlikely(!__pyx_t_1)) {
13373 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
13374 __PYX_ERR(1, 824, __pyx_L1_error)
13375 }
13376
13377 }
13378 #else
13379 if ((1)); else __PYX_ERR(1, 824, __pyx_L1_error)
13380 #endif
13381
13382 /* "View.MemoryView":826
13383 * assert memview.view.ndim > 0
13384 *
13385 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13386 * memviewsliceobj = memview
13387 * p_src = &memviewsliceobj.from_slice
13388*/
13389 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
13390 if (__pyx_t_1) {
13391
13392
13393 /* "View.MemoryView":827
13394 *
13395 * if isinstance(memview, _memoryviewslice):
13396 * memviewsliceobj = memview # <<<<<<<<<<<<<<
13397 * p_src = &memviewsliceobj.from_slice
13398 * else:
13399*/
13400 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
13401 __Pyx_INCREF(__pyx_t_2);
13402 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 827, __pyx_L1_error)
13403 __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
13404 __pyx_t_2 = 0;
13405
13406 /* "View.MemoryView":828
13407 * if isinstance(memview, _memoryviewslice):
13408 * memviewsliceobj = memview
13409 * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
13410 * else:
13411 * slice_copy(memview, &src)
13412*/
13413 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13414
13415 /* "View.MemoryView":826
13416 * assert memview.view.ndim > 0
13417 *
13418 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13419 * memviewsliceobj = memview
13420 * p_src = &memviewsliceobj.from_slice
13421*/
13422 goto __pyx_L3;
13423 }
13424
13425 /* "View.MemoryView":830
13426 * p_src = &memviewsliceobj.from_slice
13427 * else:
13428 * slice_copy(memview, &src) # <<<<<<<<<<<<<<
13429 * p_src = &src
13430 *
13431*/
13432 /*else*/ {
13433 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13434
13435 /* "View.MemoryView":831
13436 * else:
13437 * slice_copy(memview, &src)
13438 * p_src = &src # <<<<<<<<<<<<<<
13439 *
13440 *
13441*/
13442 __pyx_v_p_src = (&__pyx_v_src);
13443 }
13444 __pyx_L3:;
13445
13446 /* "View.MemoryView":837
13447 *
13448 *
13449 * dst.memview = p_src.memview # <<<<<<<<<<<<<<
13450 * dst.data = p_src.data
13451 *
13452*/
13453 __pyx_t_3 = __pyx_v_p_src->memview;
13454
13455 __pyx_v_dst.memview = __pyx_t_3;
13456
13457 /* "View.MemoryView":838
13458 *
13459 * dst.memview = p_src.memview
13460 * dst.data = p_src.data # <<<<<<<<<<<<<<
13461 *
13462 *
13463*/
13464 __pyx_t_4 = __pyx_v_p_src->data;
13465
13466 __pyx_v_dst.data = __pyx_t_4;
13467
13468 /* "View.MemoryView":843
13469 *
13470 *
13471 * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
13472 * cdef int *p_suboffset_dim = &suboffset_dim
13473 * cdef Py_ssize_t start, stop, step, cindex
13474*/
13475 __pyx_v_p_dst = (&__pyx_v_dst);
13476
13477 /* "View.MemoryView":844
13478 *
13479 * cdef __Pyx_memviewslice *p_dst = &dst
13480 * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
13481 * cdef Py_ssize_t start, stop, step, cindex
13482 * cdef bint have_start, have_stop, have_step
13483*/
13484 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13485
13486 /* "View.MemoryView":848
13487 * cdef bint have_start, have_stop, have_step
13488 *
13489 * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13490 * if PyIndex_Check(index):
13491 * cindex = index
13492*/
13493
13494 __pyx_t_5 = 0;
13495 __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
13496 __pyx_t_6 = 0;
13497 for (;;) {
13498 {
13499 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
13500 #if !CYTHON_ASSUME_SAFE_SIZE
13501 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 848, __pyx_L1_error)
13502 #endif
13503 if (__pyx_t_6 >= __pyx_temp) break;
13504 }
13505 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13506 __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
13507 #else
13508 __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
13509 #endif
13510 ++__pyx_t_6;
13511 if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 848, __pyx_L1_error)
13512 __Pyx_GOTREF(__pyx_t_7);
13513 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_7);
13514 __pyx_t_7 = 0;
13515 __pyx_v_dim = __pyx_t_5;
13516 __pyx_t_5 = (__pyx_t_5 + 1);
13517
13518 /* "View.MemoryView":849
13519 *
13520 * for dim, index in enumerate(indices):
13521 * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13522 * cindex = index
13523 * slice_memviewslice(
13524*/
13525 __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
13526
13527 if (__pyx_t_1) {
13528
13529
13530 /* "View.MemoryView":850
13531 * for dim, index in enumerate(indices):
13532 * if PyIndex_Check(index):
13533 * cindex = index # <<<<<<<<<<<<<<
13534 * slice_memviewslice(
13535 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13536*/
13537 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 850, __pyx_L1_error)
13538 __pyx_v_cindex = __pyx_t_8;
13539
13540 /* "View.MemoryView":851
13541 * if PyIndex_Check(index):
13542 * cindex = index
13543 * slice_memviewslice( # <<<<<<<<<<<<<<
13544 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13545 * dim, new_ndim, p_suboffset_dim,
13546*/
13547 __pyx_t_9 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 851, __pyx_L1_error)
13548
13549
13550 /* "View.MemoryView":849
13551 *
13552 * for dim, index in enumerate(indices):
13553 * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13554 * cindex = index
13555 * slice_memviewslice(
13556*/
13557 goto __pyx_L6;
13558 }
13559
13560 /* "View.MemoryView":857
13561 * 0, 0, 0, # have_{start,stop,step}
13562 * False)
13563 * elif index is None: # <<<<<<<<<<<<<<
13564 * p_dst.shape[new_ndim] = 1
13565 * p_dst.strides[new_ndim] = 0
13566*/
13567 __pyx_t_1 = (__pyx_v_index == Py_None);
13568 if (__pyx_t_1) {
13569
13570
13571 /* "View.MemoryView":858
13572 * False)
13573 * elif index is None:
13574 * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
13575 * p_dst.strides[new_ndim] = 0
13576 * p_dst.suboffsets[new_ndim] = -1
13577*/
13578 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13579
13580 /* "View.MemoryView":859
13581 * elif index is None:
13582 * p_dst.shape[new_ndim] = 1
13583 * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
13584 * p_dst.suboffsets[new_ndim] = -1
13585 * new_ndim += 1
13586*/
13587 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13588
13589 /* "View.MemoryView":860
13590 * p_dst.shape[new_ndim] = 1
13591 * p_dst.strides[new_ndim] = 0
13592 * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
13593 * new_ndim += 1
13594 * else:
13595*/
13596 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13597
13598 /* "View.MemoryView":861
13599 * p_dst.strides[new_ndim] = 0
13600 * p_dst.suboffsets[new_ndim] = -1
13601 * new_ndim += 1 # <<<<<<<<<<<<<<
13602 * else:
13603 * start = index.start or 0
13604*/
13605 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13606
13607 /* "View.MemoryView":857
13608 * 0, 0, 0, # have_{start,stop,step}
13609 * False)
13610 * elif index is None: # <<<<<<<<<<<<<<
13611 * p_dst.shape[new_ndim] = 1
13612 * p_dst.strides[new_ndim] = 0
13613*/
13614 goto __pyx_L6;
13615 }
13616
13617 /* "View.MemoryView":863
13618 * new_ndim += 1
13619 * else:
13620 * start = index.start or 0 # <<<<<<<<<<<<<<
13621 * stop = index.stop or 0
13622 * step = index.step or 0
13623*/
13624 /*else*/ {
13625 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 863, __pyx_L1_error)
13626 __Pyx_GOTREF(__pyx_t_7);
13627 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 863, __pyx_L1_error)
13628 if (!__pyx_t_1) {
13629 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13630 } else {
13631 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 863, __pyx_L1_error)
13632 __pyx_t_8 = __pyx_t_10;
13633 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13634 goto __pyx_L7_bool_binop_done;
13635 }
13636
13637 __pyx_t_8 = 0;
13638 __pyx_L7_bool_binop_done:;
13639 __pyx_v_start = __pyx_t_8;
13640
13641 /* "View.MemoryView":864
13642 * else:
13643 * start = index.start or 0
13644 * stop = index.stop or 0 # <<<<<<<<<<<<<<
13645 * step = index.step or 0
13646 *
13647*/
13648 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 864, __pyx_L1_error)
13649 __Pyx_GOTREF(__pyx_t_7);
13650 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 864, __pyx_L1_error)
13651 if (!__pyx_t_1) {
13652 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13653 } else {
13654 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 864, __pyx_L1_error)
13655 __pyx_t_8 = __pyx_t_10;
13656 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13657 goto __pyx_L9_bool_binop_done;
13658 }
13659
13660 __pyx_t_8 = 0;
13661 __pyx_L9_bool_binop_done:;
13662 __pyx_v_stop = __pyx_t_8;
13663
13664 /* "View.MemoryView":865
13665 * start = index.start or 0
13666 * stop = index.stop or 0
13667 * step = index.step or 0 # <<<<<<<<<<<<<<
13668 *
13669 * have_start = index.start is not None
13670*/
13671 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 865, __pyx_L1_error)
13672 __Pyx_GOTREF(__pyx_t_7);
13673 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 865, __pyx_L1_error)
13674 if (!__pyx_t_1) {
13675 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13676 } else {
13677 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 865, __pyx_L1_error)
13678 __pyx_t_8 = __pyx_t_10;
13679 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13680 goto __pyx_L11_bool_binop_done;
13681 }
13682
13683 __pyx_t_8 = 0;
13684 __pyx_L11_bool_binop_done:;
13685 __pyx_v_step = __pyx_t_8;
13686
13687 /* "View.MemoryView":867
13688 * step = index.step or 0
13689 *
13690 * have_start = index.start is not None # <<<<<<<<<<<<<<
13691 * have_stop = index.stop is not None
13692 * have_step = index.step is not None
13693*/
13694 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 867, __pyx_L1_error)
13695 __Pyx_GOTREF(__pyx_t_7);
13696 __pyx_t_1 = (__pyx_t_7 != Py_None);
13697 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13698 __pyx_v_have_start = __pyx_t_1;
13699
13700 /* "View.MemoryView":868
13701 *
13702 * have_start = index.start is not None
13703 * have_stop = index.stop is not None # <<<<<<<<<<<<<<
13704 * have_step = index.step is not None
13705 *
13706*/
13707 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 868, __pyx_L1_error)
13708 __Pyx_GOTREF(__pyx_t_7);
13709 __pyx_t_1 = (__pyx_t_7 != Py_None);
13710 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13711 __pyx_v_have_stop = __pyx_t_1;
13712
13713 /* "View.MemoryView":869
13714 * have_start = index.start is not None
13715 * have_stop = index.stop is not None
13716 * have_step = index.step is not None # <<<<<<<<<<<<<<
13717 *
13718 * slice_memviewslice(
13719*/
13720 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 869, __pyx_L1_error)
13721 __Pyx_GOTREF(__pyx_t_7);
13722 __pyx_t_1 = (__pyx_t_7 != Py_None);
13723 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13724 __pyx_v_have_step = __pyx_t_1;
13725
13726 /* "View.MemoryView":871
13727 * have_step = index.step is not None
13728 *
13729 * slice_memviewslice( # <<<<<<<<<<<<<<
13730 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13731 * dim, new_ndim, p_suboffset_dim,
13732*/
13733 __pyx_t_9 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 871, __pyx_L1_error)
13734
13735
13736 /* "View.MemoryView":877
13737 * have_start, have_stop, have_step,
13738 * True)
13739 * new_ndim += 1 # <<<<<<<<<<<<<<
13740 *
13741 * if isinstance(memview, _memoryviewslice):
13742*/
13743 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13744 }
13745 __pyx_L6:;
13746
13747 /* "View.MemoryView":848
13748 * cdef bint have_start, have_stop, have_step
13749 *
13750 * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13751 * if PyIndex_Check(index):
13752 * cindex = index
13753*/
13754 }
13755 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13756
13757 /* "View.MemoryView":879
13758 * new_ndim += 1
13759 *
13760 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13761 * return memoryview_fromslice(dst, new_ndim,
13762 * memviewsliceobj.to_object_func,
13763*/
13764 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
13765 if (__pyx_t_1) {
13766
13767
13768 /* "View.MemoryView":881
13769 * if isinstance(memview, _memoryviewslice):
13770 * return memoryview_fromslice(dst, new_ndim,
13771 * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
13772 * memviewsliceobj.to_dtype_func,
13773 * memview.dtype_is_object)
13774*/
13775 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 881, __pyx_L1_error) }
13776
13777 /* "View.MemoryView":882
13778 * return memoryview_fromslice(dst, new_ndim,
13779 * memviewsliceobj.to_object_func,
13780 * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
13781 * memview.dtype_is_object)
13782 * else:
13783*/
13784 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 882, __pyx_L1_error) }
13785
13786 /* "View.MemoryView":880
13787 *
13788 * if isinstance(memview, _memoryviewslice):
13789 * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
13790 * memviewsliceobj.to_object_func,
13791 * memviewsliceobj.to_dtype_func,
13792*/
13793 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 880, __pyx_L1_error)
13794 __Pyx_GOTREF(__pyx_t_2);
13795 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 880, __pyx_L1_error)
13796 {
13797 struct __pyx_memoryview_obj *__pyx_temp;
13798 {
13799 __pyx_temp = __pyx_r;
13800 __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13801 }
13802 __Pyx_XDECREF((PyObject *)__pyx_temp);
13803 }
13804 __pyx_t_2 = 0;
13805 goto __pyx_L0;
13806
13807 /* "View.MemoryView":879
13808 * new_ndim += 1
13809 *
13810 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13811 * return memoryview_fromslice(dst, new_ndim,
13812 * memviewsliceobj.to_object_func,
13813*/
13814 }
13815
13816 /* "View.MemoryView":885
13817 * memview.dtype_is_object)
13818 * else:
13819 * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13820 * memview.dtype_is_object)
13821 *
13822*/
13823 /*else*/ {
13824
13825 /* "View.MemoryView":886
13826 * else:
13827 * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
13828 * memview.dtype_is_object) # <<<<<<<<<<<<<<
13829 *
13830 *
13831*/
13832 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 885, __pyx_L1_error)
13833 __Pyx_GOTREF(__pyx_t_2);
13834
13835 /* "View.MemoryView":885
13836 * memview.dtype_is_object)
13837 * else:
13838 * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13839 * memview.dtype_is_object)
13840 *
13841*/
13842 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 885, __pyx_L1_error)
13843 {
13844 struct __pyx_memoryview_obj *__pyx_temp;
13845 {
13846 __pyx_temp = __pyx_r;
13847 __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13848 }
13849 __Pyx_XDECREF((PyObject *)__pyx_temp);
13850 }
13851 __pyx_t_2 = 0;
13852 goto __pyx_L0;
13853 }
13854
13855 /* "View.MemoryView":811
13856 *
13857 *
13858 * @cname('__pyx_memview_slice') # <<<<<<<<<<<<<<
13859 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13860 * cdef int new_ndim = 0, suboffset_dim = -1, dim
13861*/
13862
13863 /* function exit code */
13864 __pyx_L1_error:;
13865 __Pyx_XDECREF(__pyx_t_2);
13866 __Pyx_XDECREF(__pyx_t_7);
13867 __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13868 __pyx_r = 0;
13869 __pyx_L0:;
13870
13871
13872
13873
13874
13875
13876 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886 __Pyx_XDECREF(__pyx_v_index);
13887 __Pyx_XGIVEREF((PyObject *)__pyx_r);
13888 __Pyx_RefNannyFinishContext();
13889 return __pyx_r;
13890}
13891
13892/* "View.MemoryView":892
13893 *
13894 *
13895 * @cname('__pyx_pybuffer_index') # <<<<<<<<<<<<<<
13896 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
13897 * Py_ssize_t dim) except NULL:
13898*/
13899
13900static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
13901 Py_ssize_t __pyx_v_shape;
13902 Py_ssize_t __pyx_v_stride;
13903 Py_ssize_t __pyx_v_suboffset;
13904 Py_ssize_t __pyx_v_itemsize;
13905 char *__pyx_v_resultp;
13906 char *__pyx_r;
13907 Py_ssize_t __pyx_t_1;
13908 int __pyx_t_2;
13909 int __pyx_t_3;
13910 int __pyx_lineno = 0;
13911 const char *__pyx_filename = NULL;
13912 int __pyx_clineno = 0;
13913
13914
13915 /* "View.MemoryView":895
13916 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
13917 * Py_ssize_t dim) except NULL:
13918 * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
13919 * cdef Py_ssize_t itemsize = view.itemsize
13920 * cdef char *resultp
13921*/
13922 __pyx_v_suboffset = -1L;
13923
13924 /* "View.MemoryView":896
13925 * Py_ssize_t dim) except NULL:
13926 * cdef Py_ssize_t shape, stride, suboffset = -1
13927 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
13928 * cdef char *resultp
13929 *
13930*/
13931 __pyx_t_1 = __pyx_v_view->itemsize;
13932
13933 __pyx_v_itemsize = __pyx_t_1;
13934
13935 /* "View.MemoryView":899
13936 * cdef char *resultp
13937 *
13938 * if view.ndim == 0: # <<<<<<<<<<<<<<
13939 * shape = view.len // itemsize
13940 * stride = itemsize
13941*/
13942 __pyx_t_2 = (__pyx_v_view->ndim == 0);
13943
13944 if (__pyx_t_2) {
13945
13946
13947 /* "View.MemoryView":900
13948 *
13949 * if view.ndim == 0:
13950 * shape = view.len // itemsize # <<<<<<<<<<<<<<
13951 * stride = itemsize
13952 * else:
13953*/
13954 if (unlikely(__pyx_v_itemsize == 0)) {
13955 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
13956 __PYX_ERR(1, 900, __pyx_L1_error)
13957 }
13958 else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
13959 PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
13960 __PYX_ERR(1, 900, __pyx_L1_error)
13961 }
13962 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);
13963
13964 /* "View.MemoryView":901
13965 * if view.ndim == 0:
13966 * shape = view.len // itemsize
13967 * stride = itemsize # <<<<<<<<<<<<<<
13968 * else:
13969 * shape = view.shape[dim]
13970*/
13971 __pyx_v_stride = __pyx_v_itemsize;
13972
13973 /* "View.MemoryView":899
13974 * cdef char *resultp
13975 *
13976 * if view.ndim == 0: # <<<<<<<<<<<<<<
13977 * shape = view.len // itemsize
13978 * stride = itemsize
13979*/
13980 goto __pyx_L3;
13981 }
13982
13983 /* "View.MemoryView":903
13984 * stride = itemsize
13985 * else:
13986 * shape = view.shape[dim] # <<<<<<<<<<<<<<
13987 * stride = view.strides[dim]
13988 * if view.suboffsets != NULL:
13989*/
13990 /*else*/ {
13991 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
13992
13993 /* "View.MemoryView":904
13994 * else:
13995 * shape = view.shape[dim]
13996 * stride = view.strides[dim] # <<<<<<<<<<<<<<
13997 * if view.suboffsets != NULL:
13998 * suboffset = view.suboffsets[dim]
13999*/
14000 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14001
14002 /* "View.MemoryView":905
14003 * shape = view.shape[dim]
14004 * stride = view.strides[dim]
14005 * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14006 * suboffset = view.suboffsets[dim]
14007 *
14008*/
14009 __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14010
14011 if (__pyx_t_2) {
14012
14013
14014 /* "View.MemoryView":906
14015 * stride = view.strides[dim]
14016 * if view.suboffsets != NULL:
14017 * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
14018 *
14019 * if index < 0:
14020*/
14021 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14022
14023 /* "View.MemoryView":905
14024 * shape = view.shape[dim]
14025 * stride = view.strides[dim]
14026 * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14027 * suboffset = view.suboffsets[dim]
14028 *
14029*/
14030 }
14031 }
14032 __pyx_L3:;
14033
14034 /* "View.MemoryView":908
14035 * suboffset = view.suboffsets[dim]
14036 *
14037 * if index < 0: # <<<<<<<<<<<<<<
14038 * index += view.shape[dim]
14039 * if cython.unlikely(index < 0):
14040*/
14041 __pyx_t_2 = (__pyx_v_index < 0);
14042
14043 if (__pyx_t_2) {
14044
14045
14046 /* "View.MemoryView":909
14047 *
14048 * if index < 0:
14049 * index += view.shape[dim] # <<<<<<<<<<<<<<
14050 * if cython.unlikely(index < 0):
14051 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14052*/
14053 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14054
14055 /* "View.MemoryView":910
14056 * if index < 0:
14057 * index += view.shape[dim]
14058 * if cython.unlikely(index < 0): # <<<<<<<<<<<<<<
14059 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14060 *
14061*/
14062 __pyx_t_2 = (__pyx_v_index < 0);
14063
14064 if (unlikely(__pyx_t_2)) {
14065
14066
14067 /* "View.MemoryView":911
14068 * index += view.shape[dim]
14069 * if cython.unlikely(index < 0):
14070 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim) # <<<<<<<<<<<<<<
14071 *
14072 * if cython.unlikely(index >= shape):
14073*/
14074 __pyx_t_3 = __pyx_memoryview_err_IndexError(__pyx_k_Out_of_bounds_on_buffer_access_a, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 911, __pyx_L1_error)
14075
14076
14077 /* "View.MemoryView":910
14078 * if index < 0:
14079 * index += view.shape[dim]
14080 * if cython.unlikely(index < 0): # <<<<<<<<<<<<<<
14081 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14082 *
14083*/
14084 }
14085
14086 /* "View.MemoryView":908
14087 * suboffset = view.suboffsets[dim]
14088 *
14089 * if index < 0: # <<<<<<<<<<<<<<
14090 * index += view.shape[dim]
14091 * if cython.unlikely(index < 0):
14092*/
14093 }
14094
14095 /* "View.MemoryView":913
14096 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14097 *
14098 * if cython.unlikely(index >= shape): # <<<<<<<<<<<<<<
14099 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14100 *
14101*/
14102 __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14103
14104 if (unlikely(__pyx_t_2)) {
14105
14106
14107 /* "View.MemoryView":914
14108 *
14109 * if cython.unlikely(index >= shape):
14110 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim) # <<<<<<<<<<<<<<
14111 *
14112 * resultp = bufp + index * stride
14113*/
14114 __pyx_t_3 = __pyx_memoryview_err_IndexError(__pyx_k_Out_of_bounds_on_buffer_access_a, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 914, __pyx_L1_error)
14115
14116
14117 /* "View.MemoryView":913
14118 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14119 *
14120 * if cython.unlikely(index >= shape): # <<<<<<<<<<<<<<
14121 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14122 *
14123*/
14124 }
14125
14126 /* "View.MemoryView":916
14127 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14128 *
14129 * resultp = bufp + index * stride # <<<<<<<<<<<<<<
14130 * if suboffset >= 0:
14131 * resultp = (<char **> resultp)[0] + suboffset
14132*/
14133 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14134
14135 /* "View.MemoryView":917
14136 *
14137 * resultp = bufp + index * stride
14138 * if suboffset >= 0: # <<<<<<<<<<<<<<
14139 * resultp = (<char **> resultp)[0] + suboffset
14140 *
14141*/
14142 __pyx_t_2 = (__pyx_v_suboffset >= 0);
14143
14144 if (__pyx_t_2) {
14145
14146
14147 /* "View.MemoryView":918
14148 * resultp = bufp + index * stride
14149 * if suboffset >= 0:
14150 * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
14151 *
14152 * return resultp
14153*/
14154 __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14155
14156 /* "View.MemoryView":917
14157 *
14158 * resultp = bufp + index * stride
14159 * if suboffset >= 0: # <<<<<<<<<<<<<<
14160 * resultp = (<char **> resultp)[0] + suboffset
14161 *
14162*/
14163 }
14164
14165 /* "View.MemoryView":920
14166 * resultp = (<char **> resultp)[0] + suboffset
14167 *
14168 * return resultp # <<<<<<<<<<<<<<
14169 *
14170 *
14171*/
14172 {
14173
14174 __pyx_r = __pyx_v_resultp;
14175 }
14176 goto __pyx_L0;
14177
14178 /* "View.MemoryView":892
14179 *
14180 *
14181 * @cname('__pyx_pybuffer_index') # <<<<<<<<<<<<<<
14182 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14183 * Py_ssize_t dim) except NULL:
14184*/
14185
14186 /* function exit code */
14187 __pyx_L1_error:;
14188 __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14189 __pyx_r = NULL;
14190 __pyx_L0:;
14191
14192
14193
14194
14195
14196
14197
14198 return __pyx_r;
14199}
14200
14201/* "View.MemoryView":925
14202 *
14203 *
14204 * @cname('__pyx_memslice_transpose') # <<<<<<<<<<<<<<
14205 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14206 * cdef int ndim = memslice.memview.view.ndim
14207*/
14208
14209static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14210 int __pyx_v_ndim;
14211 Py_ssize_t *__pyx_v_shape;
14212 Py_ssize_t *__pyx_v_strides;
14213 int __pyx_v_i;
14214 int __pyx_v_j;
14215 int __pyx_r;
14216 int __pyx_t_1;
14217 Py_ssize_t *__pyx_t_2;
14218 long __pyx_t_3;
14219 long __pyx_t_4;
14220 Py_ssize_t __pyx_t_5;
14221 Py_ssize_t __pyx_t_6;
14222 int __pyx_t_7;
14223 int __pyx_t_8;
14224 int __pyx_t_9;
14225 int __pyx_lineno = 0;
14226 const char *__pyx_filename = NULL;
14227 int __pyx_clineno = 0;
14228 PyGILState_STATE __pyx_gilstate_save;
14229
14230 /* "View.MemoryView":927
14231 * @cname('__pyx_memslice_transpose')
14232 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14233 * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
14234 *
14235 * cdef Py_ssize_t *shape = memslice.shape
14236*/
14237 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14238
14239 __pyx_v_ndim = __pyx_t_1;
14240
14241 /* "View.MemoryView":929
14242 * cdef int ndim = memslice.memview.view.ndim
14243 *
14244 * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
14245 * cdef Py_ssize_t *strides = memslice.strides
14246 *
14247*/
14248 __pyx_t_2 = __pyx_v_memslice->shape;
14249
14250 __pyx_v_shape = __pyx_t_2;
14251
14252 /* "View.MemoryView":930
14253 *
14254 * cdef Py_ssize_t *shape = memslice.shape
14255 * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
14256 *
14257 *
14258*/
14259 __pyx_t_2 = __pyx_v_memslice->strides;
14260
14261 __pyx_v_strides = __pyx_t_2;
14262
14263 /* "View.MemoryView":934
14264 *
14265 * cdef int i, j
14266 * for i in range(ndim // 2): # <<<<<<<<<<<<<<
14267 * j = ndim - 1 - i
14268 * strides[i], strides[j] = strides[j], strides[i]
14269*/
14270
14271 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2, 1);
14272 __pyx_t_4 = __pyx_t_3;
14273
14274 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14275 __pyx_v_i = __pyx_t_1;
14276
14277 /* "View.MemoryView":935
14278 * cdef int i, j
14279 * for i in range(ndim // 2):
14280 * j = ndim - 1 - i # <<<<<<<<<<<<<<
14281 * strides[i], strides[j] = strides[j], strides[i]
14282 * shape[i], shape[j] = shape[j], shape[i]
14283*/
14284 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14285
14286 /* "View.MemoryView":936
14287 * for i in range(ndim // 2):
14288 * j = ndim - 1 - i
14289 * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
14290 * shape[i], shape[j] = shape[j], shape[i]
14291 *
14292*/
14293 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14294
14295 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14296
14297 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14298
14299 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14300
14301
14302 /* "View.MemoryView":937
14303 * j = ndim - 1 - i
14304 * strides[i], strides[j] = strides[j], strides[i]
14305 * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
14306 *
14307 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0):
14308*/
14309 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14310
14311 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14312
14313 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14314
14315 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14316
14317
14318 /* "View.MemoryView":939
14319 * shape[i], shape[j] = shape[j], shape[i]
14320 *
14321 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0): # <<<<<<<<<<<<<<
14322 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14323 *
14324*/
14325 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14326
14327 if (!__pyx_t_8) {
14328
14329 } else {
14330
14331 __pyx_t_7 = __pyx_t_8;
14332
14333 goto __pyx_L6_bool_binop_done;
14334 }
14335 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14336
14337
14338 __pyx_t_7 = __pyx_t_8;
14339
14340 __pyx_L6_bool_binop_done:;
14341 if (unlikely(__pyx_t_7)) {
14342
14343
14344 /* "View.MemoryView":940
14345 *
14346 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0):
14347 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
14348 *
14349 * return 0
14350*/
14351 __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 940, __pyx_L1_error)
14352
14353
14354 /* "View.MemoryView":939
14355 * shape[i], shape[j] = shape[j], shape[i]
14356 *
14357 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0): # <<<<<<<<<<<<<<
14358 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14359 *
14360*/
14361 }
14362 }
14363
14364
14365 /* "View.MemoryView":942
14366 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14367 *
14368 * return 0 # <<<<<<<<<<<<<<
14369 *
14370 *
14371*/
14372 {
14373
14374 __pyx_r = 0;
14375 }
14376 goto __pyx_L0;
14377
14378 /* "View.MemoryView":925
14379 *
14380 *
14381 * @cname('__pyx_memslice_transpose') # <<<<<<<<<<<<<<
14382 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14383 * cdef int ndim = memslice.memview.view.ndim
14384*/
14385
14386 /* function exit code */
14387 __pyx_L1_error:;
14388 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14389 __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14390 __pyx_r = -1;
14391 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14392 __pyx_L0:;
14393
14394
14395
14396
14397
14398 return __pyx_r;
14399}
14400
14401/* "View.MemoryView":960
14402 * cdef to_dtype_func_type to_dtype_func
14403 *
14404 * def __dealloc__(self): # <<<<<<<<<<<<<<
14405 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14406 *
14407*/
14408
14409/* Python wrapper */
14410static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
14411static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14412 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14413 __Pyx_RefNannyDeclarations
14414 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14415 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
14416 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14417
14418 /* function exit code */
14419 __Pyx_RefNannyFinishContext();
14420}
14421
14422static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14423
14424 /* "View.MemoryView":961
14425 *
14426 * def __dealloc__(self):
14427 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
14428 *
14429 * cdef convert_item_to_object(self, char *itemp):
14430*/
14431 __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
14432
14433 /* "View.MemoryView":960
14434 * cdef to_dtype_func_type to_dtype_func
14435 *
14436 * def __dealloc__(self): # <<<<<<<<<<<<<<
14437 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14438 *
14439*/
14440
14441 /* function exit code */
14442
14443}
14444
14445/* "View.MemoryView":963
14446 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14447 *
14448 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14449 * if self.to_object_func != NULL:
14450 * return self.to_object_func(itemp)
14451*/
14452
14453static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
14454 PyObject *__pyx_r = NULL;
14455 __Pyx_RefNannyDeclarations
14456 int __pyx_t_1;
14457 PyObject *__pyx_t_2 = NULL;
14458 int __pyx_lineno = 0;
14459 const char *__pyx_filename = NULL;
14460 int __pyx_clineno = 0;
14461 __Pyx_RefNannySetupContext("convert_item_to_object", 0);
14462
14463 /* "View.MemoryView":964
14464 *
14465 * cdef convert_item_to_object(self, char *itemp):
14466 * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14467 * return self.to_object_func(itemp)
14468 * else:
14469*/
14470 __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
14471
14472 if (__pyx_t_1) {
14473
14474
14475 /* "View.MemoryView":965
14476 * cdef convert_item_to_object(self, char *itemp):
14477 * if self.to_object_func != NULL:
14478 * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
14479 * else:
14480 * return memoryview.convert_item_to_object(self, itemp)
14481*/
14482 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 965, __pyx_L1_error)
14483 __Pyx_GOTREF(__pyx_t_2);
14484 {
14485 PyObject *__pyx_temp;
14486 {
14487 __pyx_temp = __pyx_r;
14488 __pyx_r = __pyx_t_2;
14489 }
14490 __Pyx_XDECREF(__pyx_temp);
14491 }
14492 __pyx_t_2 = 0;
14493 goto __pyx_L0;
14494
14495 /* "View.MemoryView":964
14496 *
14497 * cdef convert_item_to_object(self, char *itemp):
14498 * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14499 * return self.to_object_func(itemp)
14500 * else:
14501*/
14502 }
14503
14504 /* "View.MemoryView":967
14505 * return self.to_object_func(itemp)
14506 * else:
14507 * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
14508 *
14509 * cdef assign_item_from_object(self, char *itemp, object value):
14510*/
14511 /*else*/ {
14512 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error)
14513 __Pyx_GOTREF(__pyx_t_2);
14514 {
14515 PyObject *__pyx_temp;
14516 {
14517 __pyx_temp = __pyx_r;
14518 __pyx_r = __pyx_t_2;
14519 }
14520 __Pyx_XDECREF(__pyx_temp);
14521 }
14522 __pyx_t_2 = 0;
14523 goto __pyx_L0;
14524 }
14525
14526 /* "View.MemoryView":963
14527 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14528 *
14529 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14530 * if self.to_object_func != NULL:
14531 * return self.to_object_func(itemp)
14532*/
14533
14534 /* function exit code */
14535 __pyx_L1_error:;
14536 __Pyx_XDECREF(__pyx_t_2);
14537 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14538 __pyx_r = 0;
14539 __pyx_L0:;
14540 __Pyx_XGIVEREF(__pyx_r);
14541 __Pyx_RefNannyFinishContext();
14542 return __pyx_r;
14543}
14544
14545/* "View.MemoryView":969
14546 * return memoryview.convert_item_to_object(self, itemp)
14547 *
14548 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14549 * if self.to_dtype_func != NULL:
14550 * self.to_dtype_func(itemp, value)
14551*/
14552
14553static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14554 PyObject *__pyx_r = NULL;
14555 __Pyx_RefNannyDeclarations
14556 int __pyx_t_1;
14557 int __pyx_t_2;
14558 PyObject *__pyx_t_3 = NULL;
14559 int __pyx_lineno = 0;
14560 const char *__pyx_filename = NULL;
14561 int __pyx_clineno = 0;
14562 __Pyx_RefNannySetupContext("assign_item_from_object", 0);
14563
14564 /* "View.MemoryView":970
14565 *
14566 * cdef assign_item_from_object(self, char *itemp, object value):
14567 * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14568 * self.to_dtype_func(itemp, value)
14569 * else:
14570*/
14571 __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
14572
14573 if (__pyx_t_1) {
14574
14575
14576 /* "View.MemoryView":971
14577 * cdef assign_item_from_object(self, char *itemp, object value):
14578 * if self.to_dtype_func != NULL:
14579 * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
14580 * else:
14581 * memoryview.assign_item_from_object(self, itemp, value)
14582*/
14583 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 971, __pyx_L1_error)
14584
14585
14586 /* "View.MemoryView":970
14587 *
14588 * cdef assign_item_from_object(self, char *itemp, object value):
14589 * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14590 * self.to_dtype_func(itemp, value)
14591 * else:
14592*/
14593 goto __pyx_L3;
14594 }
14595
14596 /* "View.MemoryView":973
14597 * self.to_dtype_func(itemp, value)
14598 * else:
14599 * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
14600 *
14601 * cdef _get_base(self):
14602*/
14603 /*else*/ {
14604 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 973, __pyx_L1_error)
14605 __Pyx_GOTREF(__pyx_t_3);
14606 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14607 }
14608 __pyx_L3:;
14609
14610 /* "View.MemoryView":969
14611 * return memoryview.convert_item_to_object(self, itemp)
14612 *
14613 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14614 * if self.to_dtype_func != NULL:
14615 * self.to_dtype_func(itemp, value)
14616*/
14617
14618 /* function exit code */
14619 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14620 goto __pyx_L0;
14621 __pyx_L1_error:;
14622 __Pyx_XDECREF(__pyx_t_3);
14623 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14624 __pyx_r = 0;
14625 __pyx_L0:;
14626 __Pyx_XGIVEREF(__pyx_r);
14627 __Pyx_RefNannyFinishContext();
14628 return __pyx_r;
14629}
14630
14631/* "View.MemoryView":975
14632 * memoryview.assign_item_from_object(self, itemp, value)
14633 *
14634 * cdef _get_base(self): # <<<<<<<<<<<<<<
14635 * return self.from_object
14636 *
14637*/
14638
14639static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14640 PyObject *__pyx_r = NULL;
14641 __Pyx_RefNannyDeclarations
14642 __Pyx_RefNannySetupContext("_get_base", 0);
14643
14644 /* "View.MemoryView":976
14645 *
14646 * cdef _get_base(self):
14647 * return self.from_object # <<<<<<<<<<<<<<
14648 *
14649 *
14650*/
14651 {
14652 PyObject *__pyx_temp;
14653 {
14654 __pyx_temp = __pyx_r;
14655 __Pyx_INCREF(__pyx_v_self->from_object);
14656 __pyx_r = __pyx_v_self->from_object;
14657 }
14658 __Pyx_XDECREF(__pyx_temp);
14659 }
14660 goto __pyx_L0;
14661
14662 /* "View.MemoryView":975
14663 * memoryview.assign_item_from_object(self, itemp, value)
14664 *
14665 * cdef _get_base(self): # <<<<<<<<<<<<<<
14666 * return self.from_object
14667 *
14668*/
14669
14670 /* function exit code */
14671 __pyx_L0:;
14672 __Pyx_XGIVEREF(__pyx_r);
14673 __Pyx_RefNannyFinishContext();
14674 return __pyx_r;
14675}
14676
14677/* "(tree fragment)":1
14678 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14679 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14680 * def __setstate_cython__(self, __pyx_state):
14681*/
14682
14683/* Python wrapper */
14684static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14685#if CYTHON_VECTORCALL
14686PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14687#else
14688PyObject *__pyx_args, PyObject *__pyx_kwds
14689#endif
14690); /*proto*/
14691static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14692#if CYTHON_VECTORCALL
14693PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14694#else
14695PyObject *__pyx_args, PyObject *__pyx_kwds
14696#endif
14697) {
14698 #if !CYTHON_VECTORCALL
14699 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14700 #endif
14701 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14702 PyObject *__pyx_r = 0;
14703 __Pyx_RefNannyDeclarations
14704 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14705 #if !CYTHON_VECTORCALL
14706 #if CYTHON_ASSUME_SAFE_SIZE
14707 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14708 #else
14709 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14710 #endif
14711 #endif
14712 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14713 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
14714 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
14715 if (unlikely(__pyx_kwds_len < 0)) return NULL;
14716 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
14717 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14718
14719 /* function exit code */
14720 __Pyx_RefNannyFinishContext();
14721 return __pyx_r;
14722}
14723
14724static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14725 PyObject *__pyx_r = NULL;
14726 __Pyx_RefNannyDeclarations
14727 int __pyx_lineno = 0;
14728 const char *__pyx_filename = NULL;
14729 int __pyx_clineno = 0;
14730 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14731
14732 /* "(tree fragment)":2
14733 * def __reduce_cython__(self):
14734 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
14735 * def __setstate_cython__(self, __pyx_state):
14736 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14737*/
14738 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
14739 __PYX_ERR(1, 2, __pyx_L1_error)
14740
14741 /* "(tree fragment)":1
14742 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14743 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14744 * def __setstate_cython__(self, __pyx_state):
14745*/
14746
14747 /* function exit code */
14748 __pyx_L1_error:;
14749 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14750 __pyx_r = NULL;
14751 __Pyx_XGIVEREF(__pyx_r);
14752 __Pyx_RefNannyFinishContext();
14753 return __pyx_r;
14754}
14755
14756/* "(tree fragment)":3
14757 * def __reduce_cython__(self):
14758 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14759 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14760 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14761*/
14762
14763/* Python wrapper */
14764static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14765#if CYTHON_VECTORCALL
14766PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14767#else
14768PyObject *__pyx_args, PyObject *__pyx_kwds
14769#endif
14770); /*proto*/
14771static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14772#if CYTHON_VECTORCALL
14773PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14774#else
14775PyObject *__pyx_args, PyObject *__pyx_kwds
14776#endif
14777) {
14778 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
14779 #if !CYTHON_VECTORCALL
14780 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14781 #endif
14782 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14783 PyObject* values[1] = {0};
14784 int __pyx_lineno = 0;
14785 const char *__pyx_filename = NULL;
14786 int __pyx_clineno = 0;
14787 PyObject *__pyx_r = 0;
14788 __Pyx_RefNannyDeclarations
14789 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14790 #if !CYTHON_VECTORCALL
14791 #if CYTHON_ASSUME_SAFE_SIZE
14792 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14793 #else
14794 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14795 #endif
14796 #endif
14797 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14798 {
14799 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
14800 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
14801 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
14802 if (__pyx_kwds_len > 0) {
14803 switch (__pyx_nargs) {
14804 case 1:
14805 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
14806 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
14807 CYTHON_FALLTHROUGH;
14808 case 0: break;
14809 default: goto __pyx_L5_argtuple_error;
14810 }
14811 const Py_ssize_t kwd_pos_args = __pyx_nargs;
14812 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
14813 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
14814 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
14815 }
14816 } else if (unlikely(__pyx_nargs != 1)) {
14817 goto __pyx_L5_argtuple_error;
14818 } else {
14819 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
14820 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
14821 }
14822 __pyx_v___pyx_state = values[0];
14823 }
14824 goto __pyx_L6_skip;
14825 __pyx_L5_argtuple_error:;
14826 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
14827 __pyx_L6_skip:;
14828 goto __pyx_L4_argument_unpacking_done;
14829 __pyx_L3_error:;
14830 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14831 Py_XDECREF(values[__pyx_temp]);
14832 }
14833 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14834 __Pyx_RefNannyFinishContext();
14835 return NULL;
14836 __pyx_L4_argument_unpacking_done:;
14837 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
14838
14839 /* function exit code */
14840 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14841 Py_XDECREF(values[__pyx_temp]);
14842 }
14843 __Pyx_RefNannyFinishContext();
14844 return __pyx_r;
14845}
14846
14847static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14848 PyObject *__pyx_r = NULL;
14849 __Pyx_RefNannyDeclarations
14850 int __pyx_lineno = 0;
14851 const char *__pyx_filename = NULL;
14852 int __pyx_clineno = 0;
14853 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14854
14855 /* "(tree fragment)":4
14856 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14857 * def __setstate_cython__(self, __pyx_state):
14858 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
14859*/
14860 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
14861 __PYX_ERR(1, 4, __pyx_L1_error)
14862
14863 /* "(tree fragment)":3
14864 * def __reduce_cython__(self):
14865 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14866 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14867 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14868*/
14869
14870 /* function exit code */
14871 __pyx_L1_error:;
14872 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14873 __pyx_r = NULL;
14874 __Pyx_XGIVEREF(__pyx_r);
14875 __Pyx_RefNannyFinishContext();
14876 return __pyx_r;
14877}
14878
14879/* "View.MemoryView":995
14880 * pass # ignore failure, it's a minor issue
14881 *
14882 * @cname('__pyx_memoryview_fromslice') # <<<<<<<<<<<<<<
14883 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
14884 * int ndim,
14885*/
14886
14887static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func, int __pyx_v_dtype_is_object) {
14888 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
14889 Py_ssize_t __pyx_v_suboffset;
14890 Py_ssize_t __pyx_v_length;
14891 PyObject *__pyx_r = NULL;
14892 __Pyx_RefNannyDeclarations
14893 int __pyx_t_1;
14894 PyObject *__pyx_t_2 = NULL;
14895 PyObject *__pyx_t_3 = NULL;
14896 __Pyx_TypeInfo const *__pyx_t_4;
14897 Py_buffer __pyx_t_5;
14898 Py_ssize_t *__pyx_t_6;
14899 Py_ssize_t *__pyx_t_7;
14900 Py_ssize_t *__pyx_t_8;
14901 Py_ssize_t __pyx_t_9;
14902 int __pyx_lineno = 0;
14903 const char *__pyx_filename = NULL;
14904 int __pyx_clineno = 0;
14905 __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
14906
14907 /* "View.MemoryView":1004
14908 * cdef _memoryviewslice result
14909 *
14910 * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
14911 * return None
14912 *
14913*/
14914 __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
14915
14916 if (__pyx_t_1) {
14917
14918
14919 /* "View.MemoryView":1005
14920 *
14921 * if <PyObject *> memviewslice.memview == Py_None:
14922 * return None # <<<<<<<<<<<<<<
14923 *
14924 *
14925*/
14926 {
14927 PyObject *__pyx_temp;
14928 {
14929 __pyx_temp = __pyx_r;
14930 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14931 }
14932 __Pyx_XDECREF(__pyx_temp);
14933 }
14934 goto __pyx_L0;
14935
14936 /* "View.MemoryView":1004
14937 * cdef _memoryviewslice result
14938 *
14939 * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
14940 * return None
14941 *
14942*/
14943 }
14944
14945 /* "View.MemoryView":1010
14946 *
14947 *
14948 * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
14949 *
14950 * result.from_slice = memviewslice
14951*/
14952 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
14953 __Pyx_GOTREF(__pyx_t_2);
14954 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1010, __pyx_L1_error)
14955 __Pyx_GOTREF(__pyx_t_3);
14956 __Pyx_INCREF(Py_None);
14957 __Pyx_GIVEREF(Py_None);
14958 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
14959 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
14960 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
14961 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
14962 __Pyx_GIVEREF(__pyx_t_2);
14963 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
14964 __pyx_t_2 = 0;
14965 __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_mstate_global->__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
14966 __Pyx_GOTREF(__pyx_t_2);
14967 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14968 __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
14969 __pyx_t_2 = 0;
14970
14971 /* "View.MemoryView":1012
14972 * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
14973 *
14974 * result.from_slice = memviewslice # <<<<<<<<<<<<<<
14975 * __PYX_INC_MEMVIEW(&memviewslice, 1)
14976 *
14977*/
14978 __pyx_v_result->from_slice = __pyx_v_memviewslice;
14979
14980 /* "View.MemoryView":1013
14981 *
14982 * result.from_slice = memviewslice
14983 * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
14984 *
14985 * result.from_object = (<memoryview> memviewslice.memview)._get_base()
14986*/
14987 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
14988
14989 /* "View.MemoryView":1015
14990 * __PYX_INC_MEMVIEW(&memviewslice, 1)
14991 *
14992 * result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
14993 * result.typeinfo = memviewslice.memview.typeinfo
14994 *
14995*/
14996 __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
14997 __Pyx_GOTREF(__pyx_t_2);
14998 __Pyx_GIVEREF(__pyx_t_2);
14999 __Pyx_GOTREF(__pyx_v_result->from_object);
15000 __Pyx_DECREF(__pyx_v_result->from_object);
15001 __pyx_v_result->from_object = __pyx_t_2;
15002 __pyx_t_2 = 0;
15003
15004 /* "View.MemoryView":1016
15005 *
15006 * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15007 * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
15008 *
15009 * result.view = memviewslice.memview.view
15010*/
15011 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15012
15013 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15014
15015 /* "View.MemoryView":1018
15016 * result.typeinfo = memviewslice.memview.typeinfo
15017 *
15018 * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
15019 * result.view.buf = <void *> memviewslice.data
15020 * result.view.ndim = ndim
15021*/
15022 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15023
15024 __pyx_v_result->__pyx_base.view = __pyx_t_5;
15025
15026 /* "View.MemoryView":1019
15027 *
15028 * result.view = memviewslice.memview.view
15029 * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
15030 * result.view.ndim = ndim
15031 * (<__pyx_buffer *> &result.view).obj = Py_None
15032*/
15033 __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
15034
15035 /* "View.MemoryView":1020
15036 * result.view = memviewslice.memview.view
15037 * result.view.buf = <void *> memviewslice.data
15038 * result.view.ndim = ndim # <<<<<<<<<<<<<<
15039 * (<__pyx_buffer *> &result.view).obj = Py_None
15040 * Py_INCREF(Py_None)
15041*/
15042 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15043
15044 /* "View.MemoryView":1021
15045 * result.view.buf = <void *> memviewslice.data
15046 * result.view.ndim = ndim
15047 * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
15048 * Py_INCREF(Py_None)
15049 *
15050*/
15051 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15052
15053 /* "View.MemoryView":1022
15054 * result.view.ndim = ndim
15055 * (<__pyx_buffer *> &result.view).obj = Py_None
15056 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
15057 *
15058 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15059*/
15060 Py_INCREF(Py_None);
15061
15062 /* "View.MemoryView":1024
15063 * Py_INCREF(Py_None)
15064 *
15065 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15066 * result.flags = PyBUF_RECORDS
15067 * else:
15068*/
15069 __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15070
15071 if (__pyx_t_1) {
15072
15073
15074 /* "View.MemoryView":1025
15075 *
15076 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15077 * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
15078 * else:
15079 * result.flags = PyBUF_RECORDS_RO
15080*/
15081 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15082
15083 /* "View.MemoryView":1024
15084 * Py_INCREF(Py_None)
15085 *
15086 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15087 * result.flags = PyBUF_RECORDS
15088 * else:
15089*/
15090 goto __pyx_L4;
15091 }
15092
15093 /* "View.MemoryView":1027
15094 * result.flags = PyBUF_RECORDS
15095 * else:
15096 * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
15097 *
15098 * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15099*/
15100 /*else*/ {
15101 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15102 }
15103 __pyx_L4:;
15104
15105 /* "View.MemoryView":1029
15106 * result.flags = PyBUF_RECORDS_RO
15107 *
15108 * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
15109 * result.view.strides = <Py_ssize_t *> result.from_slice.strides
15110 *
15111*/
15112 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15113
15114 /* "View.MemoryView":1030
15115 *
15116 * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15117 * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
15118 *
15119 *
15120*/
15121 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15122
15123 /* "View.MemoryView":1033
15124 *
15125 *
15126 * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
15127 * for suboffset in result.from_slice.suboffsets[:ndim]:
15128 * if suboffset >= 0:
15129*/
15130 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15131
15132 /* "View.MemoryView":1034
15133 *
15134 * result.view.suboffsets = NULL
15135 * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
15136 * if suboffset >= 0:
15137 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15138*/
15139 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15140
15141 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15142 __pyx_t_6 = __pyx_t_8;
15143 __pyx_v_suboffset = (__pyx_t_6[0]);
15144
15145 /* "View.MemoryView":1035
15146 * result.view.suboffsets = NULL
15147 * for suboffset in result.from_slice.suboffsets[:ndim]:
15148 * if suboffset >= 0: # <<<<<<<<<<<<<<
15149 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15150 * break
15151*/
15152 __pyx_t_1 = (__pyx_v_suboffset >= 0);
15153
15154 if (__pyx_t_1) {
15155
15156
15157 /* "View.MemoryView":1036
15158 * for suboffset in result.from_slice.suboffsets[:ndim]:
15159 * if suboffset >= 0:
15160 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
15161 * break
15162 *
15163*/
15164 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15165
15166 /* "View.MemoryView":1037
15167 * if suboffset >= 0:
15168 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15169 * break # <<<<<<<<<<<<<<
15170 *
15171 * cdef Py_ssize_t length
15172*/
15173 goto __pyx_L6_break;
15174
15175 /* "View.MemoryView":1035
15176 * result.view.suboffsets = NULL
15177 * for suboffset in result.from_slice.suboffsets[:ndim]:
15178 * if suboffset >= 0: # <<<<<<<<<<<<<<
15179 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15180 * break
15181*/
15182 }
15183 }
15184 __pyx_L6_break:;
15185
15186
15187 /* "View.MemoryView":1040
15188 *
15189 * cdef Py_ssize_t length
15190 * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
15191 * for length in result.view.shape[:ndim]:
15192 * result.view.len *= length
15193*/
15194 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15195
15196 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15197
15198 /* "View.MemoryView":1041
15199 * cdef Py_ssize_t length
15200 * result.view.len = result.view.itemsize
15201 * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
15202 * result.view.len *= length
15203 *
15204*/
15205 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15206
15207 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15208 __pyx_t_6 = __pyx_t_8;
15209 __pyx_v_length = (__pyx_t_6[0]);
15210
15211 /* "View.MemoryView":1042
15212 * result.view.len = result.view.itemsize
15213 * for length in result.view.shape[:ndim]:
15214 * result.view.len *= length # <<<<<<<<<<<<<<
15215 *
15216 * result.to_object_func = to_object_func
15217*/
15218 __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * __pyx_v_length);
15219 }
15220
15221
15222 /* "View.MemoryView":1044
15223 * result.view.len *= length
15224 *
15225 * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
15226 * result.to_dtype_func = to_dtype_func
15227 *
15228*/
15229 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15230
15231 /* "View.MemoryView":1045
15232 *
15233 * result.to_object_func = to_object_func
15234 * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
15235 *
15236 * return result
15237*/
15238 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15239
15240 /* "View.MemoryView":1047
15241 * result.to_dtype_func = to_dtype_func
15242 *
15243 * return result # <<<<<<<<<<<<<<
15244 *
15245 * @cname('__pyx_memoryview_get_slice_from_memoryview')
15246*/
15247 {
15248 PyObject *__pyx_temp;
15249 {
15250 __pyx_temp = __pyx_r;
15251 __Pyx_INCREF((PyObject *)__pyx_v_result);
15252 __pyx_r = ((PyObject *)__pyx_v_result);
15253 }
15254 __Pyx_XDECREF(__pyx_temp);
15255 }
15256 goto __pyx_L0;
15257
15258 /* "View.MemoryView":995
15259 * pass # ignore failure, it's a minor issue
15260 *
15261 * @cname('__pyx_memoryview_fromslice') # <<<<<<<<<<<<<<
15262 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
15263 * int ndim,
15264*/
15265
15266 /* function exit code */
15267 __pyx_L1_error:;
15268 __Pyx_XDECREF(__pyx_t_2);
15269 __Pyx_XDECREF(__pyx_t_3);
15270 __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15271 __pyx_r = 0;
15272 __pyx_L0:;
15273 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15274
15275
15276 __Pyx_XGIVEREF(__pyx_r);
15277 __Pyx_RefNannyFinishContext();
15278 return __pyx_r;
15279}
15280
15281/* "View.MemoryView":1049
15282 * return result
15283 *
15284 * @cname('__pyx_memoryview_get_slice_from_memoryview') # <<<<<<<<<<<<<<
15285 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
15286 * __Pyx_memviewslice *mslice) except NULL:
15287*/
15288
15289static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15290 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15291 __Pyx_memviewslice *__pyx_r;
15292 __Pyx_RefNannyDeclarations
15293 int __pyx_t_1;
15294 PyObject *__pyx_t_2 = NULL;
15295 int __pyx_lineno = 0;
15296 const char *__pyx_filename = NULL;
15297 int __pyx_clineno = 0;
15298 __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
15299
15300 /* "View.MemoryView":1053
15301 * __Pyx_memviewslice *mslice) except NULL:
15302 * cdef _memoryviewslice obj
15303 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15304 * obj = memview
15305 * return &obj.from_slice
15306*/
15307 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15308 if (__pyx_t_1) {
15309
15310
15311 /* "View.MemoryView":1054
15312 * cdef _memoryviewslice obj
15313 * if isinstance(memview, _memoryviewslice):
15314 * obj = memview # <<<<<<<<<<<<<<
15315 * return &obj.from_slice
15316 * else:
15317*/
15318 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
15319 __Pyx_INCREF(__pyx_t_2);
15320 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 1054, __pyx_L1_error)
15321 __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15322 __pyx_t_2 = 0;
15323
15324 /* "View.MemoryView":1055
15325 * if isinstance(memview, _memoryviewslice):
15326 * obj = memview
15327 * return &obj.from_slice # <<<<<<<<<<<<<<
15328 * else:
15329 * slice_copy(memview, mslice)
15330*/
15331 {
15332
15333 __pyx_r = (&__pyx_v_obj->from_slice);
15334 }
15335 goto __pyx_L0;
15336
15337 /* "View.MemoryView":1053
15338 * __Pyx_memviewslice *mslice) except NULL:
15339 * cdef _memoryviewslice obj
15340 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15341 * obj = memview
15342 * return &obj.from_slice
15343*/
15344 }
15345
15346 /* "View.MemoryView":1057
15347 * return &obj.from_slice
15348 * else:
15349 * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
15350 * return mslice
15351 *
15352*/
15353 /*else*/ {
15354 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15355
15356 /* "View.MemoryView":1058
15357 * else:
15358 * slice_copy(memview, mslice)
15359 * return mslice # <<<<<<<<<<<<<<
15360 *
15361 * @cname('__pyx_memoryview_slice_copy')
15362*/
15363 {
15364
15365 __pyx_r = __pyx_v_mslice;
15366 }
15367 goto __pyx_L0;
15368 }
15369
15370 /* "View.MemoryView":1049
15371 * return result
15372 *
15373 * @cname('__pyx_memoryview_get_slice_from_memoryview') # <<<<<<<<<<<<<<
15374 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
15375 * __Pyx_memviewslice *mslice) except NULL:
15376*/
15377
15378 /* function exit code */
15379 __pyx_L1_error:;
15380 __Pyx_XDECREF(__pyx_t_2);
15381 __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15382 __pyx_r = NULL;
15383 __pyx_L0:;
15384 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15385
15386 __Pyx_RefNannyFinishContext();
15387 return __pyx_r;
15388}
15389
15390/* "View.MemoryView":1060
15391 * return mslice
15392 *
15393 * @cname('__pyx_memoryview_slice_copy') # <<<<<<<<<<<<<<
15394 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
15395 * cdef int dim
15396*/
15397
15398static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15399 int __pyx_v_dim;
15400 Py_ssize_t *__pyx_v_shape;
15401 Py_ssize_t *__pyx_v_strides;
15402 Py_ssize_t *__pyx_v_suboffsets;
15403 Py_ssize_t *__pyx_t_1;
15404 int __pyx_t_2;
15405 int __pyx_t_3;
15406 int __pyx_t_4;
15407 Py_ssize_t __pyx_t_5;
15408 int __pyx_t_6;
15409
15410 /* "View.MemoryView":1065
15411 * cdef (Py_ssize_t*) shape, strides, suboffsets
15412 *
15413 * shape = memview.view.shape # <<<<<<<<<<<<<<
15414 * strides = memview.view.strides
15415 * suboffsets = memview.view.suboffsets
15416*/
15417 __pyx_t_1 = __pyx_v_memview->view.shape;
15418
15419 __pyx_v_shape = __pyx_t_1;
15420
15421 /* "View.MemoryView":1066
15422 *
15423 * shape = memview.view.shape
15424 * strides = memview.view.strides # <<<<<<<<<<<<<<
15425 * suboffsets = memview.view.suboffsets
15426 *
15427*/
15428 __pyx_t_1 = __pyx_v_memview->view.strides;
15429
15430 __pyx_v_strides = __pyx_t_1;
15431
15432 /* "View.MemoryView":1067
15433 * shape = memview.view.shape
15434 * strides = memview.view.strides
15435 * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
15436 *
15437 * dst.memview = <__pyx_memoryview *> memview
15438*/
15439 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15440
15441 __pyx_v_suboffsets = __pyx_t_1;
15442
15443 /* "View.MemoryView":1069
15444 * suboffsets = memview.view.suboffsets
15445 *
15446 * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
15447 * dst.data = <char *> memview.view.buf
15448 *
15449*/
15450 __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
15451
15452 /* "View.MemoryView":1070
15453 *
15454 * dst.memview = <__pyx_memoryview *> memview
15455 * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
15456 *
15457 * for dim in range(memview.view.ndim):
15458*/
15459 __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
15460
15461 /* "View.MemoryView":1072
15462 * dst.data = <char *> memview.view.buf
15463 *
15464 * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
15465 * dst.shape[dim] = shape[dim]
15466 * dst.strides[dim] = strides[dim]
15467*/
15468
15469 __pyx_t_2 = __pyx_v_memview->view.ndim;
15470 __pyx_t_3 = __pyx_t_2;
15471
15472 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15473 __pyx_v_dim = __pyx_t_4;
15474
15475 /* "View.MemoryView":1073
15476 *
15477 * for dim in range(memview.view.ndim):
15478 * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
15479 * dst.strides[dim] = strides[dim]
15480 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15481*/
15482 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15483
15484 /* "View.MemoryView":1074
15485 * for dim in range(memview.view.ndim):
15486 * dst.shape[dim] = shape[dim]
15487 * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
15488 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15489 *
15490*/
15491 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15492
15493 /* "View.MemoryView":1075
15494 * dst.shape[dim] = shape[dim]
15495 * dst.strides[dim] = strides[dim]
15496 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
15497 *
15498 * @cname('__pyx_memoryview_copy_object')
15499*/
15500 __pyx_t_6 = (__pyx_v_suboffsets != 0);
15501
15502 if (__pyx_t_6) {
15503
15504 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15505 } else {
15506
15507 __pyx_t_5 = -1L;
15508 }
15509
15510 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15511
15512 }
15513
15514
15515 /* "View.MemoryView":1060
15516 * return mslice
15517 *
15518 * @cname('__pyx_memoryview_slice_copy') # <<<<<<<<<<<<<<
15519 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
15520 * cdef int dim
15521*/
15522
15523 /* function exit code */
15524
15525
15526
15527
15528
15529}
15530
15531/* "View.MemoryView":1077
15532 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15533 *
15534 * @cname('__pyx_memoryview_copy_object') # <<<<<<<<<<<<<<
15535 * cdef memoryview_copy(memoryview memview):
15536 * "Create a new memoryview object"
15537*/
15538
15539static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
15540 __Pyx_memviewslice __pyx_v_memviewslice;
15541 PyObject *__pyx_r = NULL;
15542 __Pyx_RefNannyDeclarations
15543 PyObject *__pyx_t_1 = NULL;
15544 int __pyx_lineno = 0;
15545 const char *__pyx_filename = NULL;
15546 int __pyx_clineno = 0;
15547 __Pyx_RefNannySetupContext("memoryview_copy", 0);
15548
15549 /* "View.MemoryView":1081
15550 * "Create a new memoryview object"
15551 * cdef __Pyx_memviewslice memviewslice
15552 * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
15553 * return memoryview_copy_from_slice(memview, &memviewslice)
15554 *
15555*/
15556 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15557
15558 /* "View.MemoryView":1082
15559 * cdef __Pyx_memviewslice memviewslice
15560 * slice_copy(memview, &memviewslice)
15561 * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
15562 *
15563 * @cname('__pyx_memoryview_copy_object_from_slice')
15564*/
15565 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1082, __pyx_L1_error)
15566 __Pyx_GOTREF(__pyx_t_1);
15567 {
15568 PyObject *__pyx_temp;
15569 {
15570 __pyx_temp = __pyx_r;
15571 __pyx_r = __pyx_t_1;
15572 }
15573 __Pyx_XDECREF(__pyx_temp);
15574 }
15575 __pyx_t_1 = 0;
15576 goto __pyx_L0;
15577
15578 /* "View.MemoryView":1077
15579 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15580 *
15581 * @cname('__pyx_memoryview_copy_object') # <<<<<<<<<<<<<<
15582 * cdef memoryview_copy(memoryview memview):
15583 * "Create a new memoryview object"
15584*/
15585
15586 /* function exit code */
15587 __pyx_L1_error:;
15588 __Pyx_XDECREF(__pyx_t_1);
15589 __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15590 __pyx_r = 0;
15591 __pyx_L0:;
15592
15593 __Pyx_XGIVEREF(__pyx_r);
15594 __Pyx_RefNannyFinishContext();
15595 return __pyx_r;
15596}
15597
15598/* "View.MemoryView":1084
15599 * return memoryview_copy_from_slice(memview, &memviewslice)
15600 *
15601 * @cname('__pyx_memoryview_copy_object_from_slice') # <<<<<<<<<<<<<<
15602 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
15603 * """
15604*/
15605
15606static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15607 PyObject *(*__pyx_v_to_object_func)(char *);
15608 __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func;
15609 PyObject *__pyx_r = NULL;
15610 __Pyx_RefNannyDeclarations
15611 int __pyx_t_1;
15612 PyObject *(*__pyx_t_2)(char *);
15613 __pyx_memoryview_to_dtype_func_type __pyx_t_3;
15614 PyObject *__pyx_t_4 = NULL;
15615 int __pyx_lineno = 0;
15616 const char *__pyx_filename = NULL;
15617 int __pyx_clineno = 0;
15618 __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
15619
15620 /* "View.MemoryView":1092
15621 * cdef to_dtype_func_type to_dtype_func
15622 *
15623 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15624 * to_object_func = (<_memoryviewslice> memview).to_object_func
15625 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15626*/
15627 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15628 if (__pyx_t_1) {
15629
15630
15631 /* "View.MemoryView":1093
15632 *
15633 * if isinstance(memview, _memoryviewslice):
15634 * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
15635 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15636 * else:
15637*/
15638 __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15639
15640 __pyx_v_to_object_func = __pyx_t_2;
15641
15642 /* "View.MemoryView":1094
15643 * if isinstance(memview, _memoryviewslice):
15644 * to_object_func = (<_memoryviewslice> memview).to_object_func
15645 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
15646 * else:
15647 * to_object_func = NULL
15648*/
15649 __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15650
15651 __pyx_v_to_dtype_func = __pyx_t_3;
15652
15653 /* "View.MemoryView":1092
15654 * cdef to_dtype_func_type to_dtype_func
15655 *
15656 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15657 * to_object_func = (<_memoryviewslice> memview).to_object_func
15658 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15659*/
15660 goto __pyx_L3;
15661 }
15662
15663 /* "View.MemoryView":1096
15664 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15665 * else:
15666 * to_object_func = NULL # <<<<<<<<<<<<<<
15667 * to_dtype_func = NULL
15668 *
15669*/
15670 /*else*/ {
15671 __pyx_v_to_object_func = NULL;
15672
15673 /* "View.MemoryView":1097
15674 * else:
15675 * to_object_func = NULL
15676 * to_dtype_func = NULL # <<<<<<<<<<<<<<
15677 *
15678 * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15679*/
15680 __pyx_v_to_dtype_func = NULL;
15681 }
15682 __pyx_L3:;
15683
15684 /* "View.MemoryView":1099
15685 * to_dtype_func = NULL
15686 *
15687 * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
15688 * to_object_func, to_dtype_func,
15689 * memview.dtype_is_object)
15690*/
15691 __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1099, __pyx_L1_error)
15692 __Pyx_GOTREF(__pyx_t_4);
15693 {
15694 PyObject *__pyx_temp;
15695 {
15696 __pyx_temp = __pyx_r;
15697 __pyx_r = __pyx_t_4;
15698 }
15699 __Pyx_XDECREF(__pyx_temp);
15700 }
15701 __pyx_t_4 = 0;
15702 goto __pyx_L0;
15703
15704 /* "View.MemoryView":1084
15705 * return memoryview_copy_from_slice(memview, &memviewslice)
15706 *
15707 * @cname('__pyx_memoryview_copy_object_from_slice') # <<<<<<<<<<<<<<
15708 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
15709 * """
15710*/
15711
15712 /* function exit code */
15713 __pyx_L1_error:;
15714 __Pyx_XDECREF(__pyx_t_4);
15715 __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15716 __pyx_r = 0;
15717 __pyx_L0:;
15718
15719
15720 __Pyx_XGIVEREF(__pyx_r);
15721 __Pyx_RefNannyFinishContext();
15722 return __pyx_r;
15723}
15724
15725/* "View.MemoryView":1107
15726 *
15727 *
15728 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15729 * return -arg if arg < 0 else arg
15730 *
15731*/
15732
15733static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
15734 Py_ssize_t __pyx_r;
15735 Py_ssize_t __pyx_t_1;
15736 int __pyx_t_2;
15737
15738 /* "View.MemoryView":1108
15739 *
15740 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
15741 * return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
15742 *
15743 * @cname('__pyx_get_best_slice_order')
15744*/
15745 __pyx_t_2 = (__pyx_v_arg < 0);
15746
15747 if (__pyx_t_2) {
15748
15749 __pyx_t_1 = (-__pyx_v_arg);
15750 } else {
15751
15752 __pyx_t_1 = __pyx_v_arg;
15753 }
15754
15755 {
15756 __pyx_r = __pyx_t_1;
15757 }
15758 goto __pyx_L0;
15759
15760 /* "View.MemoryView":1107
15761 *
15762 *
15763 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15764 * return -arg if arg < 0 else arg
15765 *
15766*/
15767
15768 /* function exit code */
15769 __pyx_L0:;
15770 return __pyx_r;
15771}
15772
15773/* "View.MemoryView":1110
15774 * return -arg if arg < 0 else arg
15775 *
15776 * @cname('__pyx_get_best_slice_order') # <<<<<<<<<<<<<<
15777 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
15778 * """
15779*/
15780
15781static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
15782 int __pyx_v_i;
15783 Py_ssize_t __pyx_v_c_stride;
15784 Py_ssize_t __pyx_v_f_stride;
15785 char __pyx_r;
15786 int __pyx_t_1;
15787 int __pyx_t_2;
15788 int __pyx_t_3;
15789 int __pyx_t_4;
15790
15791 /* "View.MemoryView":1116
15792 * """
15793 * cdef int i
15794 * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
15795 * cdef Py_ssize_t f_stride = 0
15796 *
15797*/
15798 __pyx_v_c_stride = 0;
15799
15800 /* "View.MemoryView":1117
15801 * cdef int i
15802 * cdef Py_ssize_t c_stride = 0
15803 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
15804 *
15805 * for i in range(ndim - 1, -1, -1):
15806*/
15807 __pyx_v_f_stride = 0;
15808
15809 /* "View.MemoryView":1119
15810 * cdef Py_ssize_t f_stride = 0
15811 *
15812 * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
15813 * if mslice.shape[i] > 1:
15814 * c_stride = mslice.strides[i]
15815*/
15816 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
15817 __pyx_v_i = __pyx_t_1;
15818
15819 /* "View.MemoryView":1120
15820 *
15821 * for i in range(ndim - 1, -1, -1):
15822 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15823 * c_stride = mslice.strides[i]
15824 * break
15825*/
15826 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15827
15828 if (__pyx_t_2) {
15829
15830
15831 /* "View.MemoryView":1121
15832 * for i in range(ndim - 1, -1, -1):
15833 * if mslice.shape[i] > 1:
15834 * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15835 * break
15836 *
15837*/
15838 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15839
15840 /* "View.MemoryView":1122
15841 * if mslice.shape[i] > 1:
15842 * c_stride = mslice.strides[i]
15843 * break # <<<<<<<<<<<<<<
15844 *
15845 * for i in range(ndim):
15846*/
15847 goto __pyx_L4_break;
15848
15849 /* "View.MemoryView":1120
15850 *
15851 * for i in range(ndim - 1, -1, -1):
15852 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15853 * c_stride = mslice.strides[i]
15854 * break
15855*/
15856 }
15857 }
15858 __pyx_L4_break:;
15859
15860 /* "View.MemoryView":1124
15861 * break
15862 *
15863 * for i in range(ndim): # <<<<<<<<<<<<<<
15864 * if mslice.shape[i] > 1:
15865 * f_stride = mslice.strides[i]
15866*/
15867
15868 __pyx_t_1 = __pyx_v_ndim;
15869 __pyx_t_3 = __pyx_t_1;
15870
15871 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15872 __pyx_v_i = __pyx_t_4;
15873
15874 /* "View.MemoryView":1125
15875 *
15876 * for i in range(ndim):
15877 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15878 * f_stride = mslice.strides[i]
15879 * break
15880*/
15881 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15882
15883 if (__pyx_t_2) {
15884
15885
15886 /* "View.MemoryView":1126
15887 * for i in range(ndim):
15888 * if mslice.shape[i] > 1:
15889 * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15890 * break
15891 *
15892*/
15893 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15894
15895 /* "View.MemoryView":1127
15896 * if mslice.shape[i] > 1:
15897 * f_stride = mslice.strides[i]
15898 * break # <<<<<<<<<<<<<<
15899 *
15900 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
15901*/
15902 goto __pyx_L7_break;
15903
15904 /* "View.MemoryView":1125
15905 *
15906 * for i in range(ndim):
15907 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15908 * f_stride = mslice.strides[i]
15909 * break
15910*/
15911 }
15912 }
15913 __pyx_L7_break:;
15914
15915
15916 /* "View.MemoryView":1129
15917 * break
15918 *
15919 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
15920 * return 'C'
15921 * else:
15922*/
15923 __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
15924
15925 if (__pyx_t_2) {
15926
15927
15928 /* "View.MemoryView":1130
15929 *
15930 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
15931 * return 'C' # <<<<<<<<<<<<<<
15932 * else:
15933 * return 'F'
15934*/
15935 {
15936
15937 __pyx_r = 'C';
15938 }
15939 goto __pyx_L0;
15940
15941 /* "View.MemoryView":1129
15942 * break
15943 *
15944 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
15945 * return 'C'
15946 * else:
15947*/
15948 }
15949
15950 /* "View.MemoryView":1132
15951 * return 'C'
15952 * else:
15953 * return 'F' # <<<<<<<<<<<<<<
15954 *
15955 * @cython.cdivision(True)
15956*/
15957 /*else*/ {
15958 {
15959
15960 __pyx_r = 'F';
15961 }
15962 goto __pyx_L0;
15963 }
15964
15965 /* "View.MemoryView":1110
15966 * return -arg if arg < 0 else arg
15967 *
15968 * @cname('__pyx_get_best_slice_order') # <<<<<<<<<<<<<<
15969 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
15970 * """
15971*/
15972
15973 /* function exit code */
15974 __pyx_L0:;
15975
15976
15977
15978 return __pyx_r;
15979}
15980
15981/* "View.MemoryView":1134
15982 * return 'F'
15983 *
15984 * @cython.cdivision(True) # <<<<<<<<<<<<<<
15985 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
15986 * char *dst_data, Py_ssize_t *dst_strides,
15987*/
15988
15989static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
15990 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
15991 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
15992 Py_ssize_t __pyx_v_dst_extent;
15993 Py_ssize_t __pyx_v_src_stride;
15994 Py_ssize_t __pyx_v_dst_stride;
15995 int __pyx_t_1;
15996 int __pyx_t_2;
15997 Py_ssize_t __pyx_t_3;
15998 Py_ssize_t __pyx_t_4;
15999 Py_ssize_t __pyx_t_5;
16000
16001
16002
16003 /* "View.MemoryView":1142
16004 *
16005 * cdef Py_ssize_t i
16006 * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
16007 * cdef Py_ssize_t dst_extent = dst_shape[0]
16008 * cdef Py_ssize_t src_stride = src_strides[0]
16009*/
16010 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16011
16012 /* "View.MemoryView":1143
16013 * cdef Py_ssize_t i
16014 * cdef Py_ssize_t src_extent = src_shape[0]
16015 * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
16016 * cdef Py_ssize_t src_stride = src_strides[0]
16017 * cdef Py_ssize_t dst_stride = dst_strides[0]
16018*/
16019 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16020
16021 /* "View.MemoryView":1144
16022 * cdef Py_ssize_t src_extent = src_shape[0]
16023 * cdef Py_ssize_t dst_extent = dst_shape[0]
16024 * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
16025 * cdef Py_ssize_t dst_stride = dst_strides[0]
16026 *
16027*/
16028 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16029
16030 /* "View.MemoryView":1145
16031 * cdef Py_ssize_t dst_extent = dst_shape[0]
16032 * cdef Py_ssize_t src_stride = src_strides[0]
16033 * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
16034 *
16035 * if ndim == 1:
16036*/
16037 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16038
16039 /* "View.MemoryView":1147
16040 * cdef Py_ssize_t dst_stride = dst_strides[0]
16041 *
16042 * if ndim == 1: # <<<<<<<<<<<<<<
16043 * if (src_stride > 0 and dst_stride > 0 and
16044 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16045*/
16046 __pyx_t_1 = (__pyx_v_ndim == 1);
16047
16048 if (__pyx_t_1) {
16049
16050
16051 /* "View.MemoryView":1148
16052 *
16053 * if ndim == 1:
16054 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16055 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16056 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16057*/
16058 __pyx_t_2 = (__pyx_v_src_stride > 0);
16059
16060 if (__pyx_t_2) {
16061
16062 } else {
16063
16064 __pyx_t_1 = __pyx_t_2;
16065
16066 goto __pyx_L5_bool_binop_done;
16067 }
16068 __pyx_t_2 = (__pyx_v_dst_stride > 0);
16069
16070 if (__pyx_t_2) {
16071
16072 } else {
16073
16074 __pyx_t_1 = __pyx_t_2;
16075
16076 goto __pyx_L5_bool_binop_done;
16077 }
16078
16079 /* "View.MemoryView":1149
16080 * if ndim == 1:
16081 * if (src_stride > 0 and dst_stride > 0 and
16082 * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
16083 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16084 * else:
16085*/
16086 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16087 if (__pyx_t_2) {
16088 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16089 }
16090
16091 __pyx_t_1 = __pyx_t_2;
16092
16093 __pyx_L5_bool_binop_done:;
16094
16095 /* "View.MemoryView":1148
16096 *
16097 * if ndim == 1:
16098 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16099 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16100 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16101*/
16102 if (__pyx_t_1) {
16103
16104
16105 /* "View.MemoryView":1150
16106 * if (src_stride > 0 and dst_stride > 0 and
16107 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16108 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent) # <<<<<<<<<<<<<<
16109 * else:
16110 * for i in range(dst_extent):
16111*/
16112 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * ((size_t)__pyx_v_dst_extent))));
16113
16114 /* "View.MemoryView":1148
16115 *
16116 * if ndim == 1:
16117 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16118 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16119 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16120*/
16121 goto __pyx_L4;
16122 }
16123
16124 /* "View.MemoryView":1152
16125 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16126 * else:
16127 * for i in range(dst_extent): # <<<<<<<<<<<<<<
16128 * memcpy(dst_data, src_data, itemsize)
16129 * src_data += src_stride
16130*/
16131 /*else*/ {
16132
16133 __pyx_t_3 = __pyx_v_dst_extent;
16134 __pyx_t_4 = __pyx_t_3;
16135
16136 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16137 __pyx_v_i = __pyx_t_5;
16138
16139 /* "View.MemoryView":1153
16140 * else:
16141 * for i in range(dst_extent):
16142 * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
16143 * src_data += src_stride
16144 * dst_data += dst_stride
16145*/
16146 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16147
16148 /* "View.MemoryView":1154
16149 * for i in range(dst_extent):
16150 * memcpy(dst_data, src_data, itemsize)
16151 * src_data += src_stride # <<<<<<<<<<<<<<
16152 * dst_data += dst_stride
16153 * else:
16154*/
16155 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16156
16157 /* "View.MemoryView":1155
16158 * memcpy(dst_data, src_data, itemsize)
16159 * src_data += src_stride
16160 * dst_data += dst_stride # <<<<<<<<<<<<<<
16161 * else:
16162 * for i in range(dst_extent):
16163*/
16164 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16165 }
16166
16167 }
16168 __pyx_L4:;
16169
16170 /* "View.MemoryView":1147
16171 * cdef Py_ssize_t dst_stride = dst_strides[0]
16172 *
16173 * if ndim == 1: # <<<<<<<<<<<<<<
16174 * if (src_stride > 0 and dst_stride > 0 and
16175 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16176*/
16177 goto __pyx_L3;
16178 }
16179
16180 /* "View.MemoryView":1157
16181 * dst_data += dst_stride
16182 * else:
16183 * for i in range(dst_extent): # <<<<<<<<<<<<<<
16184 * _copy_strided_to_strided(src_data, src_strides + 1,
16185 * dst_data, dst_strides + 1,
16186*/
16187 /*else*/ {
16188
16189 __pyx_t_3 = __pyx_v_dst_extent;
16190 __pyx_t_4 = __pyx_t_3;
16191
16192 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16193 __pyx_v_i = __pyx_t_5;
16194
16195 /* "View.MemoryView":1158
16196 * else:
16197 * for i in range(dst_extent):
16198 * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
16199 * dst_data, dst_strides + 1,
16200 * src_shape + 1, dst_shape + 1,
16201*/
16202 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
16203
16204 /* "View.MemoryView":1162
16205 * src_shape + 1, dst_shape + 1,
16206 * ndim - 1, itemsize)
16207 * src_data += src_stride # <<<<<<<<<<<<<<
16208 * dst_data += dst_stride
16209 *
16210*/
16211 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16212
16213 /* "View.MemoryView":1163
16214 * ndim - 1, itemsize)
16215 * src_data += src_stride
16216 * dst_data += dst_stride # <<<<<<<<<<<<<<
16217 *
16218 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
16219*/
16220 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16221 }
16222
16223 }
16224 __pyx_L3:;
16225
16226 /* "View.MemoryView":1134
16227 * return 'F'
16228 *
16229 * @cython.cdivision(True) # <<<<<<<<<<<<<<
16230 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
16231 * char *dst_data, Py_ssize_t *dst_strides,
16232*/
16233
16234 /* function exit code */
16235
16236
16237
16238
16239
16240
16241
16242}
16243
16244/* "View.MemoryView":1165
16245 * dst_data += dst_stride
16246 *
16247 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16248 * __Pyx_memviewslice *dst,
16249 * int ndim, size_t itemsize) noexcept nogil:
16250*/
16251
16252static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16253
16254 /* "View.MemoryView":1168
16255 * __Pyx_memviewslice *dst,
16256 * int ndim, size_t itemsize) noexcept nogil:
16257 * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
16258 * src.shape, dst.shape, ndim, itemsize)
16259 *
16260*/
16261 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
16262
16263 /* "View.MemoryView":1165
16264 * dst_data += dst_stride
16265 *
16266 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16267 * __Pyx_memviewslice *dst,
16268 * int ndim, size_t itemsize) noexcept nogil:
16269*/
16270
16271 /* function exit code */
16272}
16273
16274/* "View.MemoryView":1171
16275 * src.shape, dst.shape, ndim, itemsize)
16276 *
16277 * @cname('__pyx_memoryview_slice_get_size') # <<<<<<<<<<<<<<
16278 * cdef size_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16279 * "Return the size of the memory occupied by the slice in number of bytes"
16280*/
16281
16282static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
16283 Py_ssize_t __pyx_v_shape;
16284 size_t __pyx_v_size;
16285 size_t __pyx_r;
16286 Py_ssize_t *__pyx_t_1;
16287 Py_ssize_t *__pyx_t_2;
16288 Py_ssize_t *__pyx_t_3;
16289
16290 /* "View.MemoryView":1175
16291 * "Return the size of the memory occupied by the slice in number of bytes"
16292 * cdef Py_ssize_t shape
16293 * cdef size_t size = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
16294 *
16295 * for shape in src.shape[:ndim]:
16296*/
16297 __pyx_v_size = ((size_t)__pyx_v_src->memview->view.itemsize);
16298
16299 /* "View.MemoryView":1177
16300 * cdef size_t size = <size_t> src.memview.view.itemsize
16301 *
16302 * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
16303 * size *= <size_t> shape
16304 *
16305*/
16306 __pyx_t_2 = (__pyx_v_src->shape + __pyx_v_ndim);
16307
16308 for (__pyx_t_3 = __pyx_v_src->shape; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16309 __pyx_t_1 = __pyx_t_3;
16310 __pyx_v_shape = (__pyx_t_1[0]);
16311
16312 /* "View.MemoryView":1178
16313 *
16314 * for shape in src.shape[:ndim]:
16315 * size *= <size_t> shape # <<<<<<<<<<<<<<
16316 *
16317 * return size
16318*/
16319 __pyx_v_size = (__pyx_v_size * ((size_t)__pyx_v_shape));
16320 }
16321
16322
16323 /* "View.MemoryView":1180
16324 * size *= <size_t> shape
16325 *
16326 * return size # <<<<<<<<<<<<<<
16327 *
16328 * @cname('__pyx_fill_contig_strides_array')
16329*/
16330 {
16331
16332 __pyx_r = __pyx_v_size;
16333 }
16334 goto __pyx_L0;
16335
16336 /* "View.MemoryView":1171
16337 * src.shape, dst.shape, ndim, itemsize)
16338 *
16339 * @cname('__pyx_memoryview_slice_get_size') # <<<<<<<<<<<<<<
16340 * cdef size_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16341 * "Return the size of the memory occupied by the slice in number of bytes"
16342*/
16343
16344 /* function exit code */
16345 __pyx_L0:;
16346
16347
16348 return __pyx_r;
16349}
16350
16351/* "View.MemoryView":1182
16352 * return size
16353 *
16354 * @cname('__pyx_fill_contig_strides_array') # <<<<<<<<<<<<<<
16355 * cdef Py_ssize_t fill_contig_strides_array(
16356 * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16357*/
16358
16359static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
16360 int __pyx_v_idx;
16361 Py_ssize_t __pyx_r;
16362 int __pyx_t_1;
16363 int __pyx_t_2;
16364 int __pyx_t_3;
16365 int __pyx_t_4;
16366
16367
16368 /* "View.MemoryView":1192
16369 * cdef int idx
16370 *
16371 * if order == 'F': # <<<<<<<<<<<<<<
16372 * for idx in range(ndim):
16373 * strides[idx] = stride
16374*/
16375 __pyx_t_1 = (__pyx_v_order == 'F');
16376
16377 if (__pyx_t_1) {
16378
16379
16380 /* "View.MemoryView":1193
16381 *
16382 * if order == 'F':
16383 * for idx in range(ndim): # <<<<<<<<<<<<<<
16384 * strides[idx] = stride
16385 * stride *= shape[idx]
16386*/
16387
16388 __pyx_t_2 = __pyx_v_ndim;
16389 __pyx_t_3 = __pyx_t_2;
16390
16391 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16392 __pyx_v_idx = __pyx_t_4;
16393
16394 /* "View.MemoryView":1194
16395 * if order == 'F':
16396 * for idx in range(ndim):
16397 * strides[idx] = stride # <<<<<<<<<<<<<<
16398 * stride *= shape[idx]
16399 * else:
16400*/
16401 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16402
16403 /* "View.MemoryView":1195
16404 * for idx in range(ndim):
16405 * strides[idx] = stride
16406 * stride *= shape[idx] # <<<<<<<<<<<<<<
16407 * else:
16408 * for idx in range(ndim - 1, -1, -1):
16409*/
16410 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16411 }
16412
16413
16414 /* "View.MemoryView":1192
16415 * cdef int idx
16416 *
16417 * if order == 'F': # <<<<<<<<<<<<<<
16418 * for idx in range(ndim):
16419 * strides[idx] = stride
16420*/
16421 goto __pyx_L3;
16422 }
16423
16424 /* "View.MemoryView":1197
16425 * stride *= shape[idx]
16426 * else:
16427 * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16428 * strides[idx] = stride
16429 * stride *= shape[idx]
16430*/
16431 /*else*/ {
16432 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16433 __pyx_v_idx = __pyx_t_2;
16434
16435 /* "View.MemoryView":1198
16436 * else:
16437 * for idx in range(ndim - 1, -1, -1):
16438 * strides[idx] = stride # <<<<<<<<<<<<<<
16439 * stride *= shape[idx]
16440 *
16441*/
16442 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16443
16444 /* "View.MemoryView":1199
16445 * for idx in range(ndim - 1, -1, -1):
16446 * strides[idx] = stride
16447 * stride *= shape[idx] # <<<<<<<<<<<<<<
16448 *
16449 * return stride
16450*/
16451 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16452 }
16453 }
16454 __pyx_L3:;
16455
16456 /* "View.MemoryView":1201
16457 * stride *= shape[idx]
16458 *
16459 * return stride # <<<<<<<<<<<<<<
16460 *
16461 * @cname('__pyx_memoryview_copy_data_to_temp')
16462*/
16463 {
16464
16465 __pyx_r = __pyx_v_stride;
16466 }
16467 goto __pyx_L0;
16468
16469 /* "View.MemoryView":1182
16470 * return size
16471 *
16472 * @cname('__pyx_fill_contig_strides_array') # <<<<<<<<<<<<<<
16473 * cdef Py_ssize_t fill_contig_strides_array(
16474 * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16475*/
16476
16477 /* function exit code */
16478 __pyx_L0:;
16479
16480
16481 return __pyx_r;
16482}
16483
16484/* "View.MemoryView":1203
16485 * return stride
16486 *
16487 * @cname('__pyx_memoryview_copy_data_to_temp') # <<<<<<<<<<<<<<
16488 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
16489 * __Pyx_memviewslice *tmpslice,
16490*/
16491
16492static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
16493 int __pyx_v_i;
16494 void *__pyx_v_result;
16495 size_t __pyx_v_itemsize;
16496 size_t __pyx_v_size;
16497 void *__pyx_r;
16498 int __pyx_t_1;
16499 int __pyx_t_2;
16500 struct __pyx_memoryview_obj *__pyx_t_3;
16501 int __pyx_t_4;
16502 int __pyx_t_5;
16503 int __pyx_lineno = 0;
16504 const char *__pyx_filename = NULL;
16505 int __pyx_clineno = 0;
16506 PyGILState_STATE __pyx_gilstate_save;
16507
16508 /* "View.MemoryView":1215
16509 * cdef void *result
16510 *
16511 * cdef size_t itemsize = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
16512 * cdef size_t size = slice_get_size(src, ndim)
16513 *
16514*/
16515 __pyx_v_itemsize = ((size_t)__pyx_v_src->memview->view.itemsize);
16516
16517 /* "View.MemoryView":1216
16518 *
16519 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
16520 * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
16521 *
16522 * result = malloc(size)
16523*/
16524 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16525
16526 /* "View.MemoryView":1218
16527 * cdef size_t size = slice_get_size(src, ndim)
16528 *
16529 * result = malloc(size) # <<<<<<<<<<<<<<
16530 * if cython.unlikely(not result):
16531 * _err_no_memory()
16532*/
16533 __pyx_v_result = malloc(__pyx_v_size);
16534
16535 /* "View.MemoryView":1219
16536 *
16537 * result = malloc(size)
16538 * if cython.unlikely(not result): # <<<<<<<<<<<<<<
16539 * _err_no_memory()
16540 *
16541*/
16542 __pyx_t_1 = (!(__pyx_v_result != 0));
16543
16544 if (unlikely(__pyx_t_1)) {
16545
16546
16547 /* "View.MemoryView":1220
16548 * result = malloc(size)
16549 * if cython.unlikely(not result):
16550 * _err_no_memory() # <<<<<<<<<<<<<<
16551 *
16552 *
16553*/
16554 __pyx_t_2 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
16555
16556
16557 /* "View.MemoryView":1219
16558 *
16559 * result = malloc(size)
16560 * if cython.unlikely(not result): # <<<<<<<<<<<<<<
16561 * _err_no_memory()
16562 *
16563*/
16564 }
16565
16566 /* "View.MemoryView":1223
16567 *
16568 *
16569 * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
16570 * tmpslice.memview = src.memview
16571 * for i in range(ndim):
16572*/
16573 __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
16574
16575 /* "View.MemoryView":1224
16576 *
16577 * tmpslice.data = <char *> result
16578 * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
16579 * for i in range(ndim):
16580 * tmpslice.shape[i] = src.shape[i]
16581*/
16582 __pyx_t_3 = __pyx_v_src->memview;
16583
16584 __pyx_v_tmpslice->memview = __pyx_t_3;
16585
16586 /* "View.MemoryView":1225
16587 * tmpslice.data = <char *> result
16588 * tmpslice.memview = src.memview
16589 * for i in range(ndim): # <<<<<<<<<<<<<<
16590 * tmpslice.shape[i] = src.shape[i]
16591 * tmpslice.suboffsets[i] = -1
16592*/
16593
16594 __pyx_t_2 = __pyx_v_ndim;
16595 __pyx_t_4 = __pyx_t_2;
16596
16597 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16598 __pyx_v_i = __pyx_t_5;
16599
16600 /* "View.MemoryView":1226
16601 * tmpslice.memview = src.memview
16602 * for i in range(ndim):
16603 * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
16604 * tmpslice.suboffsets[i] = -1
16605 *
16606*/
16607 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16608
16609 /* "View.MemoryView":1227
16610 * for i in range(ndim):
16611 * tmpslice.shape[i] = src.shape[i]
16612 * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
16613 *
16614 * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], <Py_ssize_t> itemsize, ndim, order)
16615*/
16616 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16617 }
16618
16619
16620 /* "View.MemoryView":1229
16621 * tmpslice.suboffsets[i] = -1
16622 *
16623 * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], <Py_ssize_t> itemsize, ndim, order) # <<<<<<<<<<<<<<
16624 *
16625 *
16626*/
16627 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), ((Py_ssize_t)__pyx_v_itemsize), __pyx_v_ndim, __pyx_v_order));
16628
16629 /* "View.MemoryView":1232
16630 *
16631 *
16632 * for i in range(ndim): # <<<<<<<<<<<<<<
16633 * if tmpslice.shape[i] == 1:
16634 * tmpslice.strides[i] = 0
16635*/
16636
16637 __pyx_t_2 = __pyx_v_ndim;
16638 __pyx_t_4 = __pyx_t_2;
16639
16640 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16641 __pyx_v_i = __pyx_t_5;
16642
16643 /* "View.MemoryView":1233
16644 *
16645 * for i in range(ndim):
16646 * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16647 * tmpslice.strides[i] = 0
16648 *
16649*/
16650 __pyx_t_1 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
16651
16652 if (__pyx_t_1) {
16653
16654
16655 /* "View.MemoryView":1234
16656 * for i in range(ndim):
16657 * if tmpslice.shape[i] == 1:
16658 * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
16659 *
16660 * if slice_is_contig(src[0], order, ndim):
16661*/
16662 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16663
16664 /* "View.MemoryView":1233
16665 *
16666 * for i in range(ndim):
16667 * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16668 * tmpslice.strides[i] = 0
16669 *
16670*/
16671 }
16672 }
16673
16674
16675 /* "View.MemoryView":1236
16676 * tmpslice.strides[i] = 0
16677 *
16678 * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16679 * memcpy(result, src.data, size)
16680 * else:
16681*/
16682 __pyx_t_1 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
16683
16684 if (__pyx_t_1) {
16685
16686
16687 /* "View.MemoryView":1237
16688 *
16689 * if slice_is_contig(src[0], order, ndim):
16690 * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
16691 * else:
16692 * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16693*/
16694 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16695
16696 /* "View.MemoryView":1236
16697 * tmpslice.strides[i] = 0
16698 *
16699 * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16700 * memcpy(result, src.data, size)
16701 * else:
16702*/
16703 goto __pyx_L9;
16704 }
16705
16706 /* "View.MemoryView":1239
16707 * memcpy(result, src.data, size)
16708 * else:
16709 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
16710 *
16711 * return result
16712*/
16713 /*else*/ {
16714 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
16715 }
16716 __pyx_L9:;
16717
16718 /* "View.MemoryView":1241
16719 * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16720 *
16721 * return result # <<<<<<<<<<<<<<
16722 *
16723 *
16724*/
16725 {
16726
16727 __pyx_r = __pyx_v_result;
16728 }
16729 goto __pyx_L0;
16730
16731 /* "View.MemoryView":1203
16732 * return stride
16733 *
16734 * @cname('__pyx_memoryview_copy_data_to_temp') # <<<<<<<<<<<<<<
16735 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
16736 * __Pyx_memviewslice *tmpslice,
16737*/
16738
16739 /* function exit code */
16740 __pyx_L1_error:;
16741 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16742 __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
16743 __pyx_r = NULL;
16744 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16745 __pyx_L0:;
16746
16747
16748
16749
16750 return __pyx_r;
16751}
16752
16753/* "View.MemoryView":1246
16754 *
16755 *
16756 * @cname('__pyx_memoryview_err_extents') # <<<<<<<<<<<<<<
16757 * cdef int _err_extents(int i, Py_ssize_t extent1,
16758 * Py_ssize_t extent2) except -1 with gil:
16759*/
16760
16761static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
16762 int __pyx_r;
16763 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16764
16765
16766
16767
16768 /* "View.MemoryView":1249
16769 * cdef int _err_extents(int i, Py_ssize_t extent1,
16770 * Py_ssize_t extent2) except -1 with gil:
16771 * PyErr_Format( # <<<<<<<<<<<<<<
16772 * PyExc_ValueError,
16773 * "got differing extents in dimension %d (got %zd and %zd)",
16774*/
16775 (void)(PyErr_Format(PyExc_ValueError, __pyx_k_got_differing_extents_in_dimensi, __pyx_v_i, __pyx_v_extent1, __pyx_v_extent2));
16776
16777 /* "View.MemoryView":1253
16778 * "got differing extents in dimension %d (got %zd and %zd)",
16779 * i, extent1, extent2)
16780 * return -1 # <<<<<<<<<<<<<<
16781 *
16782 * @cname('__pyx_memoryview_err_dim')
16783*/
16784 {
16785
16786 __pyx_r = -1;
16787 }
16788 goto __pyx_L0;
16789
16790 /* "View.MemoryView":1246
16791 *
16792 *
16793 * @cname('__pyx_memoryview_err_extents') # <<<<<<<<<<<<<<
16794 * cdef int _err_extents(int i, Py_ssize_t extent1,
16795 * Py_ssize_t extent2) except -1 with gil:
16796*/
16797
16798 /* function exit code */
16799 __pyx_L0:;
16800
16801
16802
16803
16804 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16805 return __pyx_r;
16806}
16807
16808/* "View.MemoryView":1255
16809 * return -1
16810 *
16811 * @cname('__pyx_memoryview_err_dim') # <<<<<<<<<<<<<<
16812 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
16813 * PyErr_Format(error, msg, dim)
16814*/
16815
16816static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char const *__pyx_v_msg, int __pyx_v_dim) {
16817 int __pyx_r;
16818 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16819
16820
16821
16822
16823 /* "View.MemoryView":1257
16824 * @cname('__pyx_memoryview_err_dim')
16825 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
16826 * PyErr_Format(error, msg, dim) # <<<<<<<<<<<<<<
16827 * return -1
16828 *
16829*/
16830 (void)(PyErr_Format(__pyx_v_error, __pyx_v_msg, __pyx_v_dim));
16831
16832 /* "View.MemoryView":1258
16833 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
16834 * PyErr_Format(error, msg, dim)
16835 * return -1 # <<<<<<<<<<<<<<
16836 *
16837 * @cname('__pyx_memoryview_err')
16838*/
16839 {
16840
16841 __pyx_r = -1;
16842 }
16843 goto __pyx_L0;
16844
16845 /* "View.MemoryView":1255
16846 * return -1
16847 *
16848 * @cname('__pyx_memoryview_err_dim') # <<<<<<<<<<<<<<
16849 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
16850 * PyErr_Format(error, msg, dim)
16851*/
16852
16853 /* function exit code */
16854 __pyx_L0:;
16855
16856
16857
16858
16859 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16860 return __pyx_r;
16861}
16862
16863/* "View.MemoryView":1260
16864 * return -1
16865 *
16866 * @cname('__pyx_memoryview_err') # <<<<<<<<<<<<<<
16867 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
16868 * PyErr_SetString(error, msg)
16869*/
16870
16871static int __pyx_memoryview_err(PyObject *__pyx_v_error, char const *__pyx_v_msg) {
16872 int __pyx_r;
16873 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16874
16875
16876
16877 /* "View.MemoryView":1262
16878 * @cname('__pyx_memoryview_err')
16879 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
16880 * PyErr_SetString(error, msg) # <<<<<<<<<<<<<<
16881 * return -1
16882 *
16883*/
16884 (void)(PyErr_SetString(__pyx_v_error, __pyx_v_msg));
16885
16886 /* "View.MemoryView":1263
16887 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
16888 * PyErr_SetString(error, msg)
16889 * return -1 # <<<<<<<<<<<<<<
16890 *
16891 * @cname('__pyx_memoryview_err_no_memory')
16892*/
16893 {
16894
16895 __pyx_r = -1;
16896 }
16897 goto __pyx_L0;
16898
16899 /* "View.MemoryView":1260
16900 * return -1
16901 *
16902 * @cname('__pyx_memoryview_err') # <<<<<<<<<<<<<<
16903 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
16904 * PyErr_SetString(error, msg)
16905*/
16906
16907 /* function exit code */
16908 __pyx_L0:;
16909
16910
16911
16912 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16913 return __pyx_r;
16914}
16915
16916/* "View.MemoryView":1265
16917 * return -1
16918 *
16919 * @cname('__pyx_memoryview_err_no_memory') # <<<<<<<<<<<<<<
16920 * cdef int _err_no_memory() except -1 with gil:
16921 * raise MemoryError
16922*/
16923
16924static int __pyx_memoryview_err_no_memory(void) {
16925 int __pyx_r;
16926 int __pyx_lineno = 0;
16927 const char *__pyx_filename = NULL;
16928 int __pyx_clineno = 0;
16929 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16930
16931 /* "View.MemoryView":1267
16932 * @cname('__pyx_memoryview_err_no_memory')
16933 * cdef int _err_no_memory() except -1 with gil:
16934 * raise MemoryError # <<<<<<<<<<<<<<
16935 *
16936 *
16937*/
16938 PyErr_NoMemory(); __PYX_ERR(1, 1267, __pyx_L1_error)
16939
16940 /* "View.MemoryView":1265
16941 * return -1
16942 *
16943 * @cname('__pyx_memoryview_err_no_memory') # <<<<<<<<<<<<<<
16944 * cdef int _err_no_memory() except -1 with gil:
16945 * raise MemoryError
16946*/
16947
16948 /* function exit code */
16949 __pyx_L1_error:;
16950 __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
16951 __pyx_r = -1;
16952
16953 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16954 return __pyx_r;
16955}
16956
16957/* "View.MemoryView":1271
16958 *
16959 *
16960 * @cname('__pyx_memoryview_err_ValueError') # <<<<<<<<<<<<<<
16961 * cdef int _err_ValueError(const char* msg) except -1:
16962 * PyErr_SetString(PyExc_ValueError, msg)
16963*/
16964
16965static int __pyx_memoryview_err_ValueError(char const *__pyx_v_msg) {
16966 int __pyx_r;
16967
16968 /* "View.MemoryView":1273
16969 * @cname('__pyx_memoryview_err_ValueError')
16970 * cdef int _err_ValueError(const char* msg) except -1:
16971 * PyErr_SetString(PyExc_ValueError, msg) # <<<<<<<<<<<<<<
16972 * return -1
16973 *
16974*/
16975 (void)(PyErr_SetString(PyExc_ValueError, __pyx_v_msg));
16976
16977 /* "View.MemoryView":1274
16978 * cdef int _err_ValueError(const char* msg) except -1:
16979 * PyErr_SetString(PyExc_ValueError, msg)
16980 * return -1 # <<<<<<<<<<<<<<
16981 *
16982 * @cname('__pyx_memoryview_err_IndexError')
16983*/
16984 {
16985
16986 __pyx_r = -1;
16987 }
16988 goto __pyx_L0;
16989
16990 /* "View.MemoryView":1271
16991 *
16992 *
16993 * @cname('__pyx_memoryview_err_ValueError') # <<<<<<<<<<<<<<
16994 * cdef int _err_ValueError(const char* msg) except -1:
16995 * PyErr_SetString(PyExc_ValueError, msg)
16996*/
16997
16998 /* function exit code */
16999 __pyx_L0:;
17000
17001 return __pyx_r;
17002}
17003
17004/* "View.MemoryView":1276
17005 * return -1
17006 *
17007 * @cname('__pyx_memoryview_err_IndexError') # <<<<<<<<<<<<<<
17008 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17009 * PyErr_Format(PyExc_IndexError, msg, index)
17010*/
17011
17012static int __pyx_memoryview_err_IndexError(char const *__pyx_v_msg, Py_ssize_t __pyx_v_index) {
17013 int __pyx_r;
17014
17015 /* "View.MemoryView":1278
17016 * @cname('__pyx_memoryview_err_IndexError')
17017 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17018 * PyErr_Format(PyExc_IndexError, msg, index) # <<<<<<<<<<<<<<
17019 * return -1
17020 *
17021*/
17022 (void)(PyErr_Format(PyExc_IndexError, __pyx_v_msg, __pyx_v_index));
17023
17024 /* "View.MemoryView":1279
17025 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17026 * PyErr_Format(PyExc_IndexError, msg, index)
17027 * return -1 # <<<<<<<<<<<<<<
17028 *
17029 *
17030*/
17031 {
17032
17033 __pyx_r = -1;
17034 }
17035 goto __pyx_L0;
17036
17037 /* "View.MemoryView":1276
17038 * return -1
17039 *
17040 * @cname('__pyx_memoryview_err_IndexError') # <<<<<<<<<<<<<<
17041 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17042 * PyErr_Format(PyExc_IndexError, msg, index)
17043*/
17044
17045 /* function exit code */
17046 __pyx_L0:;
17047
17048 return __pyx_r;
17049}
17050
17051/* "View.MemoryView":1282
17052 *
17053 *
17054 * @cname('__pyx_memoryview_copy_contents') # <<<<<<<<<<<<<<
17055 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
17056 * __Pyx_memviewslice dst,
17057*/
17058
17059static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
17060 void *__pyx_v_tmpdata;
17061 size_t __pyx_v_itemsize;
17062 int __pyx_v_i;
17063 char __pyx_v_order;
17064 int __pyx_v_broadcasting;
17065 int __pyx_v_direct_copy;
17066 __Pyx_memviewslice __pyx_v_tmp;
17067 int __pyx_v_ndim;
17068 int __pyx_r;
17069 int __pyx_t_1;
17070 int __pyx_t_2;
17071 int __pyx_t_3;
17072 int __pyx_t_4;
17073 int __pyx_t_5;
17074 void *__pyx_t_6;
17075 int __pyx_lineno = 0;
17076 const char *__pyx_filename = NULL;
17077 int __pyx_clineno = 0;
17078 PyGILState_STATE __pyx_gilstate_save;
17079
17080
17081 /* "View.MemoryView":1291
17082 * Check for overlapping memory and verify the shapes.
17083 * """
17084 * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
17085 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
17086 * cdef int i
17087*/
17088 __pyx_v_tmpdata = NULL;
17089
17090 /* "View.MemoryView":1292
17091 * """
17092 * cdef void *tmpdata = NULL
17093 * cdef size_t itemsize = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
17094 * cdef int i
17095 * cdef char order = get_best_order(&src, src_ndim)
17096*/
17097 __pyx_v_itemsize = ((size_t)__pyx_v_src.memview->view.itemsize);
17098
17099 /* "View.MemoryView":1294
17100 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
17101 * cdef int i
17102 * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
17103 * cdef bint broadcasting = False
17104 * cdef bint direct_copy = False
17105*/
17106 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17107
17108 /* "View.MemoryView":1295
17109 * cdef int i
17110 * cdef char order = get_best_order(&src, src_ndim)
17111 * cdef bint broadcasting = False # <<<<<<<<<<<<<<
17112 * cdef bint direct_copy = False
17113 * cdef __Pyx_memviewslice tmp
17114*/
17115 __pyx_v_broadcasting = 0;
17116
17117 /* "View.MemoryView":1296
17118 * cdef char order = get_best_order(&src, src_ndim)
17119 * cdef bint broadcasting = False
17120 * cdef bint direct_copy = False # <<<<<<<<<<<<<<
17121 * cdef __Pyx_memviewslice tmp
17122 *
17123*/
17124 __pyx_v_direct_copy = 0;
17125
17126 /* "View.MemoryView":1299
17127 * cdef __Pyx_memviewslice tmp
17128 *
17129 * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17130 * broadcast_leading(&src, src_ndim, dst_ndim)
17131 * elif dst_ndim < src_ndim:
17132*/
17133 __pyx_t_1 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17134
17135 if (__pyx_t_1) {
17136
17137
17138 /* "View.MemoryView":1300
17139 *
17140 * if src_ndim < dst_ndim:
17141 * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17142 * elif dst_ndim < src_ndim:
17143 * broadcast_leading(&dst, dst_ndim, src_ndim)
17144*/
17145 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17146
17147 /* "View.MemoryView":1299
17148 * cdef __Pyx_memviewslice tmp
17149 *
17150 * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17151 * broadcast_leading(&src, src_ndim, dst_ndim)
17152 * elif dst_ndim < src_ndim:
17153*/
17154 goto __pyx_L3;
17155 }
17156
17157 /* "View.MemoryView":1301
17158 * if src_ndim < dst_ndim:
17159 * broadcast_leading(&src, src_ndim, dst_ndim)
17160 * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17161 * broadcast_leading(&dst, dst_ndim, src_ndim)
17162 *
17163*/
17164 __pyx_t_1 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17165
17166 if (__pyx_t_1) {
17167
17168
17169 /* "View.MemoryView":1302
17170 * broadcast_leading(&src, src_ndim, dst_ndim)
17171 * elif dst_ndim < src_ndim:
17172 * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
17173 *
17174 * cdef int ndim = max(src_ndim, dst_ndim)
17175*/
17176 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17177
17178 /* "View.MemoryView":1301
17179 * if src_ndim < dst_ndim:
17180 * broadcast_leading(&src, src_ndim, dst_ndim)
17181 * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17182 * broadcast_leading(&dst, dst_ndim, src_ndim)
17183 *
17184*/
17185 }
17186 __pyx_L3:;
17187
17188 /* "View.MemoryView":1304
17189 * broadcast_leading(&dst, dst_ndim, src_ndim)
17190 *
17191 * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17192 *
17193 * for i in range(ndim):
17194*/
17195
17196 __pyx_t_2 = __pyx_v_dst_ndim;
17197
17198 __pyx_t_3 = __pyx_v_src_ndim;
17199 __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
17200
17201 if (__pyx_t_1) {
17202
17203 __pyx_t_4 = __pyx_t_2;
17204 } else {
17205
17206 __pyx_t_4 = __pyx_t_3;
17207 }
17208
17209 __pyx_v_ndim = __pyx_t_4;
17210
17211
17212 /* "View.MemoryView":1306
17213 * cdef int ndim = max(src_ndim, dst_ndim)
17214 *
17215 * for i in range(ndim): # <<<<<<<<<<<<<<
17216 * if src.shape[i] != dst.shape[i]:
17217 * if cython.likely(src.shape[i] == 1):
17218*/
17219
17220 __pyx_t_4 = __pyx_v_ndim;
17221 __pyx_t_2 = __pyx_t_4;
17222
17223 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17224 __pyx_v_i = __pyx_t_3;
17225
17226 /* "View.MemoryView":1307
17227 *
17228 * for i in range(ndim):
17229 * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17230 * if cython.likely(src.shape[i] == 1):
17231 * broadcasting = True
17232*/
17233 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17234
17235 if (__pyx_t_1) {
17236
17237
17238 /* "View.MemoryView":1308
17239 * for i in range(ndim):
17240 * if src.shape[i] != dst.shape[i]:
17241 * if cython.likely(src.shape[i] == 1): # <<<<<<<<<<<<<<
17242 * broadcasting = True
17243 * src.strides[i] = 0
17244*/
17245 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17246
17247 if (likely(__pyx_t_1)) {
17248
17249
17250 /* "View.MemoryView":1309
17251 * if src.shape[i] != dst.shape[i]:
17252 * if cython.likely(src.shape[i] == 1):
17253 * broadcasting = True # <<<<<<<<<<<<<<
17254 * src.strides[i] = 0
17255 * else:
17256*/
17257 __pyx_v_broadcasting = 1;
17258
17259 /* "View.MemoryView":1310
17260 * if cython.likely(src.shape[i] == 1):
17261 * broadcasting = True
17262 * src.strides[i] = 0 # <<<<<<<<<<<<<<
17263 * else:
17264 * _err_extents(i, dst.shape[i], src.shape[i])
17265*/
17266 (__pyx_v_src.strides[__pyx_v_i]) = 0;
17267
17268 /* "View.MemoryView":1308
17269 * for i in range(ndim):
17270 * if src.shape[i] != dst.shape[i]:
17271 * if cython.likely(src.shape[i] == 1): # <<<<<<<<<<<<<<
17272 * broadcasting = True
17273 * src.strides[i] = 0
17274*/
17275 goto __pyx_L7;
17276 }
17277
17278 /* "View.MemoryView":1312
17279 * src.strides[i] = 0
17280 * else:
17281 * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
17282 *
17283 * if cython.unlikely(src.suboffsets[i] >= 0):
17284*/
17285 /*else*/ {
17286 __pyx_t_5 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1312, __pyx_L1_error)
17287
17288 }
17289 __pyx_L7:;
17290
17291 /* "View.MemoryView":1307
17292 *
17293 * for i in range(ndim):
17294 * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17295 * if cython.likely(src.shape[i] == 1):
17296 * broadcasting = True
17297*/
17298 }
17299
17300 /* "View.MemoryView":1314
17301 * _err_extents(i, dst.shape[i], src.shape[i])
17302 *
17303 * if cython.unlikely(src.suboffsets[i] >= 0): # <<<<<<<<<<<<<<
17304 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17305 *
17306*/
17307 __pyx_t_1 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17308
17309 if (unlikely(__pyx_t_1)) {
17310
17311
17312 /* "View.MemoryView":1315
17313 *
17314 * if cython.unlikely(src.suboffsets[i] >= 0):
17315 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
17316 *
17317 * if slices_overlap(&src, &dst, ndim, itemsize):
17318*/
17319 __pyx_t_5 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1315, __pyx_L1_error)
17320
17321
17322 /* "View.MemoryView":1314
17323 * _err_extents(i, dst.shape[i], src.shape[i])
17324 *
17325 * if cython.unlikely(src.suboffsets[i] >= 0): # <<<<<<<<<<<<<<
17326 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17327 *
17328*/
17329 }
17330 }
17331
17332
17333 /* "View.MemoryView":1317
17334 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17335 *
17336 * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17337 *
17338 * if not slice_is_contig(src, order, ndim):
17339*/
17340 __pyx_t_1 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17341
17342 if (__pyx_t_1) {
17343
17344
17345 /* "View.MemoryView":1319
17346 * if slices_overlap(&src, &dst, ndim, itemsize):
17347 *
17348 * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17349 * order = get_best_order(&dst, ndim)
17350 *
17351*/
17352 __pyx_t_1 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17353
17354 if (__pyx_t_1) {
17355
17356
17357 /* "View.MemoryView":1320
17358 *
17359 * if not slice_is_contig(src, order, ndim):
17360 * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
17361 *
17362 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17363*/
17364 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17365
17366 /* "View.MemoryView":1319
17367 * if slices_overlap(&src, &dst, ndim, itemsize):
17368 *
17369 * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17370 * order = get_best_order(&dst, ndim)
17371 *
17372*/
17373 }
17374
17375 /* "View.MemoryView":1322
17376 * order = get_best_order(&dst, ndim)
17377 *
17378 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
17379 * src = tmp
17380 *
17381*/
17382 __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == ((void *)NULL))) __PYX_ERR(1, 1322, __pyx_L1_error)
17383 __pyx_v_tmpdata = __pyx_t_6;
17384
17385 /* "View.MemoryView":1323
17386 *
17387 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17388 * src = tmp # <<<<<<<<<<<<<<
17389 *
17390 * if not broadcasting:
17391*/
17392 __pyx_v_src = __pyx_v_tmp;
17393
17394 /* "View.MemoryView":1317
17395 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17396 *
17397 * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17398 *
17399 * if not slice_is_contig(src, order, ndim):
17400*/
17401 }
17402
17403 /* "View.MemoryView":1325
17404 * src = tmp
17405 *
17406 * if not broadcasting: # <<<<<<<<<<<<<<
17407 *
17408 *
17409*/
17410 __pyx_t_1 = (!__pyx_v_broadcasting);
17411
17412 if (__pyx_t_1) {
17413
17414
17415 /* "View.MemoryView":1328
17416 *
17417 *
17418 * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17419 * direct_copy = slice_is_contig(dst, 'C', ndim)
17420 * elif slice_is_contig(src, 'F', ndim):
17421*/
17422 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
17423
17424 if (__pyx_t_1) {
17425
17426
17427 /* "View.MemoryView":1329
17428 *
17429 * if slice_is_contig(src, 'C', ndim):
17430 * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
17431 * elif slice_is_contig(src, 'F', ndim):
17432 * direct_copy = slice_is_contig(dst, 'F', ndim)
17433*/
17434 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
17435
17436 /* "View.MemoryView":1328
17437 *
17438 *
17439 * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17440 * direct_copy = slice_is_contig(dst, 'C', ndim)
17441 * elif slice_is_contig(src, 'F', ndim):
17442*/
17443 goto __pyx_L12;
17444 }
17445
17446 /* "View.MemoryView":1330
17447 * if slice_is_contig(src, 'C', ndim):
17448 * direct_copy = slice_is_contig(dst, 'C', ndim)
17449 * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17450 * direct_copy = slice_is_contig(dst, 'F', ndim)
17451 *
17452*/
17453 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
17454
17455 if (__pyx_t_1) {
17456
17457
17458 /* "View.MemoryView":1331
17459 * direct_copy = slice_is_contig(dst, 'C', ndim)
17460 * elif slice_is_contig(src, 'F', ndim):
17461 * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
17462 *
17463 * if direct_copy:
17464*/
17465 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
17466
17467 /* "View.MemoryView":1330
17468 * if slice_is_contig(src, 'C', ndim):
17469 * direct_copy = slice_is_contig(dst, 'C', ndim)
17470 * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17471 * direct_copy = slice_is_contig(dst, 'F', ndim)
17472 *
17473*/
17474 }
17475 __pyx_L12:;
17476
17477 /* "View.MemoryView":1333
17478 * direct_copy = slice_is_contig(dst, 'F', ndim)
17479 *
17480 * if direct_copy: # <<<<<<<<<<<<<<
17481 *
17482 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17483*/
17484 if (__pyx_v_direct_copy) {
17485
17486 /* "View.MemoryView":1335
17487 * if direct_copy:
17488 *
17489 * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17490 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17491 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17492*/
17493 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17494
17495 /* "View.MemoryView":1336
17496 *
17497 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17498 * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
17499 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17500 * free(tmpdata)
17501*/
17502 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17503
17504 /* "View.MemoryView":1337
17505 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17506 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17507 * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17508 * free(tmpdata)
17509 * return 0
17510*/
17511 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17512
17513 /* "View.MemoryView":1338
17514 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17515 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17516 * free(tmpdata) # <<<<<<<<<<<<<<
17517 * return 0
17518 *
17519*/
17520 free(__pyx_v_tmpdata);
17521
17522 /* "View.MemoryView":1339
17523 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17524 * free(tmpdata)
17525 * return 0 # <<<<<<<<<<<<<<
17526 *
17527 * if order == 'F' == get_best_order(&dst, ndim):
17528*/
17529 {
17530
17531 __pyx_r = 0;
17532 }
17533 goto __pyx_L0;
17534
17535 /* "View.MemoryView":1333
17536 * direct_copy = slice_is_contig(dst, 'F', ndim)
17537 *
17538 * if direct_copy: # <<<<<<<<<<<<<<
17539 *
17540 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17541*/
17542 }
17543
17544 /* "View.MemoryView":1325
17545 * src = tmp
17546 *
17547 * if not broadcasting: # <<<<<<<<<<<<<<
17548 *
17549 *
17550*/
17551 }
17552
17553 /* "View.MemoryView":1341
17554 * return 0
17555 *
17556 * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17557 *
17558 *
17559*/
17560 __pyx_t_1 = (__pyx_v_order == 'F');
17561 if (__pyx_t_1) {
17562 __pyx_t_1 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17563 }
17564 if (__pyx_t_1) {
17565
17566
17567 /* "View.MemoryView":1344
17568 *
17569 *
17570 * transpose_memslice(&src) # <<<<<<<<<<<<<<
17571 * transpose_memslice(&dst)
17572 *
17573*/
17574 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1344, __pyx_L1_error)
17575
17576
17577 /* "View.MemoryView":1345
17578 *
17579 * transpose_memslice(&src)
17580 * transpose_memslice(&dst) # <<<<<<<<<<<<<<
17581 *
17582 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17583*/
17584 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1345, __pyx_L1_error)
17585
17586
17587 /* "View.MemoryView":1341
17588 * return 0
17589 *
17590 * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17591 *
17592 *
17593*/
17594 }
17595
17596 /* "View.MemoryView":1347
17597 * transpose_memslice(&dst)
17598 *
17599 * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17600 * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17601 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17602*/
17603 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17604
17605 /* "View.MemoryView":1348
17606 *
17607 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17608 * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
17609 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17610 *
17611*/
17612 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17613
17614 /* "View.MemoryView":1349
17615 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17616 * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17617 * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17618 *
17619 * free(tmpdata)
17620*/
17621 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17622
17623 /* "View.MemoryView":1351
17624 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17625 *
17626 * free(tmpdata) # <<<<<<<<<<<<<<
17627 * return 0
17628 *
17629*/
17630 free(__pyx_v_tmpdata);
17631
17632 /* "View.MemoryView":1352
17633 *
17634 * free(tmpdata)
17635 * return 0 # <<<<<<<<<<<<<<
17636 *
17637 * @cname('__pyx_memoryview_broadcast_leading')
17638*/
17639 {
17640
17641 __pyx_r = 0;
17642 }
17643 goto __pyx_L0;
17644
17645 /* "View.MemoryView":1282
17646 *
17647 *
17648 * @cname('__pyx_memoryview_copy_contents') # <<<<<<<<<<<<<<
17649 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
17650 * __Pyx_memviewslice dst,
17651*/
17652
17653 /* function exit code */
17654 __pyx_L1_error:;
17655 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17656 __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17657 __pyx_r = -1;
17658 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17659 __pyx_L0:;
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669 return __pyx_r;
17670}
17671
17672/* "View.MemoryView":1354
17673 * return 0
17674 *
17675 * @cname('__pyx_memoryview_broadcast_leading') # <<<<<<<<<<<<<<
17676 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
17677 * int ndim,
17678*/
17679
17680static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
17681 int __pyx_v_i;
17682 int __pyx_v_offset;
17683 int __pyx_t_1;
17684 int __pyx_t_2;
17685 int __pyx_t_3;
17686
17687 /* "View.MemoryView":1359
17688 * int ndim_other) noexcept nogil:
17689 * cdef int i
17690 * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
17691 *
17692 * for i in range(ndim - 1, -1, -1):
17693*/
17694 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17695
17696 /* "View.MemoryView":1361
17697 * cdef int offset = ndim_other - ndim
17698 *
17699 * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17700 * mslice.shape[i + offset] = mslice.shape[i]
17701 * mslice.strides[i + offset] = mslice.strides[i]
17702*/
17703 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17704 __pyx_v_i = __pyx_t_1;
17705
17706 /* "View.MemoryView":1362
17707 *
17708 * for i in range(ndim - 1, -1, -1):
17709 * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
17710 * mslice.strides[i + offset] = mslice.strides[i]
17711 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17712*/
17713 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
17714
17715 /* "View.MemoryView":1363
17716 * for i in range(ndim - 1, -1, -1):
17717 * mslice.shape[i + offset] = mslice.shape[i]
17718 * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
17719 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17720 *
17721*/
17722 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
17723
17724 /* "View.MemoryView":1364
17725 * mslice.shape[i + offset] = mslice.shape[i]
17726 * mslice.strides[i + offset] = mslice.strides[i]
17727 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
17728 *
17729 * for i in range(offset):
17730*/
17731 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
17732 }
17733
17734 /* "View.MemoryView":1366
17735 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17736 *
17737 * for i in range(offset): # <<<<<<<<<<<<<<
17738 * mslice.shape[i] = 1
17739 * mslice.strides[i] = mslice.strides[0]
17740*/
17741
17742 __pyx_t_1 = __pyx_v_offset;
17743 __pyx_t_2 = __pyx_t_1;
17744
17745 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17746 __pyx_v_i = __pyx_t_3;
17747
17748 /* "View.MemoryView":1367
17749 *
17750 * for i in range(offset):
17751 * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
17752 * mslice.strides[i] = mslice.strides[0]
17753 * mslice.suboffsets[i] = -1
17754*/
17755 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
17756
17757 /* "View.MemoryView":1368
17758 * for i in range(offset):
17759 * mslice.shape[i] = 1
17760 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
17761 * mslice.suboffsets[i] = -1
17762 *
17763*/
17764 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
17765
17766 /* "View.MemoryView":1369
17767 * mslice.shape[i] = 1
17768 * mslice.strides[i] = mslice.strides[0]
17769 * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
17770 *
17771 *
17772*/
17773 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
17774 }
17775
17776
17777 /* "View.MemoryView":1354
17778 * return 0
17779 *
17780 * @cname('__pyx_memoryview_broadcast_leading') # <<<<<<<<<<<<<<
17781 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
17782 * int ndim,
17783*/
17784
17785 /* function exit code */
17786
17787
17788}
17789
17790/* "View.MemoryView":1376
17791 *
17792 *
17793 * @cname('__pyx_memoryview_refcount_copying') # <<<<<<<<<<<<<<
17794 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17795 *
17796*/
17797
17798static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
17799
17800 /* "View.MemoryView":1379
17801 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17802 *
17803 * if dtype_is_object: # <<<<<<<<<<<<<<
17804 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17805 *
17806*/
17807 if (__pyx_v_dtype_is_object) {
17808
17809 /* "View.MemoryView":1380
17810 *
17811 * if dtype_is_object:
17812 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
17813 *
17814 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17815*/
17816 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
17817
17818 /* "View.MemoryView":1379
17819 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17820 *
17821 * if dtype_is_object: # <<<<<<<<<<<<<<
17822 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17823 *
17824*/
17825 }
17826
17827 /* "View.MemoryView":1376
17828 *
17829 *
17830 * @cname('__pyx_memoryview_refcount_copying') # <<<<<<<<<<<<<<
17831 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17832 *
17833*/
17834
17835 /* function exit code */
17836}
17837
17838/* "View.MemoryView":1382
17839 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17840 *
17841 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') # <<<<<<<<<<<<<<
17842 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
17843 * Py_ssize_t *strides, int ndim,
17844*/
17845
17846static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
17847 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17848
17849
17850
17851
17852
17853
17854 /* "View.MemoryView":1386
17855 * Py_ssize_t *strides, int ndim,
17856 * bint inc) noexcept with gil:
17857 * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
17858 *
17859 * @cname('__pyx_memoryview_refcount_objects_in_slice')
17860*/
17861 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
17862
17863 /* "View.MemoryView":1382
17864 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17865 *
17866 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') # <<<<<<<<<<<<<<
17867 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
17868 * Py_ssize_t *strides, int ndim,
17869*/
17870
17871 /* function exit code */
17872
17873
17874
17875
17876
17877
17878 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17879}
17880
17881/* "View.MemoryView":1388
17882 * refcount_objects_in_slice(data, shape, strides, ndim, inc)
17883 *
17884 * @cname('__pyx_memoryview_refcount_objects_in_slice') # <<<<<<<<<<<<<<
17885 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
17886 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17887*/
17888
17889static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
17890 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17891 Py_ssize_t __pyx_v_stride;
17892 Py_ssize_t __pyx_t_1;
17893 Py_ssize_t __pyx_t_2;
17894 Py_ssize_t __pyx_t_3;
17895 int __pyx_t_4;
17896
17897
17898 /* "View.MemoryView":1392
17899 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17900 * cdef Py_ssize_t i
17901 * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
17902 *
17903 * for i in range(shape[0]):
17904*/
17905 __pyx_v_stride = (__pyx_v_strides[0]);
17906
17907 /* "View.MemoryView":1394
17908 * cdef Py_ssize_t stride = strides[0]
17909 *
17910 * for i in range(shape[0]): # <<<<<<<<<<<<<<
17911 * if ndim == 1:
17912 * if inc:
17913*/
17914
17915 __pyx_t_1 = (__pyx_v_shape[0]);
17916 __pyx_t_2 = __pyx_t_1;
17917
17918 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17919 __pyx_v_i = __pyx_t_3;
17920
17921 /* "View.MemoryView":1395
17922 *
17923 * for i in range(shape[0]):
17924 * if ndim == 1: # <<<<<<<<<<<<<<
17925 * if inc:
17926 * Py_INCREF((<PyObject **> data)[0])
17927*/
17928 __pyx_t_4 = (__pyx_v_ndim == 1);
17929
17930 if (__pyx_t_4) {
17931
17932
17933 /* "View.MemoryView":1396
17934 * for i in range(shape[0]):
17935 * if ndim == 1:
17936 * if inc: # <<<<<<<<<<<<<<
17937 * Py_INCREF((<PyObject **> data)[0])
17938 * else:
17939*/
17940 if (__pyx_v_inc) {
17941
17942 /* "View.MemoryView":1397
17943 * if ndim == 1:
17944 * if inc:
17945 * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17946 * else:
17947 * Py_DECREF((<PyObject **> data)[0])
17948*/
17949 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
17950
17951 /* "View.MemoryView":1396
17952 * for i in range(shape[0]):
17953 * if ndim == 1:
17954 * if inc: # <<<<<<<<<<<<<<
17955 * Py_INCREF((<PyObject **> data)[0])
17956 * else:
17957*/
17958 goto __pyx_L6;
17959 }
17960
17961 /* "View.MemoryView":1399
17962 * Py_INCREF((<PyObject **> data)[0])
17963 * else:
17964 * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17965 * else:
17966 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
17967*/
17968 /*else*/ {
17969 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
17970 }
17971 __pyx_L6:;
17972
17973 /* "View.MemoryView":1395
17974 *
17975 * for i in range(shape[0]):
17976 * if ndim == 1: # <<<<<<<<<<<<<<
17977 * if inc:
17978 * Py_INCREF((<PyObject **> data)[0])
17979*/
17980 goto __pyx_L5;
17981 }
17982
17983 /* "View.MemoryView":1401
17984 * Py_DECREF((<PyObject **> data)[0])
17985 * else:
17986 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
17987 *
17988 * data += stride
17989*/
17990 /*else*/ {
17991 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
17992 }
17993 __pyx_L5:;
17994
17995 /* "View.MemoryView":1403
17996 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
17997 *
17998 * data += stride # <<<<<<<<<<<<<<
17999 *
18000 *
18001*/
18002 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18003 }
18004
18005
18006 /* "View.MemoryView":1388
18007 * refcount_objects_in_slice(data, shape, strides, ndim, inc)
18008 *
18009 * @cname('__pyx_memoryview_refcount_objects_in_slice') # <<<<<<<<<<<<<<
18010 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
18011 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18012*/
18013
18014 /* function exit code */
18015
18016
18017
18018
18019}
18020
18021/* "View.MemoryView":1408
18022 *
18023 *
18024 * @cname('__pyx_memoryview_slice_assign_scalar') # <<<<<<<<<<<<<<
18025 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
18026 * size_t itemsize, void *item,
18027*/
18028
18029static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
18030
18031 /* "View.MemoryView":1412
18032 * size_t itemsize, void *item,
18033 * bint dtype_is_object) noexcept nogil:
18034 * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18035 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18036 * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18037*/
18038 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18039
18040 /* "View.MemoryView":1413
18041 * bint dtype_is_object) noexcept nogil:
18042 * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18043 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
18044 * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18045 *
18046*/
18047 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
18048
18049 /* "View.MemoryView":1414
18050 * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18051 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18052 * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18053 *
18054 *
18055*/
18056 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18057
18058 /* "View.MemoryView":1408
18059 *
18060 *
18061 * @cname('__pyx_memoryview_slice_assign_scalar') # <<<<<<<<<<<<<<
18062 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
18063 * size_t itemsize, void *item,
18064*/
18065
18066 /* function exit code */
18067}
18068
18069/* "View.MemoryView":1417
18070 *
18071 *
18072 * @cname('__pyx_memoryview__slice_assign_scalar') # <<<<<<<<<<<<<<
18073 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
18074 * Py_ssize_t *strides, int ndim,
18075*/
18076
18077static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
18078 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18079 Py_ssize_t __pyx_v_stride;
18080 Py_ssize_t __pyx_v_extent;
18081 int __pyx_t_1;
18082 Py_ssize_t __pyx_t_2;
18083 Py_ssize_t __pyx_t_3;
18084 Py_ssize_t __pyx_t_4;
18085
18086
18087 /* "View.MemoryView":1422
18088 * size_t itemsize, void *item) noexcept nogil:
18089 * cdef Py_ssize_t i
18090 * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18091 * cdef Py_ssize_t extent = shape[0]
18092 *
18093*/
18094 __pyx_v_stride = (__pyx_v_strides[0]);
18095
18096 /* "View.MemoryView":1423
18097 * cdef Py_ssize_t i
18098 * cdef Py_ssize_t stride = strides[0]
18099 * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
18100 *
18101 * if ndim == 1:
18102*/
18103 __pyx_v_extent = (__pyx_v_shape[0]);
18104
18105 /* "View.MemoryView":1425
18106 * cdef Py_ssize_t extent = shape[0]
18107 *
18108 * if ndim == 1: # <<<<<<<<<<<<<<
18109 * for i in range(extent):
18110 * memcpy(data, item, itemsize)
18111*/
18112 __pyx_t_1 = (__pyx_v_ndim == 1);
18113
18114 if (__pyx_t_1) {
18115
18116
18117 /* "View.MemoryView":1426
18118 *
18119 * if ndim == 1:
18120 * for i in range(extent): # <<<<<<<<<<<<<<
18121 * memcpy(data, item, itemsize)
18122 * data += stride
18123*/
18124
18125 __pyx_t_2 = __pyx_v_extent;
18126 __pyx_t_3 = __pyx_t_2;
18127
18128 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18129 __pyx_v_i = __pyx_t_4;
18130
18131 /* "View.MemoryView":1427
18132 * if ndim == 1:
18133 * for i in range(extent):
18134 * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
18135 * data += stride
18136 * else:
18137*/
18138 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18139
18140 /* "View.MemoryView":1428
18141 * for i in range(extent):
18142 * memcpy(data, item, itemsize)
18143 * data += stride # <<<<<<<<<<<<<<
18144 * else:
18145 * for i in range(extent):
18146*/
18147 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18148 }
18149
18150
18151 /* "View.MemoryView":1425
18152 * cdef Py_ssize_t extent = shape[0]
18153 *
18154 * if ndim == 1: # <<<<<<<<<<<<<<
18155 * for i in range(extent):
18156 * memcpy(data, item, itemsize)
18157*/
18158 goto __pyx_L3;
18159 }
18160
18161 /* "View.MemoryView":1430
18162 * data += stride
18163 * else:
18164 * for i in range(extent): # <<<<<<<<<<<<<<
18165 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18166 * data += stride
18167*/
18168 /*else*/ {
18169
18170 __pyx_t_2 = __pyx_v_extent;
18171 __pyx_t_3 = __pyx_t_2;
18172
18173 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18174 __pyx_v_i = __pyx_t_4;
18175
18176 /* "View.MemoryView":1431
18177 * else:
18178 * for i in range(extent):
18179 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
18180 * data += stride
18181 *
18182*/
18183 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
18184
18185 /* "View.MemoryView":1432
18186 * for i in range(extent):
18187 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18188 * data += stride # <<<<<<<<<<<<<<
18189 *
18190*/
18191 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18192 }
18193
18194 }
18195 __pyx_L3:;
18196
18197 /* "View.MemoryView":1417
18198 *
18199 *
18200 * @cname('__pyx_memoryview__slice_assign_scalar') # <<<<<<<<<<<<<<
18201 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
18202 * Py_ssize_t *strides, int ndim,
18203*/
18204
18205 /* function exit code */
18206
18207
18208
18209
18210}
18211
18212/* "(tree fragment)":4
18213 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
18214 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
18215 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
18216 * cdef object __pyx_result
18217 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18218*/
18219
18220/* Python wrapper */
18221static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18222#if CYTHON_VECTORCALL
18223PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18224#else
18225PyObject *__pyx_args, PyObject *__pyx_kwds
18226#endif
18227); /*proto*/
18228static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
18229static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18230#if CYTHON_VECTORCALL
18231PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18232#else
18233PyObject *__pyx_args, PyObject *__pyx_kwds
18234#endif
18235) {
18236 PyObject *__pyx_v___pyx_type = 0;
18237 long __pyx_v___pyx_checksum;
18238 PyObject *__pyx_v___pyx_state = 0;
18239 #if !CYTHON_VECTORCALL
18240 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18241 #endif
18242 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
18243 PyObject* values[3] = {0,0,0};
18244 int __pyx_lineno = 0;
18245 const char *__pyx_filename = NULL;
18246 int __pyx_clineno = 0;
18247 PyObject *__pyx_r = 0;
18248 __Pyx_RefNannyDeclarations
18249 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
18250 #if !CYTHON_VECTORCALL
18251 #if CYTHON_ASSUME_SAFE_SIZE
18252 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18253 #else
18254 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
18255 #endif
18256 #endif
18257 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18258 {
18259 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
18260 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
18261 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 4, __pyx_L3_error)
18262 if (__pyx_kwds_len > 0) {
18263 switch (__pyx_nargs) {
18264 case 3:
18265 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18266 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18267 CYTHON_FALLTHROUGH;
18268 case 2:
18269 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18270 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18271 CYTHON_FALLTHROUGH;
18272 case 1:
18273 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18274 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18275 CYTHON_FALLTHROUGH;
18276 case 0: break;
18277 default: goto __pyx_L5_argtuple_error;
18278 }
18279 const Py_ssize_t kwd_pos_args = __pyx_nargs;
18280 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_Enum", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
18281 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
18282 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
18283 }
18284 } else if (unlikely(__pyx_nargs != 3)) {
18285 goto __pyx_L5_argtuple_error;
18286 } else {
18287 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18288 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18289 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18290 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18291 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18292 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18293 }
18294 __pyx_v___pyx_type = values[0];
18295 __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
18296 __pyx_v___pyx_state = ((PyObject*)values[2]);
18297 }
18298 goto __pyx_L6_skip;
18299 __pyx_L5_argtuple_error:;
18300 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __pyx_L3_error)
18301 __pyx_L6_skip:;
18302 goto __pyx_L4_argument_unpacking_done;
18303 __pyx_L3_error:;
18304 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18305 Py_XDECREF(values[__pyx_temp]);
18306 }
18307 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18308 __Pyx_RefNannyFinishContext();
18309 return NULL;
18310 __pyx_L4_argument_unpacking_done:;
18311 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
18312 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18313
18314 /* function exit code */
18315 goto __pyx_L0;
18316 __pyx_L1_error:;
18317 __pyx_r = NULL;
18318 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18319 Py_XDECREF(values[__pyx_temp]);
18320 }
18321 goto __pyx_L7_cleaned_up;
18322 __pyx_L0:;
18323 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18324 Py_XDECREF(values[__pyx_temp]);
18325 }
18326 __pyx_L7_cleaned_up:;
18327
18328 __Pyx_RefNannyFinishContext();
18329 return __pyx_r;
18330}
18331
18332static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18333 PyObject *__pyx_v___pyx_result = 0;
18334 PyObject *__pyx_r = NULL;
18335 __Pyx_RefNannyDeclarations
18336 int __pyx_t_1;
18337 PyObject *__pyx_t_2 = NULL;
18338 PyObject *__pyx_t_3 = NULL;
18339 size_t __pyx_t_4;
18340 int __pyx_t_5;
18341 int __pyx_lineno = 0;
18342 const char *__pyx_filename = NULL;
18343 int __pyx_clineno = 0;
18344 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
18345
18346 /* "(tree fragment)":6
18347 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):
18348 * cdef object __pyx_result
18349 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name') # <<<<<<<<<<<<<<
18350 * __pyx_result = Enum.__new__(__pyx_type)
18351 * if __pyx_state is not None:
18352*/
18353 __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, __pyx_k_name); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)
18354
18355
18356 /* "(tree fragment)":7
18357 * cdef object __pyx_result
18358 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18359 * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
18360 * if __pyx_state is not None:
18361 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18362*/
18363 __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
18364 __Pyx_INCREF(__pyx_t_3);
18365 __pyx_t_4 = 0;
18366 {
18367 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
18368 __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
18369 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18370 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
18371 __Pyx_GOTREF(__pyx_t_2);
18372 }
18373 __pyx_v___pyx_result = __pyx_t_2;
18374 __pyx_t_2 = 0;
18375
18376 /* "(tree fragment)":8
18377 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18378 * __pyx_result = Enum.__new__(__pyx_type)
18379 * if __pyx_state is not None: # <<<<<<<<<<<<<<
18380 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18381 * return __pyx_result
18382*/
18383 __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
18384 if (__pyx_t_5) {
18385
18386
18387 /* "(tree fragment)":9
18388 * __pyx_result = Enum.__new__(__pyx_type)
18389 * if __pyx_state is not None:
18390 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
18391 * return __pyx_result
18392 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18393*/
18394 if (unlikely(__pyx_v___pyx_state == Py_None)) {
18395 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
18396 __PYX_ERR(1, 9, __pyx_L1_error)
18397 }
18398 __pyx_t_2 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
18399 __Pyx_GOTREF(__pyx_t_2);
18400 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18401
18402 /* "(tree fragment)":8
18403 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18404 * __pyx_result = Enum.__new__(__pyx_type)
18405 * if __pyx_state is not None: # <<<<<<<<<<<<<<
18406 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18407 * return __pyx_result
18408*/
18409 }
18410
18411 /* "(tree fragment)":10
18412 * if __pyx_state is not None:
18413 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18414 * return __pyx_result # <<<<<<<<<<<<<<
18415 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18416 * __pyx_result.name = __pyx_state[0]
18417*/
18418 {
18419 PyObject *__pyx_temp;
18420 {
18421 __pyx_temp = __pyx_r;
18422 __Pyx_INCREF(__pyx_v___pyx_result);
18423 __pyx_r = __pyx_v___pyx_result;
18424 }
18425 __Pyx_XDECREF(__pyx_temp);
18426 }
18427 goto __pyx_L0;
18428
18429 /* "(tree fragment)":4
18430 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
18431 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
18432 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
18433 * cdef object __pyx_result
18434 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18435*/
18436
18437 /* function exit code */
18438 __pyx_L1_error:;
18439 __Pyx_XDECREF(__pyx_t_2);
18440 __Pyx_XDECREF(__pyx_t_3);
18441 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18442 __pyx_r = NULL;
18443 __pyx_L0:;
18444 __Pyx_XDECREF(__pyx_v___pyx_result);
18445 __Pyx_XGIVEREF(__pyx_r);
18446 __Pyx_RefNannyFinishContext();
18447 return __pyx_r;
18448}
18449
18450/* "(tree fragment)":11
18451 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18452 * return __pyx_result
18453 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<<
18454 * __pyx_result.name = __pyx_state[0]
18455 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
18456*/
18457
18458static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18459 PyObject *__pyx_r = NULL;
18460 __Pyx_RefNannyDeclarations
18461 PyObject *__pyx_t_1 = NULL;
18462 int __pyx_t_2;
18463 int __pyx_lineno = 0;
18464 const char *__pyx_filename = NULL;
18465 int __pyx_clineno = 0;
18466 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
18467
18468 /* "(tree fragment)":12
18469 * return __pyx_result
18470 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18471 * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
18472 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
18473*/
18474 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18475 __Pyx_GOTREF(__pyx_t_1);
18476 __Pyx_GIVEREF(__pyx_t_1);
18477 __Pyx_GOTREF(__pyx_v___pyx_result->name);
18478 __Pyx_DECREF(__pyx_v___pyx_result->name);
18479 __pyx_v___pyx_result->name = __pyx_t_1;
18480 __pyx_t_1 = 0;
18481
18482 /* "(tree fragment)":13
18483 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18484 * __pyx_result.name = __pyx_state[0]
18485 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1) # <<<<<<<<<<<<<<
18486*/
18487 __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18488
18489
18490 /* "(tree fragment)":11
18491 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18492 * return __pyx_result
18493 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<<
18494 * __pyx_result.name = __pyx_state[0]
18495 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
18496*/
18497
18498 /* function exit code */
18499 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18500 goto __pyx_L0;
18501 __pyx_L1_error:;
18502 __Pyx_XDECREF(__pyx_t_1);
18503 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18504 __pyx_r = 0;
18505 __pyx_L0:;
18506 __Pyx_XGIVEREF(__pyx_r);
18507 __Pyx_RefNannyFinishContext();
18508 return __pyx_r;
18509}
18510
18511/* "BufferFormatFromTypeInfo":1467
18512 *
18513 *
18514 * @cname('__pyx_format_from_typeinfo') # <<<<<<<<<<<<<<
18515 * cdef bytes format_from_typeinfo(const __Pyx_TypeInfo *type):
18516 * cdef const __Pyx_StructField *field
18517*/
18518
18519static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo const *__pyx_v_type) {
18520 __Pyx_StructField const *__pyx_v_field;
18521 struct __pyx_typeinfo_string __pyx_v_fmt;
18522 PyObject *__pyx_v_part = 0;
18523 PyObject *__pyx_v_result = 0;
18524 PyObject *__pyx_v_alignment = NULL;
18525 PyObject *__pyx_v_parts = NULL;
18526 PyObject *__pyx_v_extents = NULL;
18527 Py_ssize_t __pyx_7genexpr__pyx_v_i;
18528 PyObject *__pyx_r = NULL;
18529 __Pyx_RefNannyDeclarations
18530 int __pyx_t_1;
18531 PyObject *__pyx_t_2 = NULL;
18532 __Pyx_StructField const *__pyx_t_3;
18533 PyObject *__pyx_t_4 = NULL;
18534 PyObject *__pyx_t_5 = NULL;
18535 int __pyx_t_6;
18536 int __pyx_t_7;
18537 int __pyx_t_8;
18538 Py_ssize_t __pyx_t_9;
18539 PyObject *__pyx_t_10[3];
18540 int __pyx_lineno = 0;
18541 const char *__pyx_filename = NULL;
18542 int __pyx_clineno = 0;
18543 __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
18544
18545 /* "BufferFormatFromTypeInfo":1474
18546 * cdef Py_ssize_t i
18547 *
18548 * if type.typegroup == 'S': # <<<<<<<<<<<<<<
18549 * assert type.fields != NULL
18550 * assert type.fields.type != NULL
18551*/
18552 __pyx_t_1 = (__pyx_v_type->typegroup == 'S');
18553
18554 if (__pyx_t_1) {
18555
18556
18557 /* "BufferFormatFromTypeInfo":1475
18558 *
18559 * if type.typegroup == 'S':
18560 * assert type.fields != NULL # <<<<<<<<<<<<<<
18561 * assert type.fields.type != NULL
18562 *
18563*/
18564 #ifndef CYTHON_WITHOUT_ASSERTIONS
18565 if (unlikely(__pyx_assertions_enabled())) {
18566 __pyx_t_1 = (__pyx_v_type->fields != NULL);
18567
18568 if (unlikely(!__pyx_t_1)) {
18569 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
18570 __PYX_ERR(1, 1475, __pyx_L1_error)
18571 }
18572
18573 }
18574 #else
18575 if ((1)); else __PYX_ERR(1, 1475, __pyx_L1_error)
18576 #endif
18577
18578 /* "BufferFormatFromTypeInfo":1476
18579 * if type.typegroup == 'S':
18580 * assert type.fields != NULL
18581 * assert type.fields.type != NULL # <<<<<<<<<<<<<<
18582 *
18583 * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
18584*/
18585 #ifndef CYTHON_WITHOUT_ASSERTIONS
18586 if (unlikely(__pyx_assertions_enabled())) {
18587 __pyx_t_1 = (__pyx_v_type->fields->type != NULL);
18588
18589 if (unlikely(!__pyx_t_1)) {
18590 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
18591 __PYX_ERR(1, 1476, __pyx_L1_error)
18592 }
18593
18594 }
18595 #else
18596 if ((1)); else __PYX_ERR(1, 1476, __pyx_L1_error)
18597 #endif
18598
18599 /* "BufferFormatFromTypeInfo":1478
18600 * assert type.fields.type != NULL
18601 *
18602 * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
18603 * alignment = b'^'
18604 * else:
18605*/
18606 __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
18607
18608 if (__pyx_t_1) {
18609
18610
18611 /* "BufferFormatFromTypeInfo":1479
18612 *
18613 * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
18614 * alignment = b'^' # <<<<<<<<<<<<<<
18615 * else:
18616 * alignment = b''
18617*/
18618 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__5);
18619 __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__5;
18620
18621 /* "BufferFormatFromTypeInfo":1478
18622 * assert type.fields.type != NULL
18623 *
18624 * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
18625 * alignment = b'^'
18626 * else:
18627*/
18628 goto __pyx_L4;
18629 }
18630
18631 /* "BufferFormatFromTypeInfo":1481
18632 * alignment = b'^'
18633 * else:
18634 * alignment = b'' # <<<<<<<<<<<<<<
18635 *
18636 * parts = [b"T{"]
18637*/
18638 /*else*/ {
18639 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__6);
18640 __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__6;
18641 }
18642 __pyx_L4:;
18643
18644 /* "BufferFormatFromTypeInfo":1483
18645 * alignment = b''
18646 *
18647 * parts = [b"T{"] # <<<<<<<<<<<<<<
18648 * field = type.fields
18649 *
18650*/
18651 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1483, __pyx_L1_error)
18652 __Pyx_GOTREF(__pyx_t_2);
18653 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_T);
18654 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b_T);
18655 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_kp_b_T) != (0)) __PYX_ERR(1, 1483, __pyx_L1_error);
18656 __pyx_v_parts = ((PyObject*)__pyx_t_2);
18657 __pyx_t_2 = 0;
18658
18659 /* "BufferFormatFromTypeInfo":1484
18660 *
18661 * parts = [b"T{"]
18662 * field = type.fields # <<<<<<<<<<<<<<
18663 *
18664 * while field.type:
18665*/
18666 __pyx_t_3 = __pyx_v_type->fields;
18667
18668 __pyx_v_field = __pyx_t_3;
18669
18670 /* "BufferFormatFromTypeInfo":1486
18671 * field = type.fields
18672 *
18673 * while field.type: # <<<<<<<<<<<<<<
18674 * part = format_from_typeinfo(field.type)
18675 * parts.append(part + b':' + field.name + b':')
18676*/
18677 while (1) {
18678 __pyx_t_1 = (__pyx_v_field->type != 0);
18679
18680
18681 if (!__pyx_t_1) break;
18682
18683 /* "BufferFormatFromTypeInfo":1487
18684 *
18685 * while field.type:
18686 * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<<
18687 * parts.append(part + b':' + field.name + b':')
18688 * field += 1
18689*/
18690 __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1487, __pyx_L1_error)
18691 __Pyx_GOTREF(__pyx_t_2);
18692 __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
18693 __pyx_t_2 = 0;
18694
18695 /* "BufferFormatFromTypeInfo":1488
18696 * while field.type:
18697 * part = format_from_typeinfo(field.type)
18698 * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<<
18699 * field += 1
18700 *
18701*/
18702 __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_mstate_global->__pyx_kp_b__7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1488, __pyx_L1_error)
18703 __Pyx_GOTREF(__pyx_t_2);
18704 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1488, __pyx_L1_error)
18705 __Pyx_GOTREF(__pyx_t_4);
18706 __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1488, __pyx_L1_error)
18707 __Pyx_GOTREF(__pyx_t_5);
18708 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18709 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18710 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_mstate_global->__pyx_kp_b__7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1488, __pyx_L1_error)
18711 __Pyx_GOTREF(__pyx_t_4);
18712 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18713 __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1488, __pyx_L1_error)
18714 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18715
18716
18717 /* "BufferFormatFromTypeInfo":1489
18718 * part = format_from_typeinfo(field.type)
18719 * parts.append(part + b':' + field.name + b':')
18720 * field += 1 # <<<<<<<<<<<<<<
18721 *
18722 * result = alignment.join(parts) + b'}'
18723*/
18724 __pyx_v_field = (__pyx_v_field + 1);
18725 }
18726
18727 /* "BufferFormatFromTypeInfo":1491
18728 * field += 1
18729 *
18730 * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<<
18731 * else:
18732 * fmt = __Pyx_TypeInfoToFormat(type)
18733*/
18734 __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1491, __pyx_L1_error)
18735 __Pyx_GOTREF(__pyx_t_4);
18736 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_mstate_global->__pyx_kp_b__8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1491, __pyx_L1_error)
18737 __Pyx_GOTREF(__pyx_t_5);
18738 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18739 __pyx_v_result = ((PyObject*)__pyx_t_5);
18740 __pyx_t_5 = 0;
18741
18742 /* "BufferFormatFromTypeInfo":1474
18743 * cdef Py_ssize_t i
18744 *
18745 * if type.typegroup == 'S': # <<<<<<<<<<<<<<
18746 * assert type.fields != NULL
18747 * assert type.fields.type != NULL
18748*/
18749 goto __pyx_L3;
18750 }
18751
18752 /* "BufferFormatFromTypeInfo":1493
18753 * result = alignment.join(parts) + b'}'
18754 * else:
18755 * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<<
18756 * result = fmt.string
18757 * if type.arraysize[0]:
18758*/
18759 /*else*/ {
18760 __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
18761
18762 /* "BufferFormatFromTypeInfo":1494
18763 * else:
18764 * fmt = __Pyx_TypeInfoToFormat(type)
18765 * result = fmt.string # <<<<<<<<<<<<<<
18766 * if type.arraysize[0]:
18767 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
18768*/
18769 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1494, __pyx_L1_error)
18770 __Pyx_GOTREF(__pyx_t_5);
18771 __pyx_v_result = ((PyObject*)__pyx_t_5);
18772 __pyx_t_5 = 0;
18773
18774 /* "BufferFormatFromTypeInfo":1495
18775 * fmt = __Pyx_TypeInfoToFormat(type)
18776 * result = fmt.string
18777 * if type.arraysize[0]: # <<<<<<<<<<<<<<
18778 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
18779 * result = f"({u','.join(extents)})".encode('ascii') + result
18780*/
18781 __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
18782
18783 if (__pyx_t_1) {
18784
18785
18786 /* "BufferFormatFromTypeInfo":1496
18787 * result = fmt.string
18788 * if type.arraysize[0]:
18789 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)] # <<<<<<<<<<<<<<
18790 * result = f"({u','.join(extents)})".encode('ascii') + result
18791 *
18792*/
18793 { /* enter inner scope */
18794 __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1496, __pyx_L1_error)
18795 __Pyx_GOTREF(__pyx_t_5);
18796
18797 __pyx_t_7 = __pyx_v_type->ndim;
18798 __pyx_t_8 = __pyx_t_7;
18799
18800 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
18801 __pyx_7genexpr__pyx_v_i = __pyx_t_9;
18802 __pyx_t_4 = __Pyx_PyUnicode_From_size_t((__pyx_v_type->arraysize[__pyx_7genexpr__pyx_v_i]), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1496, __pyx_L1_error)
18803 __Pyx_GOTREF(__pyx_t_4);
18804 __Pyx_GIVEREF(__pyx_t_4);
18805 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_5, __pyx_t_4))) __PYX_ERR(1, 1496, __pyx_L1_error)
18806 __pyx_t_4 = 0;
18807 }
18808
18809 } /* exit inner scope */
18810 __pyx_v_extents = ((PyObject*)__pyx_t_5);
18811 __pyx_t_5 = 0;
18812
18813 /* "BufferFormatFromTypeInfo":1497
18814 * if type.arraysize[0]:
18815 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
18816 * result = f"({u','.join(extents)})".encode('ascii') + result # <<<<<<<<<<<<<<
18817 *
18818 * return result
18819*/
18820 __pyx_t_5 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__10, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1497, __pyx_L1_error)
18821 __Pyx_GOTREF(__pyx_t_5);
18822 __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u__9;
18823 __pyx_t_10[1] = __pyx_t_5;
18824 __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u__11;
18825 __pyx_t_9 = 2;
18826 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
18827 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[1]);
18828 #endif
18829 __pyx_t_7 = 0;
18830 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
18831 __pyx_t_7 |= __Pyx_PyUnicode_KIND_04(__pyx_t_10[1]);
18832 #endif
18833 __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, __pyx_t_9, __pyx_t_7);
18834 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1497, __pyx_L1_error)
18835 __Pyx_GOTREF(__pyx_t_4);
18836 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18837 __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1497, __pyx_L1_error)
18838 __Pyx_GOTREF(__pyx_t_5);
18839 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18840 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1497, __pyx_L1_error)
18841 __Pyx_GOTREF(__pyx_t_4);
18842 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18843 __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
18844 __pyx_t_4 = 0;
18845
18846 /* "BufferFormatFromTypeInfo":1495
18847 * fmt = __Pyx_TypeInfoToFormat(type)
18848 * result = fmt.string
18849 * if type.arraysize[0]: # <<<<<<<<<<<<<<
18850 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
18851 * result = f"({u','.join(extents)})".encode('ascii') + result
18852*/
18853 }
18854 }
18855 __pyx_L3:;
18856
18857 /* "BufferFormatFromTypeInfo":1499
18858 * result = f"({u','.join(extents)})".encode('ascii') + result
18859 *
18860 * return result # <<<<<<<<<<<<<<
18861*/
18862 {
18863 PyObject *__pyx_temp;
18864 {
18865 __pyx_temp = __pyx_r;
18866 __Pyx_INCREF(__pyx_v_result);
18867 __pyx_r = __pyx_v_result;
18868 }
18869 __Pyx_XDECREF(__pyx_temp);
18870 }
18871 goto __pyx_L0;
18872
18873 /* "BufferFormatFromTypeInfo":1467
18874 *
18875 *
18876 * @cname('__pyx_format_from_typeinfo') # <<<<<<<<<<<<<<
18877 * cdef bytes format_from_typeinfo(const __Pyx_TypeInfo *type):
18878 * cdef const __Pyx_StructField *field
18879*/
18880
18881 /* function exit code */
18882 __pyx_L1_error:;
18883 __Pyx_XDECREF(__pyx_t_2);
18884 __Pyx_XDECREF(__pyx_t_4);
18885 __Pyx_XDECREF(__pyx_t_5);
18886 __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
18887 __pyx_r = 0;
18888 __pyx_L0:;
18889
18890
18891 __Pyx_XDECREF(__pyx_v_part);
18892 __Pyx_XDECREF(__pyx_v_result);
18893 __Pyx_XDECREF(__pyx_v_alignment);
18894 __Pyx_XDECREF(__pyx_v_parts);
18895 __Pyx_XDECREF(__pyx_v_extents);
18896
18897 __Pyx_XGIVEREF(__pyx_r);
18898 __Pyx_RefNannyFinishContext();
18899 return __pyx_r;
18900}
18901
18902/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
18903 *
18904 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
18905 * @property # <<<<<<<<<<<<<<
18906 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
18907 * return PyDataType_TYPEOBJ(self)
18908*/
18909
18910static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
18911 PyTypeObject *__pyx_r;
18912
18913 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":232
18914 * @property
18915 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
18916 * return PyDataType_TYPEOBJ(self) # <<<<<<<<<<<<<<
18917 *
18918 * @property
18919*/
18920 {
18921
18922 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
18923 }
18924 goto __pyx_L0;
18925
18926 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
18927 *
18928 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
18929 * @property # <<<<<<<<<<<<<<
18930 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
18931 * return PyDataType_TYPEOBJ(self)
18932*/
18933
18934 /* function exit code */
18935 __pyx_L0:;
18936 return __pyx_r;
18937}
18938
18939/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
18940 * return PyDataType_TYPEOBJ(self)
18941 *
18942 * @property # <<<<<<<<<<<<<<
18943 * cdef inline char kind(self) noexcept nogil:
18944 * return PyDataType_KIND(self)
18945*/
18946
18947static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
18948 char __pyx_r;
18949
18950 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":236
18951 * @property
18952 * cdef inline char kind(self) noexcept nogil:
18953 * return PyDataType_KIND(self) # <<<<<<<<<<<<<<
18954 *
18955 * @property
18956*/
18957 {
18958
18959 __pyx_r = PyDataType_KIND(__pyx_v_self);
18960 }
18961 goto __pyx_L0;
18962
18963 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
18964 * return PyDataType_TYPEOBJ(self)
18965 *
18966 * @property # <<<<<<<<<<<<<<
18967 * cdef inline char kind(self) noexcept nogil:
18968 * return PyDataType_KIND(self)
18969*/
18970
18971 /* function exit code */
18972 __pyx_L0:;
18973 return __pyx_r;
18974}
18975
18976/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
18977 * return PyDataType_KIND(self)
18978 *
18979 * @property # <<<<<<<<<<<<<<
18980 * cdef inline char type(self) noexcept nogil:
18981 * return PyDataType_TYPE(self)
18982*/
18983
18984static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
18985 char __pyx_r;
18986
18987 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":240
18988 * @property
18989 * cdef inline char type(self) noexcept nogil:
18990 * return PyDataType_TYPE(self) # <<<<<<<<<<<<<<
18991 *
18992 * # Numpy sometimes mutates this without warning (e.g. it'll
18993*/
18994 {
18995
18996 __pyx_r = PyDataType_TYPE(__pyx_v_self);
18997 }
18998 goto __pyx_L0;
18999
19000 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
19001 * return PyDataType_KIND(self)
19002 *
19003 * @property # <<<<<<<<<<<<<<
19004 * cdef inline char type(self) noexcept nogil:
19005 * return PyDataType_TYPE(self)
19006*/
19007
19008 /* function exit code */
19009 __pyx_L0:;
19010 return __pyx_r;
19011}
19012
19013/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
19014 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
19015 * # directly accessing this field.
19016 * @property # <<<<<<<<<<<<<<
19017 * cdef inline char byteorder(self) noexcept nogil:
19018 * return PyDataType_BYTEORDER(self)
19019*/
19020
19021static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
19022 char __pyx_r;
19023
19024 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":249
19025 * @property
19026 * cdef inline char byteorder(self) noexcept nogil:
19027 * return PyDataType_BYTEORDER(self) # <<<<<<<<<<<<<<
19028 *
19029 * @property
19030*/
19031 {
19032
19033 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
19034 }
19035 goto __pyx_L0;
19036
19037 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
19038 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
19039 * # directly accessing this field.
19040 * @property # <<<<<<<<<<<<<<
19041 * cdef inline char byteorder(self) noexcept nogil:
19042 * return PyDataType_BYTEORDER(self)
19043*/
19044
19045 /* function exit code */
19046 __pyx_L0:;
19047 return __pyx_r;
19048}
19049
19050/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
19051 * return PyDataType_BYTEORDER(self)
19052 *
19053 * @property # <<<<<<<<<<<<<<
19054 * cdef inline int type_num(self) noexcept nogil:
19055 * return PyDataType_TYPENUM(self)
19056*/
19057
19058static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
19059 int __pyx_r;
19060
19061 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":253
19062 * @property
19063 * cdef inline int type_num(self) noexcept nogil:
19064 * return PyDataType_TYPENUM(self) # <<<<<<<<<<<<<<
19065 *
19066 * @property
19067*/
19068 {
19069
19070 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
19071 }
19072 goto __pyx_L0;
19073
19074 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
19075 * return PyDataType_BYTEORDER(self)
19076 *
19077 * @property # <<<<<<<<<<<<<<
19078 * cdef inline int type_num(self) noexcept nogil:
19079 * return PyDataType_TYPENUM(self)
19080*/
19081
19082 /* function exit code */
19083 __pyx_L0:;
19084 return __pyx_r;
19085}
19086
19087/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
19088 * return PyDataType_TYPENUM(self)
19089 *
19090 * @property # <<<<<<<<<<<<<<
19091 * cdef inline npy_intp itemsize(self) noexcept nogil:
19092 * return PyDataType_ELSIZE(self)
19093*/
19094
19095static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
19096 npy_intp __pyx_r;
19097
19098 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":257
19099 * @property
19100 * cdef inline npy_intp itemsize(self) noexcept nogil:
19101 * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
19102 *
19103 * @property
19104*/
19105 {
19106
19107 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
19108 }
19109 goto __pyx_L0;
19110
19111 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
19112 * return PyDataType_TYPENUM(self)
19113 *
19114 * @property # <<<<<<<<<<<<<<
19115 * cdef inline npy_intp itemsize(self) noexcept nogil:
19116 * return PyDataType_ELSIZE(self)
19117*/
19118
19119 /* function exit code */
19120 __pyx_L0:;
19121 return __pyx_r;
19122}
19123
19124/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
19125 * return PyDataType_ELSIZE(self)
19126 *
19127 * @property # <<<<<<<<<<<<<<
19128 * cdef inline npy_intp alignment(self) noexcept nogil:
19129 * return PyDataType_ALIGNMENT(self)
19130*/
19131
19132static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
19133 npy_intp __pyx_r;
19134
19135 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":261
19136 * @property
19137 * cdef inline npy_intp alignment(self) noexcept nogil:
19138 * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
19139 *
19140 * # Use fields/names with care as they may be NULL. You must check
19141*/
19142 {
19143
19144 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
19145 }
19146 goto __pyx_L0;
19147
19148 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
19149 * return PyDataType_ELSIZE(self)
19150 *
19151 * @property # <<<<<<<<<<<<<<
19152 * cdef inline npy_intp alignment(self) noexcept nogil:
19153 * return PyDataType_ALIGNMENT(self)
19154*/
19155
19156 /* function exit code */
19157 __pyx_L0:;
19158 return __pyx_r;
19159}
19160
19161/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
19162 * # Use fields/names with care as they may be NULL. You must check
19163 * # for this using PyDataType_HASFIELDS.
19164 * @property # <<<<<<<<<<<<<<
19165 * cdef inline object fields(self):
19166 * return <object>PyDataType_FIELDS(self)
19167*/
19168
19169static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
19170 PyObject *__pyx_r = NULL;
19171 __Pyx_RefNannyDeclarations
19172 PyObject *__pyx_t_1;
19173 __Pyx_RefNannySetupContext("__get__", 0);
19174
19175 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":267
19176 * @property
19177 * cdef inline object fields(self):
19178 * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
19179 *
19180 * @property
19181*/
19182 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
19183
19184 {
19185 PyObject *__pyx_temp;
19186 {
19187 __pyx_temp = __pyx_r;
19188 __Pyx_INCREF(((PyObject *)__pyx_t_1));
19189 __pyx_r = ((PyObject *)__pyx_t_1);
19190 }
19191 __Pyx_XDECREF(__pyx_temp);
19192 }
19193
19194 goto __pyx_L0;
19195
19196 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
19197 * # Use fields/names with care as they may be NULL. You must check
19198 * # for this using PyDataType_HASFIELDS.
19199 * @property # <<<<<<<<<<<<<<
19200 * cdef inline object fields(self):
19201 * return <object>PyDataType_FIELDS(self)
19202*/
19203
19204 /* function exit code */
19205 __pyx_L0:;
19206 __Pyx_XGIVEREF(__pyx_r);
19207 __Pyx_RefNannyFinishContext();
19208 return __pyx_r;
19209}
19210
19211/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
19212 * return <object>PyDataType_FIELDS(self)
19213 *
19214 * @property # <<<<<<<<<<<<<<
19215 * cdef inline tuple names(self):
19216 * return <tuple>PyDataType_NAMES(self)
19217*/
19218
19219static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
19220 PyObject *__pyx_r = NULL;
19221 __Pyx_RefNannyDeclarations
19222 PyObject *__pyx_t_1;
19223 __Pyx_RefNannySetupContext("__get__", 0);
19224
19225 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":271
19226 * @property
19227 * cdef inline tuple names(self):
19228 * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
19229 *
19230 * # Use PyDataType_HASSUBARRAY to test whether this field is
19231*/
19232 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
19233
19234 {
19235 PyObject *__pyx_temp;
19236 {
19237 __pyx_temp = __pyx_r;
19238 __Pyx_INCREF(((PyObject*)__pyx_t_1));
19239 __pyx_r = ((PyObject*)__pyx_t_1);
19240 }
19241 __Pyx_XDECREF(__pyx_temp);
19242 }
19243
19244 goto __pyx_L0;
19245
19246 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
19247 * return <object>PyDataType_FIELDS(self)
19248 *
19249 * @property # <<<<<<<<<<<<<<
19250 * cdef inline tuple names(self):
19251 * return <tuple>PyDataType_NAMES(self)
19252*/
19253
19254 /* function exit code */
19255 __pyx_L0:;
19256 __Pyx_XGIVEREF(__pyx_r);
19257 __Pyx_RefNannyFinishContext();
19258 return __pyx_r;
19259}
19260
19261/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
19262 * # valid (the pointer can be NULL). Most users should access
19263 * # this field via the inline helper method PyDataType_SHAPE.
19264 * @property # <<<<<<<<<<<<<<
19265 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19266 * return PyDataType_SUBARRAY(self)
19267*/
19268
19269static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
19270 PyArray_ArrayDescr *__pyx_r;
19271
19272 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":278
19273 * @property
19274 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19275 * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
19276 *
19277 * @property
19278*/
19279 {
19280
19281 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
19282 }
19283 goto __pyx_L0;
19284
19285 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
19286 * # valid (the pointer can be NULL). Most users should access
19287 * # this field via the inline helper method PyDataType_SHAPE.
19288 * @property # <<<<<<<<<<<<<<
19289 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19290 * return PyDataType_SUBARRAY(self)
19291*/
19292
19293 /* function exit code */
19294 __pyx_L0:;
19295 return __pyx_r;
19296}
19297
19298/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
19299 * return PyDataType_SUBARRAY(self)
19300 *
19301 * @property # <<<<<<<<<<<<<<
19302 * cdef inline npy_uint64 flags(self) noexcept nogil:
19303 * """The data types flags."""
19304*/
19305
19306static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
19307 npy_uint64 __pyx_r;
19308
19309 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":283
19310 * cdef inline npy_uint64 flags(self) noexcept nogil:
19311 * """The data types flags."""
19312 * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
19313 *
19314 *
19315*/
19316 {
19317
19318 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
19319 }
19320 goto __pyx_L0;
19321
19322 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
19323 * return PyDataType_SUBARRAY(self)
19324 *
19325 * @property # <<<<<<<<<<<<<<
19326 * cdef inline npy_uint64 flags(self) noexcept nogil:
19327 * """The data types flags."""
19328*/
19329
19330 /* function exit code */
19331 __pyx_L0:;
19332 return __pyx_r;
19333}
19334
19335/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
19336 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
19337 *
19338 * @property # <<<<<<<<<<<<<<
19339 * cdef inline int numiter(self) noexcept nogil:
19340 * """The number of arrays that need to be broadcast to the same shape."""
19341*/
19342
19343static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
19344 int __pyx_r;
19345
19346 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":295
19347 * cdef inline int numiter(self) noexcept nogil:
19348 * """The number of arrays that need to be broadcast to the same shape."""
19349 * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
19350 *
19351 * @property
19352*/
19353 {
19354
19355 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
19356 }
19357 goto __pyx_L0;
19358
19359 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
19360 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
19361 *
19362 * @property # <<<<<<<<<<<<<<
19363 * cdef inline int numiter(self) noexcept nogil:
19364 * """The number of arrays that need to be broadcast to the same shape."""
19365*/
19366
19367 /* function exit code */
19368 __pyx_L0:;
19369 return __pyx_r;
19370}
19371
19372/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
19373 * return PyArray_MultiIter_NUMITER(self)
19374 *
19375 * @property # <<<<<<<<<<<<<<
19376 * cdef inline npy_intp size(self) noexcept nogil:
19377 * """The total broadcasted size."""
19378*/
19379
19380static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
19381 npy_intp __pyx_r;
19382
19383 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":300
19384 * cdef inline npy_intp size(self) noexcept nogil:
19385 * """The total broadcasted size."""
19386 * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
19387 *
19388 * @property
19389*/
19390 {
19391
19392 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
19393 }
19394 goto __pyx_L0;
19395
19396 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
19397 * return PyArray_MultiIter_NUMITER(self)
19398 *
19399 * @property # <<<<<<<<<<<<<<
19400 * cdef inline npy_intp size(self) noexcept nogil:
19401 * """The total broadcasted size."""
19402*/
19403
19404 /* function exit code */
19405 __pyx_L0:;
19406 return __pyx_r;
19407}
19408
19409/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
19410 * return PyArray_MultiIter_SIZE(self)
19411 *
19412 * @property # <<<<<<<<<<<<<<
19413 * cdef inline npy_intp index(self) noexcept nogil:
19414 * """The current (1-d) index into the broadcasted result."""
19415*/
19416
19417static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
19418 npy_intp __pyx_r;
19419
19420 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":305
19421 * cdef inline npy_intp index(self) noexcept nogil:
19422 * """The current (1-d) index into the broadcasted result."""
19423 * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
19424 *
19425 * @property
19426*/
19427 {
19428
19429 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
19430 }
19431 goto __pyx_L0;
19432
19433 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
19434 * return PyArray_MultiIter_SIZE(self)
19435 *
19436 * @property # <<<<<<<<<<<<<<
19437 * cdef inline npy_intp index(self) noexcept nogil:
19438 * """The current (1-d) index into the broadcasted result."""
19439*/
19440
19441 /* function exit code */
19442 __pyx_L0:;
19443 return __pyx_r;
19444}
19445
19446/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
19447 * return PyArray_MultiIter_INDEX(self)
19448 *
19449 * @property # <<<<<<<<<<<<<<
19450 * cdef inline int nd(self) noexcept nogil:
19451 * """The number of dimensions in the broadcasted result."""
19452*/
19453
19454static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
19455 int __pyx_r;
19456
19457 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":310
19458 * cdef inline int nd(self) noexcept nogil:
19459 * """The number of dimensions in the broadcasted result."""
19460 * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
19461 *
19462 * @property
19463*/
19464 {
19465
19466 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
19467 }
19468 goto __pyx_L0;
19469
19470 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
19471 * return PyArray_MultiIter_INDEX(self)
19472 *
19473 * @property # <<<<<<<<<<<<<<
19474 * cdef inline int nd(self) noexcept nogil:
19475 * """The number of dimensions in the broadcasted result."""
19476*/
19477
19478 /* function exit code */
19479 __pyx_L0:;
19480 return __pyx_r;
19481}
19482
19483/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
19484 * return PyArray_MultiIter_NDIM(self)
19485 *
19486 * @property # <<<<<<<<<<<<<<
19487 * cdef inline npy_intp* dimensions(self) noexcept nogil:
19488 * """The shape of the broadcasted result."""
19489*/
19490
19491static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
19492 npy_intp *__pyx_r;
19493
19494 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":315
19495 * cdef inline npy_intp* dimensions(self) noexcept nogil:
19496 * """The shape of the broadcasted result."""
19497 * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
19498 *
19499 * @property
19500*/
19501 {
19502
19503 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
19504 }
19505 goto __pyx_L0;
19506
19507 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
19508 * return PyArray_MultiIter_NDIM(self)
19509 *
19510 * @property # <<<<<<<<<<<<<<
19511 * cdef inline npy_intp* dimensions(self) noexcept nogil:
19512 * """The shape of the broadcasted result."""
19513*/
19514
19515 /* function exit code */
19516 __pyx_L0:;
19517 return __pyx_r;
19518}
19519
19520/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
19521 * return PyArray_MultiIter_DIMS(self)
19522 *
19523 * @property # <<<<<<<<<<<<<<
19524 * cdef inline void** iters(self) noexcept nogil:
19525 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19526*/
19527
19528static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
19529 void **__pyx_r;
19530
19531 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":321
19532 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19533 * On return, the iterators are adjusted for broadcasting."""
19534 * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
19535 *
19536 *
19537*/
19538 {
19539
19540 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
19541 }
19542 goto __pyx_L0;
19543
19544 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
19545 * return PyArray_MultiIter_DIMS(self)
19546 *
19547 * @property # <<<<<<<<<<<<<<
19548 * cdef inline void** iters(self) noexcept nogil:
19549 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19550*/
19551
19552 /* function exit code */
19553 __pyx_L0:;
19554 return __pyx_r;
19555}
19556
19557/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
19558 * # Instead, we use properties that map to the corresponding C-API functions.
19559 *
19560 * @property # <<<<<<<<<<<<<<
19561 * cdef inline PyObject* base(self) noexcept nogil:
19562 * """Returns a borrowed reference to the object owning the data/memory.
19563*/
19564
19565static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
19566 PyObject *__pyx_r;
19567
19568 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":339
19569 * """Returns a borrowed reference to the object owning the data/memory.
19570 * """
19571 * return PyArray_BASE(self) # <<<<<<<<<<<<<<
19572 *
19573 * @property
19574*/
19575 {
19576
19577 __pyx_r = PyArray_BASE(__pyx_v_self);
19578 }
19579 goto __pyx_L0;
19580
19581 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
19582 * # Instead, we use properties that map to the corresponding C-API functions.
19583 *
19584 * @property # <<<<<<<<<<<<<<
19585 * cdef inline PyObject* base(self) noexcept nogil:
19586 * """Returns a borrowed reference to the object owning the data/memory.
19587*/
19588
19589 /* function exit code */
19590 __pyx_L0:;
19591 return __pyx_r;
19592}
19593
19594/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
19595 * return PyArray_BASE(self)
19596 *
19597 * @property # <<<<<<<<<<<<<<
19598 * cdef inline dtype descr(self):
19599 * """Returns an owned reference to the dtype of the array.
19600*/
19601
19602static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
19603 PyArray_Descr *__pyx_r = NULL;
19604 __Pyx_RefNannyDeclarations
19605 PyArray_Descr *__pyx_t_1;
19606 __Pyx_RefNannySetupContext("__get__", 0);
19607
19608 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":345
19609 * """Returns an owned reference to the dtype of the array.
19610 * """
19611 * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
19612 *
19613 * @property
19614*/
19615 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
19616
19617 {
19618 PyArray_Descr *__pyx_temp;
19619 {
19620 __pyx_temp = __pyx_r;
19621 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
19622 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19623 }
19624 __Pyx_XDECREF((PyObject *)__pyx_temp);
19625 }
19626
19627 goto __pyx_L0;
19628
19629 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
19630 * return PyArray_BASE(self)
19631 *
19632 * @property # <<<<<<<<<<<<<<
19633 * cdef inline dtype descr(self):
19634 * """Returns an owned reference to the dtype of the array.
19635*/
19636
19637 /* function exit code */
19638 __pyx_L0:;
19639 __Pyx_XGIVEREF((PyObject *)__pyx_r);
19640 __Pyx_RefNannyFinishContext();
19641 return __pyx_r;
19642}
19643
19644/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
19645 * return <dtype>PyArray_DESCR(self)
19646 *
19647 * @property # <<<<<<<<<<<<<<
19648 * cdef inline int ndim(self) noexcept nogil:
19649 * """Returns the number of dimensions in the array.
19650*/
19651
19652static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
19653 int __pyx_r;
19654
19655 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":351
19656 * """Returns the number of dimensions in the array.
19657 * """
19658 * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
19659 *
19660 * @property
19661*/
19662 {
19663
19664 __pyx_r = PyArray_NDIM(__pyx_v_self);
19665 }
19666 goto __pyx_L0;
19667
19668 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
19669 * return <dtype>PyArray_DESCR(self)
19670 *
19671 * @property # <<<<<<<<<<<<<<
19672 * cdef inline int ndim(self) noexcept nogil:
19673 * """Returns the number of dimensions in the array.
19674*/
19675
19676 /* function exit code */
19677 __pyx_L0:;
19678 return __pyx_r;
19679}
19680
19681/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
19682 * return PyArray_NDIM(self)
19683 *
19684 * @property # <<<<<<<<<<<<<<
19685 * cdef inline npy_intp *shape(self) noexcept nogil:
19686 * """Returns a pointer to the dimensions/shape of the array.
19687*/
19688
19689static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
19690 npy_intp *__pyx_r;
19691
19692 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":359
19693 * Can return NULL for 0-dimensional arrays.
19694 * """
19695 * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
19696 *
19697 * @property
19698*/
19699 {
19700
19701 __pyx_r = PyArray_DIMS(__pyx_v_self);
19702 }
19703 goto __pyx_L0;
19704
19705 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
19706 * return PyArray_NDIM(self)
19707 *
19708 * @property # <<<<<<<<<<<<<<
19709 * cdef inline npy_intp *shape(self) noexcept nogil:
19710 * """Returns a pointer to the dimensions/shape of the array.
19711*/
19712
19713 /* function exit code */
19714 __pyx_L0:;
19715 return __pyx_r;
19716}
19717
19718/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
19719 * return PyArray_DIMS(self)
19720 *
19721 * @property # <<<<<<<<<<<<<<
19722 * cdef inline npy_intp *strides(self) noexcept nogil:
19723 * """Returns a pointer to the strides of the array.
19724*/
19725
19726static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
19727 npy_intp *__pyx_r;
19728
19729 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":366
19730 * The number of elements matches the number of dimensions of the array (ndim).
19731 * """
19732 * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
19733 *
19734 * @property
19735*/
19736 {
19737
19738 __pyx_r = PyArray_STRIDES(__pyx_v_self);
19739 }
19740 goto __pyx_L0;
19741
19742 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
19743 * return PyArray_DIMS(self)
19744 *
19745 * @property # <<<<<<<<<<<<<<
19746 * cdef inline npy_intp *strides(self) noexcept nogil:
19747 * """Returns a pointer to the strides of the array.
19748*/
19749
19750 /* function exit code */
19751 __pyx_L0:;
19752 return __pyx_r;
19753}
19754
19755/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
19756 * return PyArray_STRIDES(self)
19757 *
19758 * @property # <<<<<<<<<<<<<<
19759 * cdef inline npy_intp size(self) noexcept nogil:
19760 * """Returns the total size (in number of elements) of the array.
19761*/
19762
19763static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
19764 npy_intp __pyx_r;
19765
19766 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":372
19767 * """Returns the total size (in number of elements) of the array.
19768 * """
19769 * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
19770 *
19771 * @property
19772*/
19773 {
19774
19775 __pyx_r = PyArray_SIZE(__pyx_v_self);
19776 }
19777 goto __pyx_L0;
19778
19779 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
19780 * return PyArray_STRIDES(self)
19781 *
19782 * @property # <<<<<<<<<<<<<<
19783 * cdef inline npy_intp size(self) noexcept nogil:
19784 * """Returns the total size (in number of elements) of the array.
19785*/
19786
19787 /* function exit code */
19788 __pyx_L0:;
19789 return __pyx_r;
19790}
19791
19792/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
19793 * return PyArray_SIZE(self)
19794 *
19795 * @property # <<<<<<<<<<<<<<
19796 * cdef inline char* data(self) noexcept nogil:
19797 * """The pointer to the data buffer as a char*.
19798*/
19799
19800static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
19801 char *__pyx_r;
19802
19803 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":381
19804 * of `PyArray_DATA()` instead, which returns a 'void*'.
19805 * """
19806 * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
19807 *
19808 *
19809*/
19810 {
19811
19812 __pyx_r = PyArray_BYTES(__pyx_v_self);
19813 }
19814 goto __pyx_L0;
19815
19816 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
19817 * return PyArray_SIZE(self)
19818 *
19819 * @property # <<<<<<<<<<<<<<
19820 * cdef inline char* data(self) noexcept nogil:
19821 * """The pointer to the data buffer as a char*.
19822*/
19823
19824 /* function exit code */
19825 __pyx_L0:;
19826 return __pyx_r;
19827}
19828
19829/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
19830 * ctypedef long double complex clongdouble_t
19831 *
19832 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19833 * return PyArray_MultiIterNew(1, <void*>a)
19834 *
19835*/
19836
19837static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19838 PyObject *__pyx_r = NULL;
19839 __Pyx_RefNannyDeclarations
19840 PyObject *__pyx_t_1 = NULL;
19841 int __pyx_lineno = 0;
19842 const char *__pyx_filename = NULL;
19843 int __pyx_clineno = 0;
19844 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
19845
19846 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":795
19847 *
19848 * cdef inline object PyArray_MultiIterNew1(a):
19849 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
19850 *
19851 * cdef inline object PyArray_MultiIterNew2(a, b):
19852*/
19853 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 795, __pyx_L1_error)
19854 __Pyx_GOTREF(__pyx_t_1);
19855 {
19856 PyObject *__pyx_temp;
19857 {
19858 __pyx_temp = __pyx_r;
19859 __pyx_r = __pyx_t_1;
19860 }
19861 __Pyx_XDECREF(__pyx_temp);
19862 }
19863 __pyx_t_1 = 0;
19864 goto __pyx_L0;
19865
19866 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
19867 * ctypedef long double complex clongdouble_t
19868 *
19869 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19870 * return PyArray_MultiIterNew(1, <void*>a)
19871 *
19872*/
19873
19874 /* function exit code */
19875 __pyx_L1_error:;
19876 __Pyx_XDECREF(__pyx_t_1);
19877 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19878 __pyx_r = 0;
19879 __pyx_L0:;
19880 __Pyx_XGIVEREF(__pyx_r);
19881 __Pyx_RefNannyFinishContext();
19882 return __pyx_r;
19883}
19884
19885/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
19886 * return PyArray_MultiIterNew(1, <void*>a)
19887 *
19888 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19889 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19890 *
19891*/
19892
19893static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19894 PyObject *__pyx_r = NULL;
19895 __Pyx_RefNannyDeclarations
19896 PyObject *__pyx_t_1 = NULL;
19897 int __pyx_lineno = 0;
19898 const char *__pyx_filename = NULL;
19899 int __pyx_clineno = 0;
19900 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
19901
19902 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":798
19903 *
19904 * cdef inline object PyArray_MultiIterNew2(a, b):
19905 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
19906 *
19907 * cdef inline object PyArray_MultiIterNew3(a, b, c):
19908*/
19909 __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 798, __pyx_L1_error)
19910 __Pyx_GOTREF(__pyx_t_1);
19911 {
19912 PyObject *__pyx_temp;
19913 {
19914 __pyx_temp = __pyx_r;
19915 __pyx_r = __pyx_t_1;
19916 }
19917 __Pyx_XDECREF(__pyx_temp);
19918 }
19919 __pyx_t_1 = 0;
19920 goto __pyx_L0;
19921
19922 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
19923 * return PyArray_MultiIterNew(1, <void*>a)
19924 *
19925 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19926 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19927 *
19928*/
19929
19930 /* function exit code */
19931 __pyx_L1_error:;
19932 __Pyx_XDECREF(__pyx_t_1);
19933 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19934 __pyx_r = 0;
19935 __pyx_L0:;
19936 __Pyx_XGIVEREF(__pyx_r);
19937 __Pyx_RefNannyFinishContext();
19938 return __pyx_r;
19939}
19940
19941/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
19942 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19943 *
19944 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19945 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19946 *
19947*/
19948
19949static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19950 PyObject *__pyx_r = NULL;
19951 __Pyx_RefNannyDeclarations
19952 PyObject *__pyx_t_1 = NULL;
19953 int __pyx_lineno = 0;
19954 const char *__pyx_filename = NULL;
19955 int __pyx_clineno = 0;
19956 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
19957
19958 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":801
19959 *
19960 * cdef inline object PyArray_MultiIterNew3(a, b, c):
19961 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
19962 *
19963 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19964*/
19965 __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 801, __pyx_L1_error)
19966 __Pyx_GOTREF(__pyx_t_1);
19967 {
19968 PyObject *__pyx_temp;
19969 {
19970 __pyx_temp = __pyx_r;
19971 __pyx_r = __pyx_t_1;
19972 }
19973 __Pyx_XDECREF(__pyx_temp);
19974 }
19975 __pyx_t_1 = 0;
19976 goto __pyx_L0;
19977
19978 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
19979 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19980 *
19981 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19982 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19983 *
19984*/
19985
19986 /* function exit code */
19987 __pyx_L1_error:;
19988 __Pyx_XDECREF(__pyx_t_1);
19989 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19990 __pyx_r = 0;
19991 __pyx_L0:;
19992 __Pyx_XGIVEREF(__pyx_r);
19993 __Pyx_RefNannyFinishContext();
19994 return __pyx_r;
19995}
19996
19997/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
19998 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19999 *
20000 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
20001 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20002 *
20003*/
20004
20005static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
20006 PyObject *__pyx_r = NULL;
20007 __Pyx_RefNannyDeclarations
20008 PyObject *__pyx_t_1 = NULL;
20009 int __pyx_lineno = 0;
20010 const char *__pyx_filename = NULL;
20011 int __pyx_clineno = 0;
20012 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
20013
20014 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":804
20015 *
20016 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
20017 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
20018 *
20019 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
20020*/
20021 __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 804, __pyx_L1_error)
20022 __Pyx_GOTREF(__pyx_t_1);
20023 {
20024 PyObject *__pyx_temp;
20025 {
20026 __pyx_temp = __pyx_r;
20027 __pyx_r = __pyx_t_1;
20028 }
20029 __Pyx_XDECREF(__pyx_temp);
20030 }
20031 __pyx_t_1 = 0;
20032 goto __pyx_L0;
20033
20034 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
20035 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20036 *
20037 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
20038 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20039 *
20040*/
20041
20042 /* function exit code */
20043 __pyx_L1_error:;
20044 __Pyx_XDECREF(__pyx_t_1);
20045 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20046 __pyx_r = 0;
20047 __pyx_L0:;
20048 __Pyx_XGIVEREF(__pyx_r);
20049 __Pyx_RefNannyFinishContext();
20050 return __pyx_r;
20051}
20052
20053/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
20054 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20055 *
20056 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
20057 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20058 *
20059*/
20060
20061static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
20062 PyObject *__pyx_r = NULL;
20063 __Pyx_RefNannyDeclarations
20064 PyObject *__pyx_t_1 = NULL;
20065 int __pyx_lineno = 0;
20066 const char *__pyx_filename = NULL;
20067 int __pyx_clineno = 0;
20068 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
20069
20070 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":807
20071 *
20072 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
20073 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
20074 *
20075 * cdef inline tuple PyDataType_SHAPE(dtype d):
20076*/
20077 __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 807, __pyx_L1_error)
20078 __Pyx_GOTREF(__pyx_t_1);
20079 {
20080 PyObject *__pyx_temp;
20081 {
20082 __pyx_temp = __pyx_r;
20083 __pyx_r = __pyx_t_1;
20084 }
20085 __Pyx_XDECREF(__pyx_temp);
20086 }
20087 __pyx_t_1 = 0;
20088 goto __pyx_L0;
20089
20090 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
20091 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20092 *
20093 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
20094 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20095 *
20096*/
20097
20098 /* function exit code */
20099 __pyx_L1_error:;
20100 __Pyx_XDECREF(__pyx_t_1);
20101 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
20102 __pyx_r = 0;
20103 __pyx_L0:;
20104 __Pyx_XGIVEREF(__pyx_r);
20105 __Pyx_RefNannyFinishContext();
20106 return __pyx_r;
20107}
20108
20109/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
20110 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20111 *
20112 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20113 * if PyDataType_HASSUBARRAY(d):
20114 * return <tuple>d.subarray.shape
20115*/
20116
20117static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
20118 PyObject *__pyx_r = NULL;
20119 __Pyx_RefNannyDeclarations
20120 int __pyx_t_1;
20121 PyObject *__pyx_t_2;
20122 __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
20123
20124 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
20125 *
20126 * cdef inline tuple PyDataType_SHAPE(dtype d):
20127 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20128 * return <tuple>d.subarray.shape
20129 * else:
20130*/
20131 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
20132
20133 if (__pyx_t_1) {
20134
20135
20136 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":811
20137 * cdef inline tuple PyDataType_SHAPE(dtype d):
20138 * if PyDataType_HASSUBARRAY(d):
20139 * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
20140 * else:
20141 * return ()
20142*/
20143 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
20144
20145 {
20146 PyObject *__pyx_temp;
20147 {
20148 __pyx_temp = __pyx_r;
20149 __Pyx_INCREF(((PyObject*)__pyx_t_2));
20150 __pyx_r = ((PyObject*)__pyx_t_2);
20151 }
20152 __Pyx_XDECREF(__pyx_temp);
20153 }
20154
20155 goto __pyx_L0;
20156
20157 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
20158 *
20159 * cdef inline tuple PyDataType_SHAPE(dtype d):
20160 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20161 * return <tuple>d.subarray.shape
20162 * else:
20163*/
20164 }
20165
20166 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":813
20167 * return <tuple>d.subarray.shape
20168 * else:
20169 * return () # <<<<<<<<<<<<<<
20170 *
20171 *
20172*/
20173 /*else*/ {
20174 {
20175 PyObject *__pyx_temp;
20176 {
20177 __pyx_temp = __pyx_r;
20178 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
20179 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
20180 }
20181 __Pyx_XDECREF(__pyx_temp);
20182 }
20183 goto __pyx_L0;
20184 }
20185
20186 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
20187 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20188 *
20189 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20190 * if PyDataType_HASSUBARRAY(d):
20191 * return <tuple>d.subarray.shape
20192*/
20193
20194 /* function exit code */
20195 __pyx_L0:;
20196 __Pyx_XGIVEREF(__pyx_r);
20197 __Pyx_RefNannyFinishContext();
20198 return __pyx_r;
20199}
20200
20201/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
20202 *
20203 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
20204 * @property # <<<<<<<<<<<<<<
20205 * cdef inline int nin(self) noexcept nogil:
20206 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20207*/
20208
20209static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
20210 int __pyx_r;
20211
20212 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":949
20213 * @property
20214 * cdef inline int nin(self) noexcept nogil:
20215 * return _PyUFuncObject_GET_ITEM_DATA(self).nin # <<<<<<<<<<<<<<
20216 *
20217 * @property
20218*/
20219 {
20220
20221 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
20222 }
20223 goto __pyx_L0;
20224
20225 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
20226 *
20227 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
20228 * @property # <<<<<<<<<<<<<<
20229 * cdef inline int nin(self) noexcept nogil:
20230 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20231*/
20232
20233 /* function exit code */
20234 __pyx_L0:;
20235 return __pyx_r;
20236}
20237
20238/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
20239 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20240 *
20241 * @property # <<<<<<<<<<<<<<
20242 * cdef inline int nout(self) noexcept nogil:
20243 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20244*/
20245
20246static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
20247 int __pyx_r;
20248
20249 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":953
20250 * @property
20251 * cdef inline int nout(self) noexcept nogil:
20252 * return _PyUFuncObject_GET_ITEM_DATA(self).nout # <<<<<<<<<<<<<<
20253 *
20254 * @property
20255*/
20256 {
20257
20258 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
20259 }
20260 goto __pyx_L0;
20261
20262 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
20263 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20264 *
20265 * @property # <<<<<<<<<<<<<<
20266 * cdef inline int nout(self) noexcept nogil:
20267 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20268*/
20269
20270 /* function exit code */
20271 __pyx_L0:;
20272 return __pyx_r;
20273}
20274
20275/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
20276 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20277 *
20278 * @property # <<<<<<<<<<<<<<
20279 * cdef inline int nargs(self) noexcept nogil:
20280 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20281*/
20282
20283static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
20284 int __pyx_r;
20285
20286 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":957
20287 * @property
20288 * cdef inline int nargs(self) noexcept nogil:
20289 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs # <<<<<<<<<<<<<<
20290 *
20291 * @property
20292*/
20293 {
20294
20295 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
20296 }
20297 goto __pyx_L0;
20298
20299 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
20300 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20301 *
20302 * @property # <<<<<<<<<<<<<<
20303 * cdef inline int nargs(self) noexcept nogil:
20304 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20305*/
20306
20307 /* function exit code */
20308 __pyx_L0:;
20309 return __pyx_r;
20310}
20311
20312/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
20313 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20314 *
20315 * @property # <<<<<<<<<<<<<<
20316 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20317 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20318*/
20319
20320static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
20321 PyUFuncGenericFunction *__pyx_r;
20322
20323 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":961
20324 * @property
20325 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20326 * return _PyUFuncObject_GET_ITEM_DATA(self).functions # <<<<<<<<<<<<<<
20327 *
20328 * @property
20329*/
20330 {
20331
20332 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
20333 }
20334 goto __pyx_L0;
20335
20336 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
20337 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20338 *
20339 * @property # <<<<<<<<<<<<<<
20340 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20341 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20342*/
20343
20344 /* function exit code */
20345 __pyx_L0:;
20346 return __pyx_r;
20347}
20348
20349/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
20350 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20351 *
20352 * @property # <<<<<<<<<<<<<<
20353 * cdef inline void ** data(self) noexcept nogil:
20354 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20355*/
20356
20357static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
20358 void **__pyx_r;
20359
20360 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":965
20361 * @property
20362 * cdef inline void ** data(self) noexcept nogil:
20363 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data # <<<<<<<<<<<<<<
20364 *
20365 * @property
20366*/
20367 {
20368
20369 __pyx_r = ((void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
20370 }
20371 goto __pyx_L0;
20372
20373 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
20374 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20375 *
20376 * @property # <<<<<<<<<<<<<<
20377 * cdef inline void ** data(self) noexcept nogil:
20378 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20379*/
20380
20381 /* function exit code */
20382 __pyx_L0:;
20383 return __pyx_r;
20384}
20385
20386/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
20387 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20388 *
20389 * @property # <<<<<<<<<<<<<<
20390 * cdef inline int ntypes(self) noexcept nogil:
20391 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20392*/
20393
20394static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
20395 int __pyx_r;
20396
20397 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":969
20398 * @property
20399 * cdef inline int ntypes(self) noexcept nogil:
20400 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes # <<<<<<<<<<<<<<
20401 *
20402 * @property
20403*/
20404 {
20405
20406 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
20407 }
20408 goto __pyx_L0;
20409
20410 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
20411 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20412 *
20413 * @property # <<<<<<<<<<<<<<
20414 * cdef inline int ntypes(self) noexcept nogil:
20415 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20416*/
20417
20418 /* function exit code */
20419 __pyx_L0:;
20420 return __pyx_r;
20421}
20422
20423/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
20424 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20425 *
20426 * @property # <<<<<<<<<<<<<<
20427 * cdef inline const char* name(self) noexcept nogil:
20428 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20429*/
20430
20431static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
20432 char const *__pyx_r;
20433
20434 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":973
20435 * @property
20436 * cdef inline const char* name(self) noexcept nogil:
20437 * return _PyUFuncObject_GET_ITEM_DATA(self).name # <<<<<<<<<<<<<<
20438 *
20439 * @property
20440*/
20441 {
20442
20443 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
20444 }
20445 goto __pyx_L0;
20446
20447 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
20448 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20449 *
20450 * @property # <<<<<<<<<<<<<<
20451 * cdef inline const char* name(self) noexcept nogil:
20452 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20453*/
20454
20455 /* function exit code */
20456 __pyx_L0:;
20457 return __pyx_r;
20458}
20459
20460/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
20461 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20462 *
20463 * @property # <<<<<<<<<<<<<<
20464 * cdef inline const char* doc(self) noexcept nogil:
20465 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20466*/
20467
20468static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
20469 char const *__pyx_r;
20470
20471 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":977
20472 * @property
20473 * cdef inline const char* doc(self) noexcept nogil:
20474 * return _PyUFuncObject_GET_ITEM_DATA(self).doc # <<<<<<<<<<<<<<
20475 *
20476 * @property
20477*/
20478 {
20479
20480 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
20481 }
20482 goto __pyx_L0;
20483
20484 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
20485 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20486 *
20487 * @property # <<<<<<<<<<<<<<
20488 * cdef inline const char* doc(self) noexcept nogil:
20489 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20490*/
20491
20492 /* function exit code */
20493 __pyx_L0:;
20494 return __pyx_r;
20495}
20496
20497/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
20498 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20499 *
20500 * @property # <<<<<<<<<<<<<<
20501 * cdef inline void* ptr(self) noexcept nogil:
20502 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20503*/
20504
20505static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
20506 void *__pyx_r;
20507
20508 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":981
20509 * @property
20510 * cdef inline void* ptr(self) noexcept nogil:
20511 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr # <<<<<<<<<<<<<<
20512 *
20513 * @property
20514*/
20515 {
20516
20517 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
20518 }
20519 goto __pyx_L0;
20520
20521 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
20522 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20523 *
20524 * @property # <<<<<<<<<<<<<<
20525 * cdef inline void* ptr(self) noexcept nogil:
20526 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20527*/
20528
20529 /* function exit code */
20530 __pyx_L0:;
20531 return __pyx_r;
20532}
20533
20534/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
20535 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20536 *
20537 * @property # <<<<<<<<<<<<<<
20538 * cdef inline PyObject* obj(self) noexcept nogil:
20539 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20540*/
20541
20542static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
20543 PyObject *__pyx_r;
20544
20545 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":985
20546 * @property
20547 * cdef inline PyObject* obj(self) noexcept nogil:
20548 * return _PyUFuncObject_GET_ITEM_DATA(self).obj # <<<<<<<<<<<<<<
20549 *
20550 * @property
20551*/
20552 {
20553
20554 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
20555 }
20556 goto __pyx_L0;
20557
20558 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
20559 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20560 *
20561 * @property # <<<<<<<<<<<<<<
20562 * cdef inline PyObject* obj(self) noexcept nogil:
20563 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20564*/
20565
20566 /* function exit code */
20567 __pyx_L0:;
20568 return __pyx_r;
20569}
20570
20571/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
20572 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20573 *
20574 * @property # <<<<<<<<<<<<<<
20575 * cdef inline PyObject* userloops(self) noexcept nogil:
20576 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
20577*/
20578
20579static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
20580 PyObject *__pyx_r;
20581
20582 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":989
20583 * @property
20584 * cdef inline PyObject* userloops(self) noexcept nogil:
20585 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops # <<<<<<<<<<<<<<
20586 *
20587 * PyUFuncObject_fields *_PyUFuncObject_GET_ITEM_DATA(ufunc) nogil
20588*/
20589 {
20590
20591 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
20592 }
20593 goto __pyx_L0;
20594
20595 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
20596 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20597 *
20598 * @property # <<<<<<<<<<<<<<
20599 * cdef inline PyObject* userloops(self) noexcept nogil:
20600 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
20601*/
20602
20603 /* function exit code */
20604 __pyx_L0:;
20605 return __pyx_r;
20606}
20607
20608/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
20609 * int _import_umath() except -1
20610 *
20611 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20612 * Py_INCREF(base) # important to do this before stealing the reference below!
20613 * PyArray_SetBaseObject(arr, base)
20614*/
20615
20616static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
20617 int __pyx_t_1;
20618 int __pyx_lineno = 0;
20619 const char *__pyx_filename = NULL;
20620 int __pyx_clineno = 0;
20621
20622 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1066
20623 *
20624 * cdef inline void set_array_base(ndarray arr, object base) except *:
20625 * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
20626 * PyArray_SetBaseObject(arr, base)
20627 *
20628*/
20629 Py_INCREF(__pyx_v_base);
20630
20631 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1067
20632 * cdef inline void set_array_base(ndarray arr, object base) except *:
20633 * Py_INCREF(base) # important to do this before stealing the reference below!
20634 * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
20635 *
20636 * cdef inline object get_array_base(ndarray arr):
20637*/
20638 __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1067, __pyx_L1_error)
20639
20640
20641 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
20642 * int _import_umath() except -1
20643 *
20644 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20645 * Py_INCREF(base) # important to do this before stealing the reference below!
20646 * PyArray_SetBaseObject(arr, base)
20647*/
20648
20649 /* function exit code */
20650 goto __pyx_L0;
20651 __pyx_L1_error:;
20652 __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
20653 __pyx_L0:;
20654
20655}
20656
20657/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
20658 * PyArray_SetBaseObject(arr, base)
20659 *
20660 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20661 * base = PyArray_BASE(arr)
20662 * if base is NULL:
20663*/
20664
20665static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
20666 PyObject *__pyx_v_base;
20667 PyObject *__pyx_r = NULL;
20668 __Pyx_RefNannyDeclarations
20669 int __pyx_t_1;
20670 __Pyx_RefNannySetupContext("get_array_base", 0);
20671
20672 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1070
20673 *
20674 * cdef inline object get_array_base(ndarray arr):
20675 * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
20676 * if base is NULL:
20677 * return None
20678*/
20679 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20680
20681 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
20682 * cdef inline object get_array_base(ndarray arr):
20683 * base = PyArray_BASE(arr)
20684 * if base is NULL: # <<<<<<<<<<<<<<
20685 * return None
20686 * return <object>base
20687*/
20688 __pyx_t_1 = (__pyx_v_base == NULL);
20689
20690 if (__pyx_t_1) {
20691
20692
20693 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1072
20694 * base = PyArray_BASE(arr)
20695 * if base is NULL:
20696 * return None # <<<<<<<<<<<<<<
20697 * return <object>base
20698 *
20699*/
20700 {
20701 PyObject *__pyx_temp;
20702 {
20703 __pyx_temp = __pyx_r;
20704 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20705 }
20706 __Pyx_XDECREF(__pyx_temp);
20707 }
20708 goto __pyx_L0;
20709
20710 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
20711 * cdef inline object get_array_base(ndarray arr):
20712 * base = PyArray_BASE(arr)
20713 * if base is NULL: # <<<<<<<<<<<<<<
20714 * return None
20715 * return <object>base
20716*/
20717 }
20718
20719 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1073
20720 * if base is NULL:
20721 * return None
20722 * return <object>base # <<<<<<<<<<<<<<
20723 *
20724 * # Versions of the import_* functions which are more suitable for
20725*/
20726 {
20727 PyObject *__pyx_temp;
20728 {
20729 __pyx_temp = __pyx_r;
20730 __Pyx_INCREF(((PyObject *)__pyx_v_base));
20731 __pyx_r = ((PyObject *)__pyx_v_base);
20732 }
20733 __Pyx_XDECREF(__pyx_temp);
20734 }
20735 goto __pyx_L0;
20736
20737 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
20738 * PyArray_SetBaseObject(arr, base)
20739 *
20740 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20741 * base = PyArray_BASE(arr)
20742 * if base is NULL:
20743*/
20744
20745 /* function exit code */
20746 __pyx_L0:;
20747
20748 __Pyx_XGIVEREF(__pyx_r);
20749 __Pyx_RefNannyFinishContext();
20750 return __pyx_r;
20751}
20752
20753/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
20754 * # Versions of the import_* functions which are more suitable for
20755 * # Cython code.
20756 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20757 * try:
20758 * __pyx_import_array()
20759*/
20760
20761static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20762 int __pyx_r;
20763 __Pyx_RefNannyDeclarations
20764 PyObject *__pyx_t_1 = NULL;
20765 PyObject *__pyx_t_2 = NULL;
20766 PyObject *__pyx_t_3 = NULL;
20767 int __pyx_t_4;
20768 PyObject *__pyx_t_5 = NULL;
20769 PyObject *__pyx_t_6 = NULL;
20770 PyObject *__pyx_t_7 = NULL;
20771 PyObject *__pyx_t_8 = NULL;
20772 PyObject *__pyx_t_9 = NULL;
20773 size_t __pyx_t_10;
20774 int __pyx_lineno = 0;
20775 const char *__pyx_filename = NULL;
20776 int __pyx_clineno = 0;
20777 __Pyx_RefNannySetupContext("import_array", 0);
20778
20779 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
20780 * # Cython code.
20781 * cdef inline int import_array() except -1:
20782 * try: # <<<<<<<<<<<<<<
20783 * __pyx_import_array()
20784 * except Exception:
20785*/
20786 {
20787 __Pyx_PyThreadState_declare
20788 __Pyx_PyThreadState_assign
20789 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20790 __Pyx_XGOTREF(__pyx_t_1);
20791 __Pyx_XGOTREF(__pyx_t_2);
20792 __Pyx_XGOTREF(__pyx_t_3);
20793 /*try:*/ {
20794
20795 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1079
20796 * cdef inline int import_array() except -1:
20797 * try:
20798 * __pyx_import_array() # <<<<<<<<<<<<<<
20799 * except Exception:
20800 * raise ImportError("numpy._core.multiarray failed to import")
20801*/
20802 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1079, __pyx_L3_error)
20803
20804
20805 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
20806 * # Cython code.
20807 * cdef inline int import_array() except -1:
20808 * try: # <<<<<<<<<<<<<<
20809 * __pyx_import_array()
20810 * except Exception:
20811*/
20812 }
20813 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20814 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20815 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20816 goto __pyx_L8_try_end;
20817 __pyx_L3_error:;
20818
20819 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1080
20820 * try:
20821 * __pyx_import_array()
20822 * except Exception: # <<<<<<<<<<<<<<
20823 * raise ImportError("numpy._core.multiarray failed to import")
20824 *
20825*/
20826 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20827 if (__pyx_t_4) {
20828 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20829 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1080, __pyx_L5_except_error)
20830 __Pyx_XGOTREF(__pyx_t_5);
20831 __Pyx_XGOTREF(__pyx_t_6);
20832 __Pyx_XGOTREF(__pyx_t_7);
20833
20834 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1081
20835 * __pyx_import_array()
20836 * except Exception:
20837 * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
20838 *
20839 * cdef inline int import_umath() except -1:
20840*/
20841 __pyx_t_9 = NULL;
20842 __pyx_t_10 = 1;
20843 {
20844 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
20845 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
20846 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20847 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1081, __pyx_L5_except_error)
20848 __Pyx_GOTREF(__pyx_t_8);
20849 }
20850 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20851 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20852 __PYX_ERR(2, 1081, __pyx_L5_except_error)
20853 }
20854 goto __pyx_L5_except_error;
20855
20856 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
20857 * # Cython code.
20858 * cdef inline int import_array() except -1:
20859 * try: # <<<<<<<<<<<<<<
20860 * __pyx_import_array()
20861 * except Exception:
20862*/
20863 __pyx_L5_except_error:;
20864 __Pyx_XGIVEREF(__pyx_t_1);
20865 __Pyx_XGIVEREF(__pyx_t_2);
20866 __Pyx_XGIVEREF(__pyx_t_3);
20867 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20868 goto __pyx_L1_error;
20869 __pyx_L8_try_end:;
20870 }
20871
20872 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
20873 * # Versions of the import_* functions which are more suitable for
20874 * # Cython code.
20875 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20876 * try:
20877 * __pyx_import_array()
20878*/
20879
20880 /* function exit code */
20881 __pyx_r = 0;
20882 goto __pyx_L0;
20883 __pyx_L1_error:;
20884 __Pyx_XDECREF(__pyx_t_5);
20885 __Pyx_XDECREF(__pyx_t_6);
20886 __Pyx_XDECREF(__pyx_t_7);
20887 __Pyx_XDECREF(__pyx_t_8);
20888 __Pyx_XDECREF(__pyx_t_9);
20889 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20890 __pyx_r = -1;
20891 __pyx_L0:;
20892
20893 __Pyx_RefNannyFinishContext();
20894 return __pyx_r;
20895}
20896
20897/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
20898 * raise ImportError("numpy._core.multiarray failed to import")
20899 *
20900 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
20901 * try:
20902 * _import_umath()
20903*/
20904
20905static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20906 int __pyx_r;
20907 __Pyx_RefNannyDeclarations
20908 PyObject *__pyx_t_1 = NULL;
20909 PyObject *__pyx_t_2 = NULL;
20910 PyObject *__pyx_t_3 = NULL;
20911 int __pyx_t_4;
20912 PyObject *__pyx_t_5 = NULL;
20913 PyObject *__pyx_t_6 = NULL;
20914 PyObject *__pyx_t_7 = NULL;
20915 PyObject *__pyx_t_8 = NULL;
20916 PyObject *__pyx_t_9 = NULL;
20917 size_t __pyx_t_10;
20918 int __pyx_lineno = 0;
20919 const char *__pyx_filename = NULL;
20920 int __pyx_clineno = 0;
20921 __Pyx_RefNannySetupContext("import_umath", 0);
20922
20923 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
20924 *
20925 * cdef inline int import_umath() except -1:
20926 * try: # <<<<<<<<<<<<<<
20927 * _import_umath()
20928 * except Exception:
20929*/
20930 {
20931 __Pyx_PyThreadState_declare
20932 __Pyx_PyThreadState_assign
20933 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20934 __Pyx_XGOTREF(__pyx_t_1);
20935 __Pyx_XGOTREF(__pyx_t_2);
20936 __Pyx_XGOTREF(__pyx_t_3);
20937 /*try:*/ {
20938
20939 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1085
20940 * cdef inline int import_umath() except -1:
20941 * try:
20942 * _import_umath() # <<<<<<<<<<<<<<
20943 * except Exception:
20944 * raise ImportError("numpy._core.umath failed to import")
20945*/
20946 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1085, __pyx_L3_error)
20947
20948
20949 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
20950 *
20951 * cdef inline int import_umath() except -1:
20952 * try: # <<<<<<<<<<<<<<
20953 * _import_umath()
20954 * except Exception:
20955*/
20956 }
20957 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20958 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20959 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20960 goto __pyx_L8_try_end;
20961 __pyx_L3_error:;
20962
20963 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1086
20964 * try:
20965 * _import_umath()
20966 * except Exception: # <<<<<<<<<<<<<<
20967 * raise ImportError("numpy._core.umath failed to import")
20968 *
20969*/
20970 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20971 if (__pyx_t_4) {
20972 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20973 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1086, __pyx_L5_except_error)
20974 __Pyx_XGOTREF(__pyx_t_5);
20975 __Pyx_XGOTREF(__pyx_t_6);
20976 __Pyx_XGOTREF(__pyx_t_7);
20977
20978 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1087
20979 * _import_umath()
20980 * except Exception:
20981 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
20982 *
20983 * cdef inline int import_ufunc() except -1:
20984*/
20985 __pyx_t_9 = NULL;
20986 __pyx_t_10 = 1;
20987 {
20988 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
20989 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
20990 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20991 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1087, __pyx_L5_except_error)
20992 __Pyx_GOTREF(__pyx_t_8);
20993 }
20994 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20995 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20996 __PYX_ERR(2, 1087, __pyx_L5_except_error)
20997 }
20998 goto __pyx_L5_except_error;
20999
21000 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
21001 *
21002 * cdef inline int import_umath() except -1:
21003 * try: # <<<<<<<<<<<<<<
21004 * _import_umath()
21005 * except Exception:
21006*/
21007 __pyx_L5_except_error:;
21008 __Pyx_XGIVEREF(__pyx_t_1);
21009 __Pyx_XGIVEREF(__pyx_t_2);
21010 __Pyx_XGIVEREF(__pyx_t_3);
21011 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21012 goto __pyx_L1_error;
21013 __pyx_L8_try_end:;
21014 }
21015
21016 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
21017 * raise ImportError("numpy._core.multiarray failed to import")
21018 *
21019 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
21020 * try:
21021 * _import_umath()
21022*/
21023
21024 /* function exit code */
21025 __pyx_r = 0;
21026 goto __pyx_L0;
21027 __pyx_L1_error:;
21028 __Pyx_XDECREF(__pyx_t_5);
21029 __Pyx_XDECREF(__pyx_t_6);
21030 __Pyx_XDECREF(__pyx_t_7);
21031 __Pyx_XDECREF(__pyx_t_8);
21032 __Pyx_XDECREF(__pyx_t_9);
21033 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
21034 __pyx_r = -1;
21035 __pyx_L0:;
21036
21037 __Pyx_RefNannyFinishContext();
21038 return __pyx_r;
21039}
21040
21041/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
21042 * raise ImportError("numpy._core.umath failed to import")
21043 *
21044 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
21045 * try:
21046 * _import_umath()
21047*/
21048
21049static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
21050 int __pyx_r;
21051 __Pyx_RefNannyDeclarations
21052 PyObject *__pyx_t_1 = NULL;
21053 PyObject *__pyx_t_2 = NULL;
21054 PyObject *__pyx_t_3 = NULL;
21055 int __pyx_t_4;
21056 PyObject *__pyx_t_5 = NULL;
21057 PyObject *__pyx_t_6 = NULL;
21058 PyObject *__pyx_t_7 = NULL;
21059 PyObject *__pyx_t_8 = NULL;
21060 PyObject *__pyx_t_9 = NULL;
21061 size_t __pyx_t_10;
21062 int __pyx_lineno = 0;
21063 const char *__pyx_filename = NULL;
21064 int __pyx_clineno = 0;
21065 __Pyx_RefNannySetupContext("import_ufunc", 0);
21066
21067 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
21068 *
21069 * cdef inline int import_ufunc() except -1:
21070 * try: # <<<<<<<<<<<<<<
21071 * _import_umath()
21072 * except Exception:
21073*/
21074 {
21075 __Pyx_PyThreadState_declare
21076 __Pyx_PyThreadState_assign
21077 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21078 __Pyx_XGOTREF(__pyx_t_1);
21079 __Pyx_XGOTREF(__pyx_t_2);
21080 __Pyx_XGOTREF(__pyx_t_3);
21081 /*try:*/ {
21082
21083 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1091
21084 * cdef inline int import_ufunc() except -1:
21085 * try:
21086 * _import_umath() # <<<<<<<<<<<<<<
21087 * except Exception:
21088 * raise ImportError("numpy._core.umath failed to import")
21089*/
21090 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1091, __pyx_L3_error)
21091
21092
21093 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
21094 *
21095 * cdef inline int import_ufunc() except -1:
21096 * try: # <<<<<<<<<<<<<<
21097 * _import_umath()
21098 * except Exception:
21099*/
21100 }
21101 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21102 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21103 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21104 goto __pyx_L8_try_end;
21105 __pyx_L3_error:;
21106
21107 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1092
21108 * try:
21109 * _import_umath()
21110 * except Exception: # <<<<<<<<<<<<<<
21111 * raise ImportError("numpy._core.umath failed to import")
21112 *
21113*/
21114 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
21115 if (__pyx_t_4) {
21116 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21117 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1092, __pyx_L5_except_error)
21118 __Pyx_XGOTREF(__pyx_t_5);
21119 __Pyx_XGOTREF(__pyx_t_6);
21120 __Pyx_XGOTREF(__pyx_t_7);
21121
21122 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1093
21123 * _import_umath()
21124 * except Exception:
21125 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
21126 *
21127 *
21128*/
21129 __pyx_t_9 = NULL;
21130 __pyx_t_10 = 1;
21131 {
21132 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
21133 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21134 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21135 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1093, __pyx_L5_except_error)
21136 __Pyx_GOTREF(__pyx_t_8);
21137 }
21138 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21139 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21140 __PYX_ERR(2, 1093, __pyx_L5_except_error)
21141 }
21142 goto __pyx_L5_except_error;
21143
21144 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
21145 *
21146 * cdef inline int import_ufunc() except -1:
21147 * try: # <<<<<<<<<<<<<<
21148 * _import_umath()
21149 * except Exception:
21150*/
21151 __pyx_L5_except_error:;
21152 __Pyx_XGIVEREF(__pyx_t_1);
21153 __Pyx_XGIVEREF(__pyx_t_2);
21154 __Pyx_XGIVEREF(__pyx_t_3);
21155 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21156 goto __pyx_L1_error;
21157 __pyx_L8_try_end:;
21158 }
21159
21160 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
21161 * raise ImportError("numpy._core.umath failed to import")
21162 *
21163 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
21164 * try:
21165 * _import_umath()
21166*/
21167
21168 /* function exit code */
21169 __pyx_r = 0;
21170 goto __pyx_L0;
21171 __pyx_L1_error:;
21172 __Pyx_XDECREF(__pyx_t_5);
21173 __Pyx_XDECREF(__pyx_t_6);
21174 __Pyx_XDECREF(__pyx_t_7);
21175 __Pyx_XDECREF(__pyx_t_8);
21176 __Pyx_XDECREF(__pyx_t_9);
21177 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21178 __pyx_r = -1;
21179 __pyx_L0:;
21180
21181 __Pyx_RefNannyFinishContext();
21182 return __pyx_r;
21183}
21184
21185/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
21186 *
21187 *
21188 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21189 * """
21190 * Cython equivalent of `isinstance(obj, np.timedelta64)`
21191*/
21192
21193static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
21194 int __pyx_r;
21195
21196 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1108
21197 * bool
21198 * """
21199 * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
21200 *
21201 *
21202*/
21203 {
21204
21205 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
21206 }
21207 goto __pyx_L0;
21208
21209 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
21210 *
21211 *
21212 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21213 * """
21214 * Cython equivalent of `isinstance(obj, np.timedelta64)`
21215*/
21216
21217 /* function exit code */
21218 __pyx_L0:;
21219
21220 return __pyx_r;
21221}
21222
21223/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
21224 *
21225 *
21226 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21227 * """
21228 * Cython equivalent of `isinstance(obj, np.datetime64)`
21229*/
21230
21231static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
21232 int __pyx_r;
21233
21234 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1123
21235 * bool
21236 * """
21237 * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
21238 *
21239 *
21240*/
21241 {
21242
21243 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
21244 }
21245 goto __pyx_L0;
21246
21247 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
21248 *
21249 *
21250 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21251 * """
21252 * Cython equivalent of `isinstance(obj, np.datetime64)`
21253*/
21254
21255 /* function exit code */
21256 __pyx_L0:;
21257
21258 return __pyx_r;
21259}
21260
21261/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
21262 *
21263 *
21264 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21265 * """
21266 * returns the int64 value underlying scalar numpy datetime64 object
21267*/
21268
21269static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
21270 npy_datetime __pyx_r;
21271
21272 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1133
21273 * also needed. That can be found using `get_datetime64_unit`.
21274 * """
21275 * return _PyDatetimeScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
21276 *
21277 *
21278*/
21279 {
21280
21281 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
21282 }
21283 goto __pyx_L0;
21284
21285 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
21286 *
21287 *
21288 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21289 * """
21290 * returns the int64 value underlying scalar numpy datetime64 object
21291*/
21292
21293 /* function exit code */
21294 __pyx_L0:;
21295 return __pyx_r;
21296}
21297
21298/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
21299 *
21300 *
21301 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21302 * """
21303 * returns the int64 value underlying scalar numpy timedelta64 object
21304*/
21305
21306static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
21307 npy_timedelta __pyx_r;
21308
21309 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1140
21310 * returns the int64 value underlying scalar numpy timedelta64 object
21311 * """
21312 * return _PyTimedeltaScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
21313 *
21314 *
21315*/
21316 {
21317
21318 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
21319 }
21320 goto __pyx_L0;
21321
21322 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
21323 *
21324 *
21325 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21326 * """
21327 * returns the int64 value underlying scalar numpy timedelta64 object
21328*/
21329
21330 /* function exit code */
21331 __pyx_L0:;
21332 return __pyx_r;
21333}
21334
21335/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
21336 *
21337 *
21338 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21339 * """
21340 * returns the unit part of the dtype for a numpy datetime64 object.
21341*/
21342
21343static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
21344 NPY_DATETIMEUNIT __pyx_r;
21345
21346 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1147
21347 * returns the unit part of the dtype for a numpy datetime64 object.
21348 * """
21349 * return _PyDatetimeScalarObject_GetMetadata(obj).base # <<<<<<<<<<<<<<
21350 *
21351 *
21352*/
21353 {
21354
21355 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
21356 }
21357 goto __pyx_L0;
21358
21359 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
21360 *
21361 *
21362 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21363 * """
21364 * returns the unit part of the dtype for a numpy datetime64 object.
21365*/
21366
21367 /* function exit code */
21368 __pyx_L0:;
21369 return __pyx_r;
21370}
21371
21372/* "csparsity.pyx":8
21373 * cdef class PySparsityInfo:
21374 * cdef SparsityInfo cpp
21375 * def __cinit__(self): # <<<<<<<<<<<<<<
21376 * pass
21377 * def __dealloc__(self):
21378*/
21379
21380/* Python wrapper */
21381static int __pyx_pw_9csparsity_14PySparsityInfo_1__cinit__(PyObject *__pyx_v_self,
21382#if CYTHON_VECTORCALL_TPNEW
21383PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21384#else
21385PyObject *__pyx_args, PyObject *__pyx_kwds
21386#endif
21387); /*proto*/
21388static int __pyx_pw_9csparsity_14PySparsityInfo_1__cinit__(PyObject *__pyx_v_self,
21389#if CYTHON_VECTORCALL_TPNEW
21390PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21391#else
21392PyObject *__pyx_args, PyObject *__pyx_kwds
21393#endif
21394) {
21395 #if !CYTHON_VECTORCALL_TPNEW
21396 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21397 #endif
21398 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21399 int __pyx_r;
21400 __Pyx_RefNannyDeclarations
21401 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
21402 #if !CYTHON_VECTORCALL_TPNEW
21403 #if CYTHON_ASSUME_SAFE_SIZE
21404 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21405 #else
21406 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
21407 #endif
21408 #endif
21409 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
21410 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
21411 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
21412 if (unlikely(__pyx_kwds_len < 0)) return -1;
21413 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
21414 __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo___cinit__(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self));
21415
21416 /* function exit code */
21417 __Pyx_RefNannyFinishContext();
21418 return __pyx_r;
21419}
21420
21421static int __pyx_pf_9csparsity_14PySparsityInfo___cinit__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self) {
21422 int __pyx_r;
21423
21424 /* function exit code */
21425 __pyx_r = 0;
21426
21427 return __pyx_r;
21428}
21429
21430/* "csparsity.pyx":10
21431 * def __cinit__(self):
21432 * pass
21433 * def __dealloc__(self): # <<<<<<<<<<<<<<
21434 * pass
21435 * #self.cpp.columnIndecesMap.clear()
21436*/
21437
21438/* Python wrapper */
21439static void __pyx_pw_9csparsity_14PySparsityInfo_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
21440static void __pyx_pw_9csparsity_14PySparsityInfo_3__dealloc__(PyObject *__pyx_v_self) {
21441 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21442 __Pyx_RefNannyDeclarations
21443 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
21444 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
21445 __pyx_pf_9csparsity_14PySparsityInfo_2__dealloc__(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self));
21446
21447 /* function exit code */
21448 __Pyx_RefNannyFinishContext();
21449}
21450
21451static void __pyx_pf_9csparsity_14PySparsityInfo_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self) {
21452
21453 /* function exit code */
21454
21455}
21456
21457/* "csparsity.pyx":14
21458 * #self.cpp.columnIndecesMap.clear()
21459 * #self.cpp.columnOffsetsMap.clear()
21460 * def findNonzeros(self, # <<<<<<<<<<<<<<
21461 * int nElements_global,
21462 * int nDOF_test_element,
21463*/
21464
21465/* Python wrapper */
21466static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_5findNonzeros(PyObject *__pyx_v_self,
21467#if CYTHON_VECTORCALL
21468PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21469#else
21470PyObject *__pyx_args, PyObject *__pyx_kwds
21471#endif
21472); /*proto*/
21473static PyMethodDef __pyx_mdef_9csparsity_14PySparsityInfo_5findNonzeros = {"findNonzeros", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_5findNonzeros, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21474static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_5findNonzeros(PyObject *__pyx_v_self,
21475#if CYTHON_VECTORCALL
21476PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21477#else
21478PyObject *__pyx_args, PyObject *__pyx_kwds
21479#endif
21480) {
21481 int __pyx_v_nElements_global;
21482 int __pyx_v_nDOF_test_element;
21483 int __pyx_v_nDOF_trial_element;
21484 PyArrayObject *__pyx_v_nFreeDOF_test = 0;
21485 PyArrayObject *__pyx_v_freeGlobal_test = 0;
21486 PyArrayObject *__pyx_v_nFreeDOF_trial = 0;
21487 PyArrayObject *__pyx_v_freeGlobal_trial = 0;
21488 int __pyx_v_offset_test;
21489 int __pyx_v_stride_test;
21490 int __pyx_v_offset_trial;
21491 int __pyx_v_stride_trial;
21492 int __pyx_v_hasNumericalFlux;
21493 int __pyx_v_hasDiffusionInMixedForm;
21494 int __pyx_v_needNumericalFluxJacobian;
21495 int __pyx_v_nElementBoundaries_element;
21496 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
21497 int __pyx_v_nInteriorElementBoundaries_global;
21498 PyArrayObject *__pyx_v_interiorElementBoundariesArray = 0;
21499 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
21500 PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray = 0;
21501 int __pyx_v_hasFluxBoundaryConditions;
21502 int __pyx_v_nExteriorElementBoundaries_global;
21503 PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
21504 int __pyx_v_hasOutflowBoundary;
21505 int __pyx_v_needOutflowJacobian;
21506 #if !CYTHON_VECTORCALL
21507 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21508 #endif
21509 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21510 PyObject* values[25] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
21511 int __pyx_lineno = 0;
21512 const char *__pyx_filename = NULL;
21513 int __pyx_clineno = 0;
21514 PyObject *__pyx_r = 0;
21515 __Pyx_RefNannyDeclarations
21516 __Pyx_RefNannySetupContext("findNonzeros (wrapper)", 0);
21517 #if !CYTHON_VECTORCALL
21518 #if CYTHON_ASSUME_SAFE_SIZE
21519 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21520 #else
21521 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21522 #endif
21523 #endif
21524 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21525 {
21526 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nElements_global,&__pyx_mstate_global->__pyx_n_u_nDOF_test_element,&__pyx_mstate_global->__pyx_n_u_nDOF_trial_element,&__pyx_mstate_global->__pyx_n_u_nFreeDOF_test,&__pyx_mstate_global->__pyx_n_u_freeGlobal_test,&__pyx_mstate_global->__pyx_n_u_nFreeDOF_trial,&__pyx_mstate_global->__pyx_n_u_freeGlobal_trial,&__pyx_mstate_global->__pyx_n_u_offset_test,&__pyx_mstate_global->__pyx_n_u_stride_test,&__pyx_mstate_global->__pyx_n_u_offset_trial,&__pyx_mstate_global->__pyx_n_u_stride_trial,&__pyx_mstate_global->__pyx_n_u_hasNumericalFlux,&__pyx_mstate_global->__pyx_n_u_hasDiffusionInMixedForm,&__pyx_mstate_global->__pyx_n_u_needNumericalFluxJacobian,&__pyx_mstate_global->__pyx_n_u_nElementBoundaries_element,&__pyx_mstate_global->__pyx_n_u_elementNeighborsArray,&__pyx_mstate_global->__pyx_n_u_nInteriorElementBoundaries_globa,&__pyx_mstate_global->__pyx_n_u_interiorElementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryElementsArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryLocalElementBound,&__pyx_mstate_global->__pyx_n_u_hasFluxBoundaryConditions,&__pyx_mstate_global->__pyx_n_u_nExteriorElementBoundaries_globa,&__pyx_mstate_global->__pyx_n_u_exteriorElementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_hasOutflowBoundary,&__pyx_mstate_global->__pyx_n_u_needOutflowJacobian,0};
21527 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21528 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 14, __pyx_L3_error)
21529 if (__pyx_kwds_len > 0) {
21530 switch (__pyx_nargs) {
21531 case 25:
21532 values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
21533 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 14, __pyx_L3_error)
21534 CYTHON_FALLTHROUGH;
21535 case 24:
21536 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
21537 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 14, __pyx_L3_error)
21538 CYTHON_FALLTHROUGH;
21539 case 23:
21540 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
21541 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 14, __pyx_L3_error)
21542 CYTHON_FALLTHROUGH;
21543 case 22:
21544 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
21545 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 14, __pyx_L3_error)
21546 CYTHON_FALLTHROUGH;
21547 case 21:
21548 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
21549 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 14, __pyx_L3_error)
21550 CYTHON_FALLTHROUGH;
21551 case 20:
21552 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
21553 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 14, __pyx_L3_error)
21554 CYTHON_FALLTHROUGH;
21555 case 19:
21556 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
21557 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 14, __pyx_L3_error)
21558 CYTHON_FALLTHROUGH;
21559 case 18:
21560 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
21561 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 14, __pyx_L3_error)
21562 CYTHON_FALLTHROUGH;
21563 case 17:
21564 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
21565 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 14, __pyx_L3_error)
21566 CYTHON_FALLTHROUGH;
21567 case 16:
21568 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
21569 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 14, __pyx_L3_error)
21570 CYTHON_FALLTHROUGH;
21571 case 15:
21572 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
21573 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 14, __pyx_L3_error)
21574 CYTHON_FALLTHROUGH;
21575 case 14:
21576 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
21577 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 14, __pyx_L3_error)
21578 CYTHON_FALLTHROUGH;
21579 case 13:
21580 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
21581 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 14, __pyx_L3_error)
21582 CYTHON_FALLTHROUGH;
21583 case 12:
21584 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
21585 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 14, __pyx_L3_error)
21586 CYTHON_FALLTHROUGH;
21587 case 11:
21588 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
21589 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 14, __pyx_L3_error)
21590 CYTHON_FALLTHROUGH;
21591 case 10:
21592 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
21593 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 14, __pyx_L3_error)
21594 CYTHON_FALLTHROUGH;
21595 case 9:
21596 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
21597 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 14, __pyx_L3_error)
21598 CYTHON_FALLTHROUGH;
21599 case 8:
21600 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
21601 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 14, __pyx_L3_error)
21602 CYTHON_FALLTHROUGH;
21603 case 7:
21604 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
21605 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 14, __pyx_L3_error)
21606 CYTHON_FALLTHROUGH;
21607 case 6:
21608 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
21609 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 14, __pyx_L3_error)
21610 CYTHON_FALLTHROUGH;
21611 case 5:
21612 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21613 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 14, __pyx_L3_error)
21614 CYTHON_FALLTHROUGH;
21615 case 4:
21616 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21617 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 14, __pyx_L3_error)
21618 CYTHON_FALLTHROUGH;
21619 case 3:
21620 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21621 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 14, __pyx_L3_error)
21622 CYTHON_FALLTHROUGH;
21623 case 2:
21624 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21625 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 14, __pyx_L3_error)
21626 CYTHON_FALLTHROUGH;
21627 case 1:
21628 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21629 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 14, __pyx_L3_error)
21630 CYTHON_FALLTHROUGH;
21631 case 0: break;
21632 default: goto __pyx_L5_argtuple_error;
21633 }
21634 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21635 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "findNonzeros", 0) < (0)) __PYX_ERR(0, 14, __pyx_L3_error)
21636 for (Py_ssize_t i = __pyx_nargs; i < 25; i++) {
21637 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, i); __PYX_ERR(0, 14, __pyx_L3_error) }
21638 }
21639 } else if (unlikely(__pyx_nargs != 25)) {
21640 goto __pyx_L5_argtuple_error;
21641 } else {
21642 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21643 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 14, __pyx_L3_error)
21644 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21645 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 14, __pyx_L3_error)
21646 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21647 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 14, __pyx_L3_error)
21648 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21649 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 14, __pyx_L3_error)
21650 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21651 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 14, __pyx_L3_error)
21652 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
21653 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 14, __pyx_L3_error)
21654 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
21655 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 14, __pyx_L3_error)
21656 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
21657 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 14, __pyx_L3_error)
21658 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
21659 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 14, __pyx_L3_error)
21660 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
21661 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 14, __pyx_L3_error)
21662 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
21663 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 14, __pyx_L3_error)
21664 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
21665 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 14, __pyx_L3_error)
21666 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
21667 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 14, __pyx_L3_error)
21668 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
21669 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 14, __pyx_L3_error)
21670 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
21671 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 14, __pyx_L3_error)
21672 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
21673 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 14, __pyx_L3_error)
21674 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
21675 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 14, __pyx_L3_error)
21676 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
21677 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 14, __pyx_L3_error)
21678 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
21679 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 14, __pyx_L3_error)
21680 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
21681 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 14, __pyx_L3_error)
21682 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
21683 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 14, __pyx_L3_error)
21684 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
21685 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 14, __pyx_L3_error)
21686 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
21687 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 14, __pyx_L3_error)
21688 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
21689 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 14, __pyx_L3_error)
21690 values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
21691 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 14, __pyx_L3_error)
21692 }
21693 __pyx_v_nElements_global = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_nElements_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 15, __pyx_L3_error)
21694 __pyx_v_nDOF_test_element = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_nDOF_test_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error)
21695 __pyx_v_nDOF_trial_element = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nDOF_trial_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error)
21696 __pyx_v_nFreeDOF_test = ((PyArrayObject *)values[3]);
21697 __pyx_v_freeGlobal_test = ((PyArrayObject *)values[4]);
21698 __pyx_v_nFreeDOF_trial = ((PyArrayObject *)values[5]);
21699 __pyx_v_freeGlobal_trial = ((PyArrayObject *)values[6]);
21700 __pyx_v_offset_test = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_offset_test == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L3_error)
21701 __pyx_v_stride_test = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_stride_test == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L3_error)
21702 __pyx_v_offset_trial = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_offset_trial == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 24, __pyx_L3_error)
21703 __pyx_v_stride_trial = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_stride_trial == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L3_error)
21704 __pyx_v_hasNumericalFlux = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_hasNumericalFlux == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error)
21705 __pyx_v_hasDiffusionInMixedForm = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_hasDiffusionInMixedForm == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
21706 __pyx_v_needNumericalFluxJacobian = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_needNumericalFluxJacobian == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
21707 __pyx_v_nElementBoundaries_element = __Pyx_PyLong_As_int(values[14]); if (unlikely((__pyx_v_nElementBoundaries_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
21708 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[15]);
21709 __pyx_v_nInteriorElementBoundaries_global = __Pyx_PyLong_As_int(values[16]); if (unlikely((__pyx_v_nInteriorElementBoundaries_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
21710 __pyx_v_interiorElementBoundariesArray = ((PyArrayObject *)values[17]);
21711 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[18]);
21712 __pyx_v_elementBoundaryLocalElementBoundariesArray = ((PyArrayObject *)values[19]);
21713 __pyx_v_hasFluxBoundaryConditions = __Pyx_PyLong_As_int(values[20]); if (unlikely((__pyx_v_hasFluxBoundaryConditions == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error)
21714 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyLong_As_int(values[21]); if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)
21715 __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[22]);
21716 __pyx_v_hasOutflowBoundary = __Pyx_PyLong_As_int(values[23]); if (unlikely((__pyx_v_hasOutflowBoundary == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L3_error)
21717 __pyx_v_needOutflowJacobian = __Pyx_PyLong_As_int(values[24]); if (unlikely((__pyx_v_needOutflowJacobian == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error)
21718 }
21719 goto __pyx_L6_skip;
21720 __pyx_L5_argtuple_error:;
21721 __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, __pyx_nargs); __PYX_ERR(0, 14, __pyx_L3_error)
21722 __pyx_L6_skip:;
21723 goto __pyx_L4_argument_unpacking_done;
21724 __pyx_L3_error:;
21725 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21726 Py_XDECREF(values[__pyx_temp]);
21727 }
21728 __Pyx_AddTraceback("csparsity.PySparsityInfo.findNonzeros", __pyx_clineno, __pyx_lineno, __pyx_filename);
21729 __Pyx_RefNannyFinishContext();
21730 return NULL;
21731 __pyx_L4_argument_unpacking_done:;
21732 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nFreeDOF_test), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "nFreeDOF_test", 0))) __PYX_ERR(0, 18, __pyx_L1_error)
21733 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freeGlobal_test), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "freeGlobal_test", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
21734 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nFreeDOF_trial), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "nFreeDOF_trial", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
21735 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freeGlobal_trial), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "freeGlobal_trial", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
21736 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementNeighborsArray", 0))) __PYX_ERR(0, 30, __pyx_L1_error)
21737 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interiorElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "interiorElementBoundariesArray", 0))) __PYX_ERR(0, 32, __pyx_L1_error)
21738 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryElementsArray", 0))) __PYX_ERR(0, 33, __pyx_L1_error)
21739 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryLocalElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryLocalElementBoundariesArray", 0))) __PYX_ERR(0, 34, __pyx_L1_error)
21740 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "exteriorElementBoundariesArray", 0))) __PYX_ERR(0, 37, __pyx_L1_error)
21741 __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_4findNonzeros(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self), __pyx_v_nElements_global, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_nFreeDOF_test, __pyx_v_freeGlobal_test, __pyx_v_nFreeDOF_trial, __pyx_v_freeGlobal_trial, __pyx_v_offset_test, __pyx_v_stride_test, __pyx_v_offset_trial, __pyx_v_stride_trial, __pyx_v_hasNumericalFlux, __pyx_v_hasDiffusionInMixedForm, __pyx_v_needNumericalFluxJacobian, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_nInteriorElementBoundaries_global, __pyx_v_interiorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementBoundaryLocalElementBoundariesArray, __pyx_v_hasFluxBoundaryConditions, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_hasOutflowBoundary, __pyx_v_needOutflowJacobian);
21742
21743 /* function exit code */
21744 goto __pyx_L0;
21745 __pyx_L1_error:;
21746 __pyx_r = NULL;
21747 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21748 Py_XDECREF(values[__pyx_temp]);
21749 }
21750 goto __pyx_L7_cleaned_up;
21751 __pyx_L0:;
21752 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21753 Py_XDECREF(values[__pyx_temp]);
21754 }
21755 __pyx_L7_cleaned_up:;
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772 __Pyx_RefNannyFinishContext();
21773 return __pyx_r;
21774}
21775
21776static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_4findNonzeros(struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, int __pyx_v_nElements_global, int __pyx_v_nDOF_test_element, int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_nFreeDOF_test, PyArrayObject *__pyx_v_freeGlobal_test, PyArrayObject *__pyx_v_nFreeDOF_trial, PyArrayObject *__pyx_v_freeGlobal_trial, int __pyx_v_offset_test, int __pyx_v_stride_test, int __pyx_v_offset_trial, int __pyx_v_stride_trial, int __pyx_v_hasNumericalFlux, int __pyx_v_hasDiffusionInMixedForm, int __pyx_v_needNumericalFluxJacobian, int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, int __pyx_v_nInteriorElementBoundaries_global, PyArrayObject *__pyx_v_interiorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray, int __pyx_v_hasFluxBoundaryConditions, int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, int __pyx_v_hasOutflowBoundary, int __pyx_v_needOutflowJacobian) {
21777 PyObject *__pyx_r = NULL;
21778 __Pyx_RefNannyDeclarations
21779 __Pyx_RefNannySetupContext("findNonzeros", 0);
21780
21781 /* "csparsity.pyx":40
21782 * int hasOutflowBoundary,
21783 * int needOutflowJacobian):
21784 * self.cpp.findNonzeros(nElements_global, # <<<<<<<<<<<<<<
21785 * nDOF_test_element,
21786 * nDOF_trial_element,
21787*/
21788 __pyx_v_self->cpp.findNonzeros(__pyx_v_nElements_global, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nFreeDOF_test)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_freeGlobal_test)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nFreeDOF_trial)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_freeGlobal_trial)), __pyx_v_offset_test, __pyx_v_stride_test, __pyx_v_offset_trial, __pyx_v_stride_trial, __pyx_v_hasNumericalFlux, __pyx_v_hasDiffusionInMixedForm, __pyx_v_needNumericalFluxJacobian, __pyx_v_nElementBoundaries_element, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementNeighborsArray)), __pyx_v_nInteriorElementBoundaries_global, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_interiorElementBoundariesArray)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementBoundaryElementsArray)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementBoundaryLocalElementBoundariesArray)), __pyx_v_hasFluxBoundaryConditions, __pyx_v_nExteriorElementBoundaries_global, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_exteriorElementBoundariesArray)), __pyx_v_hasOutflowBoundary, __pyx_v_needOutflowJacobian);
21789
21790 /* "csparsity.pyx":14
21791 * #self.cpp.columnIndecesMap.clear()
21792 * #self.cpp.columnOffsetsMap.clear()
21793 * def findNonzeros(self, # <<<<<<<<<<<<<<
21794 * int nElements_global,
21795 * int nDOF_test_element,
21796*/
21797
21798 /* function exit code */
21799 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21800 __Pyx_XGIVEREF(__pyx_r);
21801 __Pyx_RefNannyFinishContext();
21802 return __pyx_r;
21803}
21804
21805/* "csparsity.pyx":65
21806 * hasOutflowBoundary,
21807 * needOutflowJacobian)
21808 * def getOffsets_CSR(self, # <<<<<<<<<<<<<<
21809 * int nElements_global,
21810 * int nDOF_test_element,
21811*/
21812
21813/* Python wrapper */
21814static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_7getOffsets_CSR(PyObject *__pyx_v_self,
21815#if CYTHON_VECTORCALL
21816PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21817#else
21818PyObject *__pyx_args, PyObject *__pyx_kwds
21819#endif
21820); /*proto*/
21821static PyMethodDef __pyx_mdef_9csparsity_14PySparsityInfo_7getOffsets_CSR = {"getOffsets_CSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_7getOffsets_CSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21822static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_7getOffsets_CSR(PyObject *__pyx_v_self,
21823#if CYTHON_VECTORCALL
21824PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21825#else
21826PyObject *__pyx_args, PyObject *__pyx_kwds
21827#endif
21828) {
21829 int __pyx_v_nElements_global;
21830 int __pyx_v_nDOF_test_element;
21831 int __pyx_v_nDOF_trial_element;
21832 PyArrayObject *__pyx_v_nFreeDOF_test = 0;
21833 PyArrayObject *__pyx_v_freeGlobal_test = 0;
21834 PyArrayObject *__pyx_v_nFreeDOF_trial = 0;
21835 PyArrayObject *__pyx_v_freeGlobal_trial = 0;
21836 int __pyx_v_offset_test;
21837 int __pyx_v_stride_test;
21838 int __pyx_v_offset_trial;
21839 int __pyx_v_stride_trial;
21840 int __pyx_v_hasNumericalFlux;
21841 int __pyx_v_hasDiffusionInMixedForm;
21842 int __pyx_v_needNumericalFluxJacobian;
21843 int __pyx_v_nElementBoundaries_element;
21844 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
21845 int __pyx_v_nInteriorElementBoundaries_global;
21846 PyArrayObject *__pyx_v_interiorElementBoundariesArray = 0;
21847 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
21848 PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray = 0;
21849 int __pyx_v_hasFluxBoundaryConditions;
21850 int __pyx_v_nExteriorElementBoundaries_global;
21851 PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
21852 int __pyx_v_hasOutflowBoundary;
21853 int __pyx_v_needOutflowJacobian;
21854 PyArrayObject *__pyx_v_rowptr = 0;
21855 PyArrayObject *__pyx_v_csrRowIndeces = 0;
21856 PyArrayObject *__pyx_v_csrColumnOffsets = 0;
21857 PyArrayObject *__pyx_v_csrColumnOffsets_eNebN = 0;
21858 PyArrayObject *__pyx_v_csrColumnOffsets_eb = 0;
21859 PyArrayObject *__pyx_v_csrColumnOffsets_eb_eNebN = 0;
21860 #if !CYTHON_VECTORCALL
21861 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21862 #endif
21863 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21864 PyObject* values[31] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
21865 int __pyx_lineno = 0;
21866 const char *__pyx_filename = NULL;
21867 int __pyx_clineno = 0;
21868 PyObject *__pyx_r = 0;
21869 __Pyx_RefNannyDeclarations
21870 __Pyx_RefNannySetupContext("getOffsets_CSR (wrapper)", 0);
21871 #if !CYTHON_VECTORCALL
21872 #if CYTHON_ASSUME_SAFE_SIZE
21873 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21874 #else
21875 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21876 #endif
21877 #endif
21878 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21879 {
21880 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nElements_global,&__pyx_mstate_global->__pyx_n_u_nDOF_test_element,&__pyx_mstate_global->__pyx_n_u_nDOF_trial_element,&__pyx_mstate_global->__pyx_n_u_nFreeDOF_test,&__pyx_mstate_global->__pyx_n_u_freeGlobal_test,&__pyx_mstate_global->__pyx_n_u_nFreeDOF_trial,&__pyx_mstate_global->__pyx_n_u_freeGlobal_trial,&__pyx_mstate_global->__pyx_n_u_offset_test,&__pyx_mstate_global->__pyx_n_u_stride_test,&__pyx_mstate_global->__pyx_n_u_offset_trial,&__pyx_mstate_global->__pyx_n_u_stride_trial,&__pyx_mstate_global->__pyx_n_u_hasNumericalFlux,&__pyx_mstate_global->__pyx_n_u_hasDiffusionInMixedForm,&__pyx_mstate_global->__pyx_n_u_needNumericalFluxJacobian,&__pyx_mstate_global->__pyx_n_u_nElementBoundaries_element,&__pyx_mstate_global->__pyx_n_u_elementNeighborsArray,&__pyx_mstate_global->__pyx_n_u_nInteriorElementBoundaries_globa,&__pyx_mstate_global->__pyx_n_u_interiorElementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryElementsArray,&__pyx_mstate_global->__pyx_n_u_elementBoundaryLocalElementBound,&__pyx_mstate_global->__pyx_n_u_hasFluxBoundaryConditions,&__pyx_mstate_global->__pyx_n_u_nExteriorElementBoundaries_globa,&__pyx_mstate_global->__pyx_n_u_exteriorElementBoundariesArray,&__pyx_mstate_global->__pyx_n_u_hasOutflowBoundary,&__pyx_mstate_global->__pyx_n_u_needOutflowJacobian,&__pyx_mstate_global->__pyx_n_u_rowptr,&__pyx_mstate_global->__pyx_n_u_csrRowIndeces,&__pyx_mstate_global->__pyx_n_u_csrColumnOffsets,&__pyx_mstate_global->__pyx_n_u_csrColumnOffsets_eNebN,&__pyx_mstate_global->__pyx_n_u_csrColumnOffsets_eb,&__pyx_mstate_global->__pyx_n_u_csrColumnOffsets_eb_eNebN,0};
21881 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21882 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 65, __pyx_L3_error)
21883 if (__pyx_kwds_len > 0) {
21884 switch (__pyx_nargs) {
21885 case 31:
21886 values[30] = __Pyx_ArgRef_FASTCALL(__pyx_args, 30);
21887 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[30])) __PYX_ERR(0, 65, __pyx_L3_error)
21888 CYTHON_FALLTHROUGH;
21889 case 30:
21890 values[29] = __Pyx_ArgRef_FASTCALL(__pyx_args, 29);
21891 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[29])) __PYX_ERR(0, 65, __pyx_L3_error)
21892 CYTHON_FALLTHROUGH;
21893 case 29:
21894 values[28] = __Pyx_ArgRef_FASTCALL(__pyx_args, 28);
21895 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[28])) __PYX_ERR(0, 65, __pyx_L3_error)
21896 CYTHON_FALLTHROUGH;
21897 case 28:
21898 values[27] = __Pyx_ArgRef_FASTCALL(__pyx_args, 27);
21899 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[27])) __PYX_ERR(0, 65, __pyx_L3_error)
21900 CYTHON_FALLTHROUGH;
21901 case 27:
21902 values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
21903 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 65, __pyx_L3_error)
21904 CYTHON_FALLTHROUGH;
21905 case 26:
21906 values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
21907 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 65, __pyx_L3_error)
21908 CYTHON_FALLTHROUGH;
21909 case 25:
21910 values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
21911 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 65, __pyx_L3_error)
21912 CYTHON_FALLTHROUGH;
21913 case 24:
21914 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
21915 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 65, __pyx_L3_error)
21916 CYTHON_FALLTHROUGH;
21917 case 23:
21918 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
21919 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 65, __pyx_L3_error)
21920 CYTHON_FALLTHROUGH;
21921 case 22:
21922 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
21923 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 65, __pyx_L3_error)
21924 CYTHON_FALLTHROUGH;
21925 case 21:
21926 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
21927 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 65, __pyx_L3_error)
21928 CYTHON_FALLTHROUGH;
21929 case 20:
21930 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
21931 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 65, __pyx_L3_error)
21932 CYTHON_FALLTHROUGH;
21933 case 19:
21934 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
21935 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 65, __pyx_L3_error)
21936 CYTHON_FALLTHROUGH;
21937 case 18:
21938 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
21939 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 65, __pyx_L3_error)
21940 CYTHON_FALLTHROUGH;
21941 case 17:
21942 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
21943 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 65, __pyx_L3_error)
21944 CYTHON_FALLTHROUGH;
21945 case 16:
21946 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
21947 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 65, __pyx_L3_error)
21948 CYTHON_FALLTHROUGH;
21949 case 15:
21950 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
21951 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 65, __pyx_L3_error)
21952 CYTHON_FALLTHROUGH;
21953 case 14:
21954 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
21955 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 65, __pyx_L3_error)
21956 CYTHON_FALLTHROUGH;
21957 case 13:
21958 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
21959 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 65, __pyx_L3_error)
21960 CYTHON_FALLTHROUGH;
21961 case 12:
21962 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
21963 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 65, __pyx_L3_error)
21964 CYTHON_FALLTHROUGH;
21965 case 11:
21966 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
21967 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 65, __pyx_L3_error)
21968 CYTHON_FALLTHROUGH;
21969 case 10:
21970 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
21971 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 65, __pyx_L3_error)
21972 CYTHON_FALLTHROUGH;
21973 case 9:
21974 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
21975 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 65, __pyx_L3_error)
21976 CYTHON_FALLTHROUGH;
21977 case 8:
21978 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
21979 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 65, __pyx_L3_error)
21980 CYTHON_FALLTHROUGH;
21981 case 7:
21982 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
21983 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 65, __pyx_L3_error)
21984 CYTHON_FALLTHROUGH;
21985 case 6:
21986 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
21987 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 65, __pyx_L3_error)
21988 CYTHON_FALLTHROUGH;
21989 case 5:
21990 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21991 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 65, __pyx_L3_error)
21992 CYTHON_FALLTHROUGH;
21993 case 4:
21994 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21995 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 65, __pyx_L3_error)
21996 CYTHON_FALLTHROUGH;
21997 case 3:
21998 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21999 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 65, __pyx_L3_error)
22000 CYTHON_FALLTHROUGH;
22001 case 2:
22002 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22003 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 65, __pyx_L3_error)
22004 CYTHON_FALLTHROUGH;
22005 case 1:
22006 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22007 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 65, __pyx_L3_error)
22008 CYTHON_FALLTHROUGH;
22009 case 0: break;
22010 default: goto __pyx_L5_argtuple_error;
22011 }
22012 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22013 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getOffsets_CSR", 0) < (0)) __PYX_ERR(0, 65, __pyx_L3_error)
22014 for (Py_ssize_t i = __pyx_nargs; i < 31; i++) {
22015 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, i); __PYX_ERR(0, 65, __pyx_L3_error) }
22016 }
22017 } else if (unlikely(__pyx_nargs != 31)) {
22018 goto __pyx_L5_argtuple_error;
22019 } else {
22020 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22021 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 65, __pyx_L3_error)
22022 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22023 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 65, __pyx_L3_error)
22024 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22025 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 65, __pyx_L3_error)
22026 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22027 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 65, __pyx_L3_error)
22028 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
22029 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 65, __pyx_L3_error)
22030 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
22031 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 65, __pyx_L3_error)
22032 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
22033 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 65, __pyx_L3_error)
22034 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
22035 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 65, __pyx_L3_error)
22036 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
22037 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 65, __pyx_L3_error)
22038 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
22039 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 65, __pyx_L3_error)
22040 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
22041 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 65, __pyx_L3_error)
22042 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
22043 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 65, __pyx_L3_error)
22044 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
22045 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 65, __pyx_L3_error)
22046 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
22047 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 65, __pyx_L3_error)
22048 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
22049 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 65, __pyx_L3_error)
22050 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
22051 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 65, __pyx_L3_error)
22052 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
22053 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 65, __pyx_L3_error)
22054 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
22055 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 65, __pyx_L3_error)
22056 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
22057 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 65, __pyx_L3_error)
22058 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
22059 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 65, __pyx_L3_error)
22060 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
22061 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 65, __pyx_L3_error)
22062 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
22063 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 65, __pyx_L3_error)
22064 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
22065 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 65, __pyx_L3_error)
22066 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
22067 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 65, __pyx_L3_error)
22068 values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
22069 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 65, __pyx_L3_error)
22070 values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
22071 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 65, __pyx_L3_error)
22072 values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
22073 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 65, __pyx_L3_error)
22074 values[27] = __Pyx_ArgRef_FASTCALL(__pyx_args, 27);
22075 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[27])) __PYX_ERR(0, 65, __pyx_L3_error)
22076 values[28] = __Pyx_ArgRef_FASTCALL(__pyx_args, 28);
22077 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[28])) __PYX_ERR(0, 65, __pyx_L3_error)
22078 values[29] = __Pyx_ArgRef_FASTCALL(__pyx_args, 29);
22079 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[29])) __PYX_ERR(0, 65, __pyx_L3_error)
22080 values[30] = __Pyx_ArgRef_FASTCALL(__pyx_args, 30);
22081 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[30])) __PYX_ERR(0, 65, __pyx_L3_error)
22082 }
22083 __pyx_v_nElements_global = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_nElements_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error)
22084 __pyx_v_nDOF_test_element = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_nDOF_test_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L3_error)
22085 __pyx_v_nDOF_trial_element = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_nDOF_trial_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error)
22086 __pyx_v_nFreeDOF_test = ((PyArrayObject *)values[3]);
22087 __pyx_v_freeGlobal_test = ((PyArrayObject *)values[4]);
22088 __pyx_v_nFreeDOF_trial = ((PyArrayObject *)values[5]);
22089 __pyx_v_freeGlobal_trial = ((PyArrayObject *)values[6]);
22090 __pyx_v_offset_test = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_offset_test == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error)
22091 __pyx_v_stride_test = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_stride_test == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L3_error)
22092 __pyx_v_offset_trial = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_offset_trial == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L3_error)
22093 __pyx_v_stride_trial = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_stride_trial == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error)
22094 __pyx_v_hasNumericalFlux = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_hasNumericalFlux == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error)
22095 __pyx_v_hasDiffusionInMixedForm = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_hasDiffusionInMixedForm == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error)
22096 __pyx_v_needNumericalFluxJacobian = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_needNumericalFluxJacobian == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error)
22097 __pyx_v_nElementBoundaries_element = __Pyx_PyLong_As_int(values[14]); if (unlikely((__pyx_v_nElementBoundaries_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error)
22098 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[15]);
22099 __pyx_v_nInteriorElementBoundaries_global = __Pyx_PyLong_As_int(values[16]); if (unlikely((__pyx_v_nInteriorElementBoundaries_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error)
22100 __pyx_v_interiorElementBoundariesArray = ((PyArrayObject *)values[17]);
22101 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[18]);
22102 __pyx_v_elementBoundaryLocalElementBoundariesArray = ((PyArrayObject *)values[19]);
22103 __pyx_v_hasFluxBoundaryConditions = __Pyx_PyLong_As_int(values[20]); if (unlikely((__pyx_v_hasFluxBoundaryConditions == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
22104 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyLong_As_int(values[21]); if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error)
22105 __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[22]);
22106 __pyx_v_hasOutflowBoundary = __Pyx_PyLong_As_int(values[23]); if (unlikely((__pyx_v_hasOutflowBoundary == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error)
22107 __pyx_v_needOutflowJacobian = __Pyx_PyLong_As_int(values[24]); if (unlikely((__pyx_v_needOutflowJacobian == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error)
22108 __pyx_v_rowptr = ((PyArrayObject *)values[25]);
22109 __pyx_v_csrRowIndeces = ((PyArrayObject *)values[26]);
22110 __pyx_v_csrColumnOffsets = ((PyArrayObject *)values[27]);
22111 __pyx_v_csrColumnOffsets_eNebN = ((PyArrayObject *)values[28]);
22112 __pyx_v_csrColumnOffsets_eb = ((PyArrayObject *)values[29]);
22113 __pyx_v_csrColumnOffsets_eb_eNebN = ((PyArrayObject *)values[30]);
22114 }
22115 goto __pyx_L6_skip;
22116 __pyx_L5_argtuple_error:;
22117 __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, __pyx_nargs); __PYX_ERR(0, 65, __pyx_L3_error)
22118 __pyx_L6_skip:;
22119 goto __pyx_L4_argument_unpacking_done;
22120 __pyx_L3_error:;
22121 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22122 Py_XDECREF(values[__pyx_temp]);
22123 }
22124 __Pyx_AddTraceback("csparsity.PySparsityInfo.getOffsets_CSR", __pyx_clineno, __pyx_lineno, __pyx_filename);
22125 __Pyx_RefNannyFinishContext();
22126 return NULL;
22127 __pyx_L4_argument_unpacking_done:;
22128 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nFreeDOF_test), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "nFreeDOF_test", 0))) __PYX_ERR(0, 69, __pyx_L1_error)
22129 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freeGlobal_test), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "freeGlobal_test", 0))) __PYX_ERR(0, 70, __pyx_L1_error)
22130 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nFreeDOF_trial), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "nFreeDOF_trial", 0))) __PYX_ERR(0, 71, __pyx_L1_error)
22131 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freeGlobal_trial), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "freeGlobal_trial", 0))) __PYX_ERR(0, 72, __pyx_L1_error)
22132 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementNeighborsArray", 0))) __PYX_ERR(0, 81, __pyx_L1_error)
22133 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interiorElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "interiorElementBoundariesArray", 0))) __PYX_ERR(0, 83, __pyx_L1_error)
22134 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryElementsArray", 0))) __PYX_ERR(0, 84, __pyx_L1_error)
22135 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryLocalElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryLocalElementBoundariesArray", 0))) __PYX_ERR(0, 85, __pyx_L1_error)
22136 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "exteriorElementBoundariesArray", 0))) __PYX_ERR(0, 88, __pyx_L1_error)
22137 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(0, 91, __pyx_L1_error)
22138 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrRowIndeces), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "csrRowIndeces", 0))) __PYX_ERR(0, 92, __pyx_L1_error)
22139 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrColumnOffsets), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "csrColumnOffsets", 0))) __PYX_ERR(0, 93, __pyx_L1_error)
22140 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrColumnOffsets_eNebN), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "csrColumnOffsets_eNebN", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
22141 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrColumnOffsets_eb), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "csrColumnOffsets_eb", 0))) __PYX_ERR(0, 95, __pyx_L1_error)
22142 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrColumnOffsets_eb_eNebN), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "csrColumnOffsets_eb_eNebN", 0))) __PYX_ERR(0, 96, __pyx_L1_error)
22143 __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_6getOffsets_CSR(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self), __pyx_v_nElements_global, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_nFreeDOF_test, __pyx_v_freeGlobal_test, __pyx_v_nFreeDOF_trial, __pyx_v_freeGlobal_trial, __pyx_v_offset_test, __pyx_v_stride_test, __pyx_v_offset_trial, __pyx_v_stride_trial, __pyx_v_hasNumericalFlux, __pyx_v_hasDiffusionInMixedForm, __pyx_v_needNumericalFluxJacobian, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_nInteriorElementBoundaries_global, __pyx_v_interiorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementBoundaryLocalElementBoundariesArray, __pyx_v_hasFluxBoundaryConditions, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_hasOutflowBoundary, __pyx_v_needOutflowJacobian, __pyx_v_rowptr, __pyx_v_csrRowIndeces, __pyx_v_csrColumnOffsets, __pyx_v_csrColumnOffsets_eNebN, __pyx_v_csrColumnOffsets_eb, __pyx_v_csrColumnOffsets_eb_eNebN);
22144
22145 /* function exit code */
22146 goto __pyx_L0;
22147 __pyx_L1_error:;
22148 __pyx_r = NULL;
22149 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22150 Py_XDECREF(values[__pyx_temp]);
22151 }
22152 goto __pyx_L7_cleaned_up;
22153 __pyx_L0:;
22154 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22155 Py_XDECREF(values[__pyx_temp]);
22156 }
22157 __pyx_L7_cleaned_up:;
22158
22159
22160
22161
22162
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174 __Pyx_RefNannyFinishContext();
22175 return __pyx_r;
22176}
22177
22178static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_6getOffsets_CSR(struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, int __pyx_v_nElements_global, int __pyx_v_nDOF_test_element, int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_nFreeDOF_test, PyArrayObject *__pyx_v_freeGlobal_test, PyArrayObject *__pyx_v_nFreeDOF_trial, PyArrayObject *__pyx_v_freeGlobal_trial, int __pyx_v_offset_test, int __pyx_v_stride_test, int __pyx_v_offset_trial, int __pyx_v_stride_trial, int __pyx_v_hasNumericalFlux, int __pyx_v_hasDiffusionInMixedForm, int __pyx_v_needNumericalFluxJacobian, int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, int __pyx_v_nInteriorElementBoundaries_global, PyArrayObject *__pyx_v_interiorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray, int __pyx_v_hasFluxBoundaryConditions, int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, int __pyx_v_hasOutflowBoundary, int __pyx_v_needOutflowJacobian, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_csrRowIndeces, PyArrayObject *__pyx_v_csrColumnOffsets, PyArrayObject *__pyx_v_csrColumnOffsets_eNebN, PyArrayObject *__pyx_v_csrColumnOffsets_eb, PyArrayObject *__pyx_v_csrColumnOffsets_eb_eNebN) {
22179 PyObject *__pyx_r = NULL;
22180 __Pyx_RefNannyDeclarations
22181 __Pyx_RefNannySetupContext("getOffsets_CSR", 0);
22182
22183 /* "csparsity.pyx":97
22184 * np.ndarray csrColumnOffsets_eb,
22185 * np.ndarray csrColumnOffsets_eb_eNebN):
22186 * self.cpp.getOffsets_CSR(nElements_global, # <<<<<<<<<<<<<<
22187 * nDOF_test_element,
22188 * nDOF_trial_element,
22189*/
22190 __pyx_v_self->cpp.getOffsets_CSR(__pyx_v_nElements_global, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nFreeDOF_test)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_freeGlobal_test)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nFreeDOF_trial)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_freeGlobal_trial)), __pyx_v_offset_test, __pyx_v_stride_test, __pyx_v_offset_trial, __pyx_v_stride_trial, __pyx_v_hasNumericalFlux, __pyx_v_hasDiffusionInMixedForm, __pyx_v_needNumericalFluxJacobian, __pyx_v_nElementBoundaries_element, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementNeighborsArray)), __pyx_v_nInteriorElementBoundaries_global, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_interiorElementBoundariesArray)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementBoundaryElementsArray)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementBoundaryLocalElementBoundariesArray)), __pyx_v_hasFluxBoundaryConditions, __pyx_v_nExteriorElementBoundaries_global, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_exteriorElementBoundariesArray)), __pyx_v_hasOutflowBoundary, __pyx_v_needOutflowJacobian, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_rowptr)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_csrRowIndeces)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_csrColumnOffsets)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_csrColumnOffsets_eNebN)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_csrColumnOffsets_eb)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_csrColumnOffsets_eb_eNebN)));
22191
22192 /* "csparsity.pyx":65
22193 * hasOutflowBoundary,
22194 * needOutflowJacobian)
22195 * def getOffsets_CSR(self, # <<<<<<<<<<<<<<
22196 * int nElements_global,
22197 * int nDOF_test_element,
22198*/
22199
22200 /* function exit code */
22201 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22202 __Pyx_XGIVEREF(__pyx_r);
22203 __Pyx_RefNannyFinishContext();
22204 return __pyx_r;
22205}
22206
22207/* "csparsity.pyx":128
22208 * <int*> csrColumnOffsets_eb.data,
22209 * <int*> csrColumnOffsets_eb_eNebN.data)
22210 * def getCSR(self): # <<<<<<<<<<<<<<
22211 * self.cpp.getCSR()
22212 * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr),
22213*/
22214
22215/* Python wrapper */
22216static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_9getCSR(PyObject *__pyx_v_self,
22217#if CYTHON_VECTORCALL
22218PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22219#else
22220PyObject *__pyx_args, PyObject *__pyx_kwds
22221#endif
22222); /*proto*/
22223static PyMethodDef __pyx_mdef_9csparsity_14PySparsityInfo_9getCSR = {"getCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_9getCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22224static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_9getCSR(PyObject *__pyx_v_self,
22225#if CYTHON_VECTORCALL
22226PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22227#else
22228PyObject *__pyx_args, PyObject *__pyx_kwds
22229#endif
22230) {
22231 #if !CYTHON_VECTORCALL
22232 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22233 #endif
22234 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22235 PyObject *__pyx_r = 0;
22236 __Pyx_RefNannyDeclarations
22237 __Pyx_RefNannySetupContext("getCSR (wrapper)", 0);
22238 #if !CYTHON_VECTORCALL
22239 #if CYTHON_ASSUME_SAFE_SIZE
22240 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22241 #else
22242 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22243 #endif
22244 #endif
22245 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22246 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCSR", 1, 0, 0, __pyx_nargs); return NULL; }
22247 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22248 if (unlikely(__pyx_kwds_len < 0)) return NULL;
22249 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCSR", __pyx_kwds); return NULL;}
22250 __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_8getCSR(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self));
22251
22252 /* function exit code */
22253 __Pyx_RefNannyFinishContext();
22254 return __pyx_r;
22255}
22256
22257static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_8getCSR(struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self) {
22258 PyObject *__pyx_r = NULL;
22259 __Pyx_RefNannyDeclarations
22260 PyObject *__pyx_t_1 = NULL;
22261 PyObject *__pyx_t_2 = NULL;
22262 PyObject *__pyx_t_3 = NULL;
22263 PyObject *__pyx_t_4 = NULL;
22264 int *__pyx_t_5;
22265 struct __pyx_array_obj *__pyx_t_6 = NULL;
22266 PyObject *__pyx_t_7 = NULL;
22267 char *__pyx_t_8;
22268 size_t __pyx_t_9;
22269 PyObject *__pyx_t_10 = NULL;
22270 PyObject *__pyx_t_11 = NULL;
22271 double *__pyx_t_12;
22272 PyObject *__pyx_t_13 = NULL;
22273 int __pyx_lineno = 0;
22274 const char *__pyx_filename = NULL;
22275 int __pyx_clineno = 0;
22276 __Pyx_RefNannySetupContext("getCSR", 0);
22277
22278 /* "csparsity.pyx":129
22279 * <int*> csrColumnOffsets_eb_eNebN.data)
22280 * def getCSR(self):
22281 * self.cpp.getCSR() # <<<<<<<<<<<<<<
22282 * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr),
22283 * np.asarray(<int[:self.cpp.nnz]>self.cpp.colind),
22284*/
22285 __pyx_v_self->cpp.getCSR();
22286
22287 /* "csparsity.pyx":130
22288 * def getCSR(self):
22289 * self.cpp.getCSR()
22290 * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr), # <<<<<<<<<<<<<<
22291 * np.asarray(<int[:self.cpp.nnz]>self.cpp.colind),
22292 * self.cpp.nnz,
22293*/
22294 __pyx_t_2 = NULL;
22295 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
22296 __Pyx_GOTREF(__pyx_t_3);
22297 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error)
22298 __Pyx_GOTREF(__pyx_t_4);
22299 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22300 __pyx_t_5 = __pyx_v_self->cpp.rowptr;
22301
22302 if (!__pyx_t_5) {
22303 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22304 __PYX_ERR(0, 130, __pyx_L1_error)
22305 }
22306 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error)
22307 __Pyx_GOTREF(__pyx_t_7);
22308 __pyx_t_3 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->cpp.nrows)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
22309 __Pyx_GOTREF(__pyx_t_3);
22310 #if CYTHON_COMPILING_IN_LIMITED_API
22311 __pyx_t_8 = PyBytes_AsString(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 130, __pyx_L1_error)
22312 #else
22313 __pyx_t_8 = PyBytes_AS_STRING(__pyx_t_7);
22314 #endif
22315 __pyx_t_6 = __pyx_array_new(__pyx_t_3, sizeof(int), __pyx_t_8, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error)
22316 __Pyx_GOTREF((PyObject *)__pyx_t_6);
22317 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22318 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22319
22320 __pyx_t_9 = 1;
22321 #if CYTHON_UNPACK_METHODS
22322 if (unlikely(PyMethod_Check(__pyx_t_4))) {
22323 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
22324 assert(__pyx_t_2);
22325 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
22326 __Pyx_INCREF(__pyx_t_2);
22327 __Pyx_INCREF(__pyx__function);
22328 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
22329 __pyx_t_9 = 0;
22330 }
22331 #endif
22332 {
22333 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_6)};
22334 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22335 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22336 __Pyx_DECREF((PyObject *)__pyx_t_6); __pyx_t_6 = 0;
22337 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22338 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
22339 __Pyx_GOTREF(__pyx_t_1);
22340 }
22341
22342 /* "csparsity.pyx":131
22343 * self.cpp.getCSR()
22344 * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr),
22345 * np.asarray(<int[:self.cpp.nnz]>self.cpp.colind), # <<<<<<<<<<<<<<
22346 * self.cpp.nnz,
22347 * np.asarray(<double[:self.cpp.nnz]>self.cpp.nzval))
22348*/
22349 __pyx_t_2 = NULL;
22350 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error)
22351 __Pyx_GOTREF(__pyx_t_7);
22352 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error)
22353 __Pyx_GOTREF(__pyx_t_3);
22354 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22355 __pyx_t_5 = __pyx_v_self->cpp.colind;
22356
22357 if (!__pyx_t_5) {
22358 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22359 __PYX_ERR(0, 131, __pyx_L1_error)
22360 }
22361 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 131, __pyx_L1_error)
22362 __Pyx_GOTREF(__pyx_t_10);
22363 __pyx_t_7 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->cpp.nnz)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error)
22364 __Pyx_GOTREF(__pyx_t_7);
22365 #if CYTHON_COMPILING_IN_LIMITED_API
22366 __pyx_t_8 = PyBytes_AsString(__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 131, __pyx_L1_error)
22367 #else
22368 __pyx_t_8 = PyBytes_AS_STRING(__pyx_t_10);
22369 #endif
22370 __pyx_t_6 = __pyx_array_new(__pyx_t_7, sizeof(int), __pyx_t_8, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error)
22371 __Pyx_GOTREF((PyObject *)__pyx_t_6);
22372 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22373 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22374
22375 __pyx_t_9 = 1;
22376 #if CYTHON_UNPACK_METHODS
22377 if (unlikely(PyMethod_Check(__pyx_t_3))) {
22378 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
22379 assert(__pyx_t_2);
22380 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
22381 __Pyx_INCREF(__pyx_t_2);
22382 __Pyx_INCREF(__pyx__function);
22383 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
22384 __pyx_t_9 = 0;
22385 }
22386 #endif
22387 {
22388 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_6)};
22389 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22390 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22391 __Pyx_DECREF((PyObject *)__pyx_t_6); __pyx_t_6 = 0;
22392 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22393 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
22394 __Pyx_GOTREF(__pyx_t_4);
22395 }
22396
22397 /* "csparsity.pyx":132
22398 * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr),
22399 * np.asarray(<int[:self.cpp.nnz]>self.cpp.colind),
22400 * self.cpp.nnz, # <<<<<<<<<<<<<<
22401 * np.asarray(<double[:self.cpp.nnz]>self.cpp.nzval))
22402*/
22403 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_self->cpp.nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error)
22404 __Pyx_GOTREF(__pyx_t_3);
22405
22406 /* "csparsity.pyx":133
22407 * np.asarray(<int[:self.cpp.nnz]>self.cpp.colind),
22408 * self.cpp.nnz,
22409 * np.asarray(<double[:self.cpp.nnz]>self.cpp.nzval)) # <<<<<<<<<<<<<<
22410*/
22411 __pyx_t_10 = NULL;
22412 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 133, __pyx_L1_error)
22413 __Pyx_GOTREF(__pyx_t_7);
22414 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 133, __pyx_L1_error)
22415 __Pyx_GOTREF(__pyx_t_11);
22416 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22417 __pyx_t_12 = __pyx_v_self->cpp.nzval;
22418
22419 if (!__pyx_t_12) {
22420 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22421 __PYX_ERR(0, 133, __pyx_L1_error)
22422 }
22423 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 133, __pyx_L1_error)
22424 __Pyx_GOTREF(__pyx_t_13);
22425 __pyx_t_7 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->cpp.nnz)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 133, __pyx_L1_error)
22426 __Pyx_GOTREF(__pyx_t_7);
22427 #if CYTHON_COMPILING_IN_LIMITED_API
22428 __pyx_t_8 = PyBytes_AsString(__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 133, __pyx_L1_error)
22429 #else
22430 __pyx_t_8 = PyBytes_AS_STRING(__pyx_t_13);
22431 #endif
22432 __pyx_t_6 = __pyx_array_new(__pyx_t_7, sizeof(double), __pyx_t_8, "c", (char *) __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error)
22433 __Pyx_GOTREF((PyObject *)__pyx_t_6);
22434 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22435 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22436
22437 __pyx_t_9 = 1;
22438 #if CYTHON_UNPACK_METHODS
22439 if (unlikely(PyMethod_Check(__pyx_t_11))) {
22440 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
22441 assert(__pyx_t_10);
22442 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
22443 __Pyx_INCREF(__pyx_t_10);
22444 __Pyx_INCREF(__pyx__function);
22445 __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
22446 __pyx_t_9 = 0;
22447 }
22448 #endif
22449 {
22450 PyObject *__pyx_callargs[2] = {__pyx_t_10, ((PyObject *)__pyx_t_6)};
22451 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22452 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22453 __Pyx_DECREF((PyObject *)__pyx_t_6); __pyx_t_6 = 0;
22454 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22455 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
22456 __Pyx_GOTREF(__pyx_t_2);
22457 }
22458
22459 /* "csparsity.pyx":130
22460 * def getCSR(self):
22461 * self.cpp.getCSR()
22462 * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr), # <<<<<<<<<<<<<<
22463 * np.asarray(<int[:self.cpp.nnz]>self.cpp.colind),
22464 * self.cpp.nnz,
22465*/
22466 __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 130, __pyx_L1_error)
22467 __Pyx_GOTREF(__pyx_t_11);
22468 __Pyx_GIVEREF(__pyx_t_1);
22469 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 130, __pyx_L1_error);
22470 __Pyx_GIVEREF(__pyx_t_4);
22471 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 130, __pyx_L1_error);
22472 __Pyx_GIVEREF(__pyx_t_3);
22473 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 130, __pyx_L1_error);
22474 __Pyx_GIVEREF(__pyx_t_2);
22475 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_2) != (0)) __PYX_ERR(0, 130, __pyx_L1_error);
22476 __pyx_t_1 = 0;
22477 __pyx_t_4 = 0;
22478 __pyx_t_3 = 0;
22479 __pyx_t_2 = 0;
22480 {
22481 PyObject *__pyx_temp;
22482 {
22483 __pyx_temp = __pyx_r;
22484 __pyx_r = __pyx_t_11;
22485 }
22486 __Pyx_XDECREF(__pyx_temp);
22487 }
22488 __pyx_t_11 = 0;
22489 goto __pyx_L0;
22490
22491 /* "csparsity.pyx":128
22492 * <int*> csrColumnOffsets_eb.data,
22493 * <int*> csrColumnOffsets_eb_eNebN.data)
22494 * def getCSR(self): # <<<<<<<<<<<<<<
22495 * self.cpp.getCSR()
22496 * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr),
22497*/
22498
22499 /* function exit code */
22500 __pyx_L1_error:;
22501 __Pyx_XDECREF(__pyx_t_1);
22502 __Pyx_XDECREF(__pyx_t_2);
22503 __Pyx_XDECREF(__pyx_t_3);
22504 __Pyx_XDECREF(__pyx_t_4);
22505 __Pyx_XDECREF((PyObject *)__pyx_t_6);
22506 __Pyx_XDECREF(__pyx_t_7);
22507 __Pyx_XDECREF(__pyx_t_10);
22508 __Pyx_XDECREF(__pyx_t_11);
22509 __Pyx_XDECREF(__pyx_t_13);
22510 __Pyx_AddTraceback("csparsity.PySparsityInfo.getCSR", __pyx_clineno, __pyx_lineno, __pyx_filename);
22511 __pyx_r = NULL;
22512 __pyx_L0:;
22513 __Pyx_XGIVEREF(__pyx_r);
22514 __Pyx_RefNannyFinishContext();
22515 return __pyx_r;
22516}
22517
22518/* "(tree fragment)":1
22519 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22520 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22521 * def __setstate_cython__(self, __pyx_state):
22522*/
22523
22524/* Python wrapper */
22525static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_11__reduce_cython__(PyObject *__pyx_v_self,
22526#if CYTHON_VECTORCALL
22527PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22528#else
22529PyObject *__pyx_args, PyObject *__pyx_kwds
22530#endif
22531); /*proto*/
22532static PyMethodDef __pyx_mdef_9csparsity_14PySparsityInfo_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22533static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_11__reduce_cython__(PyObject *__pyx_v_self,
22534#if CYTHON_VECTORCALL
22535PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22536#else
22537PyObject *__pyx_args, PyObject *__pyx_kwds
22538#endif
22539) {
22540 #if !CYTHON_VECTORCALL
22541 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22542 #endif
22543 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22544 PyObject *__pyx_r = 0;
22545 __Pyx_RefNannyDeclarations
22546 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
22547 #if !CYTHON_VECTORCALL
22548 #if CYTHON_ASSUME_SAFE_SIZE
22549 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22550 #else
22551 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22552 #endif
22553 #endif
22554 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22555 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
22556 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22557 if (unlikely(__pyx_kwds_len < 0)) return NULL;
22558 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
22559 __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_10__reduce_cython__(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self));
22560
22561 /* function exit code */
22562 __Pyx_RefNannyFinishContext();
22563 return __pyx_r;
22564}
22565
22566static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self) {
22567 PyObject *__pyx_r = NULL;
22568 __Pyx_RefNannyDeclarations
22569 int __pyx_lineno = 0;
22570 const char *__pyx_filename = NULL;
22571 int __pyx_clineno = 0;
22572 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
22573
22574 /* "(tree fragment)":2
22575 * def __reduce_cython__(self):
22576 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
22577 * def __setstate_cython__(self, __pyx_state):
22578 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22579*/
22580 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
22581 __PYX_ERR(1, 2, __pyx_L1_error)
22582
22583 /* "(tree fragment)":1
22584 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22585 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22586 * def __setstate_cython__(self, __pyx_state):
22587*/
22588
22589 /* function exit code */
22590 __pyx_L1_error:;
22591 __Pyx_AddTraceback("csparsity.PySparsityInfo.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22592 __pyx_r = NULL;
22593 __Pyx_XGIVEREF(__pyx_r);
22594 __Pyx_RefNannyFinishContext();
22595 return __pyx_r;
22596}
22597
22598/* "(tree fragment)":3
22599 * def __reduce_cython__(self):
22600 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22601 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22602 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22603*/
22604
22605/* Python wrapper */
22606static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_13__setstate_cython__(PyObject *__pyx_v_self,
22607#if CYTHON_VECTORCALL
22608PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22609#else
22610PyObject *__pyx_args, PyObject *__pyx_kwds
22611#endif
22612); /*proto*/
22613static PyMethodDef __pyx_mdef_9csparsity_14PySparsityInfo_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22614static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_13__setstate_cython__(PyObject *__pyx_v_self,
22615#if CYTHON_VECTORCALL
22616PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22617#else
22618PyObject *__pyx_args, PyObject *__pyx_kwds
22619#endif
22620) {
22621 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
22622 #if !CYTHON_VECTORCALL
22623 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22624 #endif
22625 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22626 PyObject* values[1] = {0};
22627 int __pyx_lineno = 0;
22628 const char *__pyx_filename = NULL;
22629 int __pyx_clineno = 0;
22630 PyObject *__pyx_r = 0;
22631 __Pyx_RefNannyDeclarations
22632 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
22633 #if !CYTHON_VECTORCALL
22634 #if CYTHON_ASSUME_SAFE_SIZE
22635 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22636 #else
22637 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22638 #endif
22639 #endif
22640 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22641 {
22642 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
22643 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22644 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
22645 if (__pyx_kwds_len > 0) {
22646 switch (__pyx_nargs) {
22647 case 1:
22648 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22649 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
22650 CYTHON_FALLTHROUGH;
22651 case 0: break;
22652 default: goto __pyx_L5_argtuple_error;
22653 }
22654 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22655 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
22656 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
22657 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
22658 }
22659 } else if (unlikely(__pyx_nargs != 1)) {
22660 goto __pyx_L5_argtuple_error;
22661 } else {
22662 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22663 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
22664 }
22665 __pyx_v___pyx_state = values[0];
22666 }
22667 goto __pyx_L6_skip;
22668 __pyx_L5_argtuple_error:;
22669 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
22670 __pyx_L6_skip:;
22671 goto __pyx_L4_argument_unpacking_done;
22672 __pyx_L3_error:;
22673 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22674 Py_XDECREF(values[__pyx_temp]);
22675 }
22676 __Pyx_AddTraceback("csparsity.PySparsityInfo.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22677 __Pyx_RefNannyFinishContext();
22678 return NULL;
22679 __pyx_L4_argument_unpacking_done:;
22680 __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_12__setstate_cython__(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self), __pyx_v___pyx_state);
22681
22682 /* function exit code */
22683 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22684 Py_XDECREF(values[__pyx_temp]);
22685 }
22686 __Pyx_RefNannyFinishContext();
22687 return __pyx_r;
22688}
22689
22690static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
22691 PyObject *__pyx_r = NULL;
22692 __Pyx_RefNannyDeclarations
22693 int __pyx_lineno = 0;
22694 const char *__pyx_filename = NULL;
22695 int __pyx_clineno = 0;
22696 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
22697
22698 /* "(tree fragment)":4
22699 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22700 * def __setstate_cython__(self, __pyx_state):
22701 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
22702*/
22703 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
22704 __PYX_ERR(1, 4, __pyx_L1_error)
22705
22706 /* "(tree fragment)":3
22707 * def __reduce_cython__(self):
22708 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22709 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22710 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22711*/
22712
22713 /* function exit code */
22714 __pyx_L1_error:;
22715 __Pyx_AddTraceback("csparsity.PySparsityInfo.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22716 __pyx_r = NULL;
22717 __Pyx_XGIVEREF(__pyx_r);
22718 __Pyx_RefNannyFinishContext();
22719 return __pyx_r;
22720}
22721/* #### Code section: module_exttypes ### */
22722
22723static PyObject *__pyx_tp_new__initialisation_9csparsity_PySparsityInfo(PyObject *o,
22724#if CYTHON_VECTORCALL_TPNEW
22725 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
22726#else
22727 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
22728#endif
22729) {
22730 struct __pyx_obj_9csparsity_PySparsityInfo *p = ((struct __pyx_obj_9csparsity_PySparsityInfo *)o);
22731 __Pyx_default_placement_construct(&(p->cpp));
22732 {
22733 int cinit_result = __pyx_pw_9csparsity_14PySparsityInfo_1__cinit__(
22734 #if CYTHON_VECTORCALL_TPNEW
22735 o, NULL, 0, NULL);
22736 #else
22737 o, __pyx_mstate_global->__pyx_empty_tuple, NULL);
22738 #endif
22739 if (unlikely(cinit_result)) goto bad;
22740 }
22741 return o;
22742 bad:
22743 Py_DECREF(o); o = 0;
22744 return NULL;
22745}
22746
22747static PyObject *__pyx_tp_new_vectorcall_9csparsity_PySparsityInfo(PyTypeObject *t,
22748#if CYTHON_VECTORCALL_TPNEW
22749 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
22750#else
22751 PyObject *a, PyObject *k
22752#endif
22753) {
22754 PyObject *o;
22755 o = __Pyx_AllocateExtensionType(t, 0);
22756 if (unlikely(!o)) return 0;
22757 return __pyx_tp_new__initialisation_9csparsity_PySparsityInfo(o,
22758#if CYTHON_VECTORCALL_TPNEW
22759 args, nargs, kwnames
22760#else
22761 a, k
22762#endif
22763);
22764}
22765
22766#if CYTHON_VECTORCALL_TPNEW
22767static PyObject *__pyx_tp_new_9csparsity_PySparsityInfo(PyTypeObject *t, PyObject *a, PyObject *k) {
22768 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_9csparsity_PySparsityInfo, t, a, k);
22769}
22770#endif
22771
22772#if CYTHON_VECTORCALL_TPNEW
22773static PyObject *__pyx_tp_vectorcall_9csparsity_PySparsityInfo(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
22774 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_9csparsity_PySparsityInfo || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
22775 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
22776 }
22777 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
22778 PyObject *o = __pyx_tp_new_vectorcall_9csparsity_PySparsityInfo((PyTypeObject*)t, args, nargs, kwnames);
22779 return o;
22780}
22781#endif
22782
22783static void __pyx_tp_dealloc_9csparsity_PySparsityInfo(PyObject *o) {
22784 struct __pyx_obj_9csparsity_PySparsityInfo *p = (struct __pyx_obj_9csparsity_PySparsityInfo *)o;
22785 #if CYTHON_USE_TP_FINALIZE
22786 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
22787 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9csparsity_PySparsityInfo) {
22788 if (PyObject_CallFinalizerFromDealloc(o)) return;
22789 }
22790 }
22791 #endif
22792 {
22793 PyObject *etype, *eval, *etb;
22794 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
22795 __Pyx_DeallocKeepAliveBegin(o);
22796 __pyx_pw_9csparsity_14PySparsityInfo_3__dealloc__(o);
22797 __Pyx_DeallocKeepAliveEnd(o);
22798 __Pyx_PyErr_RestoreException(etype, eval, etb);
22799 }
22800 __Pyx_call_destructor(p->cpp);
22801 PyTypeObject *tp = Py_TYPE(o);
22802 #if CYTHON_USE_TYPE_SLOTS
22803 (*tp->tp_free)(o);
22804 #else
22805 {
22806 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
22807 if (tp_free) tp_free(o);
22808 }
22809 #endif
22810 #if CYTHON_USE_TYPE_SPECS
22811 Py_DECREF(tp);
22812 #endif
22813}
22814
22815static PyMethodDef __pyx_methods_9csparsity_PySparsityInfo[] = {
22816 {"findNonzeros", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_5findNonzeros, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
22817 {"getOffsets_CSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_7getOffsets_CSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
22818 {"getCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_9getCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
22819 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
22820 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
22821 {0, 0, 0, 0}
22822};
22823#if CYTHON_USE_TYPE_SPECS
22824static PyType_Slot __pyx_type_9csparsity_PySparsityInfo_slots[] = {
22825 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9csparsity_PySparsityInfo},
22826 {Py_tp_methods, (void *)__pyx_methods_9csparsity_PySparsityInfo},
22827 {Py_tp_new, (void *)__pyx_tp_new_9csparsity_PySparsityInfo},
22828 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
22829 #if CYTHON_VECTORCALL_TPNEW
22830 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_9csparsity_PySparsityInfo},
22831 #endif
22832 #endif
22833 {0, 0},
22834};
22835static PyType_Spec __pyx_type_9csparsity_PySparsityInfo_spec = {
22836 "csparsity.PySparsityInfo",
22837 sizeof(struct __pyx_obj_9csparsity_PySparsityInfo),
22838 0,
22839 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
22840 __pyx_type_9csparsity_PySparsityInfo_slots,
22841};
22842#else
22843
22844static PyTypeObject __pyx_type_9csparsity_PySparsityInfo = {
22845 PyVarObject_HEAD_INIT(0, 0)
22846 "csparsity.""PySparsityInfo", /*tp_name*/
22847 sizeof(struct __pyx_obj_9csparsity_PySparsityInfo), /*tp_basicsize*/
22848 0, /*tp_itemsize*/
22849 __pyx_tp_dealloc_9csparsity_PySparsityInfo, /*tp_dealloc*/
22850 0, /*tp_vectorcall_offset*/
22851 0, /*tp_getattr*/
22852 0, /*tp_setattr*/
22853 0, /*tp_as_async*/
22854 0, /*tp_repr*/
22855 0, /*tp_as_number*/
22856 0, /*tp_as_sequence*/
22857 0, /*tp_as_mapping*/
22858 0, /*tp_hash*/
22859 0, /*tp_call*/
22860 0, /*tp_str*/
22861 0, /*tp_getattro*/
22862 0, /*tp_setattro*/
22863 0, /*tp_as_buffer*/
22864 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
22865 0, /*tp_doc*/
22866 0, /*tp_traverse*/
22867 0, /*tp_clear*/
22868 0, /*tp_richcompare*/
22869 0, /*tp_weaklistoffset*/
22870 0, /*tp_iter*/
22871 0, /*tp_iternext*/
22872 __pyx_methods_9csparsity_PySparsityInfo, /*tp_methods*/
22873 0, /*tp_members*/
22874 0, /*tp_getset*/
22875 0, /*tp_base*/
22876 0, /*tp_dict*/
22877 0, /*tp_descr_get*/
22878 0, /*tp_descr_set*/
22879 #if !CYTHON_USE_TYPE_SPECS
22880 0, /*tp_dictoffset*/
22881 #endif
22882 0, /*tp_init*/
22883 0, /*tp_alloc*/
22884 __pyx_tp_new_9csparsity_PySparsityInfo, /*tp_new*/
22885 0, /*tp_free*/
22886 0, /*tp_is_gc*/
22887 0, /*tp_bases*/
22888 0, /*tp_mro*/
22889 0, /*tp_cache*/
22890 0, /*tp_subclasses*/
22891 0, /*tp_weaklist*/
22892 0, /*tp_del*/
22893 0, /*tp_version_tag*/
22894 #if CYTHON_USE_TP_FINALIZE
22895 0, /*tp_finalize*/
22896 #else
22897 NULL, /*tp_finalize*/
22898 #endif
22899 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
22900 #if CYTHON_VECTORCALL_TPNEW
22901 __pyx_tp_vectorcall_9csparsity_PySparsityInfo, /*tp_vectorcall*/
22902 #else
22903 NULL, /*tp_vectorcall*/
22904 #endif
22905 #endif
22906 #if __PYX_NEED_TP_PRINT_SLOT == 1
22907 0, /*tp_print*/
22908 #endif
22909 #if PY_VERSION_HEX >= 0x030C0000
22910 0, /*tp_watched*/
22911 #endif
22912 #if PY_VERSION_HEX >= 0x030d00A4
22913 0, /*tp_versions_used*/
22914 #endif
22915 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
22916 0, /*tp_pypy_flags*/
22917 #endif
22918};
22919#endif
22920static struct __pyx_vtabstruct_array __pyx_vtable_array;
22921
22922static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
22923#if CYTHON_VECTORCALL_TPNEW
22924 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
22925#else
22926 PyObject *a, PyObject *k
22927#endif
22928) {
22929 struct __pyx_array_obj *p = ((struct __pyx_array_obj *)o);
22930 p->__pyx_vtab = __pyx_vtabptr_array;
22931 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
22932 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
22933 {
22934 int cinit_result = __pyx_array___cinit__(o,
22935#if CYTHON_VECTORCALL_TPNEW
22936 args, nargs, kwnames
22937#else
22938 a, k
22939#endif
22940);
22941 if (unlikely(cinit_result)) goto bad;
22942 }
22943 return o;
22944 bad:
22945 Py_DECREF(o); o = 0;
22946 return NULL;
22947}
22948
22949static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
22950#if CYTHON_VECTORCALL_TPNEW
22951 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
22952#else
22953 PyObject *a, PyObject *k
22954#endif
22955) {
22956 PyObject *o;
22957 o = __Pyx_AllocateExtensionType(t, 0);
22958 if (unlikely(!o)) return 0;
22959 return __pyx_tp_new__initialisation_array(o,
22960#if CYTHON_VECTORCALL_TPNEW
22961 args, nargs, kwnames
22962#else
22963 a, k
22964#endif
22965);
22966}
22967
22968#if CYTHON_VECTORCALL_TPNEW
22969static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
22970 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_array, t, a, k);
22971}
22972#endif
22973
22974#if CYTHON_VECTORCALL_TPNEW
22975static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
22976 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_array_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
22977 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
22978 }
22979 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
22980 PyObject *o = __pyx_tp_new_vectorcall_array((PyTypeObject*)t, args, nargs, kwnames);
22981 return o;
22982}
22983#endif
22984
22985static void __pyx_tp_dealloc_array(PyObject *o) {
22986 struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
22987 #if CYTHON_USE_TP_FINALIZE
22988 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
22989 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
22990 if (PyObject_CallFinalizerFromDealloc(o)) return;
22991 }
22992 }
22993 #endif
22994 {
22995 PyObject *etype, *eval, *etb;
22996 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
22997 __Pyx_DeallocKeepAliveBegin(o);
22998 __pyx_array___dealloc__(o);
22999 __Pyx_DeallocKeepAliveEnd(o);
23000 __Pyx_PyErr_RestoreException(etype, eval, etb);
23001 }
23002 Py_CLEAR(p->mode);
23003 Py_CLEAR(p->_format);
23004 PyTypeObject *tp = Py_TYPE(o);
23005 #if CYTHON_USE_TYPE_SLOTS
23006 (*tp->tp_free)(o);
23007 #else
23008 {
23009 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
23010 if (tp_free) tp_free(o);
23011 }
23012 #endif
23013 #if CYTHON_USE_TYPE_SPECS
23014 Py_DECREF(tp);
23015 #endif
23016}
23017
23018static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
23019 PyObject *r;
23020 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return NULL;
23021 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
23022 binaryfunc f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
23023 #else
23024 binaryfunc f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
23025 #endif
23026 r = f(o, x);
23027 Py_DECREF(x);
23028 return r;
23029}
23030
23031static PyObject *__pyx_mp_subscript_array(PyObject *o, PyObject *i) {
23032 return __pyx_array___getitem__(o, i);
23033}
23034
23035static int __pyx_sq_ass_item_array(PyObject *o, Py_ssize_t i, PyObject *v) {
23036 if (likely(v)) {
23037 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return -1;
23038 int r = __pyx_array___setitem__(o, x, v);
23039 Py_DECREF(x);
23040 return r;
23041 } else {
23042 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
23043 return -1;
23044 }
23045}
23046
23047static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
23048 if (likely(v)) {
23049 return __pyx_array___setitem__(o, i, v);
23050 } else {
23051 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
23052 return -1;
23053 }
23054}
23055
23056static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
23057 PyObject *v = PyObject_GenericGetAttr(o, n);
23058 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
23059 PyErr_Clear();
23060 v = __pyx_array___getattr__(o, n);
23061 }
23062 return v;
23063}
23064
23065static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
23066 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
23067}
23068
23069static PyMethodDef __pyx_methods_array[] = {
23070 {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
23071 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23072 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23073 {0, 0, 0, 0}
23074};
23075
23076static struct PyGetSetDef __pyx_getsets_array[] = {
23077 {"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
23078 {0, 0, 0, 0, 0}
23079};
23080#if CYTHON_USE_TYPE_SPECS
23081#if !CYTHON_COMPILING_IN_LIMITED_API
23082
23083static PyBufferProcs __pyx_tp_as_buffer_array = {
23084 __pyx_array_getbuffer, /*bf_getbuffer*/
23085 0, /*bf_releasebuffer*/
23086};
23087#endif
23088static PyType_Slot __pyx_type___pyx_array_slots[] = {
23089 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
23090 {Py_sq_length, (void *)__pyx_array___len__},
23091 {Py_sq_item, (void *)__pyx_sq_item_array},
23092 {Py_sq_ass_item, (void *)__pyx_sq_ass_item_array},
23093 {Py_mp_length, (void *)__pyx_array___len__},
23094 {Py_mp_subscript, (void *)__pyx_mp_subscript_array},
23095 {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
23096 {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
23097 #if defined(Py_bf_getbuffer)
23098 {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
23099 #endif
23100 {Py_tp_methods, (void *)__pyx_methods_array},
23101 {Py_tp_getset, (void *)__pyx_getsets_array},
23102 {Py_tp_new, (void *)__pyx_tp_new_array},
23103 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23104 #if CYTHON_VECTORCALL_TPNEW
23105 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_array},
23106 #endif
23107 #endif
23108 {0, 0},
23109};
23110static PyType_Spec __pyx_type___pyx_array_spec = {
23111 "csparsity.array",
23112 sizeof(struct __pyx_array_obj),
23113 0,
23114 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
23115 __pyx_type___pyx_array_slots,
23116};
23117#else
23118
23119static PySequenceMethods __pyx_tp_as_sequence_array = {
23120 __pyx_array___len__, /*sq_length*/
23121 0, /*sq_concat*/
23122 0, /*sq_repeat*/
23123 __pyx_sq_item_array, /*sq_item*/
23124 0, /*sq_slice*/
23125 __pyx_sq_ass_item_array, /*sq_ass_item*/
23126 0, /*sq_ass_slice*/
23127 0, /*sq_contains*/
23128 0, /*sq_inplace_concat*/
23129 0, /*sq_inplace_repeat*/
23130};
23131
23132static PyMappingMethods __pyx_tp_as_mapping_array = {
23133 __pyx_array___len__, /*mp_length*/
23134 __pyx_mp_subscript_array, /*mp_subscript*/
23135 __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
23136};
23137
23138static PyBufferProcs __pyx_tp_as_buffer_array = {
23139 __pyx_array_getbuffer, /*bf_getbuffer*/
23140 0, /*bf_releasebuffer*/
23141};
23142
23143static PyTypeObject __pyx_type___pyx_array = {
23144 PyVarObject_HEAD_INIT(0, 0)
23145 "csparsity.""array", /*tp_name*/
23146 sizeof(struct __pyx_array_obj), /*tp_basicsize*/
23147 0, /*tp_itemsize*/
23148 __pyx_tp_dealloc_array, /*tp_dealloc*/
23149 0, /*tp_vectorcall_offset*/
23150 0, /*tp_getattr*/
23151 0, /*tp_setattr*/
23152 0, /*tp_as_async*/
23153 0, /*tp_repr*/
23154 0, /*tp_as_number*/
23155 &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
23156 &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
23157 0, /*tp_hash*/
23158 0, /*tp_call*/
23159 0, /*tp_str*/
23160 __pyx_tp_getattro_array, /*tp_getattro*/
23161 0, /*tp_setattro*/
23162 &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
23163 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
23164 0, /*tp_doc*/
23165 0, /*tp_traverse*/
23166 0, /*tp_clear*/
23167 0, /*tp_richcompare*/
23168 0, /*tp_weaklistoffset*/
23169 0, /*tp_iter*/
23170 0, /*tp_iternext*/
23171 __pyx_methods_array, /*tp_methods*/
23172 0, /*tp_members*/
23173 __pyx_getsets_array, /*tp_getset*/
23174 0, /*tp_base*/
23175 0, /*tp_dict*/
23176 0, /*tp_descr_get*/
23177 0, /*tp_descr_set*/
23178 #if !CYTHON_USE_TYPE_SPECS
23179 0, /*tp_dictoffset*/
23180 #endif
23181 0, /*tp_init*/
23182 0, /*tp_alloc*/
23183 __pyx_tp_new_array, /*tp_new*/
23184 0, /*tp_free*/
23185 0, /*tp_is_gc*/
23186 0, /*tp_bases*/
23187 0, /*tp_mro*/
23188 0, /*tp_cache*/
23189 0, /*tp_subclasses*/
23190 0, /*tp_weaklist*/
23191 0, /*tp_del*/
23192 0, /*tp_version_tag*/
23193 #if CYTHON_USE_TP_FINALIZE
23194 0, /*tp_finalize*/
23195 #else
23196 NULL, /*tp_finalize*/
23197 #endif
23198 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23199 #if CYTHON_VECTORCALL_TPNEW
23200 __pyx_tp_vectorcall_array, /*tp_vectorcall*/
23201 #else
23202 NULL, /*tp_vectorcall*/
23203 #endif
23204 #endif
23205 #if __PYX_NEED_TP_PRINT_SLOT == 1
23206 0, /*tp_print*/
23207 #endif
23208 #if PY_VERSION_HEX >= 0x030C0000
23209 0, /*tp_watched*/
23210 #endif
23211 #if PY_VERSION_HEX >= 0x030d00A4
23212 0, /*tp_versions_used*/
23213 #endif
23214 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
23215 0, /*tp_pypy_flags*/
23216 #endif
23217};
23218#endif
23219
23220static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
23221#if CYTHON_VECTORCALL_TPNEW
23222 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
23223#else
23224 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
23225#endif
23226) {
23227 struct __pyx_MemviewEnum_obj *p = ((struct __pyx_MemviewEnum_obj *)o);
23228 p->name = Py_None; Py_INCREF(Py_None);
23229 return o;
23230}
23231
23232static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
23233#if CYTHON_VECTORCALL_TPNEW
23234 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
23235#else
23236 PyObject *a, PyObject *k
23237#endif
23238) {
23239 PyObject *o;
23240 o = __Pyx_AllocateExtensionType(t, 0);
23241 if (unlikely(!o)) return 0;
23242 return __pyx_tp_new__initialisation_Enum(o,
23243#if CYTHON_VECTORCALL_TPNEW
23244 args, nargs, kwnames
23245#else
23246 a, k
23247#endif
23248);
23249}
23250
23251#if CYTHON_VECTORCALL_TPNEW
23252static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k) {
23253 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_Enum, t, a, k);
23254}
23255#endif
23256
23257#if CYTHON_VECTORCALL_TPNEW
23258static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
23259 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_MemviewEnum_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
23260 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
23261 }
23262 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
23263 PyObject *o = __pyx_tp_new_vectorcall_Enum((PyTypeObject*)t, args, nargs, kwnames);
23264 if (likely(o)) {
23265 assert(Py_TYPE(o) == (PyTypeObject*)t);
23266 if (unlikely(__pyx_MemviewEnum___init__(o, args, nargs, kwnames) < 0)) {
23267 Py_CLEAR(o);
23268 }
23269 }
23270 return o;
23271}
23272#endif
23273
23274#if CYTHON_VECTORCALL_TPNEW
23275static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds) {
23276 return __Pyx_CallTpinitAsVectorcall(__pyx_MemviewEnum___init__, o, args, kwds);
23277}
23278#endif
23279
23280static void __pyx_tp_dealloc_Enum(PyObject *o) {
23281 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
23282 #if CYTHON_USE_TP_FINALIZE
23283 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
23284 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
23285 if (PyObject_CallFinalizerFromDealloc(o)) return;
23286 }
23287 }
23288 #endif
23289 PyObject_GC_UnTrack(o);
23290 Py_CLEAR(p->name);
23291 PyTypeObject *tp = Py_TYPE(o);
23292 #if CYTHON_USE_TYPE_SLOTS
23293 (*tp->tp_free)(o);
23294 #else
23295 {
23296 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
23297 if (tp_free) tp_free(o);
23298 }
23299 #endif
23300 #if CYTHON_USE_TYPE_SPECS
23301 Py_DECREF(tp);
23302 #endif
23303}
23304
23305static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
23306 int e;
23307 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
23308 {
23309 e = __Pyx_call_type_traverse(o, 1, v, a);
23310 if (e) return e;
23311 }
23312 if (p->name) {
23313 e = (*v)(p->name, a); if (e) return e;
23314 }
23315 return 0;
23316}
23317
23318static int __pyx_tp_clear_Enum(PyObject *o) {
23319 PyObject* tmp;
23320 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
23321 tmp = ((PyObject*)p->name);
23322 p->name = Py_None; Py_INCREF(Py_None);
23323 Py_XDECREF(tmp);
23324 return 0;
23325}
23326
23327static PyMethodDef __pyx_methods_Enum[] = {
23328 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23329 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23330 {0, 0, 0, 0}
23331};
23332#if CYTHON_USE_TYPE_SPECS
23333static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
23334 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
23335 {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
23336 {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
23337 {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
23338 {Py_tp_methods, (void *)__pyx_methods_Enum},
23339 {Py_tp_init, (void *)__pyx_tp_init_Enum},
23340 {Py_tp_new, (void *)__pyx_tp_new_Enum},
23341 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23342 #if CYTHON_VECTORCALL_TPNEW
23343 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_Enum},
23344 #endif
23345 #endif
23346 {0, 0},
23347};
23348static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
23349 "csparsity.Enum",
23350 sizeof(struct __pyx_MemviewEnum_obj),
23351 0,
23352 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
23353 __pyx_type___pyx_MemviewEnum_slots,
23354};
23355#else
23356
23357static PyTypeObject __pyx_type___pyx_MemviewEnum = {
23358 PyVarObject_HEAD_INIT(0, 0)
23359 "csparsity.""Enum", /*tp_name*/
23360 sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
23361 0, /*tp_itemsize*/
23362 __pyx_tp_dealloc_Enum, /*tp_dealloc*/
23363 0, /*tp_vectorcall_offset*/
23364 0, /*tp_getattr*/
23365 0, /*tp_setattr*/
23366 0, /*tp_as_async*/
23367 __pyx_MemviewEnum___repr__, /*tp_repr*/
23368 0, /*tp_as_number*/
23369 0, /*tp_as_sequence*/
23370 0, /*tp_as_mapping*/
23371 0, /*tp_hash*/
23372 0, /*tp_call*/
23373 0, /*tp_str*/
23374 0, /*tp_getattro*/
23375 0, /*tp_setattro*/
23376 0, /*tp_as_buffer*/
23377 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
23378 0, /*tp_doc*/
23379 __pyx_tp_traverse_Enum, /*tp_traverse*/
23380 __pyx_tp_clear_Enum, /*tp_clear*/
23381 0, /*tp_richcompare*/
23382 0, /*tp_weaklistoffset*/
23383 0, /*tp_iter*/
23384 0, /*tp_iternext*/
23385 __pyx_methods_Enum, /*tp_methods*/
23386 0, /*tp_members*/
23387 0, /*tp_getset*/
23388 0, /*tp_base*/
23389 0, /*tp_dict*/
23390 0, /*tp_descr_get*/
23391 0, /*tp_descr_set*/
23392 #if !CYTHON_USE_TYPE_SPECS
23393 0, /*tp_dictoffset*/
23394 #endif
23395 __pyx_tp_init_Enum, /*tp_init*/
23396 0, /*tp_alloc*/
23397 __pyx_tp_new_Enum, /*tp_new*/
23398 0, /*tp_free*/
23399 0, /*tp_is_gc*/
23400 0, /*tp_bases*/
23401 0, /*tp_mro*/
23402 0, /*tp_cache*/
23403 0, /*tp_subclasses*/
23404 0, /*tp_weaklist*/
23405 0, /*tp_del*/
23406 0, /*tp_version_tag*/
23407 #if CYTHON_USE_TP_FINALIZE
23408 0, /*tp_finalize*/
23409 #else
23410 NULL, /*tp_finalize*/
23411 #endif
23412 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23413 #if CYTHON_VECTORCALL_TPNEW
23414 __pyx_tp_vectorcall_Enum, /*tp_vectorcall*/
23415 #else
23416 NULL, /*tp_vectorcall*/
23417 #endif
23418 #endif
23419 #if __PYX_NEED_TP_PRINT_SLOT == 1
23420 0, /*tp_print*/
23421 #endif
23422 #if PY_VERSION_HEX >= 0x030C0000
23423 0, /*tp_watched*/
23424 #endif
23425 #if PY_VERSION_HEX >= 0x030d00A4
23426 0, /*tp_versions_used*/
23427 #endif
23428 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
23429 0, /*tp_pypy_flags*/
23430 #endif
23431};
23432#endif
23433static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
23434
23435static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
23436#if CYTHON_VECTORCALL_TPNEW
23437 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
23438#else
23439 PyObject *a, PyObject *k
23440#endif
23441) {
23442 struct __pyx_memoryview_obj *p = ((struct __pyx_memoryview_obj *)o);
23443 p->__pyx_vtab = __pyx_vtabptr_memoryview;
23444 p->obj = Py_None; Py_INCREF(Py_None);
23445 p->_size = Py_None; Py_INCREF(Py_None);
23446 p->view.obj = NULL;
23447 {
23448 int cinit_result = __pyx_memoryview___cinit__(o,
23449#if CYTHON_VECTORCALL_TPNEW
23450 args, nargs, kwnames
23451#else
23452 a, k
23453#endif
23454);
23455 if (unlikely(cinit_result)) goto bad;
23456 }
23457 return o;
23458 bad:
23459 Py_DECREF(o); o = 0;
23460 return NULL;
23461}
23462
23463static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
23464#if CYTHON_VECTORCALL_TPNEW
23465 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
23466#else
23467 PyObject *a, PyObject *k
23468#endif
23469) {
23470 PyObject *o;
23471 o = __Pyx_AllocateExtensionType(t, 0);
23472 if (unlikely(!o)) return 0;
23473 return __pyx_tp_new__initialisation_memoryview(o,
23474#if CYTHON_VECTORCALL_TPNEW
23475 args, nargs, kwnames
23476#else
23477 a, k
23478#endif
23479);
23480}
23481
23482#if CYTHON_VECTORCALL_TPNEW
23483static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
23484 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_memoryview, t, a, k);
23485}
23486#endif
23487
23488#if CYTHON_VECTORCALL_TPNEW
23489static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
23490 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryview_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
23491 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
23492 }
23493 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
23494 PyObject *o = __pyx_tp_new_vectorcall_memoryview((PyTypeObject*)t, args, nargs, kwnames);
23495 return o;
23496}
23497#endif
23498
23499static void __pyx_tp_dealloc_memoryview(PyObject *o) {
23500 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
23501 #if CYTHON_USE_TP_FINALIZE
23502 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
23503 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
23504 if (PyObject_CallFinalizerFromDealloc(o)) return;
23505 }
23506 }
23507 #endif
23508 PyObject_GC_UnTrack(o);
23509 {
23510 PyObject *etype, *eval, *etb;
23511 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
23512 __Pyx_DeallocKeepAliveBegin(o);
23513 __pyx_memoryview___dealloc__(o);
23514 __Pyx_DeallocKeepAliveEnd(o);
23515 __Pyx_PyErr_RestoreException(etype, eval, etb);
23516 }
23517 Py_CLEAR(p->obj);
23518 Py_CLEAR(p->_size);
23519 PyTypeObject *tp = Py_TYPE(o);
23520 #if CYTHON_USE_TYPE_SLOTS
23521 (*tp->tp_free)(o);
23522 #else
23523 {
23524 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
23525 if (tp_free) tp_free(o);
23526 }
23527 #endif
23528 #if CYTHON_USE_TYPE_SPECS
23529 Py_DECREF(tp);
23530 #endif
23531}
23532
23533static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
23534 int e;
23535 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
23536 {
23537 e = __Pyx_call_type_traverse(o, 1, v, a);
23538 if (e) return e;
23539 }
23540 if (p->obj) {
23541 e = (*v)(p->obj, a); if (e) return e;
23542 }
23543 if (p->_size) {
23544 e = (*v)(p->_size, a); if (e) return e;
23545 }
23546 if (p->view.obj) {
23547 e = (*v)(p->view.obj, a); if (e) return e;
23548 }
23549 return 0;
23550}
23551
23552static int __pyx_tp_clear_memoryview(PyObject *o) {
23553 PyObject* tmp;
23554 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
23555 tmp = ((PyObject*)p->obj);
23556 p->obj = Py_None; Py_INCREF(Py_None);
23557 Py_XDECREF(tmp);
23558 tmp = ((PyObject*)p->_size);
23559 p->_size = Py_None; Py_INCREF(Py_None);
23560 Py_XDECREF(tmp);
23561 Py_CLEAR(p->view.obj);
23562 return 0;
23563}
23564
23565static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
23566 PyObject *r;
23567 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return NULL;
23568 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
23569 binaryfunc f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
23570 #else
23571 binaryfunc f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
23572 #endif
23573 r = f(o, x);
23574 Py_DECREF(x);
23575 return r;
23576}
23577
23578static PyObject *__pyx_mp_subscript_memoryview(PyObject *o, PyObject *i) {
23579 return __pyx_memoryview___getitem__(o, i);
23580}
23581
23582static int __pyx_sq_ass_item_memoryview(PyObject *o, Py_ssize_t i, PyObject *v) {
23583 if (likely(v)) {
23584 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return -1;
23585 int r = __pyx_memoryview___setitem__(o, x, v);
23586 Py_DECREF(x);
23587 return r;
23588 } else {
23589 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
23590 return -1;
23591 }
23592}
23593
23594static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
23595 if (likely(v)) {
23596 return __pyx_memoryview___setitem__(o, i, v);
23597 } else {
23598 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
23599 return -1;
23600 }
23601}
23602
23603static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
23604 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
23605}
23606
23607static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
23608 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
23609}
23610
23611static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
23612 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
23613}
23614
23615static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
23616 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
23617}
23618
23619static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
23620 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
23621}
23622
23623static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
23624 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
23625}
23626
23627static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
23628 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
23629}
23630
23631static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
23632 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
23633}
23634
23635static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
23636 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
23637}
23638
23639static PyMethodDef __pyx_methods_memoryview[] = {
23640 {"is_c_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23641 {"is_f_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23642 {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23643 {"copy_fortran", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23644 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23645 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23646 {0, 0, 0, 0}
23647};
23648
23649static struct PyGetSetDef __pyx_getsets_memoryview[] = {
23650 {"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
23651 {"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
23652 {"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
23653 {"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
23654 {"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
23655 {"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
23656 {"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
23657 {"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
23658 {"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
23659 {0, 0, 0, 0, 0}
23660};
23661#if CYTHON_USE_TYPE_SPECS
23662#if !CYTHON_COMPILING_IN_LIMITED_API
23663
23664static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
23665 __pyx_memoryview_getbuffer, /*bf_getbuffer*/
23666 0, /*bf_releasebuffer*/
23667};
23668#endif
23669static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
23670 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
23671 {Py_tp_repr, (void *)__pyx_memoryview___repr__},
23672 {Py_sq_length, (void *)__pyx_memoryview___len__},
23673 {Py_sq_item, (void *)__pyx_sq_item_memoryview},
23674 {Py_sq_ass_item, (void *)__pyx_sq_ass_item_memoryview},
23675 {Py_mp_length, (void *)__pyx_memoryview___len__},
23676 {Py_mp_subscript, (void *)__pyx_mp_subscript_memoryview},
23677 {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
23678 {Py_tp_str, (void *)__pyx_memoryview___str__},
23679 #if defined(Py_bf_getbuffer)
23680 {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
23681 #endif
23682 {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
23683 {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
23684 {Py_tp_methods, (void *)__pyx_methods_memoryview},
23685 {Py_tp_getset, (void *)__pyx_getsets_memoryview},
23686 {Py_tp_new, (void *)__pyx_tp_new_memoryview},
23687 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23688 #if CYTHON_VECTORCALL_TPNEW
23689 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_memoryview},
23690 #endif
23691 #endif
23692 {0, 0},
23693};
23694static PyType_Spec __pyx_type___pyx_memoryview_spec = {
23695 "csparsity.memoryview",
23696 sizeof(struct __pyx_memoryview_obj),
23697 0,
23698 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
23699 __pyx_type___pyx_memoryview_slots,
23700};
23701#else
23702
23703static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
23704 __pyx_memoryview___len__, /*sq_length*/
23705 0, /*sq_concat*/
23706 0, /*sq_repeat*/
23707 __pyx_sq_item_memoryview, /*sq_item*/
23708 0, /*sq_slice*/
23709 __pyx_sq_ass_item_memoryview, /*sq_ass_item*/
23710 0, /*sq_ass_slice*/
23711 0, /*sq_contains*/
23712 0, /*sq_inplace_concat*/
23713 0, /*sq_inplace_repeat*/
23714};
23715
23716static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
23717 __pyx_memoryview___len__, /*mp_length*/
23718 __pyx_mp_subscript_memoryview, /*mp_subscript*/
23719 __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
23720};
23721
23722static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
23723 __pyx_memoryview_getbuffer, /*bf_getbuffer*/
23724 0, /*bf_releasebuffer*/
23725};
23726
23727static PyTypeObject __pyx_type___pyx_memoryview = {
23728 PyVarObject_HEAD_INIT(0, 0)
23729 "csparsity.""memoryview", /*tp_name*/
23730 sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
23731 0, /*tp_itemsize*/
23732 __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
23733 0, /*tp_vectorcall_offset*/
23734 0, /*tp_getattr*/
23735 0, /*tp_setattr*/
23736 0, /*tp_as_async*/
23737 __pyx_memoryview___repr__, /*tp_repr*/
23738 0, /*tp_as_number*/
23739 &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
23740 &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
23741 0, /*tp_hash*/
23742 0, /*tp_call*/
23743 __pyx_memoryview___str__, /*tp_str*/
23744 0, /*tp_getattro*/
23745 0, /*tp_setattro*/
23746 &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
23747 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
23748 0, /*tp_doc*/
23749 __pyx_tp_traverse_memoryview, /*tp_traverse*/
23750 __pyx_tp_clear_memoryview, /*tp_clear*/
23751 0, /*tp_richcompare*/
23752 0, /*tp_weaklistoffset*/
23753 0, /*tp_iter*/
23754 0, /*tp_iternext*/
23755 __pyx_methods_memoryview, /*tp_methods*/
23756 0, /*tp_members*/
23757 __pyx_getsets_memoryview, /*tp_getset*/
23758 0, /*tp_base*/
23759 0, /*tp_dict*/
23760 0, /*tp_descr_get*/
23761 0, /*tp_descr_set*/
23762 #if !CYTHON_USE_TYPE_SPECS
23763 0, /*tp_dictoffset*/
23764 #endif
23765 0, /*tp_init*/
23766 0, /*tp_alloc*/
23767 __pyx_tp_new_memoryview, /*tp_new*/
23768 0, /*tp_free*/
23769 0, /*tp_is_gc*/
23770 0, /*tp_bases*/
23771 0, /*tp_mro*/
23772 0, /*tp_cache*/
23773 0, /*tp_subclasses*/
23774 0, /*tp_weaklist*/
23775 0, /*tp_del*/
23776 0, /*tp_version_tag*/
23777 #if CYTHON_USE_TP_FINALIZE
23778 0, /*tp_finalize*/
23779 #else
23780 NULL, /*tp_finalize*/
23781 #endif
23782 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23783 #if CYTHON_VECTORCALL_TPNEW
23784 __pyx_tp_vectorcall_memoryview, /*tp_vectorcall*/
23785 #else
23786 NULL, /*tp_vectorcall*/
23787 #endif
23788 #endif
23789 #if __PYX_NEED_TP_PRINT_SLOT == 1
23790 0, /*tp_print*/
23791 #endif
23792 #if PY_VERSION_HEX >= 0x030C0000
23793 0, /*tp_watched*/
23794 #endif
23795 #if PY_VERSION_HEX >= 0x030d00A4
23796 0, /*tp_versions_used*/
23797 #endif
23798 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
23799 0, /*tp_pypy_flags*/
23800 #endif
23801};
23802#endif
23803static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
23804
23805static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
23806#if CYTHON_VECTORCALL_TPNEW
23807 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
23808#else
23809 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
23810#endif
23811) {
23812 struct __pyx_memoryviewslice_obj *p = ((struct __pyx_memoryviewslice_obj *)o);
23813 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
23814 __Pyx_default_placement_construct(&(p->from_slice));
23815 p->from_object = Py_None; Py_INCREF(Py_None);
23816 p->from_slice.memview = NULL;
23817 return o;
23818}
23819
23820static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
23821#if CYTHON_VECTORCALL_TPNEW
23822 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
23823#else
23824 PyObject *a, PyObject *k
23825#endif
23826) {
23827 PyObject *o;
23828 o = __pyx_tp_new_vectorcall_memoryview(t,
23829#if CYTHON_VECTORCALL_TPNEW
23830 args, nargs, kwnames
23831#else
23832 a, k
23833#endif
23834);
23835 if (unlikely(!o)) return 0;
23836 return __pyx_tp_new__initialisation__memoryviewslice(o,
23837#if CYTHON_VECTORCALL_TPNEW
23838 args, nargs, kwnames
23839#else
23840 a, k
23841#endif
23842);
23843}
23844
23845#if CYTHON_VECTORCALL_TPNEW
23846static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
23847 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall__memoryviewslice, t, a, k);
23848}
23849#endif
23850
23851#if CYTHON_VECTORCALL_TPNEW
23852static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
23853 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryviewslice_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
23854 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
23855 }
23856 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
23857 PyObject *o = __pyx_tp_new_vectorcall__memoryviewslice((PyTypeObject*)t, args, nargs, kwnames);
23858 return o;
23859}
23860#endif
23861
23862static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
23863 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
23864 #if CYTHON_USE_TP_FINALIZE
23865 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
23866 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
23867 if (PyObject_CallFinalizerFromDealloc(o)) return;
23868 }
23869 }
23870 #endif
23871 PyObject_GC_UnTrack(o);
23872 {
23873 PyObject *etype, *eval, *etb;
23874 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
23875 __Pyx_DeallocKeepAliveBegin(o);
23876 __pyx_memoryviewslice___dealloc__(o);
23877 __Pyx_DeallocKeepAliveEnd(o);
23878 __Pyx_PyErr_RestoreException(etype, eval, etb);
23879 }
23880 __Pyx_call_destructor(p->from_slice);
23881 Py_CLEAR(p->from_object);
23882 PyObject_GC_Track(o);
23883 __pyx_tp_dealloc_memoryview(o);
23884}
23885
23886static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
23887 int e;
23888 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
23889 e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
23890 if (p->from_object) {
23891 e = (*v)(p->from_object, a); if (e) return e;
23892 }
23893 return 0;
23894}
23895
23896static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
23897 PyObject* tmp;
23898 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
23899 __pyx_tp_clear_memoryview(o);
23900 tmp = ((PyObject*)p->from_object);
23901 p->from_object = Py_None; Py_INCREF(Py_None);
23902 Py_XDECREF(tmp);
23903 __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
23904 return 0;
23905}
23906
23907static PyMethodDef __pyx_methods__memoryviewslice[] = {
23908 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23909 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23910 {0, 0, 0, 0}
23911};
23912#if CYTHON_USE_TYPE_SPECS
23913static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
23914 {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
23915 {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
23916 {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
23917 {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
23918 {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
23919 {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
23920 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
23921 #if CYTHON_VECTORCALL_TPNEW
23922 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall__memoryviewslice},
23923 #endif
23924 #endif
23925 {0, 0},
23926};
23927static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
23928 "csparsity._memoryviewslice",
23929 sizeof(struct __pyx_memoryviewslice_obj),
23930 0,
23931 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
23932 __pyx_type___pyx_memoryviewslice_slots,
23933};
23934#else
23935
23936static PyTypeObject __pyx_type___pyx_memoryviewslice = {
23937 PyVarObject_HEAD_INIT(0, 0)
23938 "csparsity.""_memoryviewslice", /*tp_name*/
23939 sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
23940 0, /*tp_itemsize*/
23941 __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
23942 0, /*tp_vectorcall_offset*/
23943 0, /*tp_getattr*/
23944 0, /*tp_setattr*/
23945 0, /*tp_as_async*/
23946 #if CYTHON_COMPILING_IN_PYPY || 0
23947 __pyx_memoryview___repr__, /*tp_repr*/
23948 #else
23949 0, /*tp_repr*/
23950 #endif
23951 0, /*tp_as_number*/
23952 0, /*tp_as_sequence*/
23953 0, /*tp_as_mapping*/
23954 0, /*tp_hash*/
23955 0, /*tp_call*/
23956 #if CYTHON_COMPILING_IN_PYPY || 0
23957 __pyx_memoryview___str__, /*tp_str*/
23958 #else
23959 0, /*tp_str*/
23960 #endif
23961 0, /*tp_getattro*/
23962 0, /*tp_setattro*/
23963 0, /*tp_as_buffer*/
23964 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
23965 PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
23966 __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
23967 __pyx_tp_clear__memoryviewslice, /*tp_clear*/
23968 0, /*tp_richcompare*/
23969 0, /*tp_weaklistoffset*/
23970 0, /*tp_iter*/
23971 0, /*tp_iternext*/
23972 __pyx_methods__memoryviewslice, /*tp_methods*/
23973 0, /*tp_members*/
23974 0, /*tp_getset*/
23975 0, /*tp_base*/
23976 0, /*tp_dict*/
23977 0, /*tp_descr_get*/
23978 0, /*tp_descr_set*/
23979 #if !CYTHON_USE_TYPE_SPECS
23980 0, /*tp_dictoffset*/
23981 #endif
23982 0, /*tp_init*/
23983 0, /*tp_alloc*/
23984 __pyx_tp_new__memoryviewslice, /*tp_new*/
23985 0, /*tp_free*/
23986 0, /*tp_is_gc*/
23987 0, /*tp_bases*/
23988 0, /*tp_mro*/
23989 0, /*tp_cache*/
23990 0, /*tp_subclasses*/
23991 0, /*tp_weaklist*/
23992 0, /*tp_del*/
23993 0, /*tp_version_tag*/
23994 #if CYTHON_USE_TP_FINALIZE
23995 0, /*tp_finalize*/
23996 #else
23997 NULL, /*tp_finalize*/
23998 #endif
23999 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
24000 #if CYTHON_VECTORCALL_TPNEW
24001 __pyx_tp_vectorcall__memoryviewslice, /*tp_vectorcall*/
24002 #else
24003 NULL, /*tp_vectorcall*/
24004 #endif
24005 #endif
24006 #if __PYX_NEED_TP_PRINT_SLOT == 1
24007 0, /*tp_print*/
24008 #endif
24009 #if PY_VERSION_HEX >= 0x030C0000
24010 0, /*tp_watched*/
24011 #endif
24012 #if PY_VERSION_HEX >= 0x030d00A4
24013 0, /*tp_versions_used*/
24014 #endif
24015 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
24016 0, /*tp_pypy_flags*/
24017 #endif
24018};
24019#endif
24020
24021static PyMethodDef __pyx_methods[] = {
24022 {0, 0, 0, 0}
24023};
24024/* #### Code section: initfunc_declarations ### */
24025static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
24026static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
24027static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
24028static CYTHON_SMALL_CODE int __Pyx_InitAfterSharedUtility(void); /*proto*/
24029static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
24030static CYTHON_SMALL_CODE int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
24031static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
24032static CYTHON_SMALL_CODE int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
24033static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_9csparsity_PySparsityInfo(__pyx_mstatetype *__pyx_mstate); /*proto*/
24034static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
24035static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
24036static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
24037static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
24038static CYTHON_SMALL_CODE int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
24039static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
24040static CYTHON_SMALL_CODE int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
24041static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
24042/* #### Code section: init_module ### */
24043
24044static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
24045 __Pyx_RefNannyDeclarations
24046 CYTHON_UNUSED_VAR(__pyx_mstate);
24047 __Pyx_RefNannySetupContext("__Pyx_modinit_Global_init_code", 0);
24048 /*--- Global init code ---*/
24049 __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
24050 generic = Py_None; Py_INCREF(Py_None);
24051 strided = Py_None; Py_INCREF(Py_None);
24052 indirect = Py_None; Py_INCREF(Py_None);
24053 contiguous = Py_None; Py_INCREF(Py_None);
24054 indirect_contiguous = Py_None; Py_INCREF(Py_None);
24055 __Pyx_RefNannyFinishContext();
24056 return 0;
24057}
24058
24059static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
24060 __Pyx_RefNannyDeclarations
24061 CYTHON_UNUSED_VAR(__pyx_mstate);
24062 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_export_code", 0);
24063 /*--- Variable export code ---*/
24064 __Pyx_RefNannyFinishContext();
24065 return 0;
24066}
24067
24068static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
24069 __Pyx_RefNannyDeclarations
24070 CYTHON_UNUSED_VAR(__pyx_mstate);
24071 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_export_code", 0);
24072 /*--- Function export code ---*/
24073 __Pyx_RefNannyFinishContext();
24074 return 0;
24075}
24076
24077static int __Pyx_modinit_Exttype___pyx_obj_9csparsity_PySparsityInfo(__pyx_mstatetype *__pyx_mstate) {
24078 __Pyx_RefNannyDeclarations
24079 int __pyx_lineno = 0;
24080 const char *__pyx_filename = NULL;
24081 int __pyx_clineno = 0;
24082 CYTHON_UNUSED_VAR(__pyx_mstate);
24083 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_9csparsity_PySparsityInfo", 0);
24084 /*--- Exttype __pyx_obj_9csparsity_PySparsityInfo ---*/
24085 #if CYTHON_USE_TYPE_SPECS
24086 __pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9csparsity_PySparsityInfo_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo)) __PYX_ERR(0, 6, __pyx_L1_error)
24087 #else
24088 __pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo = &__pyx_type_9csparsity_PySparsityInfo;
24089 #endif
24090 #if !CYTHON_COMPILING_IN_LIMITED_API
24091 #endif
24092 #if !CYTHON_USE_TYPE_SPECS
24093 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo) < (0)) __PYX_ERR(0, 6, __pyx_L1_error)
24094 #endif
24095 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
24096 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo);
24097 #endif
24098 #if !CYTHON_COMPILING_IN_LIMITED_API
24099 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo->tp_dictoffset && __pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo->tp_getattro == PyObject_GenericGetAttr)) {
24100 __pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo->tp_getattro = PyObject_GenericGetAttr;
24101 }
24102 #endif
24103 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PySparsityInfo, (PyObject *) __pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo) < (0)) __PYX_ERR(0, 6, __pyx_L1_error)
24104 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9csparsity_PySparsityInfo) < (0)) __PYX_ERR(0, 6, __pyx_L1_error)
24105 __Pyx_RefNannyFinishContext();
24106 return 0;
24107 __pyx_L1_error:;
24108 __Pyx_RefNannyFinishContext();
24109 return -1;
24110}
24111
24112static int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate) {
24113 __Pyx_RefNannyDeclarations
24114 int __pyx_lineno = 0;
24115 const char *__pyx_filename = NULL;
24116 int __pyx_clineno = 0;
24117 CYTHON_UNUSED_VAR(__pyx_mstate);
24118 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_array_obj", 0);
24119 /*--- Exttype __pyx_array_obj ---*/
24120 __pyx_vtabptr_array = &__pyx_vtable_array;
24121 __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
24122 #if CYTHON_USE_TYPE_SPECS
24123 __pyx_mstate->__pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_array_type)) __PYX_ERR(1, 128, __pyx_L1_error)
24124 #if !CYTHON_COMPILING_IN_LIMITED_API
24125 __pyx_mstate->__pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
24126 if (!__pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
24127 __pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
24128 }
24129 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
24130 /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
24131 #elif defined(_MSC_VER)
24132 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
24133 #else
24134 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
24135 #endif
24136 #else
24137 __pyx_mstate->__pyx_array_type = &__pyx_type___pyx_array;
24138 #endif
24139 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_array_type, 1) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
24140 #if !CYTHON_COMPILING_IN_LIMITED_API
24141 #endif
24142 #if !CYTHON_USE_TYPE_SPECS
24143 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
24144 #endif
24145 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
24146 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_array_type);
24147 #endif
24148 if (__Pyx_SetVtable(__pyx_mstate->__pyx_array_type, __pyx_vtabptr_array) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
24149 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
24150 __Pyx_RefNannyFinishContext();
24151 return 0;
24152 __pyx_L1_error:;
24153 __Pyx_RefNannyFinishContext();
24154 return -1;
24155}
24156
24157static int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate) {
24158 __Pyx_RefNannyDeclarations
24159 int __pyx_lineno = 0;
24160 const char *__pyx_filename = NULL;
24161 int __pyx_clineno = 0;
24162 CYTHON_UNUSED_VAR(__pyx_mstate);
24163 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_MemviewEnum_obj", 0);
24164 /*--- Exttype __pyx_MemviewEnum_obj ---*/
24165 #if CYTHON_USE_TYPE_SPECS
24166 __pyx_mstate->__pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_MemviewEnum_type)) __PYX_ERR(1, 318, __pyx_L1_error)
24167 #else
24168 __pyx_mstate->__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
24169 #endif
24170 #if !CYTHON_COMPILING_IN_LIMITED_API
24171 #endif
24172 #if !CYTHON_USE_TYPE_SPECS
24173 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
24174 #endif
24175 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
24176 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_MemviewEnum_type);
24177 #endif
24178 #if !CYTHON_COMPILING_IN_LIMITED_API
24179 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_MemviewEnum_type->tp_dictoffset && __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
24180 __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro = PyObject_GenericGetAttr;
24181 }
24182 #endif
24183 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
24184 __Pyx_RefNannyFinishContext();
24185 return 0;
24186 __pyx_L1_error:;
24187 __Pyx_RefNannyFinishContext();
24188 return -1;
24189}
24190
24191static int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate) {
24192 __Pyx_RefNannyDeclarations
24193 int __pyx_lineno = 0;
24194 const char *__pyx_filename = NULL;
24195 int __pyx_clineno = 0;
24196 CYTHON_UNUSED_VAR(__pyx_mstate);
24197 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_memoryview_obj", 0);
24198 /*--- Exttype __pyx_memoryview_obj ---*/
24199 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
24200 __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
24201 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
24202 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
24203 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
24204 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
24205 __pyx_vtable_memoryview.setitem_indexed1 = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed1;
24206 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
24207 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
24208 __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
24209 #if CYTHON_USE_TYPE_SPECS
24210 __pyx_mstate->__pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_memoryview_type)) __PYX_ERR(1, 353, __pyx_L1_error)
24211 #if !CYTHON_COMPILING_IN_LIMITED_API
24212 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
24213 if (!__pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
24214 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
24215 }
24216 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
24217 /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
24218 #elif defined(_MSC_VER)
24219 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
24220 #else
24221 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
24222 #endif
24223 #else
24224 __pyx_mstate->__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
24225 #endif
24226 #if !CYTHON_COMPILING_IN_LIMITED_API
24227 #endif
24228 #if !CYTHON_USE_TYPE_SPECS
24229 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
24230 #endif
24231 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
24232 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryview_type);
24233 #endif
24234 #if !CYTHON_COMPILING_IN_LIMITED_API
24235 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryview_type->tp_dictoffset && __pyx_mstate->__pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
24236 __pyx_mstate->__pyx_memoryview_type->tp_getattro = PyObject_GenericGetAttr;
24237 }
24238 #endif
24239 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryview_type, __pyx_vtabptr_memoryview) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
24240 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
24241 __Pyx_RefNannyFinishContext();
24242 return 0;
24243 __pyx_L1_error:;
24244 __Pyx_RefNannyFinishContext();
24245 return -1;
24246}
24247
24248static int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate) {
24249 __Pyx_RefNannyDeclarations
24250 PyObject *__pyx_t_1 = NULL;
24251 int __pyx_lineno = 0;
24252 const char *__pyx_filename = NULL;
24253 int __pyx_clineno = 0;
24254 CYTHON_UNUSED_VAR(__pyx_mstate);
24255 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_memoryviewslice_obj", 0);
24256 /*--- Exttype __pyx_memoryviewslice_obj ---*/
24257 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
24258 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
24259 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
24260 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
24261 __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
24262 #if CYTHON_USE_TYPE_SPECS
24263 __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 947, __pyx_L1_error)
24264 __Pyx_GOTREF(__pyx_t_1);
24265 __pyx_mstate->__pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
24266 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24267 if (unlikely(!__pyx_mstate->__pyx_memoryviewslice_type)) __PYX_ERR(1, 947, __pyx_L1_error)
24268 #else
24269 __pyx_mstate->__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
24270 #endif
24271 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_memoryviewslice_type, 1) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
24272 #if !CYTHON_COMPILING_IN_LIMITED_API
24273 __pyx_mstate_global->__pyx_memoryviewslice_type->tp_base = __pyx_mstate_global->__pyx_memoryview_type;
24274 #endif
24275 #if !CYTHON_USE_TYPE_SPECS
24276 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
24277 #endif
24278 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
24279 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryviewslice_type);
24280 #endif
24281 #if !CYTHON_COMPILING_IN_LIMITED_API
24282 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryviewslice_type->tp_dictoffset && __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
24283 __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro = PyObject_GenericGetAttr;
24284 }
24285 #endif
24286 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
24287 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
24288 __Pyx_RefNannyFinishContext();
24289 return 0;
24290 __pyx_L1_error:;
24291 __Pyx_XDECREF(__pyx_t_1);
24292 __Pyx_RefNannyFinishContext();
24293 return -1;
24294}
24295
24296static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
24297 __Pyx_RefNannyDeclarations
24298 PyObject *__pyx_t_1 = NULL;
24299 int __pyx_lineno = 0;
24300 const char *__pyx_filename = NULL;
24301 int __pyx_clineno = 0;
24302 CYTHON_UNUSED_VAR(__pyx_mstate);
24303 __Pyx_RefNannySetupContext("__Pyx_modinit_Type_import_code", 0);
24304 /*--- Type import code ---*/
24305 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
24306 __Pyx_GOTREF(__pyx_t_1);
24307 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
24308 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24309 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
24310 #elif CYTHON_COMPILING_IN_LIMITED_API
24311 0, 0,
24312 #else
24313 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
24314 #endif
24315 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
24316 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24317 __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error)
24318 __Pyx_GOTREF(__pyx_t_1);
24319 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "dtype",
24320 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24321 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
24322 #elif CYTHON_COMPILING_IN_LIMITED_API
24323 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
24324 #else
24325 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
24326 #endif
24327 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 229, __pyx_L1_error)
24328 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flatiter",
24329 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24330 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
24331 #elif CYTHON_COMPILING_IN_LIMITED_API
24332 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
24333 #else
24334 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
24335 #endif
24336 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 286, __pyx_L1_error)
24337 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "broadcast",
24338 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24339 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
24340 #elif CYTHON_COMPILING_IN_LIMITED_API
24341 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
24342 #else
24343 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
24344 #endif
24345 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 290, __pyx_L1_error)
24346 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ndarray",
24347 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24348 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
24349 #elif CYTHON_COMPILING_IN_LIMITED_API
24350 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
24351 #else
24352 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
24353 #endif
24354 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 329, __pyx_L1_error)
24355 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "generic",
24356 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24357 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24358 #elif CYTHON_COMPILING_IN_LIMITED_API
24359 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24360 #else
24361 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24362 #endif
24363 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
24364 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "number",
24365 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24366 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24367 #elif CYTHON_COMPILING_IN_LIMITED_API
24368 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24369 #else
24370 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24371 #endif
24372 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
24373 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "integer",
24374 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24375 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24376 #elif CYTHON_COMPILING_IN_LIMITED_API
24377 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24378 #else
24379 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24380 #endif
24381 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
24382 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "signedinteger",
24383 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24384 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24385 #elif CYTHON_COMPILING_IN_LIMITED_API
24386 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24387 #else
24388 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24389 #endif
24390 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
24391 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "unsignedinteger",
24392 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24393 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24394 #elif CYTHON_COMPILING_IN_LIMITED_API
24395 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24396 #else
24397 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24398 #endif
24399 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
24400 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "inexact",
24401 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24402 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24403 #elif CYTHON_COMPILING_IN_LIMITED_API
24404 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24405 #else
24406 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24407 #endif
24408 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
24409 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "floating",
24410 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24411 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24412 #elif CYTHON_COMPILING_IN_LIMITED_API
24413 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24414 #else
24415 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24416 #endif
24417 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
24418 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "complexfloating",
24419 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24420 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24421 #elif CYTHON_COMPILING_IN_LIMITED_API
24422 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24423 #else
24424 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24425 #endif
24426 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
24427 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flexible",
24428 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24429 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24430 #elif CYTHON_COMPILING_IN_LIMITED_API
24431 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24432 #else
24433 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24434 #endif
24435 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
24436 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "character",
24437 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24438 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24439 #elif CYTHON_COMPILING_IN_LIMITED_API
24440 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24441 #else
24442 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
24443 #endif
24444 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
24445 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ufunc",
24446 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24447 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
24448 #elif CYTHON_COMPILING_IN_LIMITED_API
24449 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
24450 #else
24451 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
24452 #endif
24453 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 946, __pyx_L1_error)
24454 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24455 __Pyx_RefNannyFinishContext();
24456 return 0;
24457 __pyx_L1_error:;
24458 __Pyx_XDECREF(__pyx_t_1);
24459 __Pyx_RefNannyFinishContext();
24460 return -1;
24461}
24462
24463static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
24464 __Pyx_RefNannyDeclarations
24465 CYTHON_UNUSED_VAR(__pyx_mstate);
24466 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_import_code", 0);
24467 /*--- Variable import code ---*/
24468 __Pyx_RefNannyFinishContext();
24469 return 0;
24470}
24471
24472static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
24473 __Pyx_RefNannyDeclarations
24474 CYTHON_UNUSED_VAR(__pyx_mstate);
24475 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_import_code", 0);
24476 /*--- Function import code ---*/
24477 __Pyx_RefNannyFinishContext();
24478 return 0;
24479}
24480
24481#if CYTHON_PEP489_MULTI_PHASE_INIT
24482static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
24483static int __pyx_pymod_exec_csparsity(PyObject* module); /*proto*/
24484static PyModuleDef_Slot __pyx_moduledef_slots[] = {
24485 {Py_mod_create, (void*)__pyx_pymod_create},
24486 {Py_mod_exec, (void*)__pyx_pymod_exec_csparsity},
24487 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
24488 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
24489 #endif
24490 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
24491 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
24492 #endif
24493 {0, NULL}
24494};
24495#endif
24496
24497#ifdef __cplusplus
24498namespace {
24499 struct PyModuleDef __pyx_moduledef =
24500 #else
24501 static struct PyModuleDef __pyx_moduledef =
24502 #endif
24503 {
24504 PyModuleDef_HEAD_INIT,
24505 "csparsity",
24506 0, /* m_doc */
24507 #if CYTHON_USE_MODULE_STATE
24508 sizeof(__pyx_mstatetype), /* m_size */
24509 #else
24510 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
24511 #endif
24512 __pyx_methods /* m_methods */,
24513 #if CYTHON_PEP489_MULTI_PHASE_INIT
24514 __pyx_moduledef_slots, /* m_slots */
24515 #else
24516 NULL, /* m_reload */
24517 #endif
24518 #if CYTHON_USE_MODULE_STATE
24519 __pyx_m_traverse, /* m_traverse */
24520 __pyx_m_clear, /* m_clear */
24521 NULL /* m_free */
24522 #else
24523 NULL, /* m_traverse */
24524 NULL, /* m_clear */
24525 NULL /* m_free */
24526 #endif
24527 };
24528 #ifdef __cplusplus
24529} /* anonymous namespace */
24530#endif
24531
24532/* PyModInitFuncType */
24533#ifndef CYTHON_NO_PYINIT_EXPORT
24534 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
24535#else
24536 #ifdef __cplusplus
24537 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
24538 #else
24539 #define __Pyx_PyMODINIT_FUNC PyObject *
24540 #endif
24541#endif
24542
24543__Pyx_PyMODINIT_FUNC PyInit_csparsity(void) CYTHON_SMALL_CODE; /*proto*/
24544__Pyx_PyMODINIT_FUNC PyInit_csparsity(void)
24545#if CYTHON_PEP489_MULTI_PHASE_INIT
24546{
24547 return PyModuleDef_Init(&__pyx_moduledef);
24548}
24549/* ModuleCreationPEP489 */
24550#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
24551 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
24552static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
24553 {
24554 PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
24555 if (!module) {
24556 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
24557 goto bad; // BaseException
24558 }
24559 PyErr_Clear(); // just try the 3.8-3.12 version
24560 module = PyImport_ImportModule("_xxsubinterpreters");
24561 if (!module) goto bad;
24562 }
24563 PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
24564 Py_DECREF(module);
24565 if (!current) goto bad;
24566 if (PyTuple_Check(current)) {
24567 PyObject *new_current = PySequence_GetItem(current, 0);
24568 Py_DECREF(current);
24569 current = new_current;
24570 if (!new_current) goto bad;
24571 }
24572 long long as_c_int = PyLong_AsLongLong(current);
24573 Py_DECREF(current);
24574 return as_c_int;
24575 }
24576 bad:
24577 PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
24578 return -1;
24579}
24580#endif
24581#if !CYTHON_USE_MODULE_STATE
24582static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
24583 static PY_INT64_T main_interpreter_id = -1;
24584#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
24585 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
24586#elif CYTHON_COMPILING_IN_GRAAL
24587 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
24588#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
24589 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
24590 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
24591#elif CYTHON_COMPILING_IN_LIMITED_API
24592 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
24593#else
24594 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
24595#endif
24596 if (unlikely(current_id == -1)) {
24597 return -1;
24598 }
24599 if (main_interpreter_id == -1) {
24600 main_interpreter_id = current_id;
24601 return 0;
24602 } else if (unlikely(main_interpreter_id != current_id)) {
24603 PyErr_SetString(
24604 PyExc_ImportError,
24605 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
24606 return -1;
24607 }
24608 return 0;
24609}
24610#endif
24611static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
24612{
24613 PyObject *value = PyObject_GetAttrString(spec, from_name);
24614 int result = 0;
24615 if (likely(value)) {
24616 if (allow_none || value != Py_None) {
24617 result = PyDict_SetItemString(moddict, to_name, value);
24618 }
24619 Py_DECREF(value);
24620 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
24621 PyErr_Clear();
24622 } else {
24623 result = -1;
24624 }
24625 return result;
24626}
24627static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
24628 PyObject *module = NULL, *moddict, *modname;
24629 CYTHON_UNUSED_VAR(def);
24630 #if !CYTHON_USE_MODULE_STATE
24631 if (__Pyx_check_single_interpreter())
24632 return NULL;
24633 #endif
24634 if (__pyx_m)
24635 return __Pyx_NewRef(__pyx_m);
24636 modname = PyObject_GetAttrString(spec, "name");
24637 if (unlikely(!modname)) goto bad;
24638 module = PyModule_NewObject(modname);
24639 Py_DECREF(modname);
24640 if (unlikely(!module)) goto bad;
24641 moddict = PyModule_GetDict(module);
24642 if (unlikely(!moddict)) goto bad;
24643 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
24644 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
24645 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
24646 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
24647 return module;
24648bad:
24649 Py_XDECREF(module);
24650 return NULL;
24651}
24652
24653
24654static CYTHON_SMALL_CODE int __pyx_pymod_exec_csparsity(PyObject *__pyx_pyinit_module)
24655#endif
24656{
24657 int stringtab_initialized = 0;
24658 #if CYTHON_USE_MODULE_STATE
24659 int pystate_addmodule_run = 0;
24660 #endif
24661 __pyx_mstatetype *__pyx_mstate = NULL;
24662 PyObject *__pyx_t_1 = NULL;
24663 PyObject *__pyx_t_2 = NULL;
24664 PyObject *__pyx_t_3 = NULL;
24665 PyObject *__pyx_t_4 = NULL;
24666 PyObject *__pyx_t_5 = NULL;
24667 size_t __pyx_t_6;
24668 static PyThread_type_lock __pyx_t_7[8];
24669 int __pyx_t_8;
24670 int __pyx_lineno = 0;
24671 const char *__pyx_filename = NULL;
24672 int __pyx_clineno = 0;
24673 __Pyx_RefNannyDeclarations
24674 #if CYTHON_PEP489_MULTI_PHASE_INIT
24675 if (__pyx_m) {
24676 if (__pyx_m == __pyx_pyinit_module) return 0;
24677 PyErr_SetString(PyExc_RuntimeError, "Module 'csparsity' has already been imported. Re-initialisation is not supported.");
24678 return -1;
24679 }
24680 #else
24681 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
24682 #endif
24683 /*--- Module creation code ---*/
24684 #if CYTHON_PEP489_MULTI_PHASE_INIT
24685 __pyx_t_1 = __pyx_pyinit_module;
24686 Py_INCREF(__pyx_t_1);
24687 #else
24688 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24689 #endif
24690 #if CYTHON_USE_MODULE_STATE
24691 {
24692 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
24693 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "csparsity" pseudovariable */
24694 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24695 pystate_addmodule_run = 1;
24696 }
24697 #else
24698 __pyx_m = __pyx_t_1;
24699 #endif
24700 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
24701 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
24702 #endif
24703 __pyx_mstate = __pyx_mstate_global;
24704 CYTHON_UNUSED_VAR(__pyx_t_1);
24705 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
24706 Py_INCREF(__pyx_mstate->__pyx_d);
24707 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
24708 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
24709 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24710 /* ImportRefnannyAPI */
24711 #if CYTHON_REFNANNY
24712 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
24713 if (!__Pyx_RefNanny) {
24714 if (PyErr_ExceptionMatches(PyExc_Exception)) {
24715 PyErr_Clear();
24716 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
24717 }
24718 if (!__Pyx_RefNanny)
24719 Py_FatalError("failed to import 'refnanny' module");
24720 }
24721 #endif
24722
24723__Pyx_RefNannySetupContext("PyInit_csparsity", 0);
24724 __Pyx_init_runtime_version();
24725 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24726 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
24727 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
24728 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
24729 /*--- Library function declarations ---*/
24730 /*--- Initialize various global constants etc. ---*/
24731 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24732 stringtab_initialized = 1;
24733 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24734 if (__pyx_module_is_main_csparsity) {
24735 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24736 }
24737 {
24738 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
24739 if (!PyDict_GetItemString(modules, "csparsity")) {
24740 if (unlikely((PyDict_SetItemString(modules, "csparsity", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24741 }
24742 }
24743 /*--- Builtin init code ---*/
24744 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24745 /*--- Constants init code ---*/
24746 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24747 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24748 /*--- Global type/function init code ---*/
24749 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
24750 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
24751 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
24752 /*--- Type init code ---*/
24753 if (unlikely((__Pyx_modinit_Exttype___pyx_obj_9csparsity_PySparsityInfo(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24754 if (unlikely((__Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24755 if (unlikely((__Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24756 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24757 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24758 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
24759 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
24760 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
24761 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
24762 /*--- Execution code ---*/
24763
24764 /* "View.MemoryView":118
24765 *
24766 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
24767 * try: # <<<<<<<<<<<<<<
24768 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
24769 * except:
24770*/
24771 {
24772 __Pyx_PyThreadState_declare
24773 __Pyx_PyThreadState_assign
24774 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
24775 __Pyx_XGOTREF(__pyx_t_1);
24776 __Pyx_XGOTREF(__pyx_t_2);
24777 __Pyx_XGOTREF(__pyx_t_3);
24778 /*try:*/ {
24779
24780 /* "View.MemoryView":119
24781 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
24782 * try:
24783 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
24784 * except:
24785 *
24786*/
24787 __pyx_t_5 = NULL;
24788 __pyx_t_6 = 1;
24789 {
24790 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_collections_abc};
24791 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin___import__, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24792 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24793 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
24794 __Pyx_GOTREF(__pyx_t_4);
24795 }
24796 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 119, __pyx_L2_error)
24797 __Pyx_GOTREF(__pyx_t_5);
24798 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24799 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
24800 __Pyx_GOTREF(__pyx_t_4);
24801 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24802 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
24803 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
24804 __Pyx_GIVEREF(__pyx_t_4);
24805 __pyx_t_4 = 0;
24806
24807 /* "View.MemoryView":118
24808 *
24809 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
24810 * try: # <<<<<<<<<<<<<<
24811 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
24812 * except:
24813*/
24814 }
24815 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24816 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24817 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24818 goto __pyx_L7_try_end;
24819 __pyx_L2_error:;
24820 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24821 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24822
24823 /* "View.MemoryView":120
24824 * try:
24825 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
24826 * except: # <<<<<<<<<<<<<<
24827 *
24828 * __pyx_collections_abc_Sequence = None
24829*/
24830 /*except:*/ {
24831 __Pyx_ErrRestore(0,0,0);
24832
24833 /* "View.MemoryView":122
24834 * except:
24835 *
24836 * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<<
24837 *
24838 *
24839*/
24840 __Pyx_INCREF(Py_None);
24841 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
24842 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
24843 __Pyx_GIVEREF(Py_None);
24844 goto __pyx_L3_exception_handled;
24845 }
24846 __pyx_L3_exception_handled:;
24847 __Pyx_XGIVEREF(__pyx_t_1);
24848 __Pyx_XGIVEREF(__pyx_t_2);
24849 __Pyx_XGIVEREF(__pyx_t_3);
24850 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
24851 __pyx_L7_try_end:;
24852 }
24853
24854 /* "View.MemoryView":258
24855 *
24856 *
24857 * try: # <<<<<<<<<<<<<<
24858 * count = __pyx_collections_abc_Sequence.count
24859 * index = __pyx_collections_abc_Sequence.index
24860*/
24861 {
24862 __Pyx_PyThreadState_declare
24863 __Pyx_PyThreadState_assign
24864 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
24865 __Pyx_XGOTREF(__pyx_t_3);
24866 __Pyx_XGOTREF(__pyx_t_2);
24867 __Pyx_XGOTREF(__pyx_t_1);
24868 /*try:*/ {
24869
24870 /* "View.MemoryView":259
24871 *
24872 * try:
24873 * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
24874 * index = __pyx_collections_abc_Sequence.index
24875 * except:
24876*/
24877 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 259, __pyx_L10_error)
24878 __Pyx_GOTREF(__pyx_t_4);
24879 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(1, 259, __pyx_L10_error)
24880 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24881
24882 /* "View.MemoryView":260
24883 * try:
24884 * count = __pyx_collections_abc_Sequence.count
24885 * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
24886 * except:
24887 * pass
24888*/
24889 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 260, __pyx_L10_error)
24890 __Pyx_GOTREF(__pyx_t_4);
24891 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(1, 260, __pyx_L10_error)
24892 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24893
24894 /* "View.MemoryView":258
24895 *
24896 *
24897 * try: # <<<<<<<<<<<<<<
24898 * count = __pyx_collections_abc_Sequence.count
24899 * index = __pyx_collections_abc_Sequence.index
24900*/
24901 }
24902 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24903 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24904 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24905 goto __pyx_L15_try_end;
24906 __pyx_L10_error:;
24907 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24908 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24909
24910 /* "View.MemoryView":261
24911 * count = __pyx_collections_abc_Sequence.count
24912 * index = __pyx_collections_abc_Sequence.index
24913 * except: # <<<<<<<<<<<<<<
24914 * pass
24915 *
24916*/
24917 /*except:*/ {
24918 __Pyx_ErrRestore(0,0,0);
24919 goto __pyx_L11_exception_handled;
24920 }
24921 __pyx_L11_exception_handled:;
24922 __Pyx_XGIVEREF(__pyx_t_3);
24923 __Pyx_XGIVEREF(__pyx_t_2);
24924 __Pyx_XGIVEREF(__pyx_t_1);
24925 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
24926 __pyx_L15_try_end:;
24927 }
24928
24929 /* "View.MemoryView":326
24930 * return self.name
24931 *
24932 * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
24933 * cdef strided = Enum("<strided and direct>") # default
24934 * cdef indirect = Enum("<strided and indirect>")
24935*/
24936 __pyx_t_5 = NULL;
24937 __pyx_t_6 = 1;
24938 {
24939 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct_or_indirect};
24940 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24941 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24942 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 326, __pyx_L1_error)
24943 __Pyx_GOTREF((PyObject *)__pyx_t_4);
24944 }
24945 __Pyx_XGOTREF(generic);
24946 __Pyx_DECREF_SET(generic, ((PyObject *)__pyx_t_4));
24947 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
24948 __pyx_t_4 = 0;
24949
24950 /* "View.MemoryView":327
24951 *
24952 * cdef generic = Enum("<strided and direct or indirect>")
24953 * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
24954 * cdef indirect = Enum("<strided and indirect>")
24955 *
24956*/
24957 __pyx_t_5 = NULL;
24958 __pyx_t_6 = 1;
24959 {
24960 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct};
24961 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24962 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24963 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 327, __pyx_L1_error)
24964 __Pyx_GOTREF((PyObject *)__pyx_t_4);
24965 }
24966 __Pyx_XGOTREF(strided);
24967 __Pyx_DECREF_SET(strided, ((PyObject *)__pyx_t_4));
24968 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
24969 __pyx_t_4 = 0;
24970
24971 /* "View.MemoryView":328
24972 * cdef generic = Enum("<strided and direct or indirect>")
24973 * cdef strided = Enum("<strided and direct>") # default
24974 * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
24975 *
24976 *
24977*/
24978 __pyx_t_5 = NULL;
24979 __pyx_t_6 = 1;
24980 {
24981 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_indirect};
24982 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24983 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24984 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 328, __pyx_L1_error)
24985 __Pyx_GOTREF((PyObject *)__pyx_t_4);
24986 }
24987 __Pyx_XGOTREF(indirect);
24988 __Pyx_DECREF_SET(indirect, ((PyObject *)__pyx_t_4));
24989 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
24990 __pyx_t_4 = 0;
24991
24992 /* "View.MemoryView":331
24993 *
24994 *
24995 * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
24996 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
24997 *
24998*/
24999 __pyx_t_5 = NULL;
25000 __pyx_t_6 = 1;
25001 {
25002 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_direct};
25003 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25004 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25005 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 331, __pyx_L1_error)
25006 __Pyx_GOTREF((PyObject *)__pyx_t_4);
25007 }
25008 __Pyx_XGOTREF(contiguous);
25009 __Pyx_DECREF_SET(contiguous, ((PyObject *)__pyx_t_4));
25010 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
25011 __pyx_t_4 = 0;
25012
25013 /* "View.MemoryView":332
25014 *
25015 * cdef contiguous = Enum("<contiguous and direct>")
25016 * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
25017 *
25018 *
25019*/
25020 __pyx_t_5 = NULL;
25021 __pyx_t_6 = 1;
25022 {
25023 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_indirect};
25024 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25025 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25026 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 332, __pyx_L1_error)
25027 __Pyx_GOTREF((PyObject *)__pyx_t_4);
25028 }
25029 __Pyx_XGOTREF(indirect_contiguous);
25030 __Pyx_DECREF_SET(indirect_contiguous, ((PyObject *)__pyx_t_4));
25031 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
25032 __pyx_t_4 = 0;
25033
25034 /* "View.MemoryView":340
25035 *
25036 *
25037 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
25038 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
25039 * PyThread_allocate_lock(),
25040*/
25041 __pyx_memoryview_thread_locks_used = 0;
25042
25043 /* "View.MemoryView":341
25044 *
25045 * cdef int __pyx_memoryview_thread_locks_used = 0
25046 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
25047 * PyThread_allocate_lock(),
25048 * PyThread_allocate_lock(),
25049*/
25050 __pyx_t_7[0] = PyThread_allocate_lock();
25051 __pyx_t_7[1] = PyThread_allocate_lock();
25052 __pyx_t_7[2] = PyThread_allocate_lock();
25053 __pyx_t_7[3] = PyThread_allocate_lock();
25054 __pyx_t_7[4] = PyThread_allocate_lock();
25055 __pyx_t_7[5] = PyThread_allocate_lock();
25056 __pyx_t_7[6] = PyThread_allocate_lock();
25057 __pyx_t_7[7] = PyThread_allocate_lock();
25058 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_7, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
25059
25060 /* "View.MemoryView":979
25061 *
25062 *
25063 * try: # <<<<<<<<<<<<<<
25064 * count = __pyx_collections_abc_Sequence.count
25065 * index = __pyx_collections_abc_Sequence.index
25066*/
25067 {
25068 __Pyx_PyThreadState_declare
25069 __Pyx_PyThreadState_assign
25070 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
25071 __Pyx_XGOTREF(__pyx_t_1);
25072 __Pyx_XGOTREF(__pyx_t_2);
25073 __Pyx_XGOTREF(__pyx_t_3);
25074 /*try:*/ {
25075
25076 /* "View.MemoryView":980
25077 *
25078 * try:
25079 * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
25080 * index = __pyx_collections_abc_Sequence.index
25081 * except:
25082*/
25083 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 980, __pyx_L18_error)
25084 __Pyx_GOTREF(__pyx_t_4);
25085 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(1, 980, __pyx_L18_error)
25086 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25087
25088 /* "View.MemoryView":981
25089 * try:
25090 * count = __pyx_collections_abc_Sequence.count
25091 * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
25092 * except:
25093 * pass
25094*/
25095 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 981, __pyx_L18_error)
25096 __Pyx_GOTREF(__pyx_t_4);
25097 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(1, 981, __pyx_L18_error)
25098 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25099
25100 /* "View.MemoryView":979
25101 *
25102 *
25103 * try: # <<<<<<<<<<<<<<
25104 * count = __pyx_collections_abc_Sequence.count
25105 * index = __pyx_collections_abc_Sequence.index
25106*/
25107 }
25108 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25109 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25110 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
25111 goto __pyx_L23_try_end;
25112 __pyx_L18_error:;
25113 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25114 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25115
25116 /* "View.MemoryView":982
25117 * count = __pyx_collections_abc_Sequence.count
25118 * index = __pyx_collections_abc_Sequence.index
25119 * except: # <<<<<<<<<<<<<<
25120 * pass
25121 *
25122*/
25123 /*except:*/ {
25124 __Pyx_ErrRestore(0,0,0);
25125 goto __pyx_L19_exception_handled;
25126 }
25127 __pyx_L19_exception_handled:;
25128 __Pyx_XGIVEREF(__pyx_t_1);
25129 __Pyx_XGIVEREF(__pyx_t_2);
25130 __Pyx_XGIVEREF(__pyx_t_3);
25131 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
25132 __pyx_L23_try_end:;
25133 }
25134
25135 /* "View.MemoryView":985
25136 * pass
25137 *
25138 * try: # <<<<<<<<<<<<<<
25139 * if __pyx_collections_abc_Sequence:
25140 *
25141*/
25142 {
25143 __Pyx_PyThreadState_declare
25144 __Pyx_PyThreadState_assign
25145 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
25146 __Pyx_XGOTREF(__pyx_t_3);
25147 __Pyx_XGOTREF(__pyx_t_2);
25148 __Pyx_XGOTREF(__pyx_t_1);
25149 /*try:*/ {
25150
25151 /* "View.MemoryView":986
25152 *
25153 * try:
25154 * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
25155 *
25156 *
25157*/
25158 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 986, __pyx_L26_error)
25159 if (__pyx_t_8) {
25160
25161
25162 /* "View.MemoryView":990
25163 *
25164 *
25165 * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<<
25166 * __pyx_collections_abc_Sequence.register(array)
25167 * except:
25168*/
25169 __pyx_t_5 = __pyx_collections_abc_Sequence;
25170 __Pyx_INCREF(__pyx_t_5);
25171 __pyx_t_6 = 0;
25172 {
25173 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_memoryviewslice_type)};
25174 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25175 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25176 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 990, __pyx_L26_error)
25177 __Pyx_GOTREF(__pyx_t_4);
25178 }
25179 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25180
25181 /* "View.MemoryView":991
25182 *
25183 * __pyx_collections_abc_Sequence.register(_memoryviewslice)
25184 * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<<
25185 * except:
25186 * pass # ignore failure, it's a minor issue
25187*/
25188 __pyx_t_5 = __pyx_collections_abc_Sequence;
25189 __Pyx_INCREF(__pyx_t_5);
25190 __pyx_t_6 = 0;
25191 {
25192 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_array_type)};
25193 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25194 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25195 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 991, __pyx_L26_error)
25196 __Pyx_GOTREF(__pyx_t_4);
25197 }
25198 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25199
25200 /* "View.MemoryView":986
25201 *
25202 * try:
25203 * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
25204 *
25205 *
25206*/
25207 }
25208
25209 /* "View.MemoryView":985
25210 * pass
25211 *
25212 * try: # <<<<<<<<<<<<<<
25213 * if __pyx_collections_abc_Sequence:
25214 *
25215*/
25216 }
25217 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
25218 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25219 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25220 goto __pyx_L31_try_end;
25221 __pyx_L26_error:;
25222 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25223 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25224
25225 /* "View.MemoryView":992
25226 * __pyx_collections_abc_Sequence.register(_memoryviewslice)
25227 * __pyx_collections_abc_Sequence.register(array)
25228 * except: # <<<<<<<<<<<<<<
25229 * pass # ignore failure, it's a minor issue
25230 *
25231*/
25232 /*except:*/ {
25233 __Pyx_ErrRestore(0,0,0);
25234 goto __pyx_L27_exception_handled;
25235 }
25236 __pyx_L27_exception_handled:;
25237 __Pyx_XGIVEREF(__pyx_t_3);
25238 __Pyx_XGIVEREF(__pyx_t_2);
25239 __Pyx_XGIVEREF(__pyx_t_1);
25240 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
25241 __pyx_L31_try_end:;
25242 }
25243
25244 /* "(tree fragment)":4
25245 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
25246 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
25247 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
25248 * cdef object __pyx_result
25249 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
25250*/
25251 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_mstate_global->__pyx_n_u_View_MemoryView); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
25252 __Pyx_GOTREF(__pyx_t_4);
25253 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum, __pyx_t_4) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
25254 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25255
25256 /* "csparsity.pyx":2
25257 * # A type of -*- python -*- file
25258 * import numpy as np # <<<<<<<<<<<<<<
25259 * cimport numpy as np
25260 * from csparsity cimport SparsityInfo
25261*/
25262 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
25263 __pyx_t_4 = __pyx_t_1;
25264 __Pyx_GOTREF(__pyx_t_4);
25265 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_4) < (0)) __PYX_ERR(0, 2, __pyx_L1_error)
25266 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25267
25268 /* "csparsity.pyx":14
25269 * #self.cpp.columnIndecesMap.clear()
25270 * #self.cpp.columnOffsetsMap.clear()
25271 * def findNonzeros(self, # <<<<<<<<<<<<<<
25272 * int nElements_global,
25273 * int nDOF_test_element,
25274*/
25275 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9csparsity_14PySparsityInfo_5findNonzeros, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PySparsityInfo_findNonzeros, NULL, __pyx_mstate_global->__pyx_n_u_csparsity, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 14, __pyx_L1_error)
25276 __Pyx_GOTREF(__pyx_t_4);
25277 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
25278 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
25279 #endif
25280 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9csparsity_PySparsityInfo, __pyx_mstate_global->__pyx_n_u_findNonzeros, __pyx_t_4) < (0)) __PYX_ERR(0, 14, __pyx_L1_error)
25281 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25282
25283 /* "csparsity.pyx":65
25284 * hasOutflowBoundary,
25285 * needOutflowJacobian)
25286 * def getOffsets_CSR(self, # <<<<<<<<<<<<<<
25287 * int nElements_global,
25288 * int nDOF_test_element,
25289*/
25290 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9csparsity_14PySparsityInfo_7getOffsets_CSR, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PySparsityInfo_getOffsets_CSR, NULL, __pyx_mstate_global->__pyx_n_u_csparsity, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
25291 __Pyx_GOTREF(__pyx_t_4);
25292 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
25293 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
25294 #endif
25295 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9csparsity_PySparsityInfo, __pyx_mstate_global->__pyx_n_u_getOffsets_CSR, __pyx_t_4) < (0)) __PYX_ERR(0, 65, __pyx_L1_error)
25296 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25297
25298 /* "csparsity.pyx":128
25299 * <int*> csrColumnOffsets_eb.data,
25300 * <int*> csrColumnOffsets_eb_eNebN.data)
25301 * def getCSR(self): # <<<<<<<<<<<<<<
25302 * self.cpp.getCSR()
25303 * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr),
25304*/
25305 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9csparsity_14PySparsityInfo_9getCSR, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PySparsityInfo_getCSR, NULL, __pyx_mstate_global->__pyx_n_u_csparsity, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
25306 __Pyx_GOTREF(__pyx_t_4);
25307 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
25308 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
25309 #endif
25310 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9csparsity_PySparsityInfo, __pyx_mstate_global->__pyx_n_u_getCSR, __pyx_t_4) < (0)) __PYX_ERR(0, 128, __pyx_L1_error)
25311 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25312
25313 /* "(tree fragment)":1
25314 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
25315 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
25316 * def __setstate_cython__(self, __pyx_state):
25317*/
25318 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9csparsity_14PySparsityInfo_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PySparsityInfo___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_csparsity, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
25319 __Pyx_GOTREF(__pyx_t_4);
25320 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
25321 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
25322 #endif
25323 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
25324 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25325
25326 /* "(tree fragment)":3
25327 * def __reduce_cython__(self):
25328 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
25329 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
25330 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
25331*/
25332 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9csparsity_14PySparsityInfo_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PySparsityInfo___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_csparsity, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
25333 __Pyx_GOTREF(__pyx_t_4);
25334 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
25335 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
25336 #endif
25337 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
25338 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25339
25340 /* "csparsity.pyx":1
25341 * # A type of -*- python -*- file # <<<<<<<<<<<<<<
25342 * import numpy as np
25343 * cimport numpy as np
25344*/
25345 __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
25346 __Pyx_GOTREF(__pyx_t_4);
25347 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
25348 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25349
25350 /*--- Wrapped vars code ---*/
25351
25352 goto __pyx_L0;
25353 __pyx_L1_error:;
25354 __Pyx_XDECREF(__pyx_t_4);
25355 __Pyx_XDECREF(__pyx_t_5);
25356 if (__pyx_m) {
25357 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
25358 __Pyx_AddTraceback("init csparsity", __pyx_clineno, __pyx_lineno, __pyx_filename);
25359 }
25360 #if !CYTHON_USE_MODULE_STATE
25361 Py_CLEAR(__pyx_m);
25362 #else
25363 Py_DECREF(__pyx_m);
25364 if (pystate_addmodule_run) {
25365 PyObject *tp, *value, *tb;
25366 __Pyx_PyErr_FetchException(&tp, &value, &tb);
25367 __Pyx_State_RemoveModule(&__pyx_moduledef);
25368 __Pyx_PyErr_RestoreException(tp, value, tb);
25369 }
25370 #endif
25371 } else if (!PyErr_Occurred()) {
25372 PyErr_SetString(PyExc_ImportError, "init csparsity");
25373 }
25374 __pyx_L0:;
25375 __Pyx_RefNannyFinishContext();
25376 #if CYTHON_PEP489_MULTI_PHASE_INIT
25377 return (__pyx_m != NULL) ? 0 : -1;
25378 #else
25379 return __pyx_m;
25380 #endif
25381}
25382/* #### Code section: pystring_table ### */
25383/* #### Code section: cached_builtins ### */
25384
25385static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
25386 int __pyx_lineno = 0;
25387 const char *__pyx_filename = NULL;
25388 int __pyx_clineno = 0;
25389 CYTHON_UNUSED_VAR(__pyx_mstate);
25390 __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 119, __pyx_L1_error)
25391 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 175, __pyx_L1_error)
25392 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 436, __pyx_L1_error)
25393 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(1, 662, __pyx_L1_error)
25394
25395 /* Cached unbound methods */
25396 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
25397 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
25398 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
25399 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
25400 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
25401 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
25402 return 0;
25403 __pyx_L1_error:;
25404 return -1;
25405}
25406/* #### Code section: cached_constants ### */
25407
25408static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
25409 __Pyx_RefNannyDeclarations
25410 int __pyx_lineno = 0;
25411 const char *__pyx_filename = NULL;
25412 int __pyx_clineno = 0;
25413 CYTHON_UNUSED_VAR(__pyx_mstate);
25414 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
25415
25416 /* "View.MemoryView":625
25417 * def suboffsets(self):
25418 * if self.view.suboffsets == NULL:
25419 * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
25420 *
25421 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
25422*/
25423 __pyx_mstate_global->__pyx_tuple[0] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(1, 625, __pyx_L1_error)
25424 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
25425 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
25426 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_1);
25427 if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[0], 0, __pyx_mstate_global->__pyx_int_neg_1) != (0)) __PYX_ERR(1, 625, __pyx_L1_error);
25428 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
25429
25430 /* "View.MemoryView":745
25431 *
25432 * if first_ellipsis_index >= 0:
25433 * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
25434 *
25435 * for idx in range(first_ellipsis_index):
25436*/
25437 __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(1, 745, __pyx_L1_error)
25438 __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
25439 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
25440
25441 /* "View.MemoryView":763
25442 *
25443 * have_slices = True
25444 * index_tuple += (slice(None),) * (ndim - idx) # <<<<<<<<<<<<<<
25445 *
25446 * return have_slices, index_tuple
25447*/
25448 __pyx_mstate_global->__pyx_tuple[1] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 763, __pyx_L1_error)
25449 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
25450 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
25451 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
25452 if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[1], 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 763, __pyx_L1_error);
25453 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
25454 #if CYTHON_IMMORTAL_CONSTANTS
25455 {
25456 PyObject **table = __pyx_mstate->__pyx_tuple;
25457 for (Py_ssize_t i=0; i<2; ++i) {
25458 #if PY_VERSION_HEX >= 0x030F0000
25459 PyUnstable_SetImmortal(table[i]);
25460 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
25461 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
25462 #if PY_VERSION_HEX < 0x030E0000
25463 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
25464 #else
25465 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
25466 #endif
25467 {
25468 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
25469 }
25470 #else
25471 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
25472 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
25473 #endif
25474 }
25475 }
25476 #endif
25477 #if CYTHON_IMMORTAL_CONSTANTS
25478 {
25479 PyObject **table = __pyx_mstate->__pyx_slice;
25480 for (Py_ssize_t i=0; i<1; ++i) {
25481 #if PY_VERSION_HEX >= 0x030F0000
25482 PyUnstable_SetImmortal(table[i]);
25483 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
25484 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
25485 #if PY_VERSION_HEX < 0x030E0000
25486 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
25487 #else
25488 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
25489 #endif
25490 {
25491 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
25492 }
25493 #else
25494 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
25495 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
25496 #endif
25497 }
25498 }
25499 #endif
25500 __Pyx_RefNannyFinishContext();
25501 return 0;
25502 __pyx_L1_error:;
25503 __Pyx_RefNannyFinishContext();
25504 return -1;
25505}
25506/* #### Code section: init_constants ### */
25507
25508static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
25509 int __pyx_lineno = 0;
25510 const char *__pyx_filename = NULL;
25511 int __pyx_clineno = 0;
25512 CYTHON_UNUSED_VAR(__pyx_mstate);
25513 {
25514 const struct { const unsigned int length: 8; } str_length_index[] = {{6},{8},{1},{15},{1},{1},{1},{2},{15},{23},{25},{32},{20},{22},{1},{1},{37},{45},{22},{179},{8},{15},{7},{6},{2},{9},{50},{39},{34},{21},{30},{37},{5},{8},{14},{32},{34},{27},{21},{29},{8},{15},{20},{12},{9},{17},{8},{8},{12},{10},{8},{10},{8},{7},{14},{11},{10},{19},{14},{12},{10},{17},{13},{12},{12},{19},{8},{13},{3},{15},{7},{18},{4},{1},{18},{5},{9},{16},{22},{19},{25},{13},{15},{28},{42},{21},{6},{9},{5},{30},{12},{5},{6},{7},{15},{16},{6},{14},{23},{25},{16},{18},{2},{5},{30},{5},{8},{4},{7},{4},{17},{18},{26},{16},{33},{13},{14},{33},{4},{4},{25},{19},{2},{5},{3},{11},{12},{4},{3},{8},{6},{4},{10},{5},{4},{5},{4},{4},{11},{12},{6},{6},{6},{6},{1}};
25515 const struct { const unsigned int length: 8; } bytes_length_index[] = {{0},{1},{1},{2},{1},{1},{9},{83},{129},{177}};
25516 #ifndef CYTHON_COMPRESS_STRINGS
25517 #define CYTHON_COMPRESS_STRINGS 90
25518 #endif
25519 #if (CYTHON_COMPRESS_STRINGS) == 1 /* compression: zlib (1243 bytes) */
25520static const char cstring[] = "x\332\205\025Mo\033U\220\240J\024DE\212*\304\t^$*\267\242]@\n_Q(5\216\203\202\250\323$Uot\365\366\355\254\375\232\267\357\255\337Gb\027\025z\3541\307\034}\314\321\307\034s\344\330\243\177\006?\201\231]\257\343\304m\2116\236y3\363\346{\3461\356\331\327\003f\222\247 \374\275[\267\274\005`\231\345\335\034\264\277}\373N\264\306\326\037@n\354\360\261\204Cf2\266.\214\366\262\033Lp\214\353\224\245\322\322\325\313d\251k\206\363V\246\220\316\t3c\337\312\277H\233I\336\373\271\305\2656\236q\347dW3o\230\005\236\3365Z\rY^:y\200Nn\351\003\256d\312r\223\302\035\006\203\002\357\242\252\206h\220\335Ff\254\267\\7\356\260.\252\252\205]\217\027\200\246\030\037H\307:\306\003\363=\314Mk\350{F3\244\245\240d\002\226{@k\344\037j\265$\244\331\303\366\303\273\253?\254\226\336Z\240L:\346B\"\024:\n\216\222\226\004\251<j\367\303\002\\\304\266264\201i@\2770\212\002\345\346/\370\036h\346\300\023\302\032e\314\334K\243c\274.u\2671M\223<\000\272\275\311\225\203\210\247i\214r \214R\3043\332E<\021\251t<Q\000\232~\273B\272\nK\265\301\2002\036\224gql!\r\002\342\230\245\241\324\250\215\276\213\001\036H\256\220+\244\226>\216u\310\213a\024\013c!\312\361\236\344\326\362!\313\270TU\0242/0\265\363b!\347\276\267 QXt3\270\257\204+\270u\322\017\243b8\010\245[$\304\2252\002\263\314*\375)\367<z\r\267*\030e\274\352\025\0275\367Z[[m\245d\341\244{8\334\233j\337\322\231\271x\212f\021\213\262\272q\274\300\307\344;\314\371\033%2l\312\216\321\317\300\232K\246\242.\370\326\336\356\"q;\313Hk\214\314=\350\007\320\002h\244\242\363\351\"+\003\374\337\300\326\212;0\360\273\220\305\361\264\374X\036,\0055\3109\202Z\245\207\234\010)\335\301\277,hA\260[\007\200\177U\332\t\313\271\324%4iP%O\363\274\202d>\216\261\022\261\350\201\330w!\257NS-\204R\363VX\320\205\024\373\250\241\255k\271\003O%\"\035\375\300U\255\266\356\254\205\214\317\0100\240\003ff\346\212\233s}\241\016q\354\301Q,\322Q\217\231\200S\005\330\347u_\304I\3102\234RWv\017wC-\244\211f\222.\341\016\204P\210\306\230\n\\\004\002\022.\366\205\t\332\317\032R8\3332*\344zZ\263\313""\347\030:\220t\026\251\311kH3\331]\203\233)\005\001.-\023\211\001T[\027\024\320\262\375\005]H\271\035\266\253\243kR\000\227x\277c\214\252}\201&\341\202d\007d\267\227\030;%j\201K\020\260H\345\342\002kq,\007\270\267\244\261\257W3\337\330\231\342]\207\353\022\247x\27243|\035~U&\341\252,\303\374\321\342\262\250Z\377b\257\367\270\333\220Y\026\034n\244-\375@\016 \335D\225H\336TaP\007\3262\270\344\313\245\205\214\016\271+1R\222\300\363v\360\2312\207\265\254L\321G\030H\375\2668h.\\\365\363\014\236\032\251\361}\240\307\201\036\005\275\261\275Y\265\3214i\025\201\"\230Q\026\264^\346\340\364\225\221\353\366\233\362Y\013lb\226j\213\347\007\262\206\t\371\237\2738\022\230\230\234\036\212\013Y\371\215\013\223H\\\r\310\230\246gF*\312\025\214\275e\312*\224vk\224\254\026\330\357\205),t\245\363\324\022\207\205\267\016\024IL\337\204r\271R\346p\370,N \024\250\242\250\026m\251\257FI\037\342Ax\\\t\2507\024\270\257\001\237\324\000n\260\266\375\350\317\047\317_,M\256|\360\362\313\243\235\027\315\311\325\017_n\034\275w\324\237\\]>z\367\350\326\361\312\361w\243\033\243G\047\237\216o\214\037\235^\237,\177<G\374\344\304\217W\307\375\311\362\215\243\215\343\245\232\367\343h\343\344\312\311\346\370\213qz\272\362\242\371\357\352;\357_C\245\327\216w\216\371\344\263\317\313\357\346\350\217\361\n\201x\334$\360d\374\r\202W7\277\035\357\324\"\213\037\362\327NWj\264uV]i\236]/\341\366?\3759\301\222K\047t\340\376R\345\301G\307\375\321\322\204\255\224_c\364\034M#\370{\314\t\374\205\226Y\343U\343{\214g*\262\370!\177\375\264Y\243\355\263\352\n\331\"\270\363jgwN\262d\327\306\016Nv\316mN\255 \374\351\264RAq\021\274\177\266\364\037\021\252\350\330";
25521 PyObject *data = __Pyx_DecompressString(cstring, 1243, 1);
25522 #define __Pyx_DecompressString_LZSS_UNUSED
25523 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
25524 const char* const bytes = __Pyx_PyBytes_AsString(data);
25525 #if !CYTHON_ASSUME_SAFE_MACROS
25526 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
25527 #endif
25528 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90 /* compression: lzss (1653 bytes) */
25529static const char cstring[] = "\377 at 0x o\377bject>((\377tree fra\377gment)),\377.: <Memo\377ryView o\377f <conti\377guous an\237d dir7\001\007\ri\375n\021\005stride\275d\"\010 or \004\031>\371<(\tA\006>?Can\377not assi\377gn to re\377ad-only \365m\240\002v\242\000Inva\377lid mode\237, exp\327\000|\000\047\373c\047t\001\047fort\177ran\047, gH\000\276%\005shape\222\000 \377axis Not\357e th\231 Cyt\357hon \021\000del\177iberatek\000\336\320\001cter!\001n \177PEP-484\212\"\373re\306!s sub\333cl\246\000es\261!bu\357ilti\260\000ype\377s. If yoOu ne\224 \303\000p\316\000\376%\tthen se\335t\200\000e \047\357\002at\377ion_typi\267ng\047\355$iv\242\000o\377 False.a\367dd_\231 ecol\371l\310@+\000s.abc\377disablee\275n\002\001gcis\004\003d\377no defau\377lt __red\377uce__ du\336M\002non-\262@vi\373al\033\000cinit\377__numpy.\177_core.m5\000\377iarray fwail\300\003imp\330 \276\033\tumath\021\016p\375r\333 us/csp\377arsity.p\347yxu\234\002\317Aall\353oc\343 Z\003dat\303a.\013\020\253C\375a\332cs.\377ASCIIEll\377ipsisPyS^W\004Info\000\013.\351\006\315c\331B__\017\016\372 st\372\350@_\013\024findN\277onzero\\\014.?getCSRc\014\022\000\327OffR\001_\032\000Se\277quence\317\205\001.\364\324\205\007\204\001x\211\000Dict\377_NextRef\263__\370D\234@__\315b_y_\001\005h\000item\r\001yd0\001\027\000func\035\001\340\203\000\273\003+\000\223C3\001mai\275n\003\002odulM\002n\233am\002\003ewT\001\207@_\177checksuT\000\300\n\001?\004\025\001\373`\242`\037\001unopick?\000En \005\363vt\344a\230\001qual\260O\005\322e\341.\354fex\314\001s\207et_\203\005\363&\346\000\367.___test\321\001s\207\204\001\377outineab\375c\256e_buffe\367ras\231\204\002asyn\177cio.cor$\003\377sbaseccl\3722\000_\210 trace\377backcoun\375t\210\204\006csrCol\347umn\255D\000\r_eN\227ebN\004\017b\000\020#\006R\377owIndece\273sd\304\"is_\360\211\003e\353le\351\211\001B\200\000dar\233yE\t\003sA\333\205\001\r\014L\265o\346\000E#\nie\035\nN\177eighbor8\004\377ncodeenu}m\264\210\002error\325`\237erior1\023\315\204\tf\377lagsform\373at\256\211\004freeG\237lobal""\202B\003\tr\347ial\365\204\003\336\204\013has\377Diffusio\377nInMixedyFP\000\024\000Flux\355\005_Condi\337\210\001s-\000\305N\253\001i\320@\036\001=\000Ou\337tflow\231%id=i\305 xint\255\030\224\205\001\375s\000\002izejoi\317nmem\231\213\001\221\213\001nDCOF\301c\364$\013\003\276\001_\n\005\334\324.\n\rs_g\204\"nEyxq\024\031\005Freej\005\341n\004\006\254!\216 \035\034ame\317ndim\245\213\001\211*Ja?cobian\276\213\001\230$z\n\006p\245\212\002objo\355\207\002\370\254\205\002\003\005\242Apackp\377opregist\376\217awptrsel\350\233\210\001\215\213\004\211\215\002s\267 sta\373rt#\000pstop\360\303\216\003\374\205\002\003\005\362Astru\357ctunT\001upd\377atevalue\377sx:OT{^}\377\200\001\330\004\n\210+\220\377Q\200A\330\010\014\210D\377\220\007\220q\330\010\020\220\377\002\220(\230!\2306\240\377\024\240T\250\030\260\024\260\277T\270\021\330\020\022\n\010\026\377\250t\2604\260q\330\020\337\024\220D\230\001\024\0059\240\377D\250\004\250F\260$\260\377d\270!\200A\3604\000\373\t\rR\000\r\230Q\230a\367\330\036\037\000\000\330\036%\240w]\260!\003\001_\260A\n\001\367^\2601\022\000\320%5\260\345Q\033\005\037\000\006,\006\320%:{\270!:\003\320%C\300-\003wA\300\0216\002O\310q\036\010\330\031\002h\001~\000@\001|\003\017\230\277q\240\001\330 !\000\000\330\317 \047\240}x\000\004\000\177\260\365a\n\001~w\000 \047\320\047\2117\315\000\034\004!$\005\000\006\035\000<\373\270A:\003\320\047E\300Q\346E\000\320\047\206\0017\001Q\320QqRV\006\030\004e\005v\250Qj\007\214_\004k\000=\270=\003\324\001z\001@\003\300\001";
25530 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 1653, 2544);
25531 #define __Pyx_DecompressString_UNUSED
25532 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
25533 const char* const bytes = __Pyx_PyBytes_AsString(data);
25534 #if !CYTHON_ASSUME_SAFE_MACROS
25535 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
25536 #endif
25537 #else /* compression: none (2544 bytes) */
25538static const char bytes[] = " at 0x object>((tree fragment)),.: <MemoryView of <contiguous and direct><contiguous and indirect><strided and direct or indirect><strided and direct><strided and indirect>>?Cannot assign to read-only memoryviewInvalid mode, expected \047c\047 or \047fortran\047, got Invalid shape in axis Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the \047annotation_typing\047 directive to False.add_notecollections.abcdisableenablegcisenabledno default __reduce__ due to non-trivial __cinit__numpy._core.multiarray failed to importnumpy._core.umath failed to importproteus/csparsity.pyxunable to allocate array data.unable to allocate shape and strides.ASCIIEllipsisPySparsityInfoPySparsityInfo.__reduce_cython__PySparsityInfo.__setstate_cython__PySparsityInfo.findNonzerosPySparsityInfo.getCSRPySparsityInfo.getOffsets_CSRSequenceView.MemoryView__Pyx_PyDict_NextRef__annotate____class____class_getitem____dict____func____getstate____import____main____module____name____new____pyx_checksum__pyx_state__pyx_type__pyx_unpickle_Enum__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex____set_name____setstate____setstate_cython____test___is_coroutineabcallocate_bufferasarrayasyncio.coroutinesbaseccline_in_tracebackcountcsparsitycsrColumnOffsetscsrColumnOffsets_eNebNcsrColumnOffsets_ebcsrColumnOffsets_eb_eNebNcsrRowIndecesdtype_is_objectelementBoundaryElementsArrayelementBoundaryLocalElementBoundariesArrayelementNeighborsArrayencodeenumerateerrorexteriorElementBoundariesArrayfindNonzerosflagsformatfortranfreeGlobal_testfreeGlobal_trialgetCSRgetOffsets_CSRhasDiffusionInMixedFormhasFluxBoundaryConditionshasNumericalFluxhasOutflowBoundaryidindexinteriorElementBoundariesArrayitemsitemsizejoinmemviewmodenDOF_test_elementnDOF_trial_elementnElementBoundaries_elementnElements_globalnExteriorElementBoundaries_globalnFreeDOF_testnFreeDOF_trialnInteriorElementBoundaries_globalnamendimneedNumericalFluxJacobia""nneedOutflowJacobiannpnumpyobjoffset_testoffset_trialpackpopregisterrowptrselfsetdefaultshapesizestartstepstopstride_teststride_trialstructunpackupdatevaluesx:OT{^}\200\001\330\004\n\210+\220Q\200A\330\010\014\210D\220\007\220q\330\010\020\220\002\220(\230!\2306\240\024\240T\250\030\260\024\260T\270\021\330\020\022\220(\230!\2306\240\024\240T\250\026\250t\2604\260q\330\020\024\220D\230\001\330\020\022\220(\230!\2309\240D\250\004\250F\260$\260d\270!\200A\3604\000\t\r\210D\220\r\230Q\230a\330\036\037\330\036\037\330\036%\240]\260!\330\036%\240_\260A\330\036%\240^\2601\330\036%\320%5\260Q\330\036\037\330\036\037\330\036\037\330\036\037\330\036\037\330\036\037\330\036\037\330\036\037\330\036%\320%:\270!\330\036\037\330\036%\320%C\3001\330\036%\320%A\300\021\330\036%\320%O\310q\330\036\037\330\036\037\330\036%\320%C\3001\330\036\037\330\036\037\200A\360@\001\000\t\r\210D\220\017\230q\240\001\330 !\330 !\330 \047\240}\260A\330 \047\240\177\260a\330 \047\240~\260Q\330 \047\320\0477\260q\330 !\330 !\330 !\330 !\330 !\330 !\330 !\330 !\330 \047\320\047<\270A\330 !\330 \047\320\047E\300Q\330 \047\320\047C\3001\330 \047\320\047Q\320QR\330 !\330 !\330 \047\320\047E\300Q\330 !\330 !\330 \047\240v\250Q\330 \047\240}\260A\330 \047\320\0477\260q\330 \047\320\047=\270Q\330 \047\320\047:\270!\330 \047\320\047@\300\001";
25539 PyObject *data = NULL;
25540 #define __Pyx_DecompressString_UNUSED
25541 #define __Pyx_DecompressString_LZSS_UNUSED
25542 #endif
25543 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
25544 Py_ssize_t pos = 0;
25545 for (int i = 0; i < 145; i++) {
25546 Py_ssize_t bytes_length = str_length_index[i].length;
25547 PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
25548 if (likely(string) && i >= 32) PyUnicode_InternInPlace(&string);
25549 if (unlikely(!string)) {
25550 Py_XDECREF(data);
25551 __PYX_ERR(0, 1, __pyx_L1_error)
25552 }
25553 stringtab[i] = string;
25554 pos += bytes_length;
25555 }
25556 for (int i = 145; i < 155; i++) {
25557 Py_ssize_t bytes_length = bytes_length_index[i-145].length;
25558 PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
25559 stringtab[i] = string;
25560 pos += bytes_length;
25561 if (unlikely(!string)) {
25562 Py_XDECREF(data);
25563 __PYX_ERR(0, 1, __pyx_L1_error)
25564 }
25565 }
25566 Py_XDECREF(data);
25567 for (Py_ssize_t i = 0; i < 155; i++) {
25568 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
25569 __PYX_ERR(0, 1, __pyx_L1_error)
25570 }
25571 }
25572 #if CYTHON_IMMORTAL_CONSTANTS
25573 {
25574 PyObject **table = stringtab + 145;
25575 for (Py_ssize_t i=0; i<10; ++i) {
25576 #if PY_VERSION_HEX >= 0x030F0000
25577 PyUnstable_SetImmortal(table[i]);
25578 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
25579 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
25580 #if PY_VERSION_HEX < 0x030E0000
25581 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
25582 #else
25583 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
25584 #endif
25585 {
25586 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
25587 }
25588 #else
25589 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
25590 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
25591 #endif
25592 }
25593 }
25594 #endif
25595 }
25596 {
25597 PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
25598 int8_t const cint_constants_1[] = {0,-1};
25599 int32_t const cint_constants_4[] = {136983863L};
25600 for (int i = 0; i < 3; i++) {
25601 numbertab[i] = PyLong_FromLong((i < 2 ? cint_constants_1[i - 0] : cint_constants_4[i - 2]));
25602 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
25603 }
25604 }
25605 #if CYTHON_IMMORTAL_CONSTANTS
25606 {
25607 PyObject **table = __pyx_mstate->__pyx_number_tab;
25608 for (Py_ssize_t i=0; i<3; ++i) {
25609 #if PY_VERSION_HEX >= 0x030F0000
25610 PyUnstable_SetImmortal(table[i]);
25611 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
25612 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
25613 #if PY_VERSION_HEX < 0x030E0000
25614 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
25615 #else
25616 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
25617 #endif
25618 {
25619 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
25620 }
25621 #else
25622 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
25623 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
25624 #endif
25625 }
25626 }
25627 #endif
25628 return 0;
25629 __pyx_L1_error:;
25630 return -1;
25631}
25632/* #### Code section: init_codeobjects ### */
25633#ifdef __cplusplus
25634namespace {
25635#endif
25636typedef struct {
25637 unsigned int argcount : 6;
25638 unsigned int num_posonly_args : 1;
25639 unsigned int num_kwonly_args : 1;
25640 unsigned int nlocals : 6;
25641 unsigned int flags : 10;
25642 unsigned int first_line : 8;
25643} __Pyx_PyCode_New_function_description;
25644#ifdef __cplusplus
25645} /* anonymous namespace */
25646#endif
25647/* NewCodeObj.proto */
25648static PyObject* __Pyx_PyCode_New(
25649 const __Pyx_PyCode_New_function_description descr,
25650 PyObject * const *varnames,
25651 PyObject *filename,
25652 PyObject *funcname,
25653 PyObject *line_table,
25654 PyObject *tuple_dedup_map
25655);
25656
25657
25658static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
25659 PyObject* tuple_dedup_map = PyDict_New();
25660 if (unlikely(!tuple_dedup_map)) return -1;
25661 {
25662 const __Pyx_PyCode_New_function_description descr = {26, 0, 0, 26, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 14};
25663 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nElements_global, __pyx_mstate->__pyx_n_u_nDOF_test_element, __pyx_mstate->__pyx_n_u_nDOF_trial_element, __pyx_mstate->__pyx_n_u_nFreeDOF_test, __pyx_mstate->__pyx_n_u_freeGlobal_test, __pyx_mstate->__pyx_n_u_nFreeDOF_trial, __pyx_mstate->__pyx_n_u_freeGlobal_trial, __pyx_mstate->__pyx_n_u_offset_test, __pyx_mstate->__pyx_n_u_stride_test, __pyx_mstate->__pyx_n_u_offset_trial, __pyx_mstate->__pyx_n_u_stride_trial, __pyx_mstate->__pyx_n_u_hasNumericalFlux, __pyx_mstate->__pyx_n_u_hasDiffusionInMixedForm, __pyx_mstate->__pyx_n_u_needNumericalFluxJacobian, __pyx_mstate->__pyx_n_u_nElementBoundaries_element, __pyx_mstate->__pyx_n_u_elementNeighborsArray, __pyx_mstate->__pyx_n_u_nInteriorElementBoundaries_globa, __pyx_mstate->__pyx_n_u_interiorElementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryElementsArray, __pyx_mstate->__pyx_n_u_elementBoundaryLocalElementBound, __pyx_mstate->__pyx_n_u_hasFluxBoundaryConditions, __pyx_mstate->__pyx_n_u_nExteriorElementBoundaries_globa, __pyx_mstate->__pyx_n_u_exteriorElementBoundariesArray, __pyx_mstate->__pyx_n_u_hasOutflowBoundary, __pyx_mstate->__pyx_n_u_needOutflowJacobian};
25664 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csparsity_pyx, __pyx_mstate->__pyx_n_u_findNonzeros, __pyx_mstate->__pyx_kp_b_iso88591_A4_D_Qa__A_1_5Q_C1_A_Oq_C1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
25665 }
25666 {
25667 const __Pyx_PyCode_New_function_description descr = {32, 0, 0, 32, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 65};
25668 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nElements_global, __pyx_mstate->__pyx_n_u_nDOF_test_element, __pyx_mstate->__pyx_n_u_nDOF_trial_element, __pyx_mstate->__pyx_n_u_nFreeDOF_test, __pyx_mstate->__pyx_n_u_freeGlobal_test, __pyx_mstate->__pyx_n_u_nFreeDOF_trial, __pyx_mstate->__pyx_n_u_freeGlobal_trial, __pyx_mstate->__pyx_n_u_offset_test, __pyx_mstate->__pyx_n_u_stride_test, __pyx_mstate->__pyx_n_u_offset_trial, __pyx_mstate->__pyx_n_u_stride_trial, __pyx_mstate->__pyx_n_u_hasNumericalFlux, __pyx_mstate->__pyx_n_u_hasDiffusionInMixedForm, __pyx_mstate->__pyx_n_u_needNumericalFluxJacobian, __pyx_mstate->__pyx_n_u_nElementBoundaries_element, __pyx_mstate->__pyx_n_u_elementNeighborsArray, __pyx_mstate->__pyx_n_u_nInteriorElementBoundaries_globa, __pyx_mstate->__pyx_n_u_interiorElementBoundariesArray, __pyx_mstate->__pyx_n_u_elementBoundaryElementsArray, __pyx_mstate->__pyx_n_u_elementBoundaryLocalElementBound, __pyx_mstate->__pyx_n_u_hasFluxBoundaryConditions, __pyx_mstate->__pyx_n_u_nExteriorElementBoundaries_globa, __pyx_mstate->__pyx_n_u_exteriorElementBoundariesArray, __pyx_mstate->__pyx_n_u_hasOutflowBoundary, __pyx_mstate->__pyx_n_u_needOutflowJacobian, __pyx_mstate->__pyx_n_u_rowptr, __pyx_mstate->__pyx_n_u_csrRowIndeces, __pyx_mstate->__pyx_n_u_csrColumnOffsets, __pyx_mstate->__pyx_n_u_csrColumnOffsets_eNebN, __pyx_mstate->__pyx_n_u_csrColumnOffsets_eb, __pyx_mstate->__pyx_n_u_csrColumnOffsets_eb_eNebN};
25669 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csparsity_pyx, __pyx_mstate->__pyx_n_u_getOffsets_CSR, __pyx_mstate->__pyx_kp_b_iso88591_A_D_q_A_a_Q_7q_A_EQ_C1_QQR_EQ_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
25670 }
25671 {
25672 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 128};
25673 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
25674 __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csparsity_pyx, __pyx_mstate->__pyx_n_u_getCSR, __pyx_mstate->__pyx_kp_b_iso88591_A_D_q_6_T_T_6_T_t4q_D_9D_F_d, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
25675 }
25676 {
25677 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
25678 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
25679 __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
25680 }
25681 {
25682 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
25683 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
25684 __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
25685 }
25686 Py_DECREF(tuple_dedup_map);
25687 return 0;
25688 bad:
25689 Py_DECREF(tuple_dedup_map);
25690 return -1;
25691}
25692/* #### Code section: init_globals ### */
25693
25694static int __Pyx_InitGlobals(void) {
25695 int __pyx_lineno = 0;
25696 const char *__pyx_filename = NULL;
25697 int __pyx_clineno = 0;
25698 /* PythonCompatibility.init */
25699 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0)); else
25700
25701 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25702
25703 /* PyFrozenDict.init */
25704 #if CYTHON_COMPILING_IN_LIMITED_API
25705 {
25706 PyObject *builtins = PyEval_GetBuiltins(); // borrowed
25707 if (likely(builtins)) {
25708 PyObject *type_name = PyUnicode_FromStringAndSize("frozendict", sizeof("frozendict")-1);
25709 if (likely(type_name)) {
25710 PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
25711 Py_DECREF(type_name);
25712 if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
25713 PyErr_Clear();
25714 frozendict_type = (PyObject*) &PyDict_Type;
25715 Py_INCREF(frozendict_type);
25716 }
25717 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
25718 }
25719 }
25720 } // error handling follows
25721 #endif
25722
25723 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25724
25725 /* AssertionsEnabled.init */
25726 if (likely(__Pyx_init_assertions_enabled() == 0)); else
25727
25728 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25729
25730 /* NumpyImportArray.init */
25731 /*
25732 * Cython has automatically inserted a call to _import_array since
25733 * you didn't include one when you cimported numpy. To disable this
25734 * add the line
25735 * <void>numpy._import_array
25736 */
25737 #ifdef NPY_FEATURE_VERSION
25738 #ifndef NO_IMPORT_ARRAY
25739 if (unlikely(_import_array() == -1)) {
25740 PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import "
25741 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
25742 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
25743 }
25744 #endif
25745 #endif
25746
25747 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25748
25749 /* CommonTypesMetaclass.init */
25750 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
25751
25752 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25753
25754 /* CachedMethodType.init */
25755 #if CYTHON_COMPILING_IN_LIMITED_API
25756 {
25757 PyObject *typesModule=NULL;
25758 typesModule = PyImport_ImportModule("types");
25759 if (typesModule) {
25760 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
25761 Py_DECREF(typesModule);
25762 }
25763 } // error handling follows
25764 #endif
25765
25766 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25767
25768 return 0;
25769 __pyx_L1_error:;
25770 return -1;
25771}
25772/* #### Code section: init_after_shared_utility ### */
25773
25774static int __Pyx_InitAfterSharedUtility(void) {
25775 int __pyx_lineno = 0;
25776 const char *__pyx_filename = NULL;
25777 int __pyx_clineno = 0;
25778 /* CythonFunctionPerModule.init */
25779 if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
25780
25781 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25782
25783 return 0;
25784 __pyx_L1_error:;
25785 return -1;
25786}
25787/* #### Code section: cleanup_globals ### */
25788/* #### Code section: cleanup_module ### */
25789/* #### Code section: main_method ### */
25790/* #### Code section: utility_code_pragmas ### */
25791#ifdef _MSC_VER
25792#pragma warning( push )
25793/* Warning 4127: conditional expression is constant
25794 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
25795 * compile-time, so this warning is not useful
25796 */
25797#pragma warning( disable : 4127 )
25798#endif
25799
25800
25801
25802/* #### Code section: utility_code_def ### */
25803
25804/* --- Runtime support code --- */
25805/* Refnanny */
25806#if CYTHON_REFNANNY
25807static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
25808 PyObject *m = NULL, *p = NULL;
25809 void *r = NULL;
25810 m = PyImport_ImportModule(modname);
25811 if (!m) goto end;
25812 p = PyObject_GetAttrString(m, "RefNannyAPI");
25813 if (!p) goto end;
25814 r = PyLong_AsVoidPtr(p);
25815end:
25816 Py_XDECREF(p);
25817 Py_XDECREF(m);
25818 return (__Pyx_RefNannyAPIStruct *)r;
25819}
25820#endif
25821
25822/* CopyObjectArray (used by TupleOrListFromArrayImpl) */
25823#if CYTHON_COMPILING_IN_CPYTHON
25824static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
25825 PyObject *v;
25826 Py_ssize_t i;
25827 for (i = 0; i < length; i++) {
25828 v = dest[i] = src[i];
25829 Py_INCREF(v);
25830 }
25831}
25832#endif
25833
25834/* TupleOrListFromArrayImpl (used by TupleFromArray) */
25835#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
25836CYTHON_UNUSED static PyObject *
25837__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) {
25838 if (n <= 0) {
25839 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
25840 }
25841 PyObject *res = PyTuple_New(n);
25842 if (unlikely(res == NULL)) return NULL;
25843 #if CYTHON_COMPILING_IN_CPYTHON
25844 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
25845 #else
25846 Py_ssize_t i;
25847 for (i = 0; i < n; i++) {
25848 Py_INCREF(src[i]);
25849 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
25850 Py_DECREF(res);
25851 return NULL;
25852 }
25853 }
25854 #endif
25855 return res;
25856}
25857#endif
25858
25859/* PyObjectCompare (used by UnicodeEquals) */
25860#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
25861#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
25862static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
25863 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
25864 int result = PyUnicode_Equal(s1, s2);
25865 #if !CYTHON_COMPILING_IN_CPYTHON
25866 if (unlikely(result == -1)) return -1;
25867 #endif
25868 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
25869 #else
25870 int result = PyUnicode_Compare(s1, s2);
25871 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
25872 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
25873 #endif
25874__pyx_return_true:
25875 return 1;
25876__pyx_return_false:
25877 return 0;
25878}
25879#endif
25880static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop) {
25881 CYTHON_UNUSED_VAR(pyop);
25882 if (unlikely(op1 == Py_None)) {
25883 if (op2 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
25884 }
25885 if (unlikely(op2 == Py_None)) {
25886 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
25887 }
25888
25889 if (likely(op1 != Py_None)) {
25890 if (op1 == op2) goto __pyx_return_true;
25891 if (likely(op2 != Py_None)) {
25892 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
25893 }
25894 goto __pyx_richcmp;
25895 }
25896
25897 if ((0)) goto __pyx_richcmp;
25898 if ((0)) goto __pyx_return_true;
25899 if ((0)) goto __pyx_return_false;
25900__pyx_richcmp:
25901 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
25902__pyx_return_true:
25903 return 1;
25904__pyx_return_false:
25905 return 0;
25906}
25907
25908/* fastcall */
25909#if CYTHON_VECTORCALL
25910static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
25911{
25912 Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
25913 #if !CYTHON_ASSUME_SAFE_SIZE
25914 if (unlikely(n == -1)) return NULL;
25915 #endif
25916 for (i = 0; i < n; i++)
25917 {
25918 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
25919 #if !CYTHON_ASSUME_SAFE_MACROS
25920 if (unlikely(!namei)) return NULL;
25921 #endif
25922 if (s == namei) return kwvalues[i];
25923 }
25924 for (i = 0; i < n; i++)
25925 {
25926 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
25927 #if !CYTHON_ASSUME_SAFE_MACROS
25928 if (unlikely(!namei)) return NULL;
25929 #endif
25930 int eq = __Pyx_PyUnicode_Equals(s, namei);
25931 if (unlikely(eq != 0)) {
25932 if (unlikely(eq < 0)) return NULL;
25933 return kwvalues[i];
25934 }
25935 }
25936 return NULL;
25937}
25938#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
25939CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
25940 Py_ssize_t i, nkwargs;
25941 PyObject *dict;
25942#if !CYTHON_ASSUME_SAFE_SIZE
25943 nkwargs = PyTuple_Size(kwnames);
25944 if (unlikely(nkwargs < 0)) return NULL;
25945#else
25946 nkwargs = PyTuple_GET_SIZE(kwnames);
25947#endif
25948 dict = PyDict_New();
25949 if (unlikely(!dict))
25950 return NULL;
25951 for (i=0; i<nkwargs; i++) {
25952#if !CYTHON_ASSUME_SAFE_MACROS
25953 PyObject *key = PyTuple_GetItem(kwnames, i);
25954 if (!key) goto bad;
25955#else
25956 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
25957#endif
25958 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
25959 goto bad;
25960 }
25961 return dict;
25962bad:
25963 Py_DECREF(dict);
25964 return NULL;
25965}
25966#endif
25967#endif
25968
25969/* PyObjectCall (used by PyObjectFastCall) */
25970#if CYTHON_COMPILING_IN_CPYTHON
25971static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25972 PyObject *result;
25973 ternaryfunc call = Py_TYPE(func)->tp_call;
25974 if (unlikely(!call))
25975 return PyObject_Call(func, arg, kw);
25976 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
25977 return NULL;
25978 result = (*call)(func, arg, kw);
25979 Py_LeaveRecursiveCall();
25980 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25981 PyErr_SetString(
25982 PyExc_SystemError,
25983 "NULL result without error in PyObject_Call");
25984 }
25985 return result;
25986}
25987#endif
25988
25989/* PyObjectCallMethO (used by PyObjectFastCall) */
25990#if CYTHON_COMPILING_IN_CPYTHON
25991static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
25992 PyObject *self, *result;
25993 PyCFunction cfunc;
25994 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
25995 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
25996 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
25997 return NULL;
25998 result = cfunc(self, arg);
25999 Py_LeaveRecursiveCall();
26000 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
26001 PyErr_SetString(
26002 PyExc_SystemError,
26003 "NULL result without error in PyObject_Call");
26004 }
26005 return result;
26006}
26007#endif
26008
26009/* PyObjectFastCall (used by PyObjectCallOneArg) */
26010#if CYTHON_COMPILING_IN_LIMITED_API
26011static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
26012 PyObject *argstuple;
26013 PyObject *result = 0;
26014 size_t i;
26015 argstuple = PyTuple_New((Py_ssize_t)nargs);
26016 if (unlikely(!argstuple)) return NULL;
26017 for (i = 0; i < nargs; i++) {
26018 Py_INCREF(args[i]);
26019 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
26020 }
26021 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
26022 bad:
26023 Py_DECREF(argstuple);
26024 return result;
26025}
26026#endif
26027#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
26028 #if CYTHON_COMPILING_IN_CPYTHON
26029static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
26030 PyTypeObject *tp = Py_TYPE(callable);
26031 #if defined(__Pyx_CyFunction_USED)
26032 if (__Pyx_CyFunction_CheckExact(callable)) {
26033 return __Pyx_CyFunction_func_vectorcall(callable);
26034 }
26035 #endif
26036 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
26037 return NULL;
26038 }
26039 assert(PyCallable_Check(callable));
26040 Py_ssize_t offset = tp->tp_vectorcall_offset;
26041 assert(offset > 0);
26042 vectorcallfunc ptr;
26043 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
26044 return ptr;
26045}
26046 #else
26047 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
26048 #endif
26049#endif
26050static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwargs) {
26051 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
26052#if CYTHON_COMPILING_IN_CPYTHON
26053 if (nargs == 0 && kwargs == NULL) {
26054 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
26055 return __Pyx_PyObject_CallMethO(func, NULL);
26056 }
26057 else if (nargs == 1 && kwargs == NULL) {
26058 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
26059 return __Pyx_PyObject_CallMethO(func, args[0]);
26060 }
26061#endif
26062 if (kwargs == NULL) {
26063 #if CYTHON_VECTORCALL
26064 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
26065 return PyObject_Vectorcall(func, args, nargsf, NULL);
26066 #else
26067 vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
26068 if (f) {
26069 return f(func, args, nargsf, NULL);
26070 }
26071 #endif
26072 #endif
26073 }
26074 if (nargs == 0) {
26075 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
26076 }
26077 #if CYTHON_COMPILING_IN_LIMITED_API
26078 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
26079 #elif CYTHON_COMPILING_IN_PYPY
26080 return PyObject_VectorcallDict(func, args, (size_t) nargs, kwargs);
26081 #else
26082 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
26083 #endif
26084}
26085
26086/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
26087static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
26088 PyObject *args[2] = {NULL, arg};
26089 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
26090}
26091
26092/* IgnoreException (used by UnpackUnboundCMethod_impl) */
26093static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
26094 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
26095 PyErr_Clear();
26096 return 1;
26097 }
26098 return 0;
26099}
26100
26101/* FastTypeChecks (used by UnpackUnboundCMethod_impl) */
26102#if CYTHON_COMPILING_IN_CPYTHON
26103static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26104 while (a) {
26105 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
26106 if (a == b)
26107 return 1;
26108 }
26109 return b == &PyBaseObject_Type;
26110}
26111static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26112 PyObject *mro;
26113 if (a == b) return 1;
26114 mro = a->tp_mro;
26115 if (likely(mro)) {
26116 Py_ssize_t i, n;
26117 n = PyTuple_GET_SIZE(mro);
26118 for (i = 0; i < n; i++) {
26119 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26120 return 1;
26121 }
26122 return 0;
26123 }
26124 return __Pyx_InBases(a, b);
26125}
26126static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
26127 PyObject *mro;
26128 if (cls == a || cls == b) return 1;
26129 mro = cls->tp_mro;
26130 if (likely(mro)) {
26131 Py_ssize_t i, n;
26132 n = PyTuple_GET_SIZE(mro);
26133 for (i = 0; i < n; i++) {
26134 PyObject *base = PyTuple_GET_ITEM(mro, i);
26135 if (base == (PyObject *)a || base == (PyObject *)b)
26136 return 1;
26137 }
26138 return 0;
26139 }
26140 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
26141}
26142#endif
26143
26144/* PyObjectGetAttrStr (used by UnpackUnboundCMethod_impl) */
26145#if CYTHON_USE_TYPE_SLOTS
26146static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
26147 PyTypeObject* tp = Py_TYPE(obj);
26148 if (likely(tp->tp_getattro))
26149 return tp->tp_getattro(obj, attr_name);
26150 return PyObject_GetAttr(obj, attr_name);
26151}
26152#endif
26153
26154/* UnpackUnboundCMethod_impl (used by UnpackUnboundCMethod) */
26155#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
26156static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
26157 PyObject *result;
26158 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
26159 if (unlikely(!selfless_args)) return NULL;
26160 result = PyObject_Call(method, selfless_args, kwargs);
26161 Py_DECREF(selfless_args);
26162 return result;
26163}
26164#else
26165static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
26166 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
26167}
26168#endif
26169static PyMethodDef __Pyx_UnboundCMethod_Def = {
26170 "CythonUnboundCMethod",
26171 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
26172#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
26173 METH_VARARGS | METH_KEYWORDS,
26174#else
26175 METH_FASTCALL | METH_KEYWORDS,
26176#endif
26177 NULL
26178};
26179static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
26180 PyObject *method, *result=NULL;
26181 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
26182 if (unlikely(!method))
26183 return -1;
26184 result = method;
26185#if CYTHON_COMPILING_IN_CPYTHON
26186 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
26187 {
26188 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
26189 target->func = descr->d_method->ml_meth;
26190 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
26191 } else
26192#endif
26193#if CYTHON_COMPILING_IN_PYPY
26194#else
26195 if (PyCFunction_Check(method))
26196#endif
26197 {
26198 PyObject *self;
26199 int self_found;
26200#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
26201 self = PyObject_GetAttrString(method, "__self__");
26202 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
26203 return -1;
26204 }
26205#else
26206 self = PyCFunction_GET_SELF(method);
26207#endif
26208 self_found = (self && self != Py_None);
26209#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
26210 Py_XDECREF(self);
26211#endif
26212 if (self_found) {
26213 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
26214 if (unlikely(!unbound_method)) return -1;
26215 Py_DECREF(method);
26216 result = unbound_method;
26217 }
26218 }
26219#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
26220 if (unlikely(target->method)) {
26221 Py_DECREF(result);
26222 } else
26223#endif
26224 target->method = result;
26225 return 0;
26226}
26227
26228/* CallUnboundCMethod0 */
26229#if CYTHON_COMPILING_IN_CPYTHON
26230static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
26231 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
26232 if (likely(was_initialized == 2 && cfunc->func)) {
26233 if (likely(cfunc->flag == METH_NOARGS))
26234 return __Pyx_CallCFunction(cfunc, self, NULL);
26235 if (likely(cfunc->flag == METH_FASTCALL))
26236 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
26237 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
26238 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
26239 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
26240 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
26241 if (cfunc->flag == METH_VARARGS)
26242 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
26243 return __Pyx__CallUnboundCMethod0(cfunc, self);
26244 }
26245#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
26246 else if (unlikely(was_initialized == 1)) {
26247 __Pyx_CachedCFunction tmp_cfunc = {
26248#ifndef __cplusplus
26249 0
26250#endif
26251 };
26252 tmp_cfunc.type = cfunc->type;
26253 tmp_cfunc.method_name = cfunc->method_name;
26254 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
26255 }
26256#endif
26257 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
26258 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
26259 return result;
26260}
26261#endif
26262static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
26263 PyObject *result;
26264 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
26265 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
26266 return result;
26267}
26268
26269/* py_dict_items (used by OwnedDictNext) */
26270static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
26271 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
26272}
26273
26274/* py_dict_values (used by OwnedDictNext) */
26275static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
26276 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
26277}
26278
26279/* OwnedDictNext (used by ParseKeywordsImpl) */
26280#if CYTHON_AVOID_BORROWED_REFS
26281static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
26282 PyObject *next = NULL;
26283 if (!*ppos) {
26284 if (pvalue) {
26285 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
26286 if (unlikely(!dictview)) goto bad;
26287 *ppos = PyObject_GetIter(dictview);
26288 Py_DECREF(dictview);
26289 } else {
26290 *ppos = PyObject_GetIter(p);
26291 }
26292 if (unlikely(!*ppos)) goto bad;
26293 }
26294 next = PyIter_Next(*ppos);
26295 if (!next) {
26296 if (PyErr_Occurred()) goto bad;
26297 return 0;
26298 }
26299 if (pkey && pvalue) {
26300 *pkey = __Pyx_PySequence_ITEM(next, 0);
26301 if (unlikely(*pkey)) goto bad;
26302 *pvalue = __Pyx_PySequence_ITEM(next, 1);
26303 if (unlikely(*pvalue)) goto bad;
26304 Py_DECREF(next);
26305 } else if (pkey) {
26306 *pkey = next;
26307 } else {
26308 assert(pvalue);
26309 *pvalue = next;
26310 }
26311 return 1;
26312 bad:
26313 Py_XDECREF(next);
26314#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
26315 PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
26316#else
26317 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
26318#endif
26319 if (pkey) *pkey = NULL;
26320 if (pvalue) *pvalue = NULL;
26321 return 0;
26322}
26323#else // !CYTHON_AVOID_BORROWED_REFS
26324static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
26325 int result = PyDict_Next(p, ppos, pkey, pvalue);
26326 if (likely(result == 1)) {
26327 if (pkey) Py_INCREF(*pkey);
26328 if (pvalue) Py_INCREF(*pvalue);
26329 }
26330 return result;
26331}
26332#endif
26333
26334/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
26335static void __Pyx_RaiseDoubleKeywordsError(
26336 const char* func_name,
26337 PyObject* kw_name)
26338{
26339 PyErr_Format(PyExc_TypeError,
26340 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
26341}
26342
26343/* CallUnboundCMethod2 */
26344#if CYTHON_COMPILING_IN_CPYTHON
26345static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
26346 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
26347 if (likely(was_initialized == 2 && cfunc->func)) {
26348 PyObject *args[2] = {arg1, arg2};
26349 if (cfunc->flag == METH_FASTCALL) {
26350 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
26351 }
26352 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
26353 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
26354 }
26355#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
26356 else if (unlikely(was_initialized == 1)) {
26357 __Pyx_CachedCFunction tmp_cfunc = {
26358#ifndef __cplusplus
26359 0
26360#endif
26361 };
26362 tmp_cfunc.type = cfunc->type;
26363 tmp_cfunc.method_name = cfunc->method_name;
26364 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
26365 }
26366#endif
26367 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
26368 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
26369 return result;
26370}
26371#endif
26372static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
26373 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
26374#if CYTHON_COMPILING_IN_CPYTHON
26375 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
26376 PyObject *result = NULL;
26377 PyObject *args = PyTuple_New(2);
26378 if (unlikely(!args)) return NULL;
26379 Py_INCREF(arg1);
26380 PyTuple_SET_ITEM(args, 0, arg1);
26381 Py_INCREF(arg2);
26382 PyTuple_SET_ITEM(args, 1, arg2);
26383 if (cfunc->flag & METH_KEYWORDS)
26384 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
26385 else
26386 result = __Pyx_CallCFunction(cfunc, self, args);
26387 Py_DECREF(args);
26388 return result;
26389 }
26390#endif
26391 {
26392 PyObject *args[4] = {NULL, self, arg1, arg2};
26393 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
26394 }
26395}
26396
26397/* ParseKeywordsImpl (used by ParseKeywords) */
26398static int __Pyx_ValidateDuplicatePosArgs(
26399 PyObject *kwds,
26400 PyObject ** const argnames[],
26401 PyObject ** const *first_kw_arg,
26402 const char* function_name)
26403{
26404 PyObject ** const *name = argnames;
26405 while (name != first_kw_arg) {
26406 PyObject *key = **name;
26407 int found = PyDict_Contains(kwds, key);
26408 if (unlikely(found)) {
26409 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
26410 goto bad;
26411 }
26412 name++;
26413 }
26414 return 0;
26415bad:
26416 return -1;
26417}
26418#if CYTHON_USE_UNICODE_INTERNALS
26419static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
26420 int kind;
26421 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
26422 if (len != PyUnicode_GET_LENGTH(s2)) return 0;
26423 kind = PyUnicode_KIND(s1);
26424 if (kind != PyUnicode_KIND(s2)) return 0;
26425 const void *data1 = PyUnicode_DATA(s1);
26426 const void *data2 = PyUnicode_DATA(s2);
26427 return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
26428}
26429#endif
26430static int __Pyx_MatchKeywordArg_str(
26431 PyObject *key,
26432 PyObject ** const argnames[],
26433 PyObject ** const *first_kw_arg,
26434 size_t *index_found,
26435 const char *function_name)
26436{
26437 PyObject ** const *name;
26438 #if CYTHON_USE_UNICODE_INTERNALS
26439 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
26440 if (unlikely(key_hash == -1)) {
26441 key_hash = PyObject_Hash(key);
26442 if (unlikely(key_hash == -1))
26443 goto bad;
26444 }
26445 #endif
26446 name = first_kw_arg;
26447 while (*name) {
26448 PyObject *name_str = **name;
26449 #if CYTHON_USE_UNICODE_INTERNALS
26450 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
26451 *index_found = (size_t) (name - argnames);
26452 return 1;
26453 }
26454 #else
26455 #if CYTHON_ASSUME_SAFE_SIZE
26456 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
26457 #endif
26458 {
26459 int cmp = PyUnicode_Compare(name_str, key);
26460 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
26461 if (cmp == 0) {
26462 *index_found = (size_t) (name - argnames);
26463 return 1;
26464 }
26465 }
26466 #endif
26467 name++;
26468 }
26469 name = argnames;
26470 while (name != first_kw_arg) {
26471 PyObject *name_str = **name;
26472 #if CYTHON_USE_UNICODE_INTERNALS
26473 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
26474 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
26475 goto arg_passed_twice;
26476 }
26477 #else
26478 #if CYTHON_ASSUME_SAFE_SIZE
26479 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
26480 #endif
26481 {
26482 if (unlikely(name_str == key)) goto arg_passed_twice;
26483 int cmp = PyUnicode_Compare(name_str, key);
26484 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
26485 if (cmp == 0) goto arg_passed_twice;
26486 }
26487 #endif
26488 name++;
26489 }
26490 return 0;
26491arg_passed_twice:
26492 __Pyx_RaiseDoubleKeywordsError(function_name, key);
26493 goto bad;
26494bad:
26495 return -1;
26496}
26497static int __Pyx_MatchKeywordArg_nostr(
26498 PyObject *key,
26499 PyObject ** const argnames[],
26500 PyObject ** const *first_kw_arg,
26501 size_t *index_found,
26502 const char *function_name)
26503{
26504 PyObject ** const *name;
26505 if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
26506 name = first_kw_arg;
26507 while (*name) {
26508 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
26509 if (cmp == 1) {
26510 *index_found = (size_t) (name - argnames);
26511 return 1;
26512 }
26513 if (unlikely(cmp == -1)) goto bad;
26514 name++;
26515 }
26516 name = argnames;
26517 while (name != first_kw_arg) {
26518 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
26519 if (unlikely(cmp != 0)) {
26520 if (cmp == 1) goto arg_passed_twice;
26521 else goto bad;
26522 }
26523 name++;
26524 }
26525 return 0;
26526arg_passed_twice:
26527 __Pyx_RaiseDoubleKeywordsError(function_name, key);
26528 goto bad;
26529invalid_keyword_type:
26530 PyErr_Format(PyExc_TypeError,
26531 "%.200s() keywords must be strings", function_name);
26532 goto bad;
26533bad:
26534 return -1;
26535}
26536static CYTHON_INLINE int __Pyx_MatchKeywordArg(
26537 PyObject *key,
26538 PyObject ** const argnames[],
26539 PyObject ** const *first_kw_arg,
26540 size_t *index_found,
26541 const char *function_name)
26542{
26543 return likely(PyUnicode_CheckExact(key)) ?
26544 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
26545 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
26546}
26547static void __Pyx_RejectUnknownKeyword(
26548 PyObject *kwds,
26549 PyObject ** const argnames[],
26550 PyObject ** const *first_kw_arg,
26551 const char *function_name)
26552{
26553 #if CYTHON_AVOID_BORROWED_REFS
26554 PyObject *pos = NULL;
26555 #else
26556 Py_ssize_t pos = 0;
26557 #endif
26558 PyObject *key = NULL;
26559 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
26560 #if CYTHON_AVOID_BORROWED_REFS
26561 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
26562 #else
26563 (void) __Pyx_PyDict_NextRef;
26564 while (PyDict_Next(kwds, &pos, &key, NULL))
26565 #endif
26566 {
26567 PyObject** const *name = first_kw_arg;
26568 while (*name && (**name != key)) name++;
26569 if (!*name) {
26570 size_t index_found = 0;
26571 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
26572 if (cmp != 1) {
26573 if (cmp == 0) {
26574 PyErr_Format(PyExc_TypeError,
26575 "%s() got an unexpected keyword argument '%U'",
26576 function_name, key);
26577 }
26578 #if CYTHON_AVOID_BORROWED_REFS
26579 Py_DECREF(key);
26580 #endif
26581 break;
26582 }
26583 }
26584 #if CYTHON_AVOID_BORROWED_REFS
26585 Py_DECREF(key);
26586 #endif
26587 }
26588 __Pyx_END_CRITICAL_SECTION();
26589 #if CYTHON_AVOID_BORROWED_REFS
26590 Py_XDECREF(pos);
26591 #endif
26592 assert(PyErr_Occurred());
26593}
26594static int __Pyx_ParseKeywordDict(
26595 PyObject *kwds,
26596 PyObject ** const argnames[],
26597 PyObject *values[],
26598 Py_ssize_t num_pos_args,
26599 Py_ssize_t num_kwargs,
26600 const char* function_name,
26601 int ignore_unknown_kwargs)
26602{
26603 PyObject** const *name;
26604 PyObject** const *first_kw_arg = argnames + num_pos_args;
26605 Py_ssize_t extracted = 0;
26606#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
26607 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
26608#endif
26609 name = first_kw_arg;
26610 while (*name && num_kwargs > extracted) {
26611 PyObject * key = **name;
26612 PyObject *value;
26613 int found = 0;
26614 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
26615 found = PyDict_GetItemRef(kwds, key, &value);
26616 #else
26617 value = PyDict_GetItemWithError(kwds, key);
26618 if (value) {
26619 Py_INCREF(value);
26620 found = 1;
26621 } else {
26622 if (unlikely(PyErr_Occurred())) goto bad;
26623 }
26624 #endif
26625 if (found) {
26626 if (unlikely(found < 0)) goto bad;
26627 values[name-argnames] = value;
26628 extracted++;
26629 }
26630 name++;
26631 }
26632 if (num_kwargs > extracted) {
26633 if (ignore_unknown_kwargs) {
26634 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
26635 goto bad;
26636 } else {
26637 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
26638 goto bad;
26639 }
26640 }
26641 return 0;
26642bad:
26643 return -1;
26644}
26645static int __Pyx_ParseKeywordDictToDict(
26646 PyObject *kwds,
26647 PyObject ** const argnames[],
26648 PyObject *kwds2,
26649 PyObject *values[],
26650 Py_ssize_t num_pos_args,
26651 const char* function_name)
26652{
26653 PyObject** const *name;
26654 PyObject** const *first_kw_arg = argnames + num_pos_args;
26655 Py_ssize_t len;
26656#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
26657 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
26658#endif
26659 if (PyDict_Update(kwds2, kwds) < 0) goto bad;
26660 name = first_kw_arg;
26661 while (*name) {
26662 PyObject *key = **name;
26663 PyObject *value;
26664#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
26665 int found = PyDict_Pop(kwds2, key, &value);
26666 if (found) {
26667 if (unlikely(found < 0)) goto bad;
26668 values[name-argnames] = value;
26669 }
26670#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
26671 int found = PyDict_GetItemRef(kwds2, key, &value);
26672 if (found) {
26673 if (unlikely(found < 0)) goto bad;
26674 values[name-argnames] = value;
26675 if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
26676 }
26677#else
26678 #if CYTHON_COMPILING_IN_CPYTHON
26679 value = _PyDict_Pop(kwds2, key, kwds2);
26680 #else
26681 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
26682 #endif
26683 if (value == kwds2) {
26684 Py_DECREF(value);
26685 } else {
26686 if (unlikely(!value)) goto bad;
26687 values[name-argnames] = value;
26688 }
26689#endif
26690 name++;
26691 }
26692 len = PyDict_Size(kwds2);
26693 if (len > 0) {
26694 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
26695 } else if (unlikely(len == -1)) {
26696 goto bad;
26697 }
26698 return 0;
26699bad:
26700 return -1;
26701}
26702static int __Pyx_ParseKeywordsTuple(
26703 PyObject *kwds,
26704 PyObject * const *kwvalues,
26705 PyObject ** const argnames[],
26706 PyObject *kwds2,
26707 PyObject *values[],
26708 Py_ssize_t num_pos_args,
26709 Py_ssize_t num_kwargs,
26710 const char* function_name,
26711 int ignore_unknown_kwargs)
26712{
26713 PyObject *key = NULL;
26714 PyObject** const * name;
26715 PyObject** const *first_kw_arg = argnames + num_pos_args;
26716 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
26717#if CYTHON_AVOID_BORROWED_REFS
26718 key = __Pyx_PySequence_ITEM(kwds, pos);
26719#else
26720 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
26721#endif
26722#if !CYTHON_ASSUME_SAFE_MACROS
26723 if (unlikely(!key)) goto bad;
26724#endif
26725 name = first_kw_arg;
26726 while (*name && (**name != key)) name++;
26727 if (*name) {
26728 PyObject *value = kwvalues[pos];
26729 values[name-argnames] = __Pyx_NewRef(value);
26730 } else {
26731 size_t index_found = 0;
26732 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
26733 if (cmp == 1) {
26734 PyObject *value = kwvalues[pos];
26735 values[index_found] = __Pyx_NewRef(value);
26736 } else {
26737 if (unlikely(cmp == -1)) goto bad;
26738 if (kwds2) {
26739 PyObject *value = kwvalues[pos];
26740 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
26741 } else if (!ignore_unknown_kwargs) {
26742 goto invalid_keyword;
26743 }
26744 }
26745 }
26746 #if CYTHON_AVOID_BORROWED_REFS
26747 Py_DECREF(key);
26748 key = NULL;
26749 #endif
26750 }
26751 return 0;
26752invalid_keyword:
26753 PyErr_Format(PyExc_TypeError,
26754 "%s() got an unexpected keyword argument '%U'",
26755 function_name, key);
26756 goto bad;
26757bad:
26758 #if CYTHON_AVOID_BORROWED_REFS
26759 Py_XDECREF(key);
26760 #endif
26761 return -1;
26762}
26763
26764/* ParseKeywords */
26765static int __Pyx_ParseKeywords(
26766 PyObject *kwds,
26767 PyObject * const *kwvalues,
26768 PyObject ** const argnames[],
26769 PyObject *kwds2,
26770 PyObject *values[],
26771 Py_ssize_t num_pos_args,
26772 Py_ssize_t num_kwargs,
26773 const char* function_name,
26774 int ignore_unknown_kwargs)
26775{
26776 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
26777 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
26778 else if (kwds2)
26779 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
26780 else
26781 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
26782}
26783
26784/* RaiseArgTupleInvalid */
26785static void __Pyx_RaiseArgtupleInvalid(
26786 const char* func_name,
26787 int exact,
26788 Py_ssize_t num_min,
26789 Py_ssize_t num_max,
26790 Py_ssize_t num_found)
26791{
26792 Py_ssize_t num_expected;
26793 const char *more_or_less;
26794 if (num_found < num_min) {
26795 num_expected = num_min;
26796 more_or_less = "at least";
26797 } else {
26798 num_expected = num_max;
26799 more_or_less = "at most";
26800 }
26801 if (exact) {
26802 more_or_less = "exactly";
26803 }
26804 PyErr_Format(PyExc_TypeError,
26805 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
26806 func_name, more_or_less, num_expected,
26807 (num_expected == 1) ? "" : "s", num_found);
26808}
26809
26810/* ArgTypeTestError (used by ArgTypeTest) */
26811static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact)
26812{
26813 __Pyx_TypeName type_name;
26814 __Pyx_TypeName obj_type_name;
26815 PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
26816 int from_annotation_subclass = 0;
26817 if (unlikely(!type)) {
26818 PyErr_SetString(PyExc_SystemError, "Missing type object");
26819 return;
26820 } else if (exact == 2) {
26821 if (__Pyx_TypeCheck(obj, type)) {
26822 from_annotation_subclass = 1;
26823 extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
26824 }
26825 }
26826 type_name = __Pyx_PyType_GetFullyQualifiedName(type);
26827 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
26828 if (unlikely(!type_name)) return;
26829 #endif
26830 obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
26831 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
26832 if (unlikely(!obj_type_name)) goto obj_type_name_failed;
26833 #endif
26834 PyErr_Format(PyExc_TypeError,
26835 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")"
26836#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
26837 "%s%U"
26838#endif
26839 , name, type_name, obj_type_name
26840#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
26841 , (from_annotation_subclass ? ". " : ""), extra_info
26842#endif
26843 );
26844#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
26845 if (exact == 2 && from_annotation_subclass) {
26846 PyObject *res;
26847 PyObject *vargs[2];
26848 vargs[0] = PyErr_GetRaisedException();
26849 vargs[1] = extra_info;
26850 res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
26851 Py_XDECREF(res);
26852 PyErr_SetRaisedException(vargs[0]);
26853 }
26854#endif
26855 __Pyx_DECREF_TypeName(obj_type_name);
26856#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
26857obj_type_name_failed:
26858#endif
26859 __Pyx_DECREF_TypeName(type_name);
26860 return;
26861}
26862
26863/* ArgTypeTest */
26864static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) {
26865 if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
26866 return 1;
26867 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
26868 return 1;
26869 __Pyx_ArgTypeError(obj, type, name, exact);
26870 return 0;
26871}
26872
26873/* PyErrFetchRestore (used by GivenExceptionMatches) */
26874#if CYTHON_FAST_THREAD_STATE
26875static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26876#if PY_VERSION_HEX >= 0x030C00A6
26877 PyObject *tmp_value;
26878 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
26879 if (value) {
26880 #if CYTHON_COMPILING_IN_CPYTHON
26881 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
26882 #endif
26883 PyException_SetTraceback(value, tb);
26884 }
26885 tmp_value = tstate->current_exception;
26886 tstate->current_exception = value;
26887 Py_XDECREF(tmp_value);
26888 Py_XDECREF(type);
26889 Py_XDECREF(tb);
26890#else
26891 PyObject *tmp_type, *tmp_value, *tmp_tb;
26892 tmp_type = tstate->curexc_type;
26893 tmp_value = tstate->curexc_value;
26894 tmp_tb = tstate->curexc_traceback;
26895 tstate->curexc_type = type;
26896 tstate->curexc_value = value;
26897 tstate->curexc_traceback = tb;
26898 Py_XDECREF(tmp_type);
26899 Py_XDECREF(tmp_value);
26900 Py_XDECREF(tmp_tb);
26901#endif
26902}
26903static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26904#if PY_VERSION_HEX >= 0x030C00A6
26905 PyObject* exc_value;
26906 exc_value = tstate->current_exception;
26907 tstate->current_exception = 0;
26908 *value = exc_value;
26909 *type = NULL;
26910 *tb = NULL;
26911 if (exc_value) {
26912 *type = (PyObject*) Py_TYPE(exc_value);
26913 Py_INCREF(*type);
26914 #if CYTHON_COMPILING_IN_CPYTHON
26915 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
26916 Py_XINCREF(*tb);
26917 #else
26918 *tb = PyException_GetTraceback(exc_value);
26919 #endif
26920 }
26921#else
26922 *type = tstate->curexc_type;
26923 *value = tstate->curexc_value;
26924 *tb = tstate->curexc_traceback;
26925 tstate->curexc_type = 0;
26926 tstate->curexc_value = 0;
26927 tstate->curexc_traceback = 0;
26928#endif
26929}
26930#endif
26931
26932/* GivenExceptionMatches (used by PyErrExceptionMatches) */
26933#if CYTHON_COMPILING_IN_CPYTHON
26934static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26935 if (exc_type1) {
26936 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
26937 } else {
26938 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26939 }
26940}
26941static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26942 Py_ssize_t i, n;
26943 assert(PyExceptionClass_Check(exc_type));
26944 n = PyTuple_GET_SIZE(tuple);
26945 for (i=0; i<n; i++) {
26946 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
26947 }
26948 for (i=0; i<n; i++) {
26949 PyObject *t = PyTuple_GET_ITEM(tuple, i);
26950 if (likely(PyExceptionClass_Check(t))) {
26951 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
26952 } else {
26953 }
26954 }
26955 return 0;
26956}
26957static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26958 if (likely(err == exc_type)) return 1;
26959 if (likely(PyExceptionClass_Check(err))) {
26960 if (likely(PyExceptionClass_Check(exc_type))) {
26961 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26962 } else if (likely(PyTuple_Check(exc_type))) {
26963 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26964 } else {
26965 }
26966 }
26967 return PyErr_GivenExceptionMatches(err, exc_type);
26968}
26969static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26970 assert(PyExceptionClass_Check(exc_type1));
26971 assert(PyExceptionClass_Check(exc_type2));
26972 if (likely(err == exc_type1 || err == exc_type2)) return 1;
26973 if (likely(PyExceptionClass_Check(err))) {
26974 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26975 }
26976 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26977}
26978#endif
26979
26980/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
26981#if CYTHON_FAST_THREAD_STATE
26982static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26983 Py_ssize_t i, n;
26984 n = PyTuple_GET_SIZE(tuple);
26985 for (i=0; i<n; i++) {
26986 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
26987 }
26988 for (i=0; i<n; i++) {
26989 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
26990 }
26991 return 0;
26992}
26993static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
26994 int result;
26995 PyObject *exc_type;
26996#if PY_VERSION_HEX >= 0x030C00A6
26997 PyObject *current_exception = tstate->current_exception;
26998 if (unlikely(!current_exception)) return 0;
26999 exc_type = (PyObject*) Py_TYPE(current_exception);
27000 if (exc_type == err) return 1;
27001#else
27002 exc_type = tstate->curexc_type;
27003 if (exc_type == err) return 1;
27004 if (unlikely(!exc_type)) return 0;
27005#endif
27006 #if CYTHON_AVOID_BORROWED_REFS
27007 Py_INCREF(exc_type);
27008 #endif
27009 if (unlikely(PyTuple_Check(err))) {
27010 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
27011 } else {
27012 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
27013 }
27014 #if CYTHON_AVOID_BORROWED_REFS
27015 Py_DECREF(exc_type);
27016 #endif
27017 return result;
27018}
27019#endif
27020
27021/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
27022#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
27023static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
27024 __Pyx_PyThreadState_declare
27025 __Pyx_PyThreadState_assign
27026 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
27027 __Pyx_PyErr_Clear();
27028}
27029#endif
27030static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
27031 PyObject *result;
27032#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
27033 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
27034 return result;
27035#else
27036#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
27037 PyTypeObject* tp = Py_TYPE(obj);
27038 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
27039 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
27040 }
27041#endif
27042 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
27043 if (unlikely(!result)) {
27044 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
27045 }
27046 return result;
27047#endif
27048}
27049
27050/* GetBuiltinName */
27051static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
27052 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
27053 if (unlikely(!result) && !PyErr_Occurred()) {
27054 PyErr_Format(PyExc_NameError,
27055 "name '%U' is not defined", name);
27056 }
27057 return result;
27058}
27059
27060/* PyObjectFastCallMethod */
27061#if !CYTHON_VECTORCALL
27062static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
27063 PyObject *result;
27064 switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
27065 case 1:
27066 return PyObject_CallMethodObjArgs(args[0], name, NULL);
27067 case 2:
27068 return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
27069 case 3:
27070 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
27071 case 4:
27072 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
27073 case 5:
27074 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
27075 }
27076 PyObject *attr = PyObject_GetAttr(args[0], name);
27077 if (unlikely(!attr))
27078 return NULL;
27079 result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
27080 Py_DECREF(attr);
27081 return result;
27082}
27083#endif
27084
27085/* FormatTypeName (used by RaiseErrorWithObjectType1) */
27086#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
27087static __Pyx_TypeName
27088__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
27089{
27090 PyObject *module = NULL, *name = NULL, *result = NULL;
27091 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
27092 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
27093 __pyx_mstate_global->__pyx_n_u_qualname);
27094 #else
27095 name = PyType_GetQualName(tp);
27096 #endif
27097 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
27098 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
27099 __pyx_mstate_global->__pyx_n_u_module);
27100 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
27101 if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
27102 result = name;
27103 name = NULL;
27104 goto done;
27105 }
27106 result = PyUnicode_FromFormat("%U.%U", module, name);
27107 if (unlikely(result == NULL)) goto bad;
27108 done:
27109 Py_XDECREF(name);
27110 Py_XDECREF(module);
27111 return result;
27112 bad:
27113 PyErr_Clear();
27114 if (name) {
27115 result = name;
27116 name = NULL;
27117 } else {
27118 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
27119 }
27120 goto done;
27121}
27122#endif
27123
27124/* RaiseErrorWithObjectType1 (used by RaiseUnexpectedTypeError) */
27125static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj) {
27126 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
27127 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
27128 if (unlikely(!type_name)) return;
27129 #endif
27130 PyErr_Format(exc_type, message, arg, type_name);
27131 __Pyx_DECREF_TypeName(type_name);
27132}
27133
27134/* RaiseUnexpectedTypeError */
27135static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) {
27136 __Pyx_RaiseTypeErrorWithObjectType1(
27137 "Expected %.42s, got " __Pyx_FMT_TYPENAME,
27138 expected, obj);
27139 return 0;
27140}
27141
27142/* RaiseException */
27143static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
27144 PyObject* owned_instance = NULL;
27145 if (tb == Py_None) {
27146 tb = 0;
27147 } else if (tb && !PyTraceBack_Check(tb)) {
27148 PyErr_SetString(PyExc_TypeError,
27149 "raise: arg 3 must be a traceback or None");
27150 goto bad;
27151 }
27152 if (value == Py_None)
27153 value = 0;
27154 if (PyExceptionInstance_Check(type)) {
27155 if (value) {
27156 PyErr_SetString(PyExc_TypeError,
27157 "instance exception may not have a separate value");
27158 goto bad;
27159 }
27160 value = type;
27161 type = (PyObject*) Py_TYPE(value);
27162 } else if (PyExceptionClass_Check(type)) {
27163 PyObject *instance_class = NULL;
27164 if (value && PyExceptionInstance_Check(value)) {
27165 instance_class = (PyObject*) Py_TYPE(value);
27166 if (instance_class != type) {
27167 int is_subclass = PyObject_IsSubclass(instance_class, type);
27168 if (!is_subclass) {
27169 instance_class = NULL;
27170 } else if (unlikely(is_subclass == -1)) {
27171 goto bad;
27172 } else {
27173 type = instance_class;
27174 }
27175 }
27176 }
27177 if (!instance_class) {
27178 PyObject *args;
27179 if (!value)
27180 args = PyTuple_New(0);
27181 else if (PyTuple_Check(value)) {
27182 Py_INCREF(value);
27183 args = value;
27184 } else
27185 args = PyTuple_Pack(1, value);
27186 if (!args)
27187 goto bad;
27188 owned_instance = PyObject_Call(type, args, NULL);
27189 Py_DECREF(args);
27190 if (!owned_instance)
27191 goto bad;
27192 value = owned_instance;
27193 if (!PyExceptionInstance_Check(value)) {
27194 PyErr_Format(PyExc_TypeError,
27195 "calling %R should have returned an instance of "
27196 "BaseException, not %R",
27197 type, Py_TYPE(value));
27198 goto bad;
27199 }
27200 }
27201 } else {
27202 PyErr_SetString(PyExc_TypeError,
27203 "raise: exception class must be a subclass of BaseException");
27204 goto bad;
27205 }
27206 if (cause) {
27207 PyObject *fixed_cause;
27208 if (cause == Py_None) {
27209 fixed_cause = NULL;
27210 } else if (PyExceptionClass_Check(cause)) {
27211 fixed_cause = PyObject_CallObject(cause, NULL);
27212 if (fixed_cause == NULL)
27213 goto bad;
27214 } else if (PyExceptionInstance_Check(cause)) {
27215 fixed_cause = cause;
27216 Py_INCREF(fixed_cause);
27217 } else {
27218 PyErr_SetString(PyExc_TypeError,
27219 "exception causes must derive from "
27220 "BaseException");
27221 goto bad;
27222 }
27223 PyException_SetCause(value, fixed_cause);
27224 }
27225 PyErr_SetObject(type, value);
27226 if (tb) {
27227#if PY_VERSION_HEX >= 0x030C00A6
27228 PyException_SetTraceback(value, tb);
27229#elif CYTHON_FAST_THREAD_STATE
27230 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27231 PyObject* tmp_tb = tstate->curexc_traceback;
27232 if (tb != tmp_tb) {
27233 Py_INCREF(tb);
27234 tstate->curexc_traceback = tb;
27235 Py_XDECREF(tmp_tb);
27236 }
27237#else
27238 PyObject *tmp_type, *tmp_value, *tmp_tb;
27239 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
27240 Py_INCREF(tb);
27241 PyErr_Restore(tmp_type, tmp_value, tb);
27242 Py_XDECREF(tmp_tb);
27243#endif
27244 }
27245bad:
27246 Py_XDECREF(owned_instance);
27247 return;
27248}
27249
27250/* CIntToDigits (used by CIntToPyUnicode) */
27251static const char DIGIT_PAIRS_10[2*10*10+1] = {
27252 "00010203040506070809"
27253 "10111213141516171819"
27254 "20212223242526272829"
27255 "30313233343536373839"
27256 "40414243444546474849"
27257 "50515253545556575859"
27258 "60616263646566676869"
27259 "70717273747576777879"
27260 "80818283848586878889"
27261 "90919293949596979899"
27262};
27263static const char DIGIT_PAIRS_8[2*8*8+1] = {
27264 "0001020304050607"
27265 "1011121314151617"
27266 "2021222324252627"
27267 "3031323334353637"
27268 "4041424344454647"
27269 "5051525354555657"
27270 "6061626364656667"
27271 "7071727374757677"
27272};
27273static const char DIGITS_HEX[2*16+1] = {
27274 "0123456789abcdef"
27275 "0123456789ABCDEF"
27276};
27277
27278/* BuildPyUnicode (used by COrdinalToPyUnicode) */
27279static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
27280 int prepend_sign, char padding_char) {
27281 PyObject *uval;
27282 Py_ssize_t uoffset = ulength - clength;
27283#if CYTHON_USE_UNICODE_INTERNALS
27284 Py_ssize_t i;
27285 void *udata;
27286 uval = PyUnicode_New(ulength, 127);
27287 if (unlikely(!uval)) return NULL;
27288 udata = PyUnicode_DATA(uval);
27289 if (uoffset > 0) {
27290 i = 0;
27291 if (prepend_sign) {
27292 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
27293 i++;
27294 }
27295 for (; i < uoffset; i++) {
27296 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
27297 }
27298 }
27299 for (i=0; i < clength; i++) {
27300 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
27301 }
27302#else
27303 {
27304 PyObject *sign = NULL, *padding = NULL;
27305 uval = NULL;
27306 if (uoffset > 0) {
27307 prepend_sign = !!prepend_sign;
27308 if (uoffset > prepend_sign) {
27309 padding = PyUnicode_FromOrdinal(padding_char);
27310 if (likely(padding) && uoffset > prepend_sign + 1) {
27311 PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
27312 Py_DECREF(padding);
27313 padding = tmp;
27314 }
27315 if (unlikely(!padding)) goto done_or_error;
27316 }
27317 if (prepend_sign) {
27318 sign = PyUnicode_FromOrdinal('-');
27319 if (unlikely(!sign)) goto done_or_error;
27320 }
27321 }
27322 uval = PyUnicode_DecodeASCII(chars, clength, NULL);
27323 if (likely(uval) && padding) {
27324 PyObject *tmp = PyUnicode_Concat(padding, uval);
27325 Py_DECREF(uval);
27326 uval = tmp;
27327 }
27328 if (likely(uval) && sign) {
27329 PyObject *tmp = PyUnicode_Concat(sign, uval);
27330 Py_DECREF(uval);
27331 uval = tmp;
27332 }
27333done_or_error:
27334 Py_XDECREF(padding);
27335 Py_XDECREF(sign);
27336 }
27337#endif
27338 return uval;
27339}
27340
27341/* COrdinalToPyUnicode (used by CIntToPyUnicode) */
27342static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
27343 return value <= 1114111;
27344}
27345static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
27346 Py_ssize_t padding_length = ulength - 1;
27347 if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
27348 char chars[256];
27349 if (value <= 255) {
27350 memset(chars, padding_char, (size_t) padding_length);
27351 chars[ulength-1] = (char) value;
27352 return PyUnicode_DecodeLatin1(chars, ulength, NULL);
27353 }
27354 char *cpos = chars + sizeof(chars);
27355 if (value < 0x800) {
27356 *--cpos = (char) (0x80 | (value & 0x3f));
27357 value >>= 6;
27358 *--cpos = (char) (0xc0 | (value & 0x1f));
27359 } else if (value < 0x10000) {
27360 *--cpos = (char) (0x80 | (value & 0x3f));
27361 value >>= 6;
27362 *--cpos = (char) (0x80 | (value & 0x3f));
27363 value >>= 6;
27364 *--cpos = (char) (0xe0 | (value & 0x0f));
27365 } else {
27366 *--cpos = (char) (0x80 | (value & 0x3f));
27367 value >>= 6;
27368 *--cpos = (char) (0x80 | (value & 0x3f));
27369 value >>= 6;
27370 *--cpos = (char) (0x80 | (value & 0x3f));
27371 value >>= 6;
27372 *--cpos = (char) (0xf0 | (value & 0x07));
27373 }
27374 cpos -= padding_length;
27375 memset(cpos, padding_char, (size_t) padding_length);
27376 return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
27377 }
27378 if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
27379 const char chars[1] = {(char) value};
27380 return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
27381 }
27382 {
27383 PyObject *uchar, *padding_uchar, *padding, *result;
27384 padding_uchar = PyUnicode_FromOrdinal(padding_char);
27385 if (unlikely(!padding_uchar)) return NULL;
27386 padding = PySequence_Repeat(padding_uchar, padding_length);
27387 Py_DECREF(padding_uchar);
27388 if (unlikely(!padding)) return NULL;
27389 uchar = PyUnicode_FromOrdinal(value);
27390 if (unlikely(!uchar)) {
27391 Py_DECREF(padding);
27392 return NULL;
27393 }
27394 result = PyUnicode_Concat(padding, uchar);
27395 Py_DECREF(padding);
27396 Py_DECREF(uchar);
27397 return result;
27398 }
27399}
27400
27401/* CIntToPyUnicode */
27402static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char) {
27403#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27404#pragma GCC diagnostic push
27405#pragma GCC diagnostic ignored "-Wconversion"
27406#endif
27407 const int neg_one = (int) -1, const_zero = (int) 0;
27408#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27409#pragma GCC diagnostic pop
27410#endif
27411 const int is_unsigned = neg_one > const_zero;
27412 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
27413 !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
27414 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
27415 return NULL;
27416 }
27417 if (width <= 1) {
27418 return PyUnicode_FromOrdinal((int) value);
27419 }
27420 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
27421}
27422static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
27423 char digits[sizeof(int)*3+2];
27424 char *dpos, *end = digits + sizeof(int)*3+2;
27425 const char *hex_digits = DIGITS_HEX;
27426 Py_ssize_t length, ulength;
27427 int prepend_sign, last_one_off;
27428 int remaining;
27429#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27430#pragma GCC diagnostic push
27431#pragma GCC diagnostic ignored "-Wconversion"
27432#endif
27433 const int neg_one = (int) -1, const_zero = (int) 0;
27434#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27435#pragma GCC diagnostic pop
27436#endif
27437 const int is_unsigned = neg_one > const_zero;
27438 if (format_char == 'X') {
27439 hex_digits += 16;
27440 format_char = 'x';
27441 }
27442 remaining = value;
27443 last_one_off = 0;
27444 dpos = end;
27445 do {
27446 int digit_pos;
27447 switch (format_char) {
27448 case 'o':
27449 digit_pos = abs((int)(remaining % (8*8)));
27450 remaining = (int) (remaining / (8*8));
27451 dpos -= 2;
27452 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
27453 last_one_off = (digit_pos < 8);
27454 break;
27455 case 'd':
27456 digit_pos = abs((int)(remaining % (10*10)));
27457 remaining = (int) (remaining / (10*10));
27458 dpos -= 2;
27459 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
27460 last_one_off = (digit_pos < 10);
27461 break;
27462 case 'x':
27463 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
27464 remaining = (int) (remaining / 16);
27465 break;
27466 default:
27467 assert(0);
27468 break;
27469 }
27470 } while (unlikely(remaining != 0));
27471 assert(!last_one_off || *dpos == '0');
27472 dpos += last_one_off;
27473 length = end - dpos;
27474 ulength = length;
27475 prepend_sign = 0;
27476 if (!is_unsigned && value <= neg_one) {
27477 if (padding_char == ' ' || width <= length + 1) {
27478 *(--dpos) = '-';
27479 ++length;
27480 } else {
27481 prepend_sign = 1;
27482 }
27483 ++ulength;
27484 }
27485 if (width > ulength) {
27486 ulength = width;
27487 }
27488 if (ulength == 1) {
27489 return PyUnicode_FromOrdinal(*dpos);
27490 }
27491 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
27492}
27493
27494/* CIntToPyUnicode */
27495static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char) {
27496#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27497#pragma GCC diagnostic push
27498#pragma GCC diagnostic ignored "-Wconversion"
27499#endif
27500 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
27501#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27502#pragma GCC diagnostic pop
27503#endif
27504 const int is_unsigned = neg_one > const_zero;
27505 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
27506 !(sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
27507 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
27508 return NULL;
27509 }
27510 if (width <= 1) {
27511 return PyUnicode_FromOrdinal((int) value);
27512 }
27513 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
27514}
27515static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
27516 char digits[sizeof(Py_ssize_t)*3+2];
27517 char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
27518 const char *hex_digits = DIGITS_HEX;
27519 Py_ssize_t length, ulength;
27520 int prepend_sign, last_one_off;
27521 Py_ssize_t remaining;
27522#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27523#pragma GCC diagnostic push
27524#pragma GCC diagnostic ignored "-Wconversion"
27525#endif
27526 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
27527#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27528#pragma GCC diagnostic pop
27529#endif
27530 const int is_unsigned = neg_one > const_zero;
27531 if (format_char == 'X') {
27532 hex_digits += 16;
27533 format_char = 'x';
27534 }
27535 remaining = value;
27536 last_one_off = 0;
27537 dpos = end;
27538 do {
27539 int digit_pos;
27540 switch (format_char) {
27541 case 'o':
27542 digit_pos = abs((int)(remaining % (8*8)));
27543 remaining = (Py_ssize_t) (remaining / (8*8));
27544 dpos -= 2;
27545 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
27546 last_one_off = (digit_pos < 8);
27547 break;
27548 case 'd':
27549 digit_pos = abs((int)(remaining % (10*10)));
27550 remaining = (Py_ssize_t) (remaining / (10*10));
27551 dpos -= 2;
27552 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
27553 last_one_off = (digit_pos < 10);
27554 break;
27555 case 'x':
27556 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
27557 remaining = (Py_ssize_t) (remaining / 16);
27558 break;
27559 default:
27560 assert(0);
27561 break;
27562 }
27563 } while (unlikely(remaining != 0));
27564 assert(!last_one_off || *dpos == '0');
27565 dpos += last_one_off;
27566 length = end - dpos;
27567 ulength = length;
27568 prepend_sign = 0;
27569 if (!is_unsigned && value <= neg_one) {
27570 if (padding_char == ' ' || width <= length + 1) {
27571 *(--dpos) = '-';
27572 ++length;
27573 } else {
27574 prepend_sign = 1;
27575 }
27576 ++ulength;
27577 }
27578 if (width > ulength) {
27579 ulength = width;
27580 }
27581 if (ulength == 1) {
27582 return PyUnicode_FromOrdinal(*dpos);
27583 }
27584 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
27585}
27586
27587/* JoinPyUnicode */
27588static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind) {
27589#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH && CYTHON_USE_UNICODE_INTERNALS
27590 PyObject *result_uval;
27591 int result_ukind, kind_shift;
27592 Py_ssize_t i, char_pos;
27593 void *result_udata;
27594 static const Py_UCS4 max_char[5] = {0x7fU, 0xffU, 0xffffU, 0xffffU, 0x10ffffU};
27595 assert (kind >= 0);
27596 if (kind > PyUnicode_4BYTE_KIND) kind = PyUnicode_4BYTE_KIND;
27597 result_uval = PyUnicode_New(result_ulength, max_char[kind]);
27598 if (unlikely(!result_uval)) return NULL;
27599 kind_shift = kind >> 1; // 0, 1, 2
27600 result_ukind = 1 << kind_shift; // 1, 2, 4
27601 result_udata = PyUnicode_DATA(result_uval);
27602 assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
27603 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
27604 goto overflow;
27605 char_pos = 0;
27606 for (i=0; i < value_count; i++) {
27607 int ukind;
27608 Py_ssize_t ulength;
27609 void *udata;
27610 PyObject *uval = values[i];
27611 if (__Pyx_PyUnicode_READY(uval) == (-1))
27612 goto bad;
27613 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
27614 #if !CYTHON_ASSUME_SAFE_SIZE
27615 if (unlikely(ulength < 0)) goto bad;
27616 #endif
27617 if (unlikely(!ulength))
27618 continue;
27619 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
27620 goto overflow;
27621 ukind = __Pyx_PyUnicode_KIND(uval);
27622 udata = __Pyx_PyUnicode_DATA(uval);
27623 if (ukind == result_ukind) {
27624 memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
27625 } else {
27626 #if PY_VERSION_HEX >= 0x030d0000
27627 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
27628 #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
27629 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
27630 #else
27631 Py_ssize_t j;
27632 for (j=0; j < ulength; j++) {
27633 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
27634 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
27635 }
27636 #endif
27637 }
27638 char_pos += ulength;
27639 }
27640 return result_uval;
27641overflow:
27642 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
27643bad:
27644 Py_DECREF(result_uval);
27645 return NULL;
27646#else
27647 Py_ssize_t i;
27648 PyObject *result = NULL;
27649 PyObject *value_tuple = PyTuple_New(value_count);
27650 if (unlikely(!value_tuple)) return NULL;
27651 CYTHON_UNUSED_VAR(kind);
27652 CYTHON_UNUSED_VAR(result_ulength);
27653 for (i=0; i<value_count; i++) {
27654 Py_INCREF(values[i]);
27655 if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
27656 }
27657 result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
27658bad:
27659 Py_DECREF(value_tuple);
27660 return result;
27661#endif
27662}
27663
27664/* UnicodeEqualsUCS4 (used by UnicodeEquals_uchar) */
27665#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL)
27666static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals) {
27667 Py_ssize_t length;
27668 Py_UCS4 ch1;
27669 int kind;
27670 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0)) goto bad;
27671 length = __Pyx_PyUnicode_GET_LENGTH(s1);
27672 #if !CYTHON_ASSUME_SAFE_SIZE
27673 if (unlikely(length < 0)) goto bad;
27674 #endif
27675 if (length != 1) goto return_ne;
27676 kind = PyUnicode_KIND(s1);
27677 if (ch2 < 256) {
27678 if (likely(kind == PyUnicode_1BYTE_KIND)) {
27679 ch1 = PyUnicode_1BYTE_DATA(s1)[0];
27680 } else if (kind == PyUnicode_2BYTE_KIND) {
27681 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
27682 } else {
27683 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
27684 }
27685 } else if (ch2 < 65536) {
27686 if (kind == PyUnicode_2BYTE_KIND) {
27687 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
27688 } else if (kind == PyUnicode_4BYTE_KIND) {
27689 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
27690 } else {
27691 goto return_ne;
27692 }
27693 } else {
27694 if (kind == PyUnicode_4BYTE_KIND){
27695 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
27696 } else {
27697 goto return_ne;
27698 }
27699 }
27700 if (ch1 == ch2) {
27701 goto return_eq;
27702 } else {
27703 goto return_ne;
27704 }
27705return_eq:
27706 return (equals == Py_EQ);
27707return_ne:
27708 return (equals == Py_NE);
27709bad:
27710 return -1;
27711}
27712#endif
27713
27714/* PyObjectCompare */
27715#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
27716#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
27717static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
27718 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
27719 int result = PyUnicode_Equal(s1, s2);
27720 #if !CYTHON_COMPILING_IN_CPYTHON
27721 if (unlikely(result == -1)) return -1;
27722 #endif
27723 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
27724 #else
27725 int result = PyUnicode_Compare(s1, s2);
27726 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
27727 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
27728 #endif
27729__pyx_return_true:
27730 return 1;
27731__pyx_return_false:
27732 return 0;
27733}
27734#endif
27735static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop) {
27736 CYTHON_UNUSED_VAR(pyop);
27737 if (unlikely(op2 == Py_None)) {
27738 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
27739 }
27740 if (PyFloat_CheckExact(op1)) {
27741 goto __pyx_richcmp;
27742 }
27743 if (PyLong_CheckExact(op1)) {
27744 if (op1 == op2) goto __pyx_return_true;
27745 goto __pyx_richcmp;
27746 }
27747
27748 if (likely(PyUnicode_CheckExact(op1))) {
27749 if (op1 == op2) goto __pyx_return_true;
27750 if (likely(op2 != Py_None)) {
27751 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
27752 }
27753 goto __pyx_richcmp;
27754 }
27755
27756 if ((0)) goto __pyx_richcmp;
27757 if ((0)) goto __pyx_return_true;
27758 if ((0)) goto __pyx_return_false;
27759__pyx_richcmp:
27760 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
27761__pyx_return_true:
27762 return 1;
27763__pyx_return_false:
27764 return 0;
27765}
27766
27767/* PyObjectCompare */
27768#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
27769#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
27770#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
27771static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyBytesPyBytesEq(PyObject* s1, PyObject* s2) {
27772 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
27773 const char *ps1, *ps2;
27774 Py_ssize_t length = PyBytes_GET_SIZE(s1);
27775 if (length != PyBytes_GET_SIZE(s2)) goto __pyx_return_false;
27776 ps1 = PyBytes_AS_STRING(s1);
27777 ps2 = PyBytes_AS_STRING(s2);
27778 #else
27779 char *ps1, *ps2;
27780 Py_ssize_t length, length2;
27781 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length) == -1)) return NULL;
27782 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return NULL;
27783 if (length != length2) goto __pyx_return_false;
27784 #endif
27785 if (ps1[0] != ps2[0]) goto __pyx_return_false;
27786 if (length == 1) goto __pyx_return_true;
27787 {
27788 int cmp;
27789#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
27790 Py_hash_t hash1 = ((PyBytesObject*)s1)->ob_shash;
27791 Py_hash_t hash2 = ((PyBytesObject*)s2)->ob_shash;
27792 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) goto __pyx_return_false;
27793#endif
27794 cmp = memcmp(ps1, ps2, (size_t)length);
27795 if (cmp == 0) goto __pyx_return_true; else goto __pyx_return_false;
27796 }
27797__pyx_return_true:
27798 Py_RETURN_TRUE;
27799__pyx_return_false:
27800 Py_RETURN_FALSE;
27801}
27802#endif
27803#endif
27804#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
27805#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
27806#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
27807static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyByteArrayPyBytesEq(PyObject* s1, PyObject* s2) {
27808 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
27809 const char *ps1, *ps2;
27810 Py_ssize_t length = PyByteArray_GET_SIZE(s1);
27811 if (length != PyBytes_GET_SIZE(s2)) goto __pyx_return_false;
27812 ps1 = PyByteArray_AS_STRING(s1);
27813 ps2 = PyBytes_AS_STRING(s2);
27814 #else
27815 char *ps1, *ps2;
27816 Py_ssize_t length, length2;
27817 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return NULL;
27818 length = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length == -1)) return NULL;
27819 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return NULL;
27820 if (length != length2) goto __pyx_return_false;
27821 #endif
27822 if (length == 0) goto __pyx_return_true;
27823 if (ps1[0] != ps2[0]) goto __pyx_return_false;
27824 if (length == 1) goto __pyx_return_true;
27825 {
27826 int cmp;
27827 cmp = memcmp(ps1, ps2, (size_t)length);
27828 if (cmp == 0) goto __pyx_return_true; else goto __pyx_return_false;
27829 }
27830__pyx_return_true:
27831 Py_RETURN_TRUE;
27832__pyx_return_false:
27833 Py_RETURN_FALSE;
27834}
27835#endif
27836#endif
27837static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2, int pyop) {
27838 CYTHON_UNUSED_VAR(pyop);
27839 if (unlikely(op2 == Py_None)) {
27840 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
27841 }
27842 if (PyFloat_CheckExact(op1)) {
27843 goto __pyx_richcmp;
27844 }
27845 if (PyLong_CheckExact(op1)) {
27846 if (op1 == op2) goto __pyx_return_true;
27847 goto __pyx_richcmp;
27848 }
27849 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
27850 if (likely(PyBytes_CheckExact(op1))) {
27851 if (op1 == op2) goto __pyx_return_true;
27852 if (likely(op2 != Py_None)) {
27853 return __Pyx_PyObject_ComparePyBytesPyBytesEq(op1, op2);
27854 }
27855 goto __pyx_richcmp;
27856 }
27857 #endif
27858 if ((0)) goto __pyx_richcmp;
27859 if ((0)) goto __pyx_return_true;
27860 if ((0)) goto __pyx_return_false;
27861__pyx_richcmp:
27862 return PyObject_RichCompare(op1, op2, Py_EQ);
27863__pyx_return_true:
27864 Py_RETURN_TRUE;
27865__pyx_return_false:
27866 Py_RETURN_FALSE;
27867}
27868
27869/* GetAttr */
27870static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
27871#if CYTHON_USE_TYPE_SLOTS
27872 if (likely(PyUnicode_Check(n)))
27873 return __Pyx_PyObject_GetAttrStr(o, n);
27874#endif
27875 return PyObject_GetAttr(o, n);
27876}
27877
27878/* PyFrozenDict (used by GetItemInt) */
27879#if CYTHON_COMPILING_IN_LIMITED_API
27880static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
27881 return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
27882}
27883#endif
27884
27885/* GettItemInt_wraparound (used by GetItemInt) */
27886#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
27887static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
27888 assert(*i < 0);
27889 if (likely(sm->sq_length)) {
27890 Py_ssize_t l = sm->sq_length(o);
27891 if (likely(l >= 0)) {
27892 *i += l;
27893 } else {
27894 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
27895 return -1;
27896 PyErr_Clear();
27897 }
27898 }
27899 return 0;
27900}
27901#endif
27902
27903/* GetItemInt */
27904static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
27905 PyObject *r;
27906 if (unlikely(!j)) return NULL;
27907 r = PyObject_GetItem(o, j);
27908 Py_DECREF(j);
27909 return r;
27910}
27911static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
27912 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
27913}
27914static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
27915 int wraparound, int boundscheck, int unsafe_shared) {
27916 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
27917#if CYTHON_AVOID_BORROWED_REFS
27918 CYTHON_UNUSED_VAR(boundscheck);
27919 Py_ssize_t wrapped_i = i;
27920 if (wraparound & unlikely(i < 0)) {
27921 Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
27922 #if !CYTHON_ASSUME_SAFE_SIZE
27923 if (unlikely(size < 0)) return NULL;
27924 #endif
27925 wrapped_i += size;
27926 }
27927 return __Pyx_PyList_GetItemRef(o, wrapped_i);
27928#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
27929 Py_ssize_t wrapped_i = i;
27930 Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
27931 if (wraparound & unlikely(i < 0)) {
27932 wrapped_i += size;
27933 }
27934 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
27935 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
27936 }
27937 return __Pyx_GetItemInt_Generic_size(o, i);
27938#else
27939 (void)wraparound;
27940 (void)boundscheck;
27941 return PySequence_GetItem(o, i);
27942#endif
27943}
27944static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
27945 int wraparound, int boundscheck, int unsafe_shared) {
27946 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
27947#if CYTHON_AVOID_BORROWED_REFS
27948 CYTHON_UNUSED_VAR(boundscheck);
27949 Py_ssize_t wrapped_i = i;
27950 if (wraparound & unlikely(i < 0)) {
27951 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
27952 #if !CYTHON_ASSUME_SAFE_SIZE
27953 if (unlikely(size < 0)) return NULL;
27954 #endif
27955 wrapped_i += size;
27956 }
27957 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
27958 return PySequence_ITEM(o, wrapped_i);
27959 #else
27960 if (unlikely(wrapped_i < 0)) {
27961 PyErr_SetString(PyExc_IndexError, "tuple index out of range");
27962 return NULL;
27963 }
27964 return PySequence_GetItem(o, wrapped_i);
27965 #endif
27966#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
27967 Py_ssize_t wrapped_i = i;
27968 Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
27969 if (wraparound & unlikely(i < 0)) {
27970 wrapped_i += size;
27971 }
27972 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
27973 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
27974 }
27975 return __Pyx_GetItemInt_Generic_size(o, i);
27976#else
27977 (void)wraparound;
27978 (void)boundscheck;
27979 return PySequence_GetItem(o, i);
27980#endif
27981}
27982#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
27983static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
27984 PyObject *r, *key = PyLong_FromSsize_t(i);
27985 if (unlikely(!key)) return NULL;
27986 r = getitem(o, key);
27987 Py_DECREF(key);
27988 return r;
27989}
27990#endif
27991static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
27992 int wraparound, int boundscheck, int unsafe_shared) {
27993 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
27994#if CYTHON_ASSUME_SAFE_SIZE
27995 if (PyList_CheckExact(o)) {
27996 return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
27997 } else
27998 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27999 if (PyTuple_CheckExact(o)) {
28000 return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
28001 } else
28002 #endif
28003#else
28004 if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
28005 return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
28006 } else
28007#endif
28008#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
28009 if (PyDict_CheckExact(o)) {
28010 return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
28011 #if defined(PyFrozenDict_CheckExact)
28012 } else if (PyFrozenDict_CheckExact(o)) {
28013 return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
28014 #endif
28015 } else
28016 {
28017 PyTypeObject *obj_type = Py_TYPE(o);
28018 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
28019 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
28020 PyMappingMethods *mm = obj_type->tp_as_mapping;
28021 if (mm && mm->mp_subscript)
28022 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
28023 }
28024 PySequenceMethods *sm = obj_type->tp_as_sequence;
28025 if (likely(sm && sm->sq_item)) {
28026 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
28027 return NULL;
28028 return sm->sq_item(o, i);
28029 }
28030 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
28031 PyMappingMethods *mm = obj_type->tp_as_mapping;
28032 if (likely(mm && mm->mp_subscript))
28033 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
28034 }
28035 }
28036#else
28037 if (!PyMapping_Check(o)) {
28038 return PySequence_GetItem(o, i);
28039 }
28040#endif
28041 (void)wraparound;
28042 (void)boundscheck;
28043 return __Pyx_GetItemInt_Generic_size(o, i);
28044}
28045
28046/* RaiseErrorWithObjectType (used by ObjectGetItem) */
28047static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj) {
28048 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
28049 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
28050 if (unlikely(!type_name)) return;
28051 #endif
28052 PyErr_Format(exc_type, message, type_name);
28053 __Pyx_DECREF_TypeName(type_name);
28054}
28055
28056/* ObjectGetItem */
28057#if CYTHON_USE_TYPE_SLOTS
28058static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
28059 PyObject *runerr = NULL;
28060 Py_ssize_t key_value;
28061 key_value = __Pyx_PyIndex_AsSsize_t(index);
28062 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
28063 return __Pyx_GetItemInt_Fast(obj, key_value, 1, 1, 1);
28064 }
28065 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
28066 PyErr_Clear();
28067 __Pyx_RaiseErrorWithObjectType(
28068 PyExc_IndexError,
28069 "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer",
28070 index);
28071 }
28072 return NULL;
28073}
28074static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
28075 if (likely(PyType_Check(obj))) {
28076 if ((PyTypeObject*)obj == &PyType_Type) {
28077 return Py_GenericAlias(obj, key);
28078 }
28079 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
28080 if (!meth) {
28081 if (PyErr_Occurred()) {
28082 return NULL;
28083 }
28084 } else {
28085 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
28086 Py_DECREF(meth);
28087 return result;
28088 }
28089 }
28090 __Pyx_RaiseTypeErrorWithObjectType(
28091 "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj);
28092 return NULL;
28093}
28094static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
28095 PyTypeObject *tp = Py_TYPE(obj);
28096 PyMappingMethods *mm = tp->tp_as_mapping;
28097 PySequenceMethods *sm = tp->tp_as_sequence;
28098 if (likely(mm && mm->mp_subscript)) {
28099 return mm->mp_subscript(obj, key);
28100 }
28101 if (likely(sm && sm->sq_item)) {
28102 return __Pyx_PyObject_GetIndex(obj, key);
28103 }
28104 return __Pyx_PyObject_GetItem_Slow(obj, key);
28105}
28106#endif
28107
28108/* RejectKeywords */
28109static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
28110 PyObject *key = NULL;
28111 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds))) {
28112 key = __Pyx_PySequence_ITEM(kwds, 0);
28113 } else {
28114#if CYTHON_AVOID_BORROWED_REFS
28115 PyObject *pos = NULL;
28116#else
28117 Py_ssize_t pos = 0;
28118#endif
28119#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
28120 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
28121#endif
28122 __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
28123#if CYTHON_AVOID_BORROWED_REFS
28124 Py_XDECREF(pos);
28125#endif
28126 }
28127 if (likely(key)) {
28128 PyErr_Format(PyExc_TypeError,
28129 "%s() got an unexpected keyword argument '%U'",
28130 function_name, key);
28131 Py_DECREF(key);
28132 }
28133}
28134
28135/* DivInt[Py_ssize_t] */
28136static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
28137 Py_ssize_t q = a / b;
28138 Py_ssize_t r = a - q*b;
28139 Py_ssize_t adapt_python = (b_is_constant ?
28140 ((r != 0) & ((r < 0) ^ (b < 0))) :
28141 ((r != 0) & ((r ^ b) < 0))
28142 );
28143 return q - adapt_python;
28144}
28145
28146/* GetAttr3 */
28147#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
28148static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
28149 __Pyx_PyThreadState_declare
28150 __Pyx_PyThreadState_assign
28151 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28152 return NULL;
28153 __Pyx_PyErr_Clear();
28154 Py_INCREF(d);
28155 return d;
28156}
28157#endif
28158static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
28159 PyObject *r;
28160#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
28161 int res = PyObject_GetOptionalAttr(o, n, &r);
28162 return (res != 0) ? r : __Pyx_NewRef(d);
28163#else
28164 #if CYTHON_USE_TYPE_SLOTS
28165 if (likely(PyUnicode_Check(n))) {
28166 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
28167 if (unlikely(!r) && likely(!PyErr_Occurred())) {
28168 r = __Pyx_NewRef(d);
28169 }
28170 return r;
28171 }
28172 #endif
28173 r = PyObject_GetAttr(o, n);
28174 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
28175#endif
28176}
28177
28178/* PyDictVersioning (used by GetModuleGlobalName) */
28179#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
28180static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
28181 PyObject *dict = Py_TYPE(obj)->tp_dict;
28182 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
28183}
28184static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
28185 PyObject **dictptr = NULL;
28186 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
28187 if (offset) {
28188#if CYTHON_COMPILING_IN_CPYTHON
28189 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
28190#else
28191 dictptr = _PyObject_GetDictPtr(obj);
28192#endif
28193 }
28194 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
28195}
28196static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
28197 PyObject *dict = Py_TYPE(obj)->tp_dict;
28198 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
28199 return 0;
28200 return obj_dict_version == __Pyx_get_object_dict_version(obj);
28201}
28202#endif
28203
28204/* GetModuleGlobalName */
28205#if CYTHON_USE_DICT_VERSIONS
28206static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
28207#else
28208static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
28209#endif
28210{
28211 PyObject *result;
28212#if CYTHON_COMPILING_IN_LIMITED_API
28213 if (unlikely(!__pyx_m)) {
28214 if (!PyErr_Occurred())
28215 PyErr_SetNone(PyExc_NameError);
28216 return NULL;
28217 }
28218 result = PyObject_GetAttr(__pyx_m, name);
28219 if (likely(result)) {
28220 return result;
28221 }
28222 if (!__Pyx_IgnoreException(PyExc_Exception)) {
28223 return NULL; // BaseException
28224 }
28225#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
28226 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
28227 if (!__Pyx_IgnoreException(PyExc_Exception)) {
28228 return NULL; // BaseException
28229 }
28230 }
28231 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
28232 if (likely(result)) {
28233 return result;
28234 }
28235#else
28236 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
28237 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
28238 if (likely(result)) {
28239 return __Pyx_NewRef(result);
28240 }
28241 PyObject *exc = PyErr_Occurred();
28242 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
28243 return NULL; // BaseException
28244 }
28245#endif
28246 return __Pyx_GetBuiltinName(name);
28247}
28248
28249/* RaiseTooManyValuesToUnpack */
28250static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
28251 PyErr_Format(PyExc_ValueError,
28252 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
28253}
28254
28255/* RaiseNeedMoreValuesToUnpack */
28256static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
28257 PyErr_Format(PyExc_ValueError,
28258 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
28259 index, (index == 1) ? "" : "s");
28260}
28261
28262/* RaiseNoneIterError */
28263static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
28264 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
28265}
28266
28267/* GetTopmostException (used by SaveResetException) */
28268#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
28269static _PyErr_StackItem *
28270__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
28271{
28272 _PyErr_StackItem *exc_info = tstate->exc_info;
28273 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
28274 exc_info->previous_item != NULL)
28275 {
28276 exc_info = exc_info->previous_item;
28277 }
28278 return exc_info;
28279}
28280#endif
28281
28282/* SaveResetException */
28283#if CYTHON_FAST_THREAD_STATE
28284static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28285 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
28286 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
28287 PyObject *exc_value = exc_info->exc_value;
28288 if (exc_value == NULL || exc_value == Py_None) {
28289 *value = NULL;
28290 *type = NULL;
28291 *tb = NULL;
28292 } else {
28293 *value = exc_value;
28294 Py_INCREF(*value);
28295 *type = (PyObject*) Py_TYPE(exc_value);
28296 Py_INCREF(*type);
28297 *tb = PyException_GetTraceback(exc_value);
28298 }
28299 #elif CYTHON_USE_EXC_INFO_STACK
28300 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
28301 *type = exc_info->exc_type;
28302 *value = exc_info->exc_value;
28303 *tb = exc_info->exc_traceback;
28304 Py_XINCREF(*type);
28305 Py_XINCREF(*value);
28306 Py_XINCREF(*tb);
28307 #else
28308 *type = tstate->exc_type;
28309 *value = tstate->exc_value;
28310 *tb = tstate->exc_traceback;
28311 Py_XINCREF(*type);
28312 Py_XINCREF(*value);
28313 Py_XINCREF(*tb);
28314 #endif
28315}
28316static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
28317 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
28318 _PyErr_StackItem *exc_info = tstate->exc_info;
28319 PyObject *tmp_value = exc_info->exc_value;
28320 exc_info->exc_value = value;
28321 Py_XDECREF(tmp_value);
28322 Py_XDECREF(type);
28323 Py_XDECREF(tb);
28324 #else
28325 PyObject *tmp_type, *tmp_value, *tmp_tb;
28326 #if CYTHON_USE_EXC_INFO_STACK
28327 _PyErr_StackItem *exc_info = tstate->exc_info;
28328 tmp_type = exc_info->exc_type;
28329 tmp_value = exc_info->exc_value;
28330 tmp_tb = exc_info->exc_traceback;
28331 exc_info->exc_type = type;
28332 exc_info->exc_value = value;
28333 exc_info->exc_traceback = tb;
28334 #else
28335 tmp_type = tstate->exc_type;
28336 tmp_value = tstate->exc_value;
28337 tmp_tb = tstate->exc_traceback;
28338 tstate->exc_type = type;
28339 tstate->exc_value = value;
28340 tstate->exc_traceback = tb;
28341 #endif
28342 Py_XDECREF(tmp_type);
28343 Py_XDECREF(tmp_value);
28344 Py_XDECREF(tmp_tb);
28345 #endif
28346}
28347#endif
28348
28349/* RaiseErrorWithObjectTypes (used by ExtTypeTest) */
28350static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
28351 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
28352 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
28353 if (unlikely(!type_name1)) return;
28354 #endif
28355 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
28356 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
28357 if (unlikely(!type_name2)) goto type2_failed;
28358 #endif
28359 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
28360 __Pyx_DECREF_TypeName(type_name2);
28361#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
28362type2_failed:
28363#endif
28364 __Pyx_DECREF_TypeName(type_name1);
28365}
28366
28367/* ExtTypeTest */
28368static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
28369 if (unlikely(!type)) {
28370 PyErr_SetString(PyExc_SystemError, "Missing type object");
28371 return 0;
28372 }
28373 if (likely(__Pyx_TypeCheck(obj, type)))
28374 return 1;
28375 __Pyx_RaiseTypeErrorWithTypes(
28376 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
28377 Py_TYPE(obj), type);
28378 return 0;
28379}
28380
28381/* GetException */
28382#if CYTHON_FAST_THREAD_STATE
28383static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
28384#else
28385static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
28386#endif
28387{
28388 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
28389#if CYTHON_FAST_THREAD_STATE
28390 PyObject *tmp_type, *tmp_value, *tmp_tb;
28391 #if PY_VERSION_HEX >= 0x030C0000
28392 local_value = tstate->current_exception;
28393 tstate->current_exception = 0;
28394 #else
28395 local_type = tstate->curexc_type;
28396 local_value = tstate->curexc_value;
28397 local_tb = tstate->curexc_traceback;
28398 tstate->curexc_type = 0;
28399 tstate->curexc_value = 0;
28400 tstate->curexc_traceback = 0;
28401 #endif
28402#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
28403 local_value = PyErr_GetRaisedException();
28404#else
28405 PyErr_Fetch(&local_type, &local_value, &local_tb);
28406#endif
28407#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
28408 if (likely(local_value)) {
28409 local_type = (PyObject*) Py_TYPE(local_value);
28410 Py_INCREF(local_type);
28411 local_tb = PyException_GetTraceback(local_value);
28412 }
28413#else
28414 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
28415#if CYTHON_FAST_THREAD_STATE
28416 if (unlikely(tstate->curexc_type))
28417#else
28418 if (unlikely(PyErr_Occurred()))
28419#endif
28420 goto bad;
28421 if (local_tb) {
28422 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
28423 goto bad;
28424 }
28425#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000
28426 Py_XINCREF(local_tb);
28427 Py_XINCREF(local_type);
28428 Py_XINCREF(local_value);
28429 *type = local_type;
28430 *value = local_value;
28431 *tb = local_tb;
28432#if CYTHON_FAST_THREAD_STATE
28433 #if CYTHON_USE_EXC_INFO_STACK
28434 {
28435 _PyErr_StackItem *exc_info = tstate->exc_info;
28436 #if PY_VERSION_HEX >= 0x030B00a4
28437 tmp_value = exc_info->exc_value;
28438 exc_info->exc_value = local_value;
28439 tmp_type = NULL;
28440 tmp_tb = NULL;
28441 Py_XDECREF(local_type);
28442 Py_XDECREF(local_tb);
28443 #else
28444 tmp_type = exc_info->exc_type;
28445 tmp_value = exc_info->exc_value;
28446 tmp_tb = exc_info->exc_traceback;
28447 exc_info->exc_type = local_type;
28448 exc_info->exc_value = local_value;
28449 exc_info->exc_traceback = local_tb;
28450 #endif
28451 }
28452 #else
28453 tmp_type = tstate->exc_type;
28454 tmp_value = tstate->exc_value;
28455 tmp_tb = tstate->exc_traceback;
28456 tstate->exc_type = local_type;
28457 tstate->exc_value = local_value;
28458 tstate->exc_traceback = local_tb;
28459 #endif
28460 Py_XDECREF(tmp_type);
28461 Py_XDECREF(tmp_value);
28462 Py_XDECREF(tmp_tb);
28463#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
28464 PyErr_SetHandledException(local_value);
28465 Py_XDECREF(local_value);
28466 Py_XDECREF(local_type);
28467 Py_XDECREF(local_tb);
28468#else
28469 PyErr_SetExcInfo(local_type, local_value, local_tb);
28470#endif
28471 return 0;
28472#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
28473bad:
28474 *type = 0;
28475 *value = 0;
28476 *tb = 0;
28477 Py_XDECREF(local_type);
28478 Py_XDECREF(local_value);
28479 Py_XDECREF(local_tb);
28480 return -1;
28481#endif
28482}
28483
28484/* SwapException */
28485#if CYTHON_FAST_THREAD_STATE
28486static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28487 PyObject *tmp_type, *tmp_value, *tmp_tb;
28488 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
28489 _PyErr_StackItem *exc_info = tstate->exc_info;
28490 tmp_value = exc_info->exc_value;
28491 exc_info->exc_value = *value;
28492 if (tmp_value == NULL || tmp_value == Py_None) {
28493 Py_XDECREF(tmp_value);
28494 tmp_value = NULL;
28495 tmp_type = NULL;
28496 tmp_tb = NULL;
28497 } else {
28498 tmp_type = (PyObject*) Py_TYPE(tmp_value);
28499 Py_INCREF(tmp_type);
28500 #if CYTHON_COMPILING_IN_CPYTHON
28501 tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
28502 Py_XINCREF(tmp_tb);
28503 #else
28504 tmp_tb = PyException_GetTraceback(tmp_value);
28505 #endif
28506 }
28507 #elif CYTHON_USE_EXC_INFO_STACK
28508 _PyErr_StackItem *exc_info = tstate->exc_info;
28509 tmp_type = exc_info->exc_type;
28510 tmp_value = exc_info->exc_value;
28511 tmp_tb = exc_info->exc_traceback;
28512 exc_info->exc_type = *type;
28513 exc_info->exc_value = *value;
28514 exc_info->exc_traceback = *tb;
28515 #else
28516 tmp_type = tstate->exc_type;
28517 tmp_value = tstate->exc_value;
28518 tmp_tb = tstate->exc_traceback;
28519 tstate->exc_type = *type;
28520 tstate->exc_value = *value;
28521 tstate->exc_traceback = *tb;
28522 #endif
28523 *type = tmp_type;
28524 *value = tmp_value;
28525 *tb = tmp_tb;
28526}
28527#else
28528static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
28529 PyObject *tmp_type, *tmp_value, *tmp_tb;
28530 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
28531 PyErr_SetExcInfo(*type, *value, *tb);
28532 *type = tmp_type;
28533 *value = tmp_value;
28534 *tb = tmp_tb;
28535}
28536#endif
28537
28538/* HasAttr (used by ImportImpl) */
28539#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
28540static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
28541 PyObject *r;
28542 if (unlikely(!PyUnicode_Check(n))) {
28543 PyErr_SetString(PyExc_TypeError,
28544 "hasattr(): attribute name must be string");
28545 return -1;
28546 }
28547 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
28548 if (!r) {
28549 return (unlikely(PyErr_Occurred())) ? -1 : 0;
28550 } else {
28551 Py_DECREF(r);
28552 return 1;
28553 }
28554}
28555#endif
28556
28557/* TupleOrListFromArrayImpl (used by ListFromArray) */
28558CYTHON_UNUSED static PyObject *
28559__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) {
28560 PyObject *res = PyList_New(n);
28561 if (unlikely(res == NULL)) return NULL;
28562 #if CYTHON_COMPILING_IN_CPYTHON
28563 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
28564 #else
28565 Py_ssize_t i;
28566 for (i = 0; i < n; i++) {
28567 Py_INCREF(src[i]);
28568 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
28569 Py_DECREF(res);
28570 return NULL;
28571 }
28572 }
28573 #endif
28574 return res;
28575}
28576
28577/* ImportImpl (used by Import) */
28578static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
28579 PyObject *imported_module = PyImport_GetModule(qualname);
28580 if (unlikely(!imported_module)) {
28581 *module = NULL;
28582 if (PyErr_Occurred()) {
28583 return -1;
28584 }
28585 return 0;
28586 }
28587 *module = imported_module;
28588 return 1;
28589}
28590static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
28591 PyObject *imported_module;
28592 PyObject *top_level_package_name;
28593 Py_ssize_t i;
28594 int status, module_found;
28595 Py_ssize_t dot_index;
28596 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
28597 if (unlikely(!module_found || module_found == -1)) {
28598 *module = NULL;
28599 return module_found;
28600 }
28601 if (imported_names) {
28602 for (i = 0; i < len_imported_names; i++) {
28603 PyObject *imported_name = imported_names[i];
28604#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
28605 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
28606#else
28607 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
28608 if (unlikely(has_imported_attribute == -1)) goto error;
28609#endif
28610 if (!has_imported_attribute) {
28611 goto not_found;
28612 }
28613 }
28614 *module = imported_module;
28615 return 1;
28616 }
28617 dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
28618 if (dot_index == -1) {
28619 *module = imported_module;
28620 return 1;
28621 }
28622 if (unlikely(dot_index == -2)) goto error;
28623 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
28624 if (unlikely(!top_level_package_name)) goto error;
28625 Py_DECREF(imported_module);
28626 status = __Pyx__Import_GetModule(top_level_package_name, module);
28627 Py_DECREF(top_level_package_name);
28628 return status;
28629error:
28630 Py_DECREF(imported_module);
28631 *module = NULL;
28632 return -1;
28633not_found:
28634 Py_DECREF(imported_module);
28635 *module = NULL;
28636 return 0;
28637}
28638static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
28639 PyObject *module = 0;
28640 PyObject *empty_dict = 0;
28641 PyObject *from_list = 0;
28642 int module_found;
28643 if (!qualname) {
28644 qualname = name;
28645 }
28646 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
28647 if (likely(module_found == 1)) {
28648 return module;
28649 } else if (unlikely(module_found == -1)) {
28650 return NULL;
28651 }
28652 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
28653 empty_dict = PyFrozenDict_New(NULL);
28654 #else
28655 empty_dict = PyDict_New();
28656 #endif
28657 if (unlikely(!empty_dict))
28658 goto bad;
28659 if (imported_names) {
28660 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
28661 if (unlikely(!from_list))
28662 goto bad;
28663 }
28664 if (level == -1) {
28665 const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
28666 if (package_sep != (0)) {
28667 module = PyImport_ImportModuleLevelObject(
28668 name, moddict, empty_dict, from_list, 1);
28669 if (unlikely(!module)) {
28670 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
28671 goto bad;
28672 PyErr_Clear();
28673 }
28674 }
28675 level = 0;
28676 }
28677 if (!module) {
28678 module = PyImport_ImportModuleLevelObject(
28679 name, moddict, empty_dict, from_list, level);
28680 }
28681bad:
28682 Py_XDECREF(from_list);
28683 Py_XDECREF(empty_dict);
28684 return module;
28685}
28686
28687/* Import */
28688static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
28689 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
28690}
28691
28692/* ListAppendAndDecrefInternal (used by ListCompAppendAndDecref) */
28693#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
28694static CYTHON_INLINE void __Pyx__ListComp_AppendAndDecref(PyObject* list, Py_ssize_t len, PyObject* x) {
28695 PyList_SET_ITEM(list, len, x);
28696 Py_SET_SIZE(list, len + 1);
28697}
28698#endif
28699
28700/* ListCompAppendAndDecref */
28701#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
28702static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
28703 PyListObject* L = (PyListObject*) list;
28704 Py_ssize_t len = Py_SIZE(list);
28705 if (likely(L->allocated > len)) {
28706 __Pyx__ListComp_AppendAndDecref(list, len, x);
28707 return 0;
28708 }
28709 int result = PyList_Append(list, x);
28710 Py_DECREF(x);
28711 return result;
28712}
28713#else
28714static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
28715 int result = PyList_Append(list, x);
28716 Py_DECREF(x);
28717 return result;
28718}
28719#endif
28720
28721/* PySequenceMultiply */
28722#if CYTHON_USE_TYPE_SLOTS
28723static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
28724 PyObject *result, *pymul = PyLong_FromSsize_t(mul);
28725 if (unlikely(!pymul))
28726 return NULL;
28727 result = PyNumber_Multiply(seq, pymul);
28728 Py_DECREF(pymul);
28729 return result;
28730}
28731static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
28732 PyTypeObject *type = Py_TYPE(seq);
28733 if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
28734 return type->tp_as_sequence->sq_repeat(seq, mul);
28735 } else {
28736 return __Pyx_PySequence_Multiply_Generic(seq, mul);
28737 }
28738}
28739#endif
28740
28741/* PyNumberBinop */
28742#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
28743#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
28744#ifndef __Pyx_DEFINED_BinopTypeError
28745#define __Pyx_DEFINED_BinopTypeError
28746static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
28747 char opname[4] = {op[0], op[1], 0, 0};
28748 if (inplace) {
28749 opname[op[1] ? 2 : 1] = '=';
28750 }
28751 __Pyx_RaiseErrorWithObjectTypes1(
28752 PyExc_TypeError,
28753 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
28754 opname, op1, op2);
28755}
28756#endif
28757#endif
28758#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
28759#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
28760static PyObject* __Pyx_PyNumber_Multiply_xfloat_int(PyObject *op1, PyObject *op2, int inplace) {
28761 if (likely(op2 != Py_None)) {
28762 double int_op2;
28763 #if CYTHON_USE_PYLONG_INTERNALS
28764 if (__Pyx_PyLong_IsCompact(op2)) {
28765 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
28766 int_op2 = (double) compact_op2;
28767 } else
28768 #endif
28769 {
28770 int_op2 = PyLong_AsDouble(op2);
28771 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
28772 }
28773 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
28774 #if !CYTHON_ASSUME_SAFE_MACROS
28775 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
28776 #endif
28777 if (float_op1 == 0.) return __Pyx_NewRef(op1);
28778 return PyFloat_FromDouble(float_op1 * int_op2);
28779 }
28780 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
28781 {
28782 PyTypeObject *type_op2 = Py_TYPE(op2);
28783 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
28784 if (likely(slot_func)) {
28785 PyObject *result = slot_func(op1, op2);
28786 if (likely(result != Py_NotImplemented)) {
28787 return result;
28788 }
28789 Py_DECREF(result);
28790 }
28791 __Pyx_BinopTypeError(op1, op2, "*", inplace);
28792 return NULL;
28793 }
28794 #else
28795 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
28796 #endif
28797}
28798#endif
28799#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_int
28800#define __Pyx_DEFINED_PyNumber_Multiply_xint_int
28801static PyObject* __Pyx_PyNumber_Multiply_xint_int(PyObject *op1, PyObject *op2, int inplace) {
28802 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
28803 {
28804 PyTypeObject *type_op2 = Py_TYPE(op2);
28805 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
28806 if (likely(slot_func)) {
28807 PyObject *result = slot_func(op1, op2);
28808 if (likely(result != Py_NotImplemented)) {
28809 return result;
28810 }
28811 Py_DECREF(result);
28812 }
28813 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
28814 if (likely(repeat_func)) {
28815 Py_ssize_t count;
28816 #if CYTHON_USE_PYLONG_INTERNALS
28817 if (__Pyx_PyLong_IsCompact(op1)) {
28818 count = __Pyx_PyLong_CompactValue(op1);
28819 } else
28820 #endif
28821 {
28822 count = PyLong_AsSsize_t(op1);
28823 if (unlikely((count == -1) && PyErr_Occurred())) return NULL;
28824 }
28825 return repeat_func(op2, count);
28826 }
28827 __Pyx_BinopTypeError(op1, op2, "*", inplace);
28828 return NULL;
28829 }
28830 #else
28831 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
28832 #endif
28833}
28834#endif
28835static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2, int inplace) {
28836 if (PyFloat_CheckExact(op1)) {
28837 return __Pyx_PyNumber_Multiply_xfloat_int(op1, op2, inplace);
28838 }
28839 if (likely(PyLong_CheckExact(op1))) {
28840 if (likely(op2 != Py_None)) {
28841 #if CYTHON_USE_PYLONG_INTERNALS
28842 if (__Pyx_PyLong_IsCompact(op1)) {
28843 long long int_op1 = (long long) __Pyx_PyLong_CompactValue(op1);
28844 if (int_op1 == 0) return __Pyx_NewRef(op1);
28845 if (__Pyx_PyLong_IsCompact(op2)) {
28846 long long int_op2 = (long long) __Pyx_PyLong_CompactValue(op2);
28847 if (int_op2 == 0) return __Pyx_NewRef(op2);
28848 return PyLong_FromLongLong(int_op1 * int_op2);
28849 }
28850 }
28851 else if (__Pyx_PyLong_IsZero(op2)) return __Pyx_NewRef(op2);
28852 #endif
28853 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_multiply, binaryfunc);
28854 if (likely(slot_func)) {
28855 return slot_func(op1, op2);
28856 }
28857 }
28858 return __Pyx_PyNumber_Multiply_xint_int(op1, op2, inplace);
28859 }
28860 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
28861}
28862#endif
28863
28864/* PyObjectFormatAndDecref */
28865static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
28866 if (unlikely(!s)) return NULL;
28867 if (likely(PyUnicode_CheckExact(s))) return s;
28868 return __Pyx_PyObject_FormatAndDecref(s, f);
28869}
28870static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
28871 PyObject *result;
28872 if (unlikely(!s)) return NULL;
28873 result = PyObject_Format(s, f);
28874 Py_DECREF(s);
28875 return result;
28876}
28877
28878/* PyObjectFormat */
28879#if CYTHON_USE_UNICODE_WRITER
28880static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
28881 int ret;
28882 _PyUnicodeWriter writer;
28883 if (likely(PyFloat_CheckExact(obj))) {
28884 _PyUnicodeWriter_Init(&writer);
28885 ret = _PyFloat_FormatAdvancedWriter(
28886 &writer,
28887 obj,
28888 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
28889 } else if (likely(PyLong_CheckExact(obj))) {
28890 _PyUnicodeWriter_Init(&writer);
28891 ret = _PyLong_FormatAdvancedWriter(
28892 &writer,
28893 obj,
28894 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
28895 } else {
28896 return PyObject_Format(obj, format_spec);
28897 }
28898 if (unlikely(ret == -1)) {
28899 _PyUnicodeWriter_Dealloc(&writer);
28900 return NULL;
28901 }
28902 return _PyUnicodeWriter_Finish(&writer);
28903}
28904#endif
28905
28906/* SetItemInt */
28907static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
28908 int r;
28909 if (unlikely(!j)) return -1;
28910 r = PyObject_SetItem(o, j, v);
28911 Py_DECREF(j);
28912 return r;
28913}
28914#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
28915static CYTHON_INLINE int __Pyx_SetItemInt_Fast_mapping(PyObject *o, objobjargproc setitem, Py_ssize_t i, PyObject *value) {
28916 PyObject *key = PyLong_FromSsize_t(i);
28917 if (unlikely(!key)) return -1;
28918 int r = setitem(o, key, value);
28919 Py_DECREF(key);
28920 return r;
28921}
28922#endif
28923static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
28924 int wraparound, int boundscheck, int unsafe_shared) {
28925 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
28926#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
28927 if (PyList_CheckExact(o)) {
28928 Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
28929 if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
28930 Py_INCREF(v);
28931 return PyList_SetItem(o, n, v);
28932 } else if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
28933 PyObject* old;
28934 Py_INCREF(v);
28935 old = PyList_GET_ITEM(o, n);
28936 PyList_SET_ITEM(o, n, v);
28937 Py_DECREF(old);
28938 return 0;
28939 }
28940 } else
28941#endif
28942#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
28943 if (PyDict_CheckExact(o)) {
28944 return __Pyx_SetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_ass_subscript, i, v);
28945 } else
28946 {
28947 PyTypeObject *obj_type = Py_TYPE(o);
28948 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
28949 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
28950 PyMappingMethods *mm = obj_type->tp_as_mapping;
28951 if (mm && mm->mp_ass_subscript)
28952 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i, v);
28953 }
28954 PySequenceMethods *sm = obj_type->tp_as_sequence;
28955 if (likely(sm && sm->sq_ass_item)) {
28956 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
28957 return -1;
28958 return sm->sq_ass_item(o, i, v);
28959 }
28960 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
28961 PyMappingMethods *mm = obj_type->tp_as_mapping;
28962 if (likely(mm && mm->mp_ass_subscript))
28963 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i, v);
28964 }
28965 }
28966#else
28967 if (!PyMapping_Check(o)) {
28968 return PySequence_SetItem(o, i, v);
28969 }
28970#endif
28971 (void)wraparound;
28972 (void)boundscheck;
28973 return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i), v);
28974}
28975
28976/* RaiseUnboundLocalError */
28977static void __Pyx_RaiseUnboundLocalError(const char *varname) {
28978 PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
28979}
28980
28981/* DivInt[long] */
28982static CYTHON_INLINE long __Pyx_div_long(long a, long b, int b_is_constant) {
28983 long q = a / b;
28984 long r = a - q*b;
28985 long adapt_python = (b_is_constant ?
28986 ((r != 0) & ((r < 0) ^ (b < 0))) :
28987 ((r != 0) & ((r ^ b) < 0))
28988 );
28989 return q - adapt_python;
28990}
28991
28992/* ListAppend */
28993#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
28994static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
28995 PyListObject* L = (PyListObject*) list;
28996 Py_ssize_t len = Py_SIZE(list);
28997 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
28998 Py_INCREF(x);
28999 __Pyx__ListComp_AppendAndDecref(list, len, x);
29000 return 0;
29001 }
29002 return PyList_Append(list, x);
29003}
29004#endif
29005
29006/* PyObjectCallMethod1 (used by StringJoin) */
29007static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
29008#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
29009 PyObject *args[2] = {obj, arg};
29010 return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
29011#elif CYTHON_COMPILING_IN_LIMITED_API
29012 return PyObject_CallMethodObjArgs(obj, method_name, arg, NULL);
29013#else
29014 return PyObject_CallMethodOneArg(obj, method_name, arg);
29015#endif
29016}
29017
29018/* StringJoin */
29019static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
29020 (void) __Pyx_PyObject_CallMethod1;
29021#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030e0000 || defined(PyBytes_Join)
29022 return PyBytes_Join(sep, values);
29023#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyBytes_Join)
29024 return _PyBytes_Join(sep, values);
29025#else
29026 return __Pyx_PyObject_CallMethod1(sep, __pyx_mstate_global->__pyx_n_u_join, values);
29027#endif
29028}
29029
29030/* CIntToPyUnicode */
29031static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char) {
29032#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29033#pragma GCC diagnostic push
29034#pragma GCC diagnostic ignored "-Wconversion"
29035#endif
29036 const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
29037#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29038#pragma GCC diagnostic pop
29039#endif
29040 const int is_unsigned = neg_one > const_zero;
29041 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
29042 !(sizeof(value) <= 2 || value & ~ (size_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
29043 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
29044 return NULL;
29045 }
29046 if (width <= 1) {
29047 return PyUnicode_FromOrdinal((int) value);
29048 }
29049 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
29050}
29051static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char) {
29052 char digits[sizeof(size_t)*3+2];
29053 char *dpos, *end = digits + sizeof(size_t)*3+2;
29054 const char *hex_digits = DIGITS_HEX;
29055 Py_ssize_t length, ulength;
29056 int prepend_sign, last_one_off;
29057 size_t remaining;
29058#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29059#pragma GCC diagnostic push
29060#pragma GCC diagnostic ignored "-Wconversion"
29061#endif
29062 const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
29063#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29064#pragma GCC diagnostic pop
29065#endif
29066 const int is_unsigned = neg_one > const_zero;
29067 if (format_char == 'X') {
29068 hex_digits += 16;
29069 format_char = 'x';
29070 }
29071 remaining = value;
29072 last_one_off = 0;
29073 dpos = end;
29074 do {
29075 int digit_pos;
29076 switch (format_char) {
29077 case 'o':
29078 digit_pos = abs((int)(remaining % (8*8)));
29079 remaining = (size_t) (remaining / (8*8));
29080 dpos -= 2;
29081 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
29082 last_one_off = (digit_pos < 8);
29083 break;
29084 case 'd':
29085 digit_pos = abs((int)(remaining % (10*10)));
29086 remaining = (size_t) (remaining / (10*10));
29087 dpos -= 2;
29088 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
29089 last_one_off = (digit_pos < 10);
29090 break;
29091 case 'x':
29092 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
29093 remaining = (size_t) (remaining / 16);
29094 break;
29095 default:
29096 assert(0);
29097 break;
29098 }
29099 } while (unlikely(remaining != 0));
29100 assert(!last_one_off || *dpos == '0');
29101 dpos += last_one_off;
29102 length = end - dpos;
29103 ulength = length;
29104 prepend_sign = 0;
29105 if (!is_unsigned && value <= neg_one) {
29106 if (padding_char == ' ' || width <= length + 1) {
29107 *(--dpos) = '-';
29108 ++length;
29109 } else {
29110 prepend_sign = 1;
29111 }
29112 ++ulength;
29113 }
29114 if (width > ulength) {
29115 ulength = width;
29116 }
29117 if (ulength == 1) {
29118 return PyUnicode_FromOrdinal(*dpos);
29119 }
29120 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
29121}
29122
29123/* AllocateExtensionType */
29124static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
29125 if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
29126 allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
29127 return alloc_func(t, 0);
29128 } else {
29129 newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
29130 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
29131 if (!tp_new) {
29132 PyObject *new_str = PyUnicode_FromString("__new__");
29133 if (likely(new_str)) {
29134 PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
29135 Py_DECREF(new_str);
29136 return o;
29137 } else
29138 return NULL;
29139 } else
29140 #endif
29141 return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
29142 }
29143}
29144
29145/* CallSlotAsVectorcallUnpackDict (used by CallSlotAsVectorcall) */
29146static CYTHON_INLINE int __Pyx_CallSlotAsVectorcallUnpackDict(Py_ssize_t args_size, PyObject *keys_dict, PyObject **args, PyObject *kwnames) {
29147 Py_ssize_t pos = 0, i = 0;
29148 PyObject *key, *value;
29149 while (PyDict_Next(keys_dict, &pos, &key, &value)) {
29150 Py_INCREF(value);
29151 args[args_size+i] = value;
29152 Py_INCREF(key);
29153 if (unlikely(__Pyx_PyTuple_SET_ITEM(kwnames, i, key) == -1)) {
29154 return -1;
29155 }
29156 ++i;
29157 }
29158 return 0;
29159}
29160
29161/* CallSlotAsVectorcall */
29162#if CYTHON_VECTORCALL_TPNEW
29163static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k) {
29164 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
29165#if !CYTHON_ASSUME_SAFE_SIZE
29166 if (unlikely(k_size < 0)) return NULL;
29167#endif
29168 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
29169#if !CYTHON_ASSUME_SAFE_SIZE
29170 if (unlikely(a_size < 0)) return NULL;
29171#endif
29172#if CYTHON_ASSUME_SAFE_MACROS
29173 if (k_size == 0) {
29174 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
29175 }
29176#else
29177 if (k_size == 0 && a_size == 0) {
29178 return f(o, NULL, 0, NULL);
29179 }
29180#endif
29181 PyObject *stack_args[5];
29182 PyObject **args = stack_args;
29183 Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
29184 if (a_size > maxnargs - k_size) {
29185 PyErr_NoMemory();
29186 return NULL;
29187 }
29188 Py_ssize_t total_size = a_size + k_size;
29189 if (total_size > 5) {
29190 args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
29191 if (unlikely(!args)) {
29192 PyErr_NoMemory();
29193 return NULL;
29194 }
29195 }
29196 PyObject * result = NULL;
29197 PyObject *kwnames = NULL;
29198 int unpack_dict_result;
29199 Py_ssize_t i = 0;
29200 for (; i < a_size; ++i) {
29201 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
29202#if !CYTHON_ASSUME_SAFE_MACROS
29203 if (unlikely(!args[i])) goto cleanup;
29204#endif
29205 }
29206#if !CYTHON_ASSUME_SAFE_MACROS
29207 if (k) // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
29208#endif
29209 {
29210 kwnames = PyTuple_New(k_size);
29211 if (unlikely(!kwnames)) goto cleanup;
29212 __Pyx_BEGIN_CRITICAL_SECTION(k);
29213 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
29214 __Pyx_END_CRITICAL_SECTION();
29215 if (unlikely(unpack_dict_result == -1)) goto cleanup;
29216 }
29217 result = f(o, args, a_size, kwnames);
29218 cleanup:
29219 Py_XDECREF(kwnames);
29220 for (i=a_size; i<total_size; ++i) {
29221 Py_XDECREF(args[i]);
29222 }
29223 if (args != stack_args) {
29224 PyMem_Free(args);
29225 }
29226 return result;
29227}
29228#endif
29229
29230/* CallNewInitFromVectorcall */
29231#if CYTHON_VECTORCALL_TPNEW
29232static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
29233 newfunc tp_new = __Pyx_PyType_GetSlot(t, tp_new, newfunc);
29234 if (unlikely(!tp_new)) {
29235 __Pyx_RaiseErrorWithType(PyExc_TypeError, "cannot create " __Pyx_FMT_TYPENAME " instances", t);
29236 return NULL;
29237 }
29238 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
29239 PyObject *result = NULL, *args_tuple = NULL, *kwds_dict = NULL;
29240 Py_ssize_t kw_size = kwnames ? __Pyx_PyTuple_GET_SIZE(kwnames) : 0;
29241#if !CYTHON_ASSUME_SAFE_SIZE
29242 if (unlikely(kw_size == -1)) {
29243 return NULL;
29244 }
29245#endif
29246 if (kw_size) {
29247 kwds_dict = __Pyx_PyDict_NewPresized(kw_size);
29248 if (unlikely(!kwds_dict)) {
29249 return NULL;
29250 }
29251 for (Py_ssize_t i=0; i<kw_size; ++i) {
29252 PyObject *v = args[nargs + i];
29253 PyObject *k = __Pyx_PyTuple_GET_ITEM(kwnames, i);
29254#if !CYTHON_ASSUME_SAFE_MACROS
29255 if (unlikely(!k)) {
29256 goto end;
29257 }
29258#endif
29259 if (unlikely(PyDict_SetItem(kwds_dict, k, v) < 0)) {
29260 goto end;
29261 }
29262 }
29263 }
29264 if (nargs) {
29265 args_tuple = __Pyx_PyTuple_FromArray(args, nargs);
29266 if (unlikely(!args_tuple)) {
29267 goto end;
29268 }
29269 } else {
29270 args_tuple = __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
29271 }
29272 result = tp_new(t, args_tuple, kwds_dict);
29273 if (unlikely(!result)) {
29274 goto end;
29275 }
29276 if (PyObject_TypeCheck(result, t)) {
29277 initproc tp_init = __Pyx_PyObject_GetSlot(result, tp_init, initproc);
29278 if (tp_init && unlikely(tp_init(result, args_tuple, kwds_dict) < 0)) {
29279 Py_CLEAR(result);
29280 }
29281 }
29282 end:
29283 Py_XDECREF(args_tuple);
29284 Py_XDECREF(kwds_dict);
29285 return result;
29286}
29287#endif
29288
29289/* CallSlotAsVectorcall */
29290#if CYTHON_VECTORCALL_TPNEW
29291static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k) {
29292 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
29293#if !CYTHON_ASSUME_SAFE_SIZE
29294 if (unlikely(k_size < 0)) return -1;
29295#endif
29296 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
29297#if !CYTHON_ASSUME_SAFE_SIZE
29298 if (unlikely(a_size < 0)) return -1;
29299#endif
29300#if CYTHON_ASSUME_SAFE_MACROS
29301 if (k_size == 0) {
29302 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
29303 }
29304#else
29305 if (k_size == 0 && a_size == 0) {
29306 return f(o, NULL, 0, NULL);
29307 }
29308#endif
29309 PyObject *stack_args[5];
29310 PyObject **args = stack_args;
29311 Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
29312 if (a_size > maxnargs - k_size) {
29313 PyErr_NoMemory();
29314 return -1;
29315 }
29316 Py_ssize_t total_size = a_size + k_size;
29317 if (total_size > 5) {
29318 args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
29319 if (unlikely(!args)) {
29320 PyErr_NoMemory();
29321 return -1;
29322 }
29323 }
29324 int result = -1;
29325 PyObject *kwnames = NULL;
29326 int unpack_dict_result;
29327 Py_ssize_t i = 0;
29328 for (; i < a_size; ++i) {
29329 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
29330#if !CYTHON_ASSUME_SAFE_MACROS
29331 if (unlikely(!args[i])) goto cleanup;
29332#endif
29333 }
29334#if !CYTHON_ASSUME_SAFE_MACROS
29335 if (k) // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
29336#endif
29337 {
29338 kwnames = PyTuple_New(k_size);
29339 if (unlikely(!kwnames)) goto cleanup;
29340 __Pyx_BEGIN_CRITICAL_SECTION(k);
29341 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
29342 __Pyx_END_CRITICAL_SECTION();
29343 if (unlikely(unpack_dict_result == -1)) goto cleanup;
29344 }
29345 result = f(o, args, a_size, kwnames);
29346 cleanup:
29347 Py_XDECREF(kwnames);
29348 for (i=a_size; i<total_size; ++i) {
29349 Py_XDECREF(args[i]);
29350 }
29351 if (args != stack_args) {
29352 PyMem_Free(args);
29353 }
29354 return result;
29355}
29356#endif
29357
29358/* CallTypeTraverse */
29359#if !CYTHON_USE_TYPE_SPECS
29360#else
29361static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
29362 if (!always_call) {
29363 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
29364 unsigned long flags = PyType_GetFlags(base);
29365 if (flags & Py_TPFLAGS_HEAPTYPE) {
29366 return 0;
29367 }
29368 }
29369 Py_VISIT((PyObject*)Py_TYPE(o));
29370 return 0;
29371}
29372#endif
29373
29374/* PyObjectCallMethod0 (used by PyType_Ready) */
29375static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
29376#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
29377 return PyObject_VectorcallMethod(method_name, &obj, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
29378#elif CYTHON_COMPILING_IN_LIMITED_API
29379 return PyObject_CallMethodObjArgs(obj, method_name, NULL);
29380#else
29381 return PyObject_CallMethodNoArgs(obj, method_name);
29382#endif
29383}
29384
29385/* GetTypeDictOffset (used by ValidateBasesTuple) */
29386#if !CYTHON_USE_TYPE_SLOTS
29387CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result) {
29388 PyObject *tp_dictoffset_o;
29389 Py_ssize_t tp_dictoffset;
29390 tp_dictoffset_o = PyObject_GetAttrString(tp, "__dictoffset__");
29391 if (unlikely(!tp_dictoffset_o)) return -1;
29392 tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
29393 Py_DECREF(tp_dictoffset_o);
29394 if (unlikely(require_cython_valid_result && tp_dictoffset == 0)) {
29395 PyErr_SetString(
29396 PyExc_TypeError,
29397 "'type' doesn't have a dictoffset");
29398 return -1;
29399 } else if (unlikely(require_cython_valid_result && tp_dictoffset < 0)) {
29400 PyErr_SetString(
29401 PyExc_TypeError,
29402 "'type' has an unexpected negative dictoffset. "
29403 "Please report this as Cython bug");
29404 return -1;
29405 }
29406 return tp_dictoffset;
29407}
29408#endif
29409
29410/* ValidateBasesTuple (used by PyType_Ready) */
29411#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
29412static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases) {
29413 Py_ssize_t i, n;
29414#if CYTHON_ASSUME_SAFE_SIZE
29415 n = PyTuple_GET_SIZE(bases);
29416#else
29417 n = PyTuple_Size(bases);
29418 if (unlikely(n < 0)) return -1;
29419#endif
29420 if (!has_dictoffset) {
29421 PyObject *b;
29422#if CYTHON_AVOID_BORROWED_REFS
29423 b = PySequence_GetItem(bases, 0);
29424 if (!b) return -1;
29425#elif CYTHON_ASSUME_SAFE_MACROS
29426 b = PyTuple_GET_ITEM(bases, 0);
29427#else
29428 b = PyTuple_GetItem(bases, 0);
29429 if (!b) return -1;
29430#endif
29431#if CYTHON_USE_TYPE_SLOTS
29432 has_dictoffset = ((PyTypeObject*)b)->tp_dictoffset != 0;
29433#else
29434 Py_ssize_t dictoffset = __Pyx_GetTypeDictOffset(b, 0);
29435 has_dictoffset = dictoffset != 0;
29436#endif
29437#if CYTHON_AVOID_BORROWED_REFS
29438 Py_DECREF(b);
29439#endif
29440#if !CYTHON_USE_TYPE_SLOTS
29441 if (dictoffset == -1 && PyErr_Occurred()) return -1;
29442#endif
29443 }
29444 for (i = 1; i < n; i++)
29445 {
29446 PyTypeObject *b;
29447#if CYTHON_AVOID_BORROWED_REFS
29448 PyObject *b0 = PySequence_GetItem(bases, i);
29449 if (!b0) return -1;
29450#elif CYTHON_ASSUME_SAFE_MACROS
29451 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
29452#else
29453 PyObject *b0 = PyTuple_GetItem(bases, i);
29454 if (!b0) return -1;
29455#endif
29456 b = (PyTypeObject*) b0;
29457 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
29458 {
29459 __Pyx_RaiseErrorWithType(
29460 PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b);
29461#if CYTHON_AVOID_BORROWED_REFS
29462 Py_DECREF(b0);
29463#endif
29464 return -1;
29465 }
29466 if (!has_dictoffset)
29467 {
29468 Py_ssize_t b_dictoffset = 0;
29469#if CYTHON_USE_TYPE_SLOTS
29470 b_dictoffset = b->tp_dictoffset;
29471#else
29472 b_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)b, 0);
29473 if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
29474#endif
29475 if (b_dictoffset) {
29476 __Pyx_RaiseErrorWithType1(
29477 PyExc_TypeError,
29478 "extension type '%.200s' has no __dict__ slot, "
29479 "but base type '" __Pyx_FMT_TYPENAME "' has: "
29480 "either add 'cdef dict __dict__' to the extension type "
29481 "or add '__slots__ = [...]' to the base type",
29482 type_name, b);
29483#if !CYTHON_USE_TYPE_SLOTS
29484 dictoffset_return:
29485#endif
29486#if CYTHON_AVOID_BORROWED_REFS
29487 Py_DECREF(b0);
29488#endif
29489 return -1;
29490 }
29491 }
29492#if CYTHON_AVOID_BORROWED_REFS
29493 Py_DECREF(b0);
29494#endif
29495 }
29496 return 0;
29497}
29498#endif
29499
29500/* PyType_Ready */
29501CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
29502 while (t) {
29503 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
29504 if (bases) {
29505 return 1;
29506 }
29507 t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
29508 }
29509 return 0;
29510}
29511static int __Pyx_PyType_Ready(PyTypeObject *t) {
29512#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON
29513 (void)__Pyx_PyObject_CallMethod0;
29514#if CYTHON_USE_TYPE_SPECS
29515 (void)__Pyx_validate_bases_tuple;
29516#endif
29517 return PyType_Ready(t);
29518#else
29519 int r;
29520 if (!__Pyx_PyType_HasMultipleInheritance(t)) {
29521 return PyType_Ready(t);
29522 }
29523 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
29524 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset != 0, bases) == -1))
29525 return -1;
29526 {
29527 int gc_was_enabled;
29528 #if PY_VERSION_HEX >= 0x030A00b1
29529 gc_was_enabled = PyGC_Disable();
29530 (void)__Pyx_PyObject_CallMethod0;
29531 #else
29532 PyObject *ret, *py_status;
29533 PyObject *gc = NULL;
29534 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
29535 !CYTHON_COMPILING_IN_GRAAL
29536 gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
29537 #endif
29538 if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
29539 if (unlikely(!gc)) return -1;
29540 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
29541 if (unlikely(!py_status)) {
29542 Py_DECREF(gc);
29543 return -1;
29544 }
29545 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
29546 Py_DECREF(py_status);
29547 if (gc_was_enabled > 0) {
29548 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
29549 if (unlikely(!ret)) {
29550 Py_DECREF(gc);
29551 return -1;
29552 }
29553 Py_DECREF(ret);
29554 } else if (unlikely(gc_was_enabled == -1)) {
29555 Py_DECREF(gc);
29556 return -1;
29557 }
29558 #endif
29559 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
29560#if PY_VERSION_HEX >= 0x030A0000
29561 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
29562#endif
29563 r = PyType_Ready(t);
29564 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
29565 #if PY_VERSION_HEX >= 0x030A00b1
29566 if (gc_was_enabled)
29567 PyGC_Enable();
29568 #else
29569 if (gc_was_enabled) {
29570 PyObject *tp, *v, *tb;
29571 PyErr_Fetch(&tp, &v, &tb);
29572 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
29573 if (likely(ret || r == -1)) {
29574 Py_XDECREF(ret);
29575 PyErr_Restore(tp, v, tb);
29576 } else {
29577 Py_XDECREF(tp);
29578 Py_XDECREF(v);
29579 Py_XDECREF(tb);
29580 r = -1;
29581 }
29582 }
29583 Py_DECREF(gc);
29584 #endif
29585 }
29586 return r;
29587#endif
29588}
29589
29590/* LimitedApiGetTypeTypeDict (used by DelItemOnTypeDict) */
29591#if CYTHON_COMPILING_IN_LIMITED_API
29592static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp) {
29593 static Py_ssize_t tp_dictoffset = 0;
29594 if (unlikely(tp_dictoffset == 0)) {
29595 tp_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)(&PyType_Type), 1);
29596 if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
29597 tp_dictoffset = 0; // try again next time?
29598 return NULL;
29599 }
29600 }
29601 return *(PyObject**)((char*)tp + tp_dictoffset);
29602}
29603#endif
29604
29605/* DelItemOnTypeDict (used by SetupReduce) */
29606static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
29607 int result;
29608 PyObject *tp_dict;
29609#if CYTHON_COMPILING_IN_LIMITED_API
29610 tp_dict = __Pyx_GetTypeTypeDict(tp);
29611 if (unlikely(!tp_dict)) return -1;
29612#else
29613 tp_dict = tp->tp_dict;
29614#endif
29615 result = PyDict_DelItem(tp_dict, k);
29616 if (likely(!result)) PyType_Modified(tp);
29617 return result;
29618}
29619
29620/* SetItemOnTypeDict (used by SetupReduce) */
29621static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
29622 int result;
29623 PyObject *tp_dict;
29624#if CYTHON_COMPILING_IN_LIMITED_API
29625 tp_dict = __Pyx_GetTypeTypeDict(tp);
29626 if (unlikely(!tp_dict)) return -1;
29627#else
29628 tp_dict = tp->tp_dict;
29629#endif
29630 result = PyDict_SetItem(tp_dict, k, v);
29631 if (likely(!result)) {
29632 PyType_Modified(tp);
29633 if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
29634 PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL);
29635 if (!setNameResult) return -1;
29636 Py_DECREF(setNameResult);
29637 }
29638 }
29639 return result;
29640}
29641
29642/* SetupReduce */
29643static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
29644 int ret;
29645 PyObject *name_attr;
29646 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_2);
29647 if (likely(name_attr)) {
29648 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
29649 } else {
29650 ret = -1;
29651 }
29652 if (unlikely(ret < 0) && __Pyx_IgnoreException(PyExc_Exception)) {
29653 ret = 0; // But BaseException is still propagated.
29654 }
29655 Py_XDECREF(name_attr);
29656 return ret;
29657}
29658static PyObject *__Pyx_setup_reduce_get_reduce_attribute(PyObject *type_obj, PyObject *name, int allow_not_present) {
29659#if CYTHON_USE_PYTYPE_LOOKUP
29660 CYTHON_UNUSED_VAR(allow_not_present);
29661 return _PyType_Lookup((PyTypeObject*)type_obj, name);
29662#else
29663 if (allow_not_present) {
29664 return __Pyx_PyObject_GetAttrStrNoError(type_obj, name);
29665 } else {
29666 return __Pyx_PyObject_GetAttrStr(type_obj, name);
29667 }
29668#endif
29669}
29670static int __Pyx_setup_reduce(PyObject* type_obj) {
29671 int ret = 0;
29672 PyObject *object_reduce = NULL;
29673 PyObject *object_getstate = NULL;
29674 PyObject *object_reduce_ex = NULL;
29675 PyObject *reduce = NULL;
29676 PyObject *reduce_ex = NULL;
29677 PyObject *reduce_cython = NULL;
29678 PyObject *setstate = NULL;
29679 PyObject *setstate_cython = NULL;
29680 PyObject *getstate = NULL;
29681 getstate = __Pyx_setup_reduce_get_reduce_attribute(type_obj, __pyx_mstate_global->__pyx_n_u_getstate, 1);
29682 if (!getstate && PyErr_Occurred()) {
29683 goto __PYX_BAD;
29684 }
29685 if (getstate) {
29686 object_getstate = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate, 1);
29687 if (!object_getstate && PyErr_Occurred()) {
29688 goto __PYX_BAD;
29689 }
29690 if (object_getstate != getstate) {
29691 goto __PYX_GOOD;
29692 }
29693 }
29694 object_reduce_ex = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex, 0);
29695 if (unlikely(!object_reduce_ex)) goto __PYX_BAD;
29696 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
29697 if (reduce_ex == object_reduce_ex) {
29698 object_reduce = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce, 0);
29699 if (!object_reduce) goto __PYX_BAD;
29700 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
29701 int try_to_replace_reduce = (reduce == object_reduce);
29702 if (!try_to_replace_reduce) {
29703 try_to_replace_reduce = __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython);
29704 if (unlikely(try_to_replace_reduce < 0)) {
29705 goto __PYX_BAD;
29706 }
29707 }
29708 if (try_to_replace_reduce) {
29709 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
29710 if (likely(reduce_cython)) {
29711 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
29712 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
29713 } else if (reduce == object_reduce || PyErr_Occurred()) {
29714 goto __PYX_BAD;
29715 }
29716 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
29717 int try_to_replace_setstate;
29718 if (!setstate) {
29719 PyObject *exc = PyErr_Occurred();
29720 if (exc && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
29721 goto __PYX_BAD;
29722 }
29723 try_to_replace_setstate = 1;
29724 } else {
29725 try_to_replace_setstate = __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython);
29726 if (unlikely(try_to_replace_setstate < 0)) {
29727 goto __PYX_BAD;
29728 }
29729 }
29730 if (try_to_replace_setstate) {
29731 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
29732 if (likely(setstate_cython)) {
29733 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
29734 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
29735 } else if (!setstate || PyErr_Occurred()) {
29736 goto __PYX_BAD;
29737 }
29738 }
29739 PyType_Modified((PyTypeObject*)type_obj);
29740 }
29741 }
29742 goto __PYX_GOOD;
29743__PYX_BAD:
29744 if (!PyErr_Occurred()) {
29745 __Pyx_RaiseErrorWithType(
29746 PyExc_RuntimeError,
29747 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME,
29748 (PyTypeObject*)type_obj);
29749 }
29750 ret = -1;
29751__PYX_GOOD:
29752#if !CYTHON_USE_PYTYPE_LOOKUP
29753 Py_XDECREF(object_reduce);
29754 Py_XDECREF(object_reduce_ex);
29755 Py_XDECREF(object_getstate);
29756 Py_XDECREF(getstate);
29757#endif
29758 Py_XDECREF(reduce);
29759 Py_XDECREF(reduce_ex);
29760 Py_XDECREF(reduce_cython);
29761 Py_XDECREF(setstate);
29762 Py_XDECREF(setstate_cython);
29763 return ret;
29764}
29765
29766/* ApplySequenceOrMappingFlag */
29767#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_PYPY && CYTHON_USE_TYPE_SPECS)
29768int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence) {
29769 PyObject *abc;
29770 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
29771 if (unlikely(!collections_abc)) return -1;
29772 abc = PyObject_GetAttrString(collections_abc, is_sequence ? "Sequence": "Mapping");
29773 Py_DECREF(collections_abc);
29774 if (unlikely(!abc)) return -1;
29775 PyObject *register_result = PyObject_CallMethod(abc, "register", "O", (PyObject*)tp);
29776 Py_DECREF(abc);
29777 if (unlikely(!register_result)) return -1;
29778 Py_DECREF(register_result);
29779 return 0;
29780}
29781#elif CYTHON_COMPILING_IN_PYPY // && !CYTHON_USE_TYPE_SPECS
29782int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence) {
29783 CYTHON_UNUSED_VAR(tp);
29784 CYTHON_UNUSED_VAR(is_sequence);
29785 return PyErr_WarnEx(
29786 PyExc_RuntimeWarning,
29787 "cython.collection_type only works on PyPy with the C flag CYTHON_USE_TYPE_SPECS=1",
29788 1
29789 );
29790}
29791#endif
29792
29793/* GetVTable (used by MergeVTables) */
29794static int __Pyx_GetVtable(PyTypeObject *type, void** table) {
29795 void* ptr;
29796 *table = NULL;
29797#if CYTHON_COMPILING_IN_LIMITED_API
29798 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
29799#else
29800 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
29801#endif
29802 if (!ob)
29803 goto no_attr;
29804 ptr = PyCapsule_GetPointer(ob, 0);
29805 if (!ptr && !PyErr_Occurred())
29806 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
29807 Py_DECREF(ob);
29808 *table = ptr;
29809 return 1;
29810no_attr:
29811 if (PyErr_ExceptionMatches(CYTHON_COMPILING_IN_LIMITED_API ? PyExc_AttributeError : PyExc_KeyError)) {
29812 return 0;
29813 }
29814 Py_XDECREF(ob);
29815 return -1;
29816}
29817
29818/* MergeVTables (used by SetVTable) */
29819static int __Pyx_MergeVtables(PyTypeObject *type) {
29820 int i=0;
29821 Py_ssize_t size;
29822 void** base_vtables;
29823 void* unknown = (void*)-1;
29824 PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
29825 int base_depth = 0;
29826 {
29827 PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
29828 while (base) {
29829 base_depth += 1;
29830 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
29831 }
29832 }
29833 base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
29834 if (unlikely(!base_vtables)) {
29835 PyErr_NoMemory();
29836 return -1;
29837 }
29838 base_vtables[0] = unknown;
29839#if CYTHON_COMPILING_IN_LIMITED_API
29840 size = PyTuple_Size(bases);
29841 if (size < 0) goto other_failure;
29842#else
29843 size = PyTuple_GET_SIZE(bases);
29844#endif
29845 for (i = 1; i < size; i++) {
29846 PyObject *basei;
29847 void* base_vtable;
29848#if CYTHON_AVOID_BORROWED_REFS
29849 basei = PySequence_GetItem(bases, i);
29850 if (unlikely(!basei)) goto other_failure;
29851#elif !CYTHON_ASSUME_SAFE_MACROS
29852 basei = PyTuple_GetItem(bases, i);
29853 if (unlikely(!basei)) goto other_failure;
29854#else
29855 basei = PyTuple_GET_ITEM(bases, i);
29856#endif
29857 int get_vtable_result = __Pyx_GetVtable((PyTypeObject*)basei, &base_vtable);
29858#if CYTHON_AVOID_BORROWED_REFS
29859 Py_DECREF(basei);
29860#endif
29861 if (get_vtable_result != 1) {
29862 if (get_vtable_result == -1) {
29863 goto other_failure;
29864 }
29865 PyErr_Clear(); // Class doesn't have a vtable.
29866 } else {
29867 assert(base_vtable != NULL);
29868 int j;
29869 PyTypeObject* base = __Pyx_PyType_TryGetSlot(type, tp_base, PyTypeObject*);
29870#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
29871 if (!base) goto bad;
29872#endif
29873 for (j = 0; j < base_depth; j++) {
29874 if (base_vtables[j] == unknown) {
29875 switch (__Pyx_GetVtable(base, &base_vtables[j])) {
29876 case 1:
29877 assert(base_vtables[j] == NULL);
29878 break;
29879 case 0:
29880 goto bad;
29881 case -1:
29882 default:
29883 goto other_failure;
29884 }
29885 base_vtables[j + 1] = unknown;
29886 }
29887 if (base_vtables[j] == base_vtable) {
29888 break;
29889 }
29890 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
29891#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
29892 if (!base) goto bad;
29893#endif
29894 }
29895 }
29896 }
29897 PyMem_Free(base_vtables);
29898 return 0;
29899bad:
29900 {
29901 PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
29902 PyTypeObject* basei;
29903#if CYTHON_AVOID_BORROWED_REFS
29904 basei = (PyTypeObject*)PySequence_GetItem(bases, i);
29905 if (unlikely(!basei)) goto other_failure;
29906#elif !CYTHON_ASSUME_SAFE_MACROS
29907 basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
29908 if (unlikely(!basei)) goto other_failure;
29909#else
29910 basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
29911#endif
29912 __Pyx_RaiseTypeErrorWithTypes(
29913 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base, basei);
29914#if CYTHON_AVOID_BORROWED_REFS
29915 Py_DECREF(basei);
29916#endif
29917 }
29918other_failure:
29919 PyMem_Free(base_vtables);
29920 return -1;
29921}
29922
29923/* SetVTable */
29924static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
29925 PyObject *ob = PyCapsule_New(vtable, 0, 0);
29926 if (unlikely(!ob))
29927 goto bad;
29928#if CYTHON_COMPILING_IN_LIMITED_API
29929 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
29930#else
29931 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
29932#endif
29933 goto bad;
29934 Py_DECREF(ob);
29935 return __Pyx_MergeVtables(type);
29936bad:
29937 Py_XDECREF(ob);
29938 return -1;
29939}
29940
29941/* TypeImport */
29942#ifndef __PYX_HAVE_RT_ImportType_3_3_0
29943#define __PYX_HAVE_RT_ImportType_3_3_0
29944static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module, const char *module_name, const char *class_name,
29945 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
29946{
29947 PyObject *result = 0;
29948 Py_ssize_t basicsize;
29949 Py_ssize_t itemsize;
29950#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
29951 PyObject *py_basicsize;
29952 PyObject *py_itemsize;
29953#endif
29954 result = PyObject_GetAttrString(module, class_name);
29955 if (!result)
29956 goto bad;
29957 if (!PyType_Check(result)) {
29958 PyErr_Format(PyExc_TypeError,
29959 "%.200s.%.200s is not a type object",
29960 module_name, class_name);
29961 goto bad;
29962 }
29963#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
29964 basicsize = ((PyTypeObject *)result)->tp_basicsize;
29965 itemsize = ((PyTypeObject *)result)->tp_itemsize;
29966#else
29967 if (size == 0) {
29968 return (PyTypeObject *)result;
29969 }
29970 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
29971 if (!py_basicsize)
29972 goto bad;
29973 basicsize = PyLong_AsSsize_t(py_basicsize);
29974 Py_DECREF(py_basicsize);
29975 py_basicsize = 0;
29976 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
29977 goto bad;
29978 py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
29979 if (!py_itemsize)
29980 goto bad;
29981 itemsize = PyLong_AsSsize_t(py_itemsize);
29982 Py_DECREF(py_itemsize);
29983 py_itemsize = 0;
29984 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
29985 goto bad;
29986#endif
29987 if (itemsize) {
29988 if (size % alignment) {
29989 alignment = size % alignment;
29990 }
29991 if (itemsize < (Py_ssize_t)alignment)
29992 itemsize = (Py_ssize_t)alignment;
29993 }
29994 if ((size_t)(basicsize + itemsize) < size) {
29995 PyErr_Format(PyExc_ValueError,
29996 "%.200s.%.200s size changed, may indicate binary incompatibility. "
29997 "Expected %zd from C header, got %zd from PyObject",
29998 module_name, class_name, size, basicsize+itemsize);
29999 goto bad;
30000 }
30001 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
30002 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
30003 PyErr_Format(PyExc_ValueError,
30004 "%.200s.%.200s size changed, may indicate binary incompatibility. "
30005 "Expected %zd from C header, got %zd-%zd from PyObject",
30006 module_name, class_name, size, basicsize, basicsize+itemsize);
30007 goto bad;
30008 }
30009 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (size_t)basicsize > size) {
30010 if (PyErr_WarnFormat(NULL, 0,
30011 "%.200s.%.200s size changed, may indicate binary incompatibility. "
30012 "Expected %zd from C header, got %zd from PyObject",
30013 module_name, class_name, size, basicsize) < 0) {
30014 goto bad;
30015 }
30016 }
30017 return (PyTypeObject *)result;
30018bad:
30019 Py_XDECREF(result);
30020 return NULL;
30021}
30022#endif
30023
30024/* dict_setdefault (used by FetchCommonType) */
30025static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
30026 PyObject* value;
30027#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
30028 PyDict_SetDefaultRef(d, key, default_value, &value);
30029#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
30030 PyObject *args[] = {d, key, default_value};
30031 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
30032#elif CYTHON_COMPILING_IN_LIMITED_API
30033 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
30034#else
30035 value = PyDict_SetDefault(d, key, default_value);
30036 if (unlikely(!value)) return NULL;
30037 Py_INCREF(value);
30038#endif
30039 return value;
30040}
30041
30042/* AddModuleRef (used by FetchSharedCythonModule) */
30043#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
30044 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
30045 PyObject *module_dict = PyImport_GetModuleDict();
30046 PyObject *m;
30047 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
30048 return NULL;
30049 }
30050 if (m != NULL && PyModule_Check(m)) {
30051 return m;
30052 }
30053 Py_XDECREF(m);
30054 m = PyModule_NewObject(name);
30055 if (m == NULL)
30056 return NULL;
30057 if (PyDict_CheckExact(module_dict)) {
30058 PyObject *new_m;
30059 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
30060 Py_DECREF(m);
30061 return new_m;
30062 } else {
30063 if (PyObject_SetItem(module_dict, name, m) != 0) {
30064 Py_DECREF(m);
30065 return NULL;
30066 }
30067 return m;
30068 }
30069 }
30070 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
30071 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
30072 return PyImport_AddModuleRef(name);
30073 }
30074 PyObject *py_name = PyUnicode_FromString(name);
30075 if (!py_name) return NULL;
30076 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
30077 Py_DECREF(py_name);
30078 return module;
30079 }
30080#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
30081 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
30082 PyObject *module = PyImport_AddModule(name);
30083 Py_XINCREF(module);
30084 return module;
30085 }
30086#endif
30087
30088/* FetchSharedCythonModule (used by FetchCommonType) */
30089static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
30090 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
30091}
30092
30093/* VerifyCachedType (used by FetchCommonType) */
30094static int __Pyx_VerifyCachedType(PyObject *cached_type,
30095 const char *name,
30096 Py_ssize_t expected_basicsize) {
30097 Py_ssize_t basicsize;
30098 if (!PyType_Check(cached_type)) {
30099 PyErr_Format(PyExc_TypeError,
30100 "Shared Cython type %.200s is not a type object", name);
30101 return -1;
30102 }
30103 if (expected_basicsize == 0) {
30104 return 0; // size is inherited, nothing useful to check
30105 }
30106#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
30107 if (expected_basicsize < 0) {
30108 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
30109 } else
30110#endif
30111 {
30112 #if CYTHON_COMPILING_IN_LIMITED_API
30113 PyObject *py_basicsize;
30114 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
30115 if (unlikely(!py_basicsize)) return -1;
30116 basicsize = PyLong_AsSsize_t(py_basicsize);
30117 Py_DECREF(py_basicsize);
30118 py_basicsize = NULL;
30119 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
30120 #else
30121 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
30122 #endif
30123 }
30124 if ((expected_basicsize >= 0) ?
30125 (basicsize != expected_basicsize) :
30126 (basicsize < -expected_basicsize)) {
30127 PyErr_Format(PyExc_TypeError,
30128 "Shared Cython type %.200s has the wrong size, try recompiling",
30129 name);
30130 return -1;
30131 }
30132 return 0;
30133}
30134
30135/* FetchCommonType (used by CommonTypesMetaclass) */
30136#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
30137static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
30138 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
30139 if (result && metaclass) {
30140 PyObject *old_tp = (PyObject*)Py_TYPE(result);
30141 Py_INCREF((PyObject*)metaclass);
30142 Py_SET_TYPE(result, metaclass);
30143 Py_DECREF(old_tp);
30144 PyType_Modified((PyTypeObject*)result);
30145 }
30146 return result;
30147}
30148#else
30149#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
30150#endif
30151static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
30152 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
30153 int get_item_ref_result;
30154 const char* object_name = strrchr(spec->name, '.');
30155 object_name = object_name ? object_name+1 : spec->name;
30156 py_object_name = PyUnicode_FromString(object_name);
30157 if (!py_object_name) return NULL;
30158 abi_module = __Pyx_FetchSharedCythonABIModule();
30159 if (!abi_module) goto done;
30160 abi_module_dict = PyModule_GetDict(abi_module);
30161 if (!abi_module_dict) goto done;
30162 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
30163 if (get_item_ref_result == 1) {
30164 if (__Pyx_VerifyCachedType(
30165 cached_type,
30166 object_name,
30167 spec->basicsize) < 0) {
30168 goto bad;
30169 }
30170 goto done;
30171 } else if (unlikely(get_item_ref_result == -1)) {
30172 goto bad;
30173 }
30174 cached_type = __Pyx_PyType_FromMetaclass(
30175 metaclass,
30176 CYTHON_USE_MODULE_STATE ? module : abi_module,
30177 spec, bases);
30178 if (unlikely(!cached_type)) goto bad;
30179 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
30180 if (unlikely(new_cached_type != cached_type)) {
30181 if (unlikely(!new_cached_type)) goto bad;
30182 Py_DECREF(cached_type);
30183 cached_type = new_cached_type;
30184 if (__Pyx_VerifyCachedType(
30185 cached_type,
30186 object_name,
30187 spec->basicsize) < 0) {
30188 goto bad;
30189 }
30190 goto done;
30191 } else {
30192 Py_DECREF(new_cached_type);
30193 }
30194done:
30195 Py_XDECREF(abi_module);
30196 Py_DECREF(py_object_name);
30197 assert(cached_type == NULL || PyType_Check(cached_type));
30198 return (PyTypeObject *) cached_type;
30199bad:
30200 Py_XDECREF(cached_type);
30201 cached_type = NULL;
30202 goto done;
30203}
30204
30205/* CommonTypesMetaclass (used by CythonFunctionShared) */
30206static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
30207 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
30208}
30209#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
30210static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
30211 PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
30212 return NULL;
30213}
30214static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
30215 PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
30216 return -1;
30217}
30218#endif
30219static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
30220 {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
30221 {0, 0, 0, 0, 0}
30222};
30223static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
30224 {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
30225 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
30226 {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
30227 {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
30228 {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
30229 #endif
30230 {0, 0}
30231};
30232static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
30233 __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
30234 0,
30235 0,
30236 Py_TPFLAGS_IMMUTABLETYPE |
30237 Py_TPFLAGS_DISALLOW_INSTANTIATION |
30238 Py_TPFLAGS_DEFAULT,
30239 __pyx_CommonTypesMetaclass_slots
30240};
30241static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
30242 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
30243 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
30244 if (unlikely(!bases)) {
30245 return -1;
30246 }
30247 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
30248 Py_DECREF(bases);
30249 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
30250 return -1;
30251 }
30252 return 0;
30253}
30254
30255/* CythonFunctionPerModule (used by CythonFunctionShared) */
30256#if CYTHON_COMPILING_IN_LIMITED_API
30257static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
30258 if (__Pyx_CyFunction_Check(func)) {
30259 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
30260 } else if (PyCFunction_Check(func)) {
30261 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
30262 }
30263 return 0;
30264}
30265static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
30266 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
30267 int result;
30268 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
30269 if (unlikely(!newFunc)) {
30270 PyErr_Clear(); // It's only an optimization, so don't throw an error
30271 return 0;
30272 }
30273 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
30274 Py_DECREF(newFunc);
30275 return result;
30276 }
30277 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
30278}
30279#else
30280static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
30281 if (PyMethod_Check(func)) {
30282 func = PyMethod_GET_FUNCTION(func);
30283 }
30284 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
30285}
30286#endif
30287static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
30288#if CYTHON_COMPILING_IN_LIMITED_API
30289 __Pyx_Py_XDECREF_SET(
30290 __Pyx__CyFunction_GetClassObj(f),
30291 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
30292#else
30293 __Pyx_Py_XDECREF_SET(
30294 ((PyCMethodObject *) (f))->mm_class,
30295 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
30296#endif
30297}
30298static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
30299 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
30300 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
30301 if (unlikely(!m->defaults))
30302 return NULL;
30303 return m->defaults;
30304}
30305static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
30306 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
30307 m->defaults_tuple = tuple;
30308 Py_INCREF(tuple);
30309}
30310static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
30311 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
30312 m->defaults_kwdict = dict;
30313 Py_INCREF(dict);
30314}
30315static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
30316 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
30317 m->func_annotations = dict;
30318 Py_INCREF(dict);
30319}
30320
30321/* PyMethodNew (used by CythonFunctionShared) */
30322#if CYTHON_COMPILING_IN_LIMITED_API
30323static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
30324 PyObject *result;
30325 CYTHON_UNUSED_VAR(typ);
30326 if (!self)
30327 return __Pyx_NewRef(func);
30328 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
30329 {
30330 PyObject *args[] = {func, self};
30331 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
30332 }
30333 #else
30334 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
30335 #endif
30336 return result;
30337}
30338#else
30339static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
30340 CYTHON_UNUSED_VAR(typ);
30341 if (!self)
30342 return __Pyx_NewRef(func);
30343 return PyMethod_New(func, self);
30344}
30345#endif
30346
30347/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
30348#if CYTHON_VECTORCALL
30349static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
30350{
30351 PyObject *res = NULL;
30352 PyObject *kwnames;
30353 PyObject **newargs;
30354 PyObject **kwvalues;
30355 Py_ssize_t i;
30356 #if CYTHON_AVOID_BORROWED_REFS
30357 PyObject *pos;
30358 #else
30359 Py_ssize_t pos;
30360 #endif
30361 size_t j;
30362 PyObject *key, *value;
30363 unsigned long keys_are_strings;
30364 #if !CYTHON_ASSUME_SAFE_SIZE
30365 Py_ssize_t nkw = PyDict_Size(kw);
30366 if (unlikely(nkw == -1)) return NULL;
30367 #else
30368 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
30369 #endif
30370 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
30371 if (unlikely(newargs == NULL)) {
30372 PyErr_NoMemory();
30373 return NULL;
30374 }
30375 for (j = 0; j < nargs; j++) newargs[j] = args[j];
30376 kwnames = PyTuple_New(nkw);
30377 if (unlikely(kwnames == NULL)) {
30378 PyMem_Free(newargs);
30379 return NULL;
30380 }
30381 kwvalues = newargs + nargs;
30382 pos = 0;
30383 i = 0;
30384 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
30385 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
30386 keys_are_strings &=
30387 #if CYTHON_COMPILING_IN_LIMITED_API
30388 PyType_GetFlags(Py_TYPE(key));
30389 #else
30390 Py_TYPE(key)->tp_flags;
30391 #endif
30392 #if !CYTHON_ASSUME_SAFE_MACROS
30393 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
30394 #else
30395 PyTuple_SET_ITEM(kwnames, i, key);
30396 #endif
30397 kwvalues[i] = value;
30398 i++;
30399 }
30400 if (unlikely(!keys_are_strings)) {
30401 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
30402 goto cleanup;
30403 }
30404 res = vc(func, newargs, nargs, kwnames);
30405cleanup:
30406 #if CYTHON_AVOID_BORROWED_REFS
30407 Py_DECREF(pos);
30408 #endif
30409 Py_DECREF(kwnames);
30410 for (i = 0; i < nkw; i++)
30411 Py_DECREF(kwvalues[i]);
30412 PyMem_Free(newargs);
30413 return res;
30414}
30415static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
30416{
30417 Py_ssize_t kw_size =
30418 likely(kw == NULL) ?
30419 0 :
30420#if !CYTHON_ASSUME_SAFE_SIZE
30421 PyDict_Size(kw);
30422#else
30423 PyDict_GET_SIZE(kw);
30424#endif
30425 if (kw_size == 0) {
30426 return vc(func, args, nargs, NULL);
30427 }
30428#if !CYTHON_ASSUME_SAFE_SIZE
30429 else if (unlikely(kw_size == -1)) {
30430 return NULL;
30431 }
30432#endif
30433 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
30434}
30435#endif
30436
30437/* CythonFunctionShared (used by CythonFunction) */
30438static PyObject *
30439__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
30440{
30441 if (unlikely(op->func_doc == NULL)) {
30442#if CYTHON_COMPILING_IN_LIMITED_API
30443 const char *doc = op->func_methoddef->ml_doc;
30444#else
30445 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
30446#endif
30447 if (doc) {
30448 op->func_doc = PyUnicode_FromString(doc);
30449 if (unlikely(op->func_doc == NULL))
30450 return NULL;
30451 } else {
30452 Py_INCREF(Py_None);
30453 return Py_None;
30454 }
30455 }
30456 Py_INCREF(op->func_doc);
30457 return op->func_doc;
30458}
30459static PyObject *
30460__Pyx_CyFunction_get_doc(PyObject *op_in, void *closure) {
30461 PyObject *result;
30462 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30463 CYTHON_UNUSED_VAR(closure);
30464 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30465 result = __Pyx_CyFunction_get_doc_locked(op);
30466 __Pyx_END_CRITICAL_SECTION();
30467 return result;
30468}
30469static int
30470__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value, void *context)
30471{
30472 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30473 CYTHON_UNUSED_VAR(context);
30474 if (value == NULL) {
30475 value = Py_None;
30476 }
30477 Py_INCREF(value);
30478 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30479 __Pyx_Py_XDECREF_SET(op->func_doc, value);
30480 __Pyx_END_CRITICAL_SECTION();
30481 return 0;
30482}
30483static PyObject *
30484__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
30485{
30486 if (unlikely(op->func_name == NULL)) {
30487#if CYTHON_COMPILING_IN_LIMITED_API
30488 const char *name = op->func_methoddef->ml_name;
30489#else
30490 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
30491#endif
30492 op->func_name = PyUnicode_InternFromString(name);
30493 if (unlikely(op->func_name == NULL))
30494 return NULL;
30495 }
30496 Py_INCREF(op->func_name);
30497 return op->func_name;
30498}
30499static PyObject *
30500__Pyx_CyFunction_get_name(PyObject *op, void *context)
30501{
30502 PyObject *result = NULL;
30503 CYTHON_UNUSED_VAR(context);
30504 __Pyx_BEGIN_CRITICAL_SECTION(op);
30505 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
30506 __Pyx_END_CRITICAL_SECTION();
30507 return result;
30508}
30509static int
30510__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value, void *context)
30511{
30512 CYTHON_UNUSED_VAR(context);
30513 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
30514 PyErr_SetString(PyExc_TypeError,
30515 "__name__ must be set to a string object");
30516 return -1;
30517 }
30518 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30519 Py_INCREF(value);
30520 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30521 __Pyx_Py_XDECREF_SET(op->func_name, value);
30522 __Pyx_END_CRITICAL_SECTION();
30523 return 0;
30524}
30525static PyObject *
30526__Pyx_CyFunction_get_qualname(PyObject *op_in, void *context)
30527{
30528 CYTHON_UNUSED_VAR(context);
30529 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30530 PyObject *result;
30531 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30532 Py_INCREF(op->func_qualname);
30533 result = op->func_qualname;
30534 __Pyx_END_CRITICAL_SECTION();
30535 return result;
30536}
30537static int
30538__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value, void *context)
30539{
30540 CYTHON_UNUSED_VAR(context);
30541 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
30542 PyErr_SetString(PyExc_TypeError,
30543 "__qualname__ must be set to a string object");
30544 return -1;
30545 }
30546 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30547 Py_INCREF(value);
30548 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30549 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
30550 __Pyx_END_CRITICAL_SECTION();
30551 return 0;
30552}
30553#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
30554static PyObject *
30555__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
30556{
30557 CYTHON_UNUSED_VAR(context);
30558 if (unlikely(op->func_dict == NULL)) {
30559 op->func_dict = PyDict_New();
30560 if (unlikely(op->func_dict == NULL))
30561 return NULL;
30562 }
30563 Py_INCREF(op->func_dict);
30564 return op->func_dict;
30565}
30566#endif
30567static PyObject *
30568__Pyx_CyFunction_get_globals(PyObject *op_in, void *context)
30569{
30570 CYTHON_UNUSED_VAR(context);
30571 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30572 Py_INCREF(op->func_globals);
30573 return op->func_globals;
30574}
30575static PyObject *
30576__Pyx_CyFunction_get_closure(PyObject *op, void *context)
30577{
30578 CYTHON_UNUSED_VAR(op);
30579 CYTHON_UNUSED_VAR(context);
30580 Py_INCREF(Py_None);
30581 return Py_None;
30582}
30583static PyObject *
30584__Pyx_CyFunction_get_code(PyObject *op_in, void *context)
30585{
30586 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30587 PyObject* result = (op->func_code) ? op->func_code : Py_None;
30588 CYTHON_UNUSED_VAR(context);
30589 Py_INCREF(result);
30590 return result;
30591}
30592static int
30593__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
30594 int result = 0;
30595 PyObject *res = op->defaults_getter(op_obj);
30596 if (unlikely(!res))
30597 return -1;
30598 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30599 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
30600 Py_INCREF(op->defaults_tuple);
30601 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
30602 Py_INCREF(op->defaults_kwdict);
30603 #else
30604 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
30605 if (unlikely(!op->defaults_tuple)) result = -1;
30606 else {
30607 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
30608 if (unlikely(!op->defaults_kwdict)) result = -1;
30609 }
30610 #endif
30611 Py_DECREF(res);
30612 return result;
30613}
30614static int
30615__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value, void *context) {
30616 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30617 CYTHON_UNUSED_VAR(context);
30618 if (!value) {
30619 value = Py_None;
30620 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
30621 PyErr_SetString(PyExc_TypeError,
30622 "__defaults__ must be set to a tuple object");
30623 return -1;
30624 }
30625 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
30626 "currently affect the values used in function calls", 1);
30627 Py_INCREF(value);
30628 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30629 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
30630 __Pyx_END_CRITICAL_SECTION();
30631 return 0;
30632}
30633static PyObject *
30634__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
30635 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30636 PyObject* result = op->defaults_tuple;
30637 if (unlikely(!result)) {
30638 if (op->defaults_getter) {
30639 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
30640 result = op->defaults_tuple;
30641 } else {
30642 result = Py_None;
30643 }
30644 }
30645 Py_INCREF(result);
30646 return result;
30647}
30648static PyObject *
30649__Pyx_CyFunction_get_defaults(PyObject *op, void *context) {
30650 PyObject* result = NULL;
30651 CYTHON_UNUSED_VAR(context);
30652 __Pyx_BEGIN_CRITICAL_SECTION(op);
30653 result = __Pyx_CyFunction_get_defaults_locked(op);
30654 __Pyx_END_CRITICAL_SECTION();
30655 return result;
30656}
30657static int
30658__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value, void *context) {
30659 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30660 CYTHON_UNUSED_VAR(context);
30661 if (!value) {
30662 value = Py_None;
30663 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
30664 PyErr_SetString(PyExc_TypeError,
30665 "__kwdefaults__ must be set to a dict object");
30666 return -1;
30667 }
30668 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
30669 "currently affect the values used in function calls", 1);
30670 Py_INCREF(value);
30671 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30672 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
30673 __Pyx_END_CRITICAL_SECTION();
30674 return 0;
30675}
30676static PyObject *
30677__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
30678 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30679 PyObject* result = op->defaults_kwdict;
30680 if (unlikely(!result)) {
30681 if (op->defaults_getter) {
30682 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
30683 result = op->defaults_kwdict;
30684 } else {
30685 result = Py_None;
30686 }
30687 }
30688 Py_INCREF(result);
30689 return result;
30690}
30691static PyObject *
30692__Pyx_CyFunction_get_kwdefaults(PyObject *op, void *context) {
30693 PyObject* result;
30694 CYTHON_UNUSED_VAR(context);
30695 __Pyx_BEGIN_CRITICAL_SECTION(op);
30696 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
30697 __Pyx_END_CRITICAL_SECTION();
30698 return result;
30699}
30700static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
30701static int
30702__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value, void *context) {
30703 CYTHON_UNUSED_VAR(context);
30704 if (!value || value == Py_None) {
30705 value = NULL;
30706 } else if (unlikely(!PyDict_Check(value))) {
30707 PyErr_SetString(PyExc_TypeError,
30708 "__annotations__ must be set to a dict object");
30709 return -1;
30710 }
30711 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30712 Py_XINCREF(value);
30713 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30714 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
30715 __Pyx_END_CRITICAL_SECTION();
30716 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0)) return -1;
30717 return 0;
30718}
30719static int
30720__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
30721 /* Return 1 if the function dict exists, 0 otherwise. This cannot fail:
30722 * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
30723#if CYTHON_COMPILING_IN_PYPY
30724 *dict = PyObject_GenericGetDict(op_in, NULL);
30725#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
30726 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
30727#else
30728 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
30729 *dict = likely(dictptr) ? *dictptr : NULL;
30730#endif
30731 return *dict ? 1 : 0;
30732}
30733static int
30734__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
30735 PyObject *dict;
30736 int dict_found;
30737 *annotate = NULL;
30738 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
30739 if (!dict_found) return 0;
30740 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
30741}
30742static int
30743__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
30744 PyObject *dict;
30745 int dict_found;
30746 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
30747 if (!dict_found) return 0;
30748 if (value) {
30749 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
30750 } else {
30751#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
30752 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
30753#else
30754 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
30755 if (result == 1) {
30756 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
30757 }
30758 return result;
30759#endif
30760 }
30761}
30762static int
30763__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
30764 PyObject *dict;
30765 int result;
30766#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
30767 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
30768#else
30769 dict = PyObject_GenericGetDict(op_in, NULL);
30770#endif
30771 if (unlikely(!dict)) return -1;
30772 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
30773 Py_DECREF(dict);
30774 return result;
30775}
30776static PyObject *
30777__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
30778 PyObject* result = op->func_annotations;
30779 if (unlikely(!result)) {
30780 result = PyDict_New();
30781 if (unlikely(!result)) return NULL;
30782 op->func_annotations = result;
30783 }
30784 Py_INCREF(result);
30785 return result;
30786}
30787static PyObject *
30788__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) {
30789 PyObject *annotate = NULL;
30790 PyObject *result = NULL;
30791 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30792 CYTHON_UNUSED_VAR(context);
30793 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30794 result = __Pyx_XNewRef(op->func_annotations);
30795 __Pyx_END_CRITICAL_SECTION();
30796 if (result) return result;
30797 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
30798 if (!annotate || annotate == Py_None) {
30799 Py_XDECREF(annotate);
30800 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30801 result = __Pyx_CyFunction_get_annotations_locked(op);
30802 __Pyx_END_CRITICAL_SECTION();
30803 return result;
30804 }
30805 PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE
30806 if (likely(format)) {
30807 if (!Py_EnterRecursiveCall(" cyfunction __annotations__.__get__")) {
30808 result = __Pyx_PyObject_CallOneArg(annotate, format);
30809 Py_LeaveRecursiveCall();
30810 Py_DECREF(format);
30811 }
30812 }
30813 Py_DECREF(annotate);
30814 if (unlikely(!result)) return NULL;
30815 if (unlikely(!PyDict_Check(result))) {
30816 PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
30817 Py_DECREF(result);
30818 return NULL;
30819 }
30820 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30821 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
30822 __Pyx_END_CRITICAL_SECTION();
30823 return result;
30824}
30825static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
30826 CYTHON_UNUSED_VAR(arg);
30827 if (unlikely(!self)) {
30828 PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
30829 return NULL;
30830 }
30831 PyObject *result;
30832 if (Py_EnterRecursiveCall(" in cyfunction annotate")) {
30833 return NULL;
30834 }
30835 result = __Pyx_CyFunction_get_annotations(self, NULL);
30836 Py_LeaveRecursiveCall();
30837 return result;
30838}
30839static PyObject *
30840__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context);
30841static int
30842__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
30843 CYTHON_UNUSED_VAR(context);
30844 if (value == NULL) {
30845 PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
30846 return -1;
30847 }
30848 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
30849 PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
30850 return -1;
30851 }
30852 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
30853#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
30854 PyCFunction cfunction = PyCFunction_GetFunction(value);
30855 if (unlikely(!cfunction)) return -1;
30856 PyObject *value_self = PyCFunction_GetSelf(value);
30857 if (unlikely(!value_self && PyErr_Occurred())) return -1;
30858#else
30859 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
30860 PyObject *value_self = PyCFunction_GET_SELF(value);
30861#endif
30862 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
30863 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
30864 }
30865 }
30866 if (value != Py_None) {
30867 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30868 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30869 Py_CLEAR(op->func_annotations);
30870 __Pyx_END_CRITICAL_SECTION();
30871 }
30872 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
30873}
30874#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
30875static PyObject *
30876__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
30877 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
30878 if (is_coroutine) {
30879 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
30880 fromlist = PyList_New(1);
30881 if (unlikely(!fromlist)) return NULL;
30882 Py_INCREF(marker);
30883#if CYTHON_ASSUME_SAFE_MACROS
30884 PyList_SET_ITEM(fromlist, 0, marker);
30885#else
30886 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
30887 Py_DECREF(fromlist);
30888 return NULL;
30889 }
30890#endif
30891 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
30892 Py_DECREF(fromlist);
30893 if (unlikely(!module)) {
30894 goto ignore_or_error;
30895 }
30896 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
30897 Py_DECREF(module);
30898 if (likely(is_coroutine_value)) {
30899 return is_coroutine_value;
30900 }
30901ignore_or_error:
30902 if (!__Pyx_IgnoreException(PyExc_Exception)) {
30903 return NULL;
30904 }
30905 }
30906 return __Pyx_PyBool_FromLong(is_coroutine);
30907}
30908static PyObject *
30909__Pyx_CyFunction_get_is_coroutine(PyObject *op_in, void *context) {
30910 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30911 PyObject *result;
30912 CYTHON_UNUSED_VAR(context);
30913 if (op->func_is_coroutine) {
30914 return __Pyx_NewRef(op->func_is_coroutine);
30915 }
30916 result = __Pyx_CyFunction_get_is_coroutine_value(op);
30917 if (unlikely(!result))
30918 return NULL;
30919 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
30920 if (op->func_is_coroutine) {
30921 Py_DECREF(result);
30922 result = __Pyx_NewRef(op->func_is_coroutine);
30923 } else {
30924 op->func_is_coroutine = __Pyx_NewRef(result);
30925 }
30926 __Pyx_END_CRITICAL_SECTION();
30927 return result;
30928}
30929#endif
30930static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func, const char* message, Py_ssize_t size) {
30931#if CYTHON_COMPILING_IN_LIMITED_API
30932 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
30933 if (!py_name) return;
30934 PyErr_Format(PyExc_TypeError,
30935 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
30936 py_name, message, size);
30937 Py_DECREF(py_name);
30938#else
30939 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
30940 PyErr_Format(PyExc_TypeError,
30941 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
30942 name, message, size);
30943#endif
30944}
30945static void __Pyx_CyFunction_raise_type_error(PyObject *func, const char* message) {
30946#if CYTHON_COMPILING_IN_LIMITED_API
30947 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
30948 if (!py_name) return;
30949 PyErr_Format(PyExc_TypeError,
30950 "%.200S() %s",
30951 py_name, message);
30952 Py_DECREF(py_name);
30953#else
30954 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
30955 PyErr_Format(PyExc_TypeError,
30956 "%.200s() %s",
30957 name, message);
30958#endif
30959}
30960#if CYTHON_COMPILING_IN_LIMITED_API
30961static PyObject *
30962__Pyx_CyFunction_get_module(PyObject *op_in, void *context) {
30963 CYTHON_UNUSED_VAR(context);
30964 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30965 Py_INCREF(op->func_module);
30966 return op->func_module;
30967}
30968static int
30969__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value, void *context) {
30970 CYTHON_UNUSED_VAR(context);
30971 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
30972 if (value == NULL) {
30973 value = Py_None;
30974 }
30975 Py_INCREF(value);
30976 PyObject *old = op->func_module;
30977 op->func_module = value;
30978 Py_DECREF(old);
30979 return 0;
30980}
30981#endif
30982static PyGetSetDef __pyx_CyFunction_getsets[] = {
30983 {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
30984 {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
30985 {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
30986 {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
30987 {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
30988#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
30989 {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
30990 {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
30991#else
30992 {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
30993 {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
30994#endif
30995 {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
30996 {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
30997 {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
30998 {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
30999 {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
31000 {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
31001 {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
31002 {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
31003 {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
31004 {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
31005 {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
31006#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
31007 {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
31008#endif
31009#if CYTHON_COMPILING_IN_LIMITED_API
31010 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
31011#endif
31012 {0, 0, 0, 0, 0}
31013};
31014static PyMemberDef __pyx_CyFunction_members[] = {
31015#if !CYTHON_COMPILING_IN_LIMITED_API
31016 {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
31017#endif
31018#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
31019 {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
31020 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
31021#endif
31022#if CYTHON_VECTORCALL
31023#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
31024 {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
31025 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
31026#else
31027 {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
31028#endif
31029#if CYTHON_COMPILING_IN_LIMITED_API
31030 {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
31031 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
31032#else
31033 {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
31034#endif
31035#endif
31036 {0, 0, 0, 0, 0}
31037};
31038static PyObject *
31039__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
31040{
31041 PyObject *result = NULL;
31042 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
31043 CYTHON_UNUSED_VAR(args);
31044 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
31045 Py_INCREF(m->func_qualname);
31046 result = m->func_qualname;
31047 __Pyx_END_CRITICAL_SECTION();
31048 return result;
31049}
31050static PyMethodDef __pyx_CyFunction_methods[] = {
31051 {"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
31052 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
31053 "on Cython functions."},
31054 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
31055 {0, 0, 0, 0}
31056};
31057static PyObject *
31058__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
31059 PyObject *annotate = NULL;
31060 CYTHON_UNUSED_VAR(context);
31061 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
31062 if (annotate) return annotate;
31063 PyObject *method = PyCFunction_New(
31064 &__pyx_CyFunction_methods[0],
31065 op_in);
31066 return method;
31067}
31068#if CYTHON_COMPILING_IN_LIMITED_API
31069#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
31070#else
31071#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
31072#endif
31073static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
31074 PyMethodDef *ml, int flags, PyObject* qualname,
31075 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
31076 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
31077#if !CYTHON_COMPILING_IN_LIMITED_API
31078 PyCFunctionObject *cf = (PyCFunctionObject*) op;
31079#endif
31080 if (unlikely(op == NULL))
31081 return NULL;
31082#if CYTHON_COMPILING_IN_LIMITED_API
31083 op->func_methoddef = ml;
31084 Py_INCREF(module);
31085 op->func_module = module;
31086#endif
31087 op->flags = flags;
31088 __Pyx_CyFunction_weakreflist(op) = NULL;
31089#if !CYTHON_COMPILING_IN_LIMITED_API
31090 cf->m_ml = ml;
31091 cf->m_self = (PyObject *) op;
31092#endif
31093 Py_XINCREF(closure);
31094 op->func_closure = closure;
31095#if !CYTHON_COMPILING_IN_LIMITED_API
31096 Py_XINCREF(module);
31097 cf->m_module = module;
31098#endif
31099#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
31100 op->func_dict = NULL;
31101#endif
31102 op->func_name = NULL;
31103 Py_INCREF(qualname);
31104 op->func_qualname = qualname;
31105 op->func_doc = NULL;
31106#if CYTHON_COMPILING_IN_LIMITED_API
31107 op->func_classobj = NULL;
31108#else
31109 ((PyCMethodObject*)op)->mm_class = NULL;
31110#endif
31111 op->func_globals = globals;
31112 Py_INCREF(op->func_globals);
31113 Py_XINCREF(code);
31114 op->func_code = code;
31115 op->defaults = NULL;
31116 op->defaults_tuple = NULL;
31117 op->defaults_kwdict = NULL;
31118 op->defaults_getter = NULL;
31119 op->func_annotations = NULL;
31120#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
31121 op->func_is_coroutine = NULL;
31122#endif
31123#if CYTHON_VECTORCALL
31124 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
31125 case METH_NOARGS:
31126 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
31127 break;
31128 case METH_O:
31129 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
31130 break;
31131 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
31132 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
31133 break;
31134 case METH_FASTCALL | METH_KEYWORDS:
31135 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
31136 break;
31137 case METH_VARARGS | METH_KEYWORDS:
31138 __Pyx_CyFunction_func_vectorcall(op) = NULL;
31139 break;
31140 default:
31141 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
31142 Py_DECREF(op_in);
31143 return NULL;
31144 }
31145#endif
31146 return op_in;
31147}
31148static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
31149{
31150 Py_CLEAR(m->func_closure);
31151#if CYTHON_COMPILING_IN_LIMITED_API
31152 Py_CLEAR(m->func_module);
31153#else
31154 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
31155#endif
31156#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
31157 Py_CLEAR(m->func_dict);
31158#elif PY_VERSION_HEX < 0x030d0000
31159 _PyObject_ClearManagedDict((PyObject*)m);
31160#else
31161 PyObject_ClearManagedDict((PyObject*)m);
31162#endif
31163 Py_CLEAR(m->func_name);
31164 Py_CLEAR(m->func_qualname);
31165 Py_CLEAR(m->func_doc);
31166 Py_CLEAR(m->func_globals);
31167 Py_CLEAR(m->func_code);
31168#if CYTHON_COMPILING_IN_LIMITED_API
31169 Py_CLEAR(m->func_classobj);
31170#else
31171 {
31172 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
31173 ((PyCMethodObject *) (m))->mm_class = NULL;
31174 Py_XDECREF(cls);
31175 }
31176#endif
31177 Py_CLEAR(m->defaults_tuple);
31178 Py_CLEAR(m->defaults_kwdict);
31179 Py_CLEAR(m->func_annotations);
31180#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
31181 Py_CLEAR(m->func_is_coroutine);
31182#endif
31183 Py_CLEAR(m->defaults);
31184 return 0;
31185}
31186static int
31187__Pyx_CyFunction_clear(PyObject *m)
31188{
31189 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
31190}
31191static void __Pyx__CyFunction_dealloc(PyObject *m)
31192{
31193 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
31194 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
31195 PyObject_ClearWeakRefs(m);
31196 __Pyx__CyFunction_clear(cyfunc);
31197 __Pyx_PyHeapTypeObject_GC_Del(m);
31198}
31199static void __Pyx_CyFunction_dealloc(PyObject *m)
31200{
31201 PyObject_GC_UnTrack(m);
31202 __Pyx__CyFunction_dealloc(m);
31203}
31204static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit, void *arg)
31205{
31206 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
31207 {
31208 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
31209 if (e) return e;
31210 }
31211 Py_VISIT(m->func_closure);
31212#if CYTHON_COMPILING_IN_LIMITED_API
31213 Py_VISIT(m->func_module);
31214#else
31215 Py_VISIT(((PyCFunctionObject*)m)->m_module);
31216#endif
31217#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
31218 Py_VISIT(m->func_dict);
31219#else
31220 {
31221 int e =
31222#if PY_VERSION_HEX < 0x030d0000
31223 _PyObject_VisitManagedDict
31224#else
31225 PyObject_VisitManagedDict
31226#endif
31227 ((PyObject*)m, visit, arg);
31228 if (e != 0) return e;
31229 }
31230#endif
31231 __Pyx_VISIT_CONST(m->func_name);
31232 __Pyx_VISIT_CONST(m->func_qualname);
31233 Py_VISIT(m->func_doc);
31234 Py_VISIT(m->func_globals);
31235 __Pyx_VISIT_CONST(m->func_code);
31236 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
31237 Py_VISIT(m->defaults_tuple);
31238 Py_VISIT(m->defaults_kwdict);
31239 Py_VISIT(m->func_annotations);
31240#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
31241 Py_VISIT(m->func_is_coroutine);
31242#endif
31243 Py_VISIT(m->defaults);
31244 return 0;
31245}
31246static PyObject*
31247__Pyx_CyFunction_repr(PyObject *op_in)
31248{
31249 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
31250 PyObject *repr;
31251 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
31252 repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
31253 op->func_qualname, (void *)op);
31254 __Pyx_END_CRITICAL_SECTION();
31255 return repr;
31256}
31257static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
31258#if CYTHON_COMPILING_IN_LIMITED_API
31259 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
31260 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
31261 int flags = cyfunc->func_methoddef->ml_flags;
31262#else
31263 PyCFunctionObject* f = (PyCFunctionObject*)func;
31264 PyCFunction meth = f->m_ml->ml_meth;
31265 int flags = f->m_ml->ml_flags;
31266#endif
31267 Py_ssize_t size;
31268 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
31269 case METH_VARARGS:
31270 if (likely(kw == NULL || PyDict_Size(kw) == 0))
31271 return (*meth)(self, arg);
31272 break;
31273 case METH_VARARGS | METH_KEYWORDS:
31274 return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
31275 case METH_NOARGS:
31276 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
31277#if CYTHON_ASSUME_SAFE_SIZE
31278 size = PyTuple_GET_SIZE(arg);
31279#else
31280 size = PyTuple_Size(arg);
31281 if (unlikely(size < 0)) return NULL;
31282#endif
31283 if (likely(size == 0))
31284 return (*meth)(self, NULL);
31285 __Pyx_CyFunction_raise_argument_count_error(
31286 func,
31287 "takes no arguments", size);
31288 return NULL;
31289 }
31290 break;
31291 case METH_O:
31292 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
31293#if CYTHON_ASSUME_SAFE_SIZE
31294 size = PyTuple_GET_SIZE(arg);
31295#else
31296 size = PyTuple_Size(arg);
31297 if (unlikely(size < 0)) return NULL;
31298#endif
31299 if (likely(size == 1)) {
31300 PyObject *result, *arg0;
31301 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31302 arg0 = PyTuple_GET_ITEM(arg, 0);
31303 #else
31304 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
31305 #endif
31306 result = (*meth)(self, arg0);
31307 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
31308 Py_DECREF(arg0);
31309 #endif
31310 return result;
31311 }
31312 __Pyx_CyFunction_raise_argument_count_error(
31313 func,
31314 "takes exactly one argument", size);
31315 return NULL;
31316 }
31317 break;
31318 default:
31319 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
31320 return NULL;
31321 }
31322 __Pyx_CyFunction_raise_type_error(
31323 func, "takes no keyword arguments");
31324 return NULL;
31325}
31326static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
31327 PyObject *result;
31328 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
31329 return result;
31330}
31331static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
31332 PyObject *result;
31333 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
31334#if CYTHON_VECTORCALL
31335 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
31336 if (vc) {
31337#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
31338 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
31339#else
31340 (void) &__Pyx_PyVectorcall_FastCallDict;
31341 return PyVectorcall_Call(func, args, kw);
31342#endif
31343 }
31344#endif
31345 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
31346 Py_ssize_t argc;
31347 PyObject *new_args;
31348 PyObject *self;
31349#if CYTHON_ASSUME_SAFE_SIZE
31350 argc = PyTuple_GET_SIZE(args);
31351#else
31352 argc = PyTuple_Size(args);
31353 if (unlikely(argc < 0)) return NULL;
31354#endif
31355 new_args = PyTuple_GetSlice(args, 1, argc);
31356 if (unlikely(!new_args))
31357 return NULL;
31358 self = PyTuple_GetItem(args, 0);
31359 if (unlikely(!self)) {
31360 Py_DECREF(new_args);
31361 PyErr_Format(PyExc_TypeError,
31362 "unbound method %.200S() needs an argument",
31363 cyfunc->func_qualname);
31364 return NULL;
31365 }
31366 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
31367 Py_DECREF(new_args);
31368 } else {
31369 result = __Pyx_CyFunction_Call(func, args, kw);
31370 }
31371 return result;
31372}
31373#if CYTHON_VECTORCALL
31374static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
31375{
31376 int ret = 0;
31377 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
31378 if (unlikely(nargs < 1)) {
31379 __Pyx_CyFunction_raise_type_error(
31380 func, "needs an argument");
31381 return -1;
31382 }
31383 ret = 1;
31384 }
31385 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
31386 __Pyx_CyFunction_raise_type_error(
31387 func, "takes no keyword arguments");
31388 return -1;
31389 }
31390 return ret;
31391}
31392static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
31393{
31394 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
31395 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
31396 PyObject *self;
31397#if CYTHON_COMPILING_IN_LIMITED_API
31398 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
31399 if (unlikely(!meth)) return NULL;
31400#else
31401 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
31402#endif
31403 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
31404 case 1:
31405 self = args[0];
31406 args += 1;
31407 nargs -= 1;
31408 break;
31409 case 0:
31410 self = func;
31411 break;
31412 default:
31413 return NULL;
31414 }
31415 if (unlikely(nargs != 0)) {
31416 __Pyx_CyFunction_raise_argument_count_error(
31417 func, "takes no arguments", nargs);
31418 return NULL;
31419 }
31420 return meth(self, NULL);
31421}
31422static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
31423{
31424 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
31425 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
31426 PyObject *self;
31427#if CYTHON_COMPILING_IN_LIMITED_API
31428 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
31429 if (unlikely(!meth)) return NULL;
31430#else
31431 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
31432#endif
31433 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
31434 case 1:
31435 self = args[0];
31436 args += 1;
31437 nargs -= 1;
31438 break;
31439 case 0:
31440 self = func;
31441 break;
31442 default:
31443 return NULL;
31444 }
31445 if (unlikely(nargs != 1)) {
31446 __Pyx_CyFunction_raise_argument_count_error(
31447 func, "takes exactly one argument", nargs);
31448 return NULL;
31449 }
31450 return meth(self, args[0]);
31451}
31452static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
31453{
31454 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
31455 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
31456 PyObject *self;
31457#if CYTHON_COMPILING_IN_LIMITED_API
31458 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
31459 if (unlikely(!meth)) return NULL;
31460#else
31461 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
31462#endif
31463 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
31464 case 1:
31465 self = args[0];
31466 args += 1;
31467 nargs -= 1;
31468 break;
31469 case 0:
31470 self = func;
31471 break;
31472 default:
31473 return NULL;
31474 }
31475 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
31476}
31477static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
31478{
31479 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
31480 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
31481 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
31482 PyObject *self;
31483#if CYTHON_COMPILING_IN_LIMITED_API
31484 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
31485 if (unlikely(!meth)) return NULL;
31486#else
31487 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
31488#endif
31489 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
31490 case 1:
31491 self = args[0];
31492 args += 1;
31493 nargs -= 1;
31494 break;
31495 case 0:
31496 self = func;
31497 break;
31498 default:
31499 return NULL;
31500 }
31501 #if PY_VERSION_HEX < 0x030e00A6
31502 size_t nargs_value = (size_t) nargs;
31503 #else
31504 Py_ssize_t nargs_value = nargs;
31505 #endif
31506 return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
31507}
31508#endif
31509static PyType_Slot __pyx_CyFunctionType_slots[] = {
31510 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
31511 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
31512 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
31513 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
31514 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
31515 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
31516 {Py_tp_members, (void *)__pyx_CyFunction_members},
31517 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
31518 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
31519 {0, 0},
31520};
31521static PyType_Spec __pyx_CyFunctionType_spec = {
31522 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
31523 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
31524 0,
31525#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
31526 Py_TPFLAGS_METHOD_DESCRIPTOR |
31527#endif
31528#if CYTHON_VECTORCALL
31529#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
31530 Py_TPFLAGS_HAVE_VECTORCALL |
31531#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
31532 _Py_TPFLAGS_HAVE_VECTORCALL |
31533#endif
31534#endif // CYTHON_VECTORCALL
31535#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
31536 Py_TPFLAGS_MANAGED_DICT |
31537#endif
31538 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
31539 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
31540 __pyx_CyFunctionType_slots
31541};
31542static int __pyx_CyFunction_init(PyObject *module) {
31543 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
31544 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
31545 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
31546 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
31547 return -1;
31548 }
31549 return 0;
31550}
31551
31552/* CythonFunction */
31553static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
31554 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
31555 (void)&__Pyx_Get_CyFunction_Type;
31556 PyObject *op = __Pyx_CyFunction_Init(
31557 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
31558 ml, flags, qualname, closure, module, globals, code
31559 );
31560 if (likely(op)) {
31561 PyObject_GC_Track(op);
31562 }
31563 return op;
31564}
31565static PyTypeObject *__Pyx_Get_CyFunction_Type(void) {
31566 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
31567 Py_INCREF((PyObject*)tp);
31568 return tp;
31569}
31570
31571/* CLineInTraceback (used by AddTraceback) */
31572#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
31573#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
31574#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
31575#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
31576#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
31577#else
31578PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
31579 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
31580 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
31581}
31582#endif
31583static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
31584 PyObject *use_cline = NULL;
31585 PyObject *ptype, *pvalue, *ptraceback;
31586 PyObject *cython_runtime_dict;
31587 CYTHON_MAYBE_UNUSED_VAR(tstate);
31588 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
31589 return c_line;
31590 }
31591 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
31592 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
31593 if (likely(cython_runtime_dict)) {
31594 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
31595 use_cline, cython_runtime_dict,
31596 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
31597 }
31598 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
31599 c_line = 0;
31600 }
31601 Py_XDECREF(use_cline);
31602 Py_XDECREF(cython_runtime_dict);
31603 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
31604 return c_line;
31605}
31606#endif
31607
31608/* CodeObjectCache (used by AddTraceback) */
31609static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
31610 int start = 0, mid = 0, end = count - 1;
31611 if (end >= 0 && code_line > entries[end].code_line) {
31612 return count;
31613 }
31614 while (start < end) {
31615 mid = start + (end - start) / 2;
31616 if (code_line < entries[mid].code_line) {
31617 end = mid;
31618 } else if (code_line > entries[mid].code_line) {
31619 start = mid + 1;
31620 } else {
31621 return mid;
31622 }
31623 }
31624 if (code_line <= entries[mid].code_line) {
31625 return mid;
31626 } else {
31627 return mid + 1;
31628 }
31629}
31630static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
31631 __Pyx_CachedCodeObjectType* code_object;
31632 int pos;
31633 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
31634 return NULL;
31635 }
31636 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
31637 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
31638 return NULL;
31639 }
31640 code_object = code_cache->entries[pos].code_object;
31641 Py_INCREF(code_object);
31642 return code_object;
31643}
31644static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
31645#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
31646 (void)__pyx__find_code_object;
31647 return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
31648#else
31649 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
31650#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
31651 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
31652 if (old_count < 0) {
31653 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
31654 return NULL;
31655 }
31656#endif
31657 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
31658#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
31659 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
31660#endif
31661 return result;
31662#endif
31663}
31664static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
31665{
31666 int pos, i;
31667 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
31668 if (unlikely(!code_line)) {
31669 return;
31670 }
31671 if (unlikely(!entries)) {
31672 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
31673 if (likely(entries)) {
31674 code_cache->entries = entries;
31675 code_cache->max_count = 64;
31676 code_cache->count = 1;
31677 entries[0].code_line = code_line;
31678 entries[0].code_object = code_object;
31679 Py_INCREF(code_object);
31680 }
31681 return;
31682 }
31683 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
31684 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
31685 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
31686 entries[pos].code_object = code_object;
31687 Py_INCREF(code_object);
31688 Py_DECREF(tmp);
31689 return;
31690 }
31691 if (code_cache->count == code_cache->max_count) {
31692 int new_max = code_cache->max_count + 64;
31693 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
31694 code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
31695 if (unlikely(!entries)) {
31696 return;
31697 }
31698 code_cache->entries = entries;
31699 code_cache->max_count = new_max;
31700 }
31701 for (i=code_cache->count; i>pos; i--) {
31702 entries[i] = entries[i-1];
31703 }
31704 entries[pos].code_line = code_line;
31705 entries[pos].code_object = code_object;
31706 code_cache->count++;
31707 Py_INCREF(code_object);
31708}
31709static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
31710#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
31711 (void)__pyx__insert_code_object;
31712 return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
31713#else
31714 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
31715#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
31716 __pyx_nonatomic_int_type expected = 0;
31717 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
31718 return;
31719 }
31720#endif
31721 __pyx__insert_code_object(code_cache, code_line, code_object);
31722#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
31723 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
31724#endif
31725#endif
31726}
31727
31728/* AddTraceback */
31729#include "compile.h"
31730#include "frameobject.h"
31731#include "traceback.h"
31732#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
31733 #ifndef Py_BUILD_CORE
31734 #define Py_BUILD_CORE 1
31735 #endif
31736 #include "internal/pycore_frame.h"
31737#endif
31738#if CYTHON_COMPILING_IN_LIMITED_API
31739static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
31740 PyObject *firstlineno, PyObject *name) {
31741 PyObject *replace = NULL;
31742 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
31743 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
31744 replace = PyObject_GetAttrString(code, "replace");
31745 if (likely(replace)) {
31746 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
31747 Py_DECREF(replace);
31748 return result;
31749 }
31750 return NULL;
31751}
31752static void __Pyx_AddTraceback(const char *funcname, int c_line,
31753 int py_line, const char *filename) {
31754 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
31755 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
31756 PyObject *exc_type, *exc_value, *exc_traceback;
31757 int success = 0;
31758 if (c_line) {
31759 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
31760 }
31761 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
31762 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
31763 if (!code_object) {
31764 code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
31765 if (unlikely(!code_object)) goto bad;
31766 py_py_line = PyLong_FromLong(py_line);
31767 if (unlikely(!py_py_line)) goto bad;
31768 if (c_line) {
31769 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
31770 } else {
31771 py_funcname = PyUnicode_FromString(funcname);
31772 }
31773 if (unlikely(!py_funcname)) goto bad;
31774 dict = PyDict_New();
31775 if (unlikely(!dict)) goto bad;
31776 {
31777 PyObject *old_code_object = code_object;
31778 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
31779 Py_DECREF(old_code_object);
31780 }
31781 if (unlikely(!code_object)) goto bad;
31782 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
31783 } else {
31784 dict = PyDict_New();
31785 }
31786 getframe = PySys_GetObject("_getframe");
31787 if (unlikely(!getframe)) goto bad;
31788 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
31789 frame = PyEval_EvalCode(code_object, dict, dict);
31790 if (unlikely(!frame) || frame == Py_None) goto bad;
31791 success = 1;
31792 bad:
31793 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
31794 Py_XDECREF(code_object);
31795 Py_XDECREF(py_py_line);
31796 Py_XDECREF(py_funcname);
31797 Py_XDECREF(dict);
31798 Py_XDECREF(replace);
31799 if (success) {
31800 PyTraceBack_Here(
31801 (struct _frame*)frame);
31802 }
31803 Py_XDECREF(frame);
31804}
31805#else
31806static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
31807 const char *funcname, int c_line,
31808 int py_line, const char *filename) {
31809 PyCodeObject *py_code = NULL;
31810 PyObject *py_funcname = NULL;
31811 if (c_line) {
31812 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
31813 if (!py_funcname) goto bad;
31814 funcname = PyUnicode_AsUTF8(py_funcname);
31815 if (!funcname) goto bad;
31816 }
31817 py_code = PyCode_NewEmpty(filename, funcname, py_line);
31818 Py_XDECREF(py_funcname);
31819 return py_code;
31820bad:
31821 Py_XDECREF(py_funcname);
31822 return NULL;
31823}
31824static void __Pyx_AddTraceback(const char *funcname, int c_line,
31825 int py_line, const char *filename) {
31826 PyCodeObject *py_code = 0;
31827 PyFrameObject *py_frame = 0;
31828 PyThreadState *tstate = __Pyx_PyThreadState_Current;
31829 PyObject *ptype, *pvalue, *ptraceback;
31830 if (c_line) {
31831 c_line = __Pyx_CLineForTraceback(tstate, c_line);
31832 }
31833 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
31834 if (!py_code) {
31835 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
31836 py_code = __Pyx_CreateCodeObjectForTraceback(
31837 funcname, c_line, py_line, filename);
31838 if (!py_code) {
31839 /* If the code object creation fails, then we should clear the
31840 fetched exception references and propagate the new exception */
31841 Py_XDECREF(ptype);
31842 Py_XDECREF(pvalue);
31843 Py_XDECREF(ptraceback);
31844 goto bad;
31845 }
31846 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
31847 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
31848 }
31849 py_frame = PyFrame_New(
31850 tstate, /*PyThreadState *tstate,*/
31851 py_code, /*PyCodeObject *code,*/
31852 __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/
31853 0 /*PyObject *locals*/
31854 );
31855 if (!py_frame) goto bad;
31856 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
31857 PyTraceBack_Here(py_frame);
31858bad:
31859 Py_XDECREF(py_code);
31860 Py_XDECREF(py_frame);
31861}
31862#endif
31863
31864/* CIntFromPyVerify */
31865#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
31866 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
31867#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
31868 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
31869#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
31870 {\
31871 func_type value = func_value;\
31872 if (sizeof(target_type) < sizeof(func_type)) {\
31873 if (unlikely(value != (func_type) (target_type) value)) {\
31874 func_type zero = 0;\
31875 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
31876 return (target_type) -1;\
31877 if (is_unsigned && unlikely(value < zero))\
31878 goto raise_neg_overflow;\
31879 else\
31880 goto raise_overflow;\
31881 }\
31882 }\
31883 return (target_type) value;\
31884 }
31885
31886/* MemviewDtypeToObject */
31887static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
31888 return (PyObject *) __Pyx_PyLong_From_int(*(int const *) itemp);
31889}
31890static CYTHON_INLINE int __pyx_memview_set_int(char *itemp, PyObject *obj) {
31891 int value = __Pyx_PyLong_As_int(obj);
31892 if (unlikely((value == (int)-1) && PyErr_Occurred()))
31893 return 0;
31894 *(int *) itemp = value;
31895 return 1;
31896}
31897
31898/* MemviewDtypeToObject */
31899static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
31900 return (PyObject *) PyFloat_FromDouble(*(double const *) itemp);
31901}
31902static CYTHON_INLINE int __pyx_memview_set_double(char *itemp, PyObject *obj) {
31903 double value = __Pyx_PyFloat_AsDouble(obj);
31904 if (unlikely((value == (double)-1) && PyErr_Occurred()))
31905 return 0;
31906 *(double *) itemp = value;
31907 return 1;
31908}
31909
31910/* Declarations */
31911#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
31912 #ifdef __cplusplus
31913 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
31914 return ::std::complex< float >(x, y);
31915 }
31916 #else
31917 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
31918 return x + y*(__pyx_t_float_complex)_Complex_I;
31919 }
31920 #endif
31921#else
31922 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
31923 __pyx_t_float_complex z;
31924 z.real = x;
31925 z.imag = y;
31926 return z;
31927 }
31928#endif
31929
31930/* Arithmetic */
31931#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
31932#else
31933 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31934 return (a.real == b.real) && (a.imag == b.imag);
31935 }
31936 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31937 __pyx_t_float_complex z;
31938 z.real = a.real + b.real;
31939 z.imag = a.imag + b.imag;
31940 return z;
31941 }
31942 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31943 __pyx_t_float_complex z;
31944 z.real = a.real - b.real;
31945 z.imag = a.imag - b.imag;
31946 return z;
31947 }
31948 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31949 __pyx_t_float_complex z;
31950 z.real = a.real * b.real - a.imag * b.imag;
31951 z.imag = a.real * b.imag + a.imag * b.real;
31952 return z;
31953 }
31954 #if 1
31955 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31956 if (b.imag == 0) {
31957 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
31958 } else if (fabsf(b.real) >= fabsf(b.imag)) {
31959 if (b.real == 0 && b.imag == 0) {
31960 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
31961 } else {
31962 float r = b.imag / b.real;
31963 float s = (float)(1.0) / (b.real + b.imag * r);
31964 return __pyx_t_float_complex_from_parts(
31965 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
31966 }
31967 } else {
31968 float r = b.real / b.imag;
31969 float s = (float)(1.0) / (b.imag + b.real * r);
31970 return __pyx_t_float_complex_from_parts(
31971 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
31972 }
31973 }
31974 #else
31975 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31976 if (b.imag == 0) {
31977 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
31978 } else {
31979 float denom = b.real * b.real + b.imag * b.imag;
31980 return __pyx_t_float_complex_from_parts(
31981 (a.real * b.real + a.imag * b.imag) / denom,
31982 (a.imag * b.real - a.real * b.imag) / denom);
31983 }
31984 }
31985 #endif
31986 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
31987 __pyx_t_float_complex z;
31988 z.real = -a.real;
31989 z.imag = -a.imag;
31990 return z;
31991 }
31992 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
31993 return (a.real == 0) && (a.imag == 0);
31994 }
31995 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
31996 __pyx_t_float_complex z;
31997 z.real = a.real;
31998 z.imag = -a.imag;
31999 return z;
32000 }
32001 #if 1
32002 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
32003 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
32004 return sqrtf(z.real*z.real + z.imag*z.imag);
32005 #else
32006 return hypotf(z.real, z.imag);
32007 #endif
32008 }
32009 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
32010 __pyx_t_float_complex z;
32011 float r, lnr, theta, z_r, z_theta;
32012 if (b.imag == 0 && b.real == (int)b.real) {
32013 if (b.real < 0) {
32014 float denom = a.real * a.real + a.imag * a.imag;
32015 a.real = a.real / denom;
32016 a.imag = -a.imag / denom;
32017 b.real = -b.real;
32018 }
32019 switch ((int)b.real) {
32020 case 0:
32021 z.real = 1;
32022 z.imag = 0;
32023 return z;
32024 case 1:
32025 return a;
32026 case 2:
32027 return __Pyx_c_prod_float(a, a);
32028 case 3:
32029 z = __Pyx_c_prod_float(a, a);
32030 return __Pyx_c_prod_float(z, a);
32031 case 4:
32032 z = __Pyx_c_prod_float(a, a);
32033 return __Pyx_c_prod_float(z, z);
32034 }
32035 }
32036 if (a.imag == 0) {
32037 if (a.real == 0) {
32038 return a;
32039 } else if ((b.imag == 0) && (a.real >= 0)) {
32040 z.real = powf(a.real, b.real);
32041 z.imag = 0;
32042 return z;
32043 } else if (a.real > 0) {
32044 r = a.real;
32045 theta = 0;
32046 } else {
32047 r = -a.real;
32048 theta = atan2f(0.0, -1.0);
32049 }
32050 } else {
32051 r = __Pyx_c_abs_float(a);
32052 theta = atan2f(a.imag, a.real);
32053 }
32054 lnr = logf(r);
32055 z_r = expf(lnr * b.real - theta * b.imag);
32056 z_theta = theta * b.real + lnr * b.imag;
32057 z.real = z_r * cosf(z_theta);
32058 z.imag = z_r * sinf(z_theta);
32059 return z;
32060 }
32061 #endif
32062#endif
32063
32064/* Declarations */
32065#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
32066 #ifdef __cplusplus
32067 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
32068 return ::std::complex< double >(x, y);
32069 }
32070 #else
32071 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
32072 return x + y*(__pyx_t_double_complex)_Complex_I;
32073 }
32074 #endif
32075#else
32076 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
32077 __pyx_t_double_complex z;
32078 z.real = x;
32079 z.imag = y;
32080 return z;
32081 }
32082#endif
32083
32084/* Arithmetic */
32085#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
32086#else
32087 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32088 return (a.real == b.real) && (a.imag == b.imag);
32089 }
32090 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32091 __pyx_t_double_complex z;
32092 z.real = a.real + b.real;
32093 z.imag = a.imag + b.imag;
32094 return z;
32095 }
32096 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32097 __pyx_t_double_complex z;
32098 z.real = a.real - b.real;
32099 z.imag = a.imag - b.imag;
32100 return z;
32101 }
32102 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32103 __pyx_t_double_complex z;
32104 z.real = a.real * b.real - a.imag * b.imag;
32105 z.imag = a.real * b.imag + a.imag * b.real;
32106 return z;
32107 }
32108 #if 1
32109 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32110 if (b.imag == 0) {
32111 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
32112 } else if (fabs(b.real) >= fabs(b.imag)) {
32113 if (b.real == 0 && b.imag == 0) {
32114 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
32115 } else {
32116 double r = b.imag / b.real;
32117 double s = (double)(1.0) / (b.real + b.imag * r);
32118 return __pyx_t_double_complex_from_parts(
32119 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
32120 }
32121 } else {
32122 double r = b.real / b.imag;
32123 double s = (double)(1.0) / (b.imag + b.real * r);
32124 return __pyx_t_double_complex_from_parts(
32125 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
32126 }
32127 }
32128 #else
32129 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32130 if (b.imag == 0) {
32131 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
32132 } else {
32133 double denom = b.real * b.real + b.imag * b.imag;
32134 return __pyx_t_double_complex_from_parts(
32135 (a.real * b.real + a.imag * b.imag) / denom,
32136 (a.imag * b.real - a.real * b.imag) / denom);
32137 }
32138 }
32139 #endif
32140 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
32141 __pyx_t_double_complex z;
32142 z.real = -a.real;
32143 z.imag = -a.imag;
32144 return z;
32145 }
32146 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
32147 return (a.real == 0) && (a.imag == 0);
32148 }
32149 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
32150 __pyx_t_double_complex z;
32151 z.real = a.real;
32152 z.imag = -a.imag;
32153 return z;
32154 }
32155 #if 1
32156 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
32157 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
32158 return sqrt(z.real*z.real + z.imag*z.imag);
32159 #else
32160 return hypot(z.real, z.imag);
32161 #endif
32162 }
32163 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32164 __pyx_t_double_complex z;
32165 double r, lnr, theta, z_r, z_theta;
32166 if (b.imag == 0 && b.real == (int)b.real) {
32167 if (b.real < 0) {
32168 double denom = a.real * a.real + a.imag * a.imag;
32169 a.real = a.real / denom;
32170 a.imag = -a.imag / denom;
32171 b.real = -b.real;
32172 }
32173 switch ((int)b.real) {
32174 case 0:
32175 z.real = 1;
32176 z.imag = 0;
32177 return z;
32178 case 1:
32179 return a;
32180 case 2:
32181 return __Pyx_c_prod_double(a, a);
32182 case 3:
32183 z = __Pyx_c_prod_double(a, a);
32184 return __Pyx_c_prod_double(z, a);
32185 case 4:
32186 z = __Pyx_c_prod_double(a, a);
32187 return __Pyx_c_prod_double(z, z);
32188 }
32189 }
32190 if (a.imag == 0) {
32191 if (a.real == 0) {
32192 return a;
32193 } else if ((b.imag == 0) && (a.real >= 0)) {
32194 z.real = pow(a.real, b.real);
32195 z.imag = 0;
32196 return z;
32197 } else if (a.real > 0) {
32198 r = a.real;
32199 theta = 0;
32200 } else {
32201 r = -a.real;
32202 theta = atan2(0.0, -1.0);
32203 }
32204 } else {
32205 r = __Pyx_c_abs_double(a);
32206 theta = atan2(a.imag, a.real);
32207 }
32208 lnr = log(r);
32209 z_r = exp(lnr * b.real - theta * b.imag);
32210 z_theta = theta * b.real + lnr * b.imag;
32211 z.real = z_r * cos(z_theta);
32212 z.imag = z_r * sin(z_theta);
32213 return z;
32214 }
32215 #endif
32216#endif
32217
32218/* Declarations */
32219#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
32220 #ifdef __cplusplus
32221 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
32222 return ::std::complex< long double >(x, y);
32223 }
32224 #else
32225 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
32226 return x + y*(__pyx_t_long_double_complex)_Complex_I;
32227 }
32228 #endif
32229#else
32230 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
32231 __pyx_t_long_double_complex z;
32232 z.real = x;
32233 z.imag = y;
32234 return z;
32235 }
32236#endif
32237
32238/* Arithmetic */
32239#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
32240#else
32241 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32242 return (a.real == b.real) && (a.imag == b.imag);
32243 }
32244 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32245 __pyx_t_long_double_complex z;
32246 z.real = a.real + b.real;
32247 z.imag = a.imag + b.imag;
32248 return z;
32249 }
32250 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32251 __pyx_t_long_double_complex z;
32252 z.real = a.real - b.real;
32253 z.imag = a.imag - b.imag;
32254 return z;
32255 }
32256 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32257 __pyx_t_long_double_complex z;
32258 z.real = a.real * b.real - a.imag * b.imag;
32259 z.imag = a.real * b.imag + a.imag * b.real;
32260 return z;
32261 }
32262 #if 1
32263 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32264 if (b.imag == 0) {
32265 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
32266 } else if (fabsl(b.real) >= fabsl(b.imag)) {
32267 if (b.real == 0 && b.imag == 0) {
32268 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
32269 } else {
32270 long double r = b.imag / b.real;
32271 long double s = (long double)(1.0) / (b.real + b.imag * r);
32272 return __pyx_t_long_double_complex_from_parts(
32273 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
32274 }
32275 } else {
32276 long double r = b.real / b.imag;
32277 long double s = (long double)(1.0) / (b.imag + b.real * r);
32278 return __pyx_t_long_double_complex_from_parts(
32279 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
32280 }
32281 }
32282 #else
32283 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32284 if (b.imag == 0) {
32285 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
32286 } else {
32287 long double denom = b.real * b.real + b.imag * b.imag;
32288 return __pyx_t_long_double_complex_from_parts(
32289 (a.real * b.real + a.imag * b.imag) / denom,
32290 (a.imag * b.real - a.real * b.imag) / denom);
32291 }
32292 }
32293 #endif
32294 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
32295 __pyx_t_long_double_complex z;
32296 z.real = -a.real;
32297 z.imag = -a.imag;
32298 return z;
32299 }
32300 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
32301 return (a.real == 0) && (a.imag == 0);
32302 }
32303 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
32304 __pyx_t_long_double_complex z;
32305 z.real = a.real;
32306 z.imag = -a.imag;
32307 return z;
32308 }
32309 #if 1
32310 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
32311 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
32312 return sqrtl(z.real*z.real + z.imag*z.imag);
32313 #else
32314 return hypotl(z.real, z.imag);
32315 #endif
32316 }
32317 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32318 __pyx_t_long_double_complex z;
32319 long double r, lnr, theta, z_r, z_theta;
32320 if (b.imag == 0 && b.real == (int)b.real) {
32321 if (b.real < 0) {
32322 long double denom = a.real * a.real + a.imag * a.imag;
32323 a.real = a.real / denom;
32324 a.imag = -a.imag / denom;
32325 b.real = -b.real;
32326 }
32327 switch ((int)b.real) {
32328 case 0:
32329 z.real = 1;
32330 z.imag = 0;
32331 return z;
32332 case 1:
32333 return a;
32334 case 2:
32335 return __Pyx_c_prod_long__double(a, a);
32336 case 3:
32337 z = __Pyx_c_prod_long__double(a, a);
32338 return __Pyx_c_prod_long__double(z, a);
32339 case 4:
32340 z = __Pyx_c_prod_long__double(a, a);
32341 return __Pyx_c_prod_long__double(z, z);
32342 }
32343 }
32344 if (a.imag == 0) {
32345 if (a.real == 0) {
32346 return a;
32347 } else if ((b.imag == 0) && (a.real >= 0)) {
32348 z.real = powl(a.real, b.real);
32349 z.imag = 0;
32350 return z;
32351 } else if (a.real > 0) {
32352 r = a.real;
32353 theta = 0;
32354 } else {
32355 r = -a.real;
32356 theta = atan2l(0.0, -1.0);
32357 }
32358 } else {
32359 r = __Pyx_c_abs_long__double(a);
32360 theta = atan2l(a.imag, a.real);
32361 }
32362 lnr = logl(r);
32363 z_r = expl(lnr * b.real - theta * b.imag);
32364 z_theta = theta * b.real + lnr * b.imag;
32365 z.real = z_r * cosl(z_theta);
32366 z.imag = z_r * sinl(z_theta);
32367 return z;
32368 }
32369 #endif
32370#endif
32371
32372/* MemviewRefcount */
32373#include <stdio.h>
32374#ifndef _Py_NO_RETURN
32375#define _Py_NO_RETURN
32376#endif
32377_Py_NO_RETURN
32378static void __pyx_fatalerror(const char *fmt, ...) {
32379 va_list vargs;
32380 char msg[200];
32381#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
32382 va_start(vargs, fmt);
32383#else
32384 va_start(vargs);
32385#endif
32386 vsnprintf(msg, 200, fmt, vargs);
32387 va_end(vargs);
32388 Py_FatalError(msg);
32389}
32390static CYTHON_INLINE int
32391__pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
32392 PyThread_type_lock lock)
32393{
32394 int result;
32395 PyThread_acquire_lock(lock, 1);
32396 result = (*acquisition_count)++;
32397 PyThread_release_lock(lock);
32398 return result;
32399}
32400static CYTHON_INLINE int
32401__pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
32402 PyThread_type_lock lock)
32403{
32404 int result;
32405 PyThread_acquire_lock(lock, 1);
32406 result = (*acquisition_count)--;
32407 PyThread_release_lock(lock);
32408 return result;
32409}
32410static CYTHON_INLINE void
32411__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
32412{
32413 __pyx_nonatomic_int_type old_acquisition_count;
32414 struct __pyx_memoryview_obj *memview = memslice->memview;
32415 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
32416 return;
32417 }
32418 old_acquisition_count = __pyx_add_acquisition_count(memview);
32419 if (unlikely(old_acquisition_count <= 0)) {
32420 if (likely(old_acquisition_count == 0)) {
32421 if (have_gil) {
32422 Py_INCREF((PyObject *) memview);
32423 } else {
32424 PyGILState_STATE _gilstate = PyGILState_Ensure();
32425 Py_INCREF((PyObject *) memview);
32426 PyGILState_Release(_gilstate);
32427 }
32428 } else {
32429 __pyx_fatalerror("Acquisition count is %d (line %d)",
32430 old_acquisition_count+1, lineno);
32431 }
32432 }
32433}
32434static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
32435 int have_gil, int lineno) {
32436 __pyx_nonatomic_int_type old_acquisition_count;
32437 struct __pyx_memoryview_obj *memview = memslice->memview;
32438 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
32439 memslice->memview = NULL;
32440 return;
32441 }
32442 old_acquisition_count = __pyx_sub_acquisition_count(memview);
32443 memslice->data = NULL;
32444 if (likely(old_acquisition_count > 1)) {
32445 memslice->memview = NULL;
32446 } else if (likely(old_acquisition_count == 1)) {
32447 if (have_gil) {
32448 Py_CLEAR(memslice->memview);
32449 } else {
32450 PyGILState_STATE _gilstate = PyGILState_Ensure();
32451 Py_CLEAR(memslice->memview);
32452 PyGILState_Release(_gilstate);
32453 }
32454 } else {
32455 __pyx_fatalerror("Acquisition count is %d (line %d)",
32456 old_acquisition_count-1, lineno);
32457 }
32458}
32459
32460/* MemviewSliceIsContig */
32461static int
32462__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
32463{
32464 int i, index, step, start;
32465 Py_ssize_t itemsize = mvs.memview->view.itemsize;
32466 if (order == 'F') {
32467 step = 1;
32468 start = 0;
32469 } else {
32470 step = -1;
32471 start = ndim - 1;
32472 }
32473 for (i = 0; i < ndim; i++) {
32474 index = start + step * i;
32475 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
32476 return 0;
32477 itemsize *= mvs.shape[index];
32478 }
32479 return 1;
32480}
32481
32482/* OverlappingSlices */
32483static void
32484__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
32485 void **out_start, void **out_end,
32486 int ndim, size_t itemsize)
32487{
32488 char *start, *end;
32489 int i;
32490 start = end = slice->data;
32491 for (i = 0; i < ndim; i++) {
32492 Py_ssize_t stride = slice->strides[i];
32493 Py_ssize_t extent = slice->shape[i];
32494 if (extent == 0) {
32495 *out_start = *out_end = start;
32496 return;
32497 } else {
32498 if (stride > 0)
32499 end += stride * (extent - 1);
32500 else
32501 start += stride * (extent - 1);
32502 }
32503 }
32504 *out_start = start;
32505 *out_end = end + itemsize;
32506}
32507static int
32508__pyx_slices_overlap(__Pyx_memviewslice *slice1,
32509 __Pyx_memviewslice *slice2,
32510 int ndim, size_t itemsize)
32511{
32512 void *start1, *end1, *start2, *end2;
32513 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
32514 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
32515 return (start1 < end2) && (start2 < end1);
32516}
32517
32518/* MemviewSliceInit */
32519static int
32520__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
32521 int ndim,
32522 __Pyx_memviewslice *memviewslice,
32523 int memview_is_new_reference)
32524{
32525 __Pyx_RefNannyDeclarations
32526 int i, retval=-1;
32527 Py_buffer *buf = &memview->view;
32528 __Pyx_RefNannySetupContext("init_memviewslice", 0);
32529 if (unlikely(memviewslice->memview || memviewslice->data)) {
32530 PyErr_SetString(PyExc_ValueError,
32531 "memviewslice is already initialized!");
32532 goto fail;
32533 }
32534 if (buf->strides) {
32535 for (i = 0; i < ndim; i++) {
32536 memviewslice->strides[i] = buf->strides[i];
32537 }
32538 } else {
32539 Py_ssize_t stride = buf->itemsize;
32540 for (i = ndim - 1; i >= 0; i--) {
32541 memviewslice->strides[i] = stride;
32542 stride *= buf->shape[i];
32543 }
32544 }
32545 for (i = 0; i < ndim; i++) {
32546 memviewslice->shape[i] = buf->shape[i];
32547 if (buf->suboffsets) {
32548 memviewslice->suboffsets[i] = buf->suboffsets[i];
32549 } else {
32550 memviewslice->suboffsets[i] = -1;
32551 }
32552 }
32553 memviewslice->memview = memview;
32554 memviewslice->data = (char *)buf->buf;
32555 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
32556 Py_INCREF((PyObject*)memview);
32557 }
32558 retval = 0;
32559 goto no_fail;
32560fail:
32561 memviewslice->memview = 0;
32562 memviewslice->data = 0;
32563 retval = -1;
32564no_fail:
32565 __Pyx_RefNannyFinishContext();
32566 return retval;
32567}
32568
32569/* SliceMemoryviewSlice */
32570static void __pyx_memoryview_slice_memviewslice_err_dim(PyObject *error, const char* msg, int dim) {
32571 PyGILState_STATE gilstate = PyGILState_Ensure();
32572 PyErr_Format(error, msg, dim);
32573 PyGILState_Release(gilstate);
32574}
32575static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
32576 __Pyx_memviewslice *dst,
32577 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
32578 int dim, int new_ndim, int *suboffset_dim,
32579 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
32580 int have_start, int have_stop, int have_step,
32581 int is_slice) {
32582 if (!is_slice) {
32583 if (start < 0) {
32584 start += shape;
32585 }
32586 if (unlikely(!(0 <= start && start < shape))) {
32587 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim);
32588 return -1;
32589 }
32590 } else {
32591 int negative_step;
32592 if (have_step) {
32593 negative_step = step < 0;
32594 if (unlikely(step == 0)) {
32595 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim);
32596 return -1;
32597 }
32598 } else {
32599 negative_step = 0;
32600 step = 1;
32601 }
32602 if (have_start) {
32603 if (start < 0) {
32604 start += shape;
32605 if (start < 0) {
32606 start = 0;
32607 }
32608 } else if (start >= shape) {
32609 start = negative_step ? (shape - 1) : shape;
32610 }
32611 } else {
32612 start = negative_step ? (shape - 1) : 0;
32613 }
32614 if (have_stop) {
32615 if (stop < 0) {
32616 stop += shape;
32617 if (stop < 0) {
32618 stop = 0;
32619 }
32620 } else if (stop > shape) {
32621 stop = shape;
32622 }
32623 } else {
32624 stop = negative_step ? -1 : shape;
32625 }
32626 Py_ssize_t new_shape = (stop - start) / step;
32627 if ((stop - start) - step * new_shape) {
32628 ++new_shape;
32629 }
32630 if (new_shape < 0) {
32631 new_shape = 0;
32632 }
32633 dst->strides[new_ndim] = stride * step;
32634 dst->shape[new_ndim] = new_shape;
32635 dst->suboffsets[new_ndim] = suboffset;
32636 }
32637 if (suboffset_dim[0] < 0) {
32638 dst->data += start * stride;
32639 } else {
32640 dst->suboffsets[suboffset_dim[0]] += start * stride;
32641 }
32642 if (suboffset >= 0) {
32643 if (!is_slice) {
32644 if (likely(new_ndim == 0)) {
32645 dst->data = ((char **)(dst->data))[0] + suboffset;
32646 } else {
32647 __pyx_memoryview_slice_memviewslice_err_dim(
32648 PyExc_IndexError,
32649 "All dimensions preceding dimension %d must be indexed and not sliced",
32650 dim);
32651 return -1;
32652 }
32653 } else {
32654 suboffset_dim[0] = new_ndim;
32655 }
32656 }
32657 return 0;
32658}
32659
32660/* CIntFromPy */
32661static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
32662static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(void) {
32663 const char* type_name = "int";
32664 PyErr_Format(PyExc_OverflowError,
32665 "can't convert negative value to %.200s", type_name);
32666 return (int) -1;
32667}
32668static int __Pyx_raise_overflow___Pyx_PyLong_As_int(void) {
32669 const char* type_name = "int";
32670 PyErr_Format(PyExc_OverflowError,
32671 "value too large to convert to %.200s", type_name);
32672 return (int) -1;
32673}
32674static CYTHON_INLINE int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
32675 const int is_unsigned = 1;
32676#if CYTHON_USE_PYLONG_INTERNALS
32677 {
32678 const digit* digits = __Pyx_PyLong_Digits(x);
32679 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
32680 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
32681 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
32682 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32683 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
32684 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32685 }
32686 } else
32687 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
32688 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
32689 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32690 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
32691 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32692 }
32693 } else
32694 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
32695 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
32696 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32697 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
32698 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32699 }
32700 } else
32701 {}
32702 }
32703#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
32704 if (unlikely(Py_SIZE(x) < 0)) {
32705 goto raise_neg_overflow;
32706 }
32707#else
32708 {
32709 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32710 if (unlikely(result < 0))
32711 return (int) -1;
32712 if (unlikely(result == 1))
32713 goto raise_neg_overflow;
32714 }
32715#endif
32716 if ((sizeof(int) <= sizeof(unsigned long))) {
32717 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
32718 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
32719 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32720 }
32721 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
32722raise_neg_overflow:
32723 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
32724raise_overflow:
32725 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
32726}
32727static CYTHON_INLINE int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
32728 const int is_unsigned = 0;
32729#if CYTHON_USE_PYLONG_INTERNALS
32730 if (__Pyx_PyLong_IsNeg(x)) {
32731 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
32732 const digit* digits = __Pyx_PyLong_Digits(x);
32733 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
32734 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
32735 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
32736 __PYX_VERIFY_RETURN_INT(int, long, ival)
32737 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
32738 return (int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32739 }
32740 } else
32741 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
32742 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
32743 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
32744 __PYX_VERIFY_RETURN_INT(int, long, ival)
32745 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
32746 return (int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32747 }
32748 } else
32749 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
32750 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
32751 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
32752 __PYX_VERIFY_RETURN_INT(int, long, ival)
32753 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
32754 return (int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32755 }
32756 } else
32757 {}
32758 } else {
32759 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
32760 const digit* digits = __Pyx_PyLong_Digits(x);
32761 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
32762 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
32763 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32764 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
32765 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32766 }
32767 } else
32768 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
32769 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
32770 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32771 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
32772 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32773 }
32774 } else
32775 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
32776 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
32777 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32778 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
32779 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32780 }
32781 } else
32782 {}
32783 }
32784#endif
32785 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
32786 if ((sizeof(int) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
32787 __PYX_VERIFY_RETURN_INT_EXC(int, int, PyLong_AsInt(x))
32788 } else
32789 #endif
32790 if ((sizeof(int) <= sizeof(long))) {
32791 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
32792 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
32793 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
32794 }
32795 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
32796raise_neg_overflow:
32797 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
32798raise_overflow:
32799 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
32800}
32801static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
32802#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32803#pragma GCC diagnostic push
32804#pragma GCC diagnostic ignored "-Wconversion"
32805#endif
32806 const int neg_one = (int) -1, const_zero = (int) 0;
32807#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32808#pragma GCC diagnostic pop
32809#endif
32810 const int is_unsigned = neg_one > const_zero;
32811 int val;
32812 int ret = -1;
32813#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
32814 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
32815 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
32816 if (unlikely(bytes_copied == -1)) {
32817 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
32818 goto raise_overflow;
32819 } else {
32820 ret = 0;
32821 }
32822#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
32823 int one = 1; int is_little = (int)*(unsigned char *)&one;
32824 unsigned char *bytes = (unsigned char *)&val;
32825 ret = _PyLong_AsByteArray((PyLongObject *)x,
32826 bytes, sizeof(val),
32827 is_little, !is_unsigned);
32828 if ((0)) goto raise_overflow;
32829#else
32830 PyObject *v;
32831 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
32832 int bits, remaining_bits, is_negative = 0;
32833 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
32834 if (likely(PyLong_CheckExact(x))) {
32835 v = __Pyx_NewRef(x);
32836 } else {
32837 v = PyNumber_Long(x);
32838 if (unlikely(!v)) return (int) -1;
32839 assert(PyLong_CheckExact(v));
32840 }
32841 {
32842 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
32843 if (unlikely(result < 0)) {
32844 Py_DECREF(v);
32845 return (int) -1;
32846 }
32847 is_negative = result == 1;
32848 }
32849 if (is_unsigned && unlikely(is_negative)) {
32850 Py_DECREF(v);
32851 PyErr_SetString(PyExc_OverflowError,
32852 "can't convert negative value to int");
32853 return (int) -1;
32854 } else if (is_negative) {
32855 stepval = PyNumber_Invert(v);
32856 Py_DECREF(v);
32857 if (unlikely(!stepval))
32858 return (int) -1;
32859 } else {
32860 stepval = v;
32861 }
32862 v = NULL;
32863 val = (int) 0;
32864 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
32865 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
32866 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
32867 PyObject *tmp, *digit;
32868 long idigit;
32869 digit = PyNumber_And(stepval, mask);
32870 if (unlikely(!digit)) goto done;
32871 idigit = PyLong_AsLong(digit);
32872 Py_DECREF(digit);
32873 if (unlikely(idigit < 0)) goto done;
32874 val |= ((int) idigit) << bits;
32875 tmp = PyNumber_Rshift(stepval, shift);
32876 if (unlikely(!tmp)) goto done;
32877 Py_DECREF(stepval); stepval = tmp;
32878 }
32879 Py_DECREF(shift); shift = NULL;
32880 Py_DECREF(mask); mask = NULL;
32881 {
32882 long idigit = PyLong_AsLong(stepval);
32883 if (unlikely(idigit < 0)) goto done;
32884 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
32885 if (unlikely(idigit >= (1L << remaining_bits)))
32886 goto raise_overflow;
32887 val |= ((int) idigit) << bits;
32888 }
32889 if (!is_unsigned) {
32890 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
32891 goto raise_overflow;
32892 if (is_negative)
32893 val = ~val;
32894 }
32895 ret = 0;
32896done:
32897 Py_XDECREF(shift);
32898 Py_XDECREF(mask);
32899 Py_XDECREF(stepval);
32900#endif
32901 if (unlikely(ret))
32902 return (int) -1;
32903 return val;
32904raise_overflow:
32905 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
32906}
32907static CYTHON_INLINE int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
32908#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32909#pragma GCC diagnostic push
32910#pragma GCC diagnostic ignored "-Wconversion"
32911#endif
32912 const int neg_one = (int) -1, const_zero = (int) 0;
32913#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32914#pragma GCC diagnostic pop
32915#endif
32916 const int is_unsigned = neg_one > const_zero;
32917 if (is_unsigned) {
32918 #if CYTHON_USE_PYLONG_INTERNALS
32919 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
32920 goto raise_neg_overflow;
32921 } else if (__Pyx_PyLong_IsCompact(x)) {
32922 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
32923 } else
32924 #endif
32925 {
32926 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
32927 }
32928 } else {
32929 #if CYTHON_USE_PYLONG_INTERNALS
32930 if (__Pyx_PyLong_IsCompact(x)) {
32931 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
32932 } else
32933 #endif
32934 {
32935 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
32936 }
32937 }
32938#if CYTHON_USE_PYLONG_INTERNALS
32939raise_neg_overflow:
32940 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
32941raise_overflow:
32942 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
32943#endif
32944}
32945static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
32946 int val;
32947 PyObject *tmp = __Pyx_PyNumber_Long(x);
32948 if (!tmp) return (int) -1;
32949 val = __Pyx_PyLong_As_int(tmp);
32950 Py_DECREF(tmp);
32951 return val;
32952}
32953static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
32954 if (likely(PyLong_Check(x))) {
32955 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
32956 } else {
32957 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
32958 }
32959}
32960
32961/* PyObjectVectorcallKwds (used by PyObjectVectorcallMethodKwds) */
32962#if CYTHON_VECTORCALL
32963CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
32964 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
32965#if !CYTHON_ASSUME_SAFE_MACROS
32966 if (unlikely(!key)) return -1;
32967#endif
32968 if (unlikely(!PyUnicode_Check(key))) {
32969 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
32970 return -1;
32971 }
32972 return 0;
32973}
32974#else
32975CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n) {
32976 PyObject *out = PyDict_New();
32977 if (unlikely(!out)) return NULL;
32978 for (Py_ssize_t i=0; i<n; ++i) {
32979 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
32980 Py_DECREF(out);
32981 return NULL;
32982 }
32983 }
32984 return out;
32985}
32986CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
32987 PyObject *key = kwnames[i];
32988 if (unlikely(!PyUnicode_Check(key))) {
32989 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
32990 return -1;
32991 }
32992 return 0;
32993}
32994#endif
32995
32996/* PyObjectVectorcallMethodKwds (used by CIntToPy) */
32997#if !CYTHON_VECTORCALL
32998static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
32999 PyObject *result;
33000 PyObject *obj = PyObject_GetAttr(args[0], name);
33001 if (unlikely(!obj))
33002 return NULL;
33003 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
33004 Py_DECREF(obj);
33005 return result;
33006}
33007#endif
33008
33009/* CIntToPy */
33010static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
33011#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33012#pragma GCC diagnostic push
33013#pragma GCC diagnostic ignored "-Wconversion"
33014#endif
33015 const int neg_one = (int) -1, const_zero = (int) 0;
33016#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33017#pragma GCC diagnostic pop
33018#endif
33019 const int is_unsigned = neg_one > const_zero;
33020 if (is_unsigned) {
33021 if (sizeof(int) < sizeof(long)) {
33022 return PyLong_FromLong((long) value);
33023 } else if (sizeof(int) <= sizeof(unsigned long)) {
33024 return PyLong_FromUnsignedLong((unsigned long) value);
33025#if !CYTHON_COMPILING_IN_PYPY
33026 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
33027 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
33028#endif
33029 }
33030 } else {
33031 if (sizeof(int) <= sizeof(long)) {
33032 return PyLong_FromLong((long) value);
33033 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
33034 return PyLong_FromLongLong((PY_LONG_LONG) value);
33035 }
33036 }
33037 {
33038 unsigned char *bytes = (unsigned char *)&value;
33039#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
33040 if (is_unsigned) {
33041 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
33042 } else {
33043 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
33044 }
33045#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
33046 int one = 1; int little = (int)*(unsigned char *)&one;
33047 return _PyLong_FromByteArray(bytes, sizeof(int),
33048 little, !is_unsigned);
33049#else
33050 int one = 1; int little = (int)*(unsigned char *)&one;
33051 PyObject *result = NULL, *kwds = NULL;
33052 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
33053 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
33054 if (!py_bytes) goto limited_bad;
33055 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
33056 if (!from_bytes_str) goto limited_bad;
33057 order_str = PyUnicode_FromString(little ? "little" : "big");
33058 if (!order_str) goto limited_bad;
33059 {
33060 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
33061 if (!is_unsigned) {
33062 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
33063 if (!signed_str) goto limited_bad;
33064#if CYTHON_VECTORCALL
33065 kwds = PyTuple_Pack(1, signed_str);
33066#else
33067 {
33068 PyObject *keys[] = {signed_str};
33069 PyObject *values[] = {Py_True};
33070 kwds = __Pyx_MakeKwargDict(keys, values, 1);
33071 }
33072#endif
33073 Py_DECREF(signed_str);
33074 if (unlikely(!kwds)) goto limited_bad;
33075 }
33076 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
33077 }
33078 limited_bad:
33079 Py_XDECREF(kwds);
33080 Py_XDECREF(order_str);
33081 Py_XDECREF(py_bytes);
33082 Py_XDECREF(from_bytes_str);
33083 return result;
33084#endif
33085 }
33086}
33087
33088/* TypeInfoToFormat */
33089static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(const __Pyx_TypeInfo *type) {
33090 struct __pyx_typeinfo_string result = { {0} };
33091 char *buf = (char *) result.string;
33092 size_t size = type->size;
33093 switch (type->typegroup) {
33094 case 'H':
33095 *buf = 'c';
33096 break;
33097 case 'I':
33098 case 'U':
33099 if (size == 1)
33100 *buf = (type->is_unsigned) ? 'B' : 'b';
33101 else if (size == 2)
33102 *buf = (type->is_unsigned) ? 'H' : 'h';
33103 else if (size == 4)
33104 *buf = (type->is_unsigned) ? 'I' : 'i';
33105 else if (size == 8)
33106 *buf = (type->is_unsigned) ? 'Q' : 'q';
33107 break;
33108 case 'P':
33109 *buf = 'P';
33110 break;
33111 case 'C':
33112 {
33113 __Pyx_TypeInfo complex_type = *type;
33114 complex_type.typegroup = 'R';
33115 complex_type.size /= 2;
33116 *buf++ = 'Z';
33117 *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
33118 break;
33119 }
33120 case 'R':
33121 if (size == 4)
33122 *buf = 'f';
33123 else if (size == 8)
33124 *buf = 'd';
33125 else
33126 *buf = 'g';
33127 break;
33128 }
33129 return result;
33130}
33131
33132/* MemviewSliceCopy */
33133static __Pyx_memviewslice
33134__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
33135 const char *mode, int ndim,
33136 Py_ssize_t sizeof_dtype, int contig_flag,
33137 int dtype_is_object)
33138{
33139 __Pyx_RefNannyDeclarations
33140 int i;
33141 __Pyx_memviewslice new_mvs = __Pyx_MEMSLICE_INIT;
33142 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
33143 Py_buffer *buf = &from_memview->view;
33144 PyObject *shape_tuple = NULL;
33145 struct __pyx_array_obj *array_obj = NULL;
33146 struct __pyx_memoryview_obj *memview_obj = NULL;
33147 __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
33148 for (i = 0; i < ndim; i++) {
33149 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
33150 PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
33151 "indirect dimensions (axis %d)", i);
33152 goto fail;
33153 }
33154 }
33155 shape_tuple = PyTuple_New(ndim);
33156 if (unlikely(!shape_tuple)) {
33157 goto fail;
33158 }
33159 __Pyx_GOTREF(shape_tuple);
33160 for(i = 0; i < ndim; i++) {
33161 PyObject *temp_int = PyLong_FromSsize_t(from_mvs->shape[i]);
33162 if(unlikely(!temp_int)) {
33163 goto fail;
33164 } else {
33165#if CYTHON_ASSUME_SAFE_MACROS
33166 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
33167#else
33168 if (PyTuple_SetItem(shape_tuple, i, temp_int) < 0) {
33169 goto fail;
33170 }
33171#endif
33172 }
33173 }
33174 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, mode, NULL);
33175 if (unlikely(!array_obj)) {
33176 goto fail;
33177 }
33178 __Pyx_GOTREF(array_obj);
33179 memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
33180 (PyObject *) array_obj, contig_flag,
33181 dtype_is_object,
33182 from_mvs->memview->typeinfo);
33183 if (unlikely(!memview_obj))
33184 goto fail;
33185 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
33186 goto fail;
33187 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
33188 dtype_is_object) < 0))
33189 goto fail;
33190 goto no_fail;
33191fail:
33192 __Pyx_XDECREF((PyObject *) new_mvs.memview);
33193 new_mvs.memview = NULL;
33194 new_mvs.data = NULL;
33195no_fail:
33196 __Pyx_XDECREF(shape_tuple);
33197 __Pyx_XDECREF((PyObject *) array_obj);
33198 __Pyx_RefNannyFinishContext();
33199 return new_mvs;
33200}
33201
33202/* UpdateUnpickledDict */
33203static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
33204 PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
33205 if (unlikely(!state_dict)) {
33206 return -1;
33207 }
33208 int non_empty = PyObject_IsTrue(state_dict);
33209 if (non_empty == 0) {
33210 Py_DECREF(state_dict);
33211 return 0;
33212 } else if (unlikely(non_empty == -1)) {
33213 return -1;
33214 }
33215 PyObject *dict;
33216 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33217 dict = PyObject_GetAttrString(obj, "__dict__");
33218 #else
33219 dict = PyObject_GenericGetDict(obj, NULL);
33220 #endif
33221 if (unlikely(!dict)) {
33222 Py_DECREF(state_dict);
33223 return -1;
33224 }
33225 int result;
33226 if (likely(PyDict_CheckExact(dict))) {
33227 result = PyDict_Update(dict, state_dict);
33228 } else {
33229 PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
33230 if (likely(obj_result)) {
33231 Py_DECREF(obj_result);
33232 result = 0;
33233 } else {
33234 result = -1;
33235 }
33236 }
33237 Py_DECREF(state_dict);
33238 Py_DECREF(dict);
33239 return result;
33240}
33241static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
33242 Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
33243 #if !CYTHON_ASSUME_SAFE_SIZE
33244 if (unlikely(state_size == -1)) return -1;
33245 #endif
33246 if (state_size <= index) {
33247 return 0;
33248 }
33249 return __Pyx__UpdateUnpickledDict(obj, state, index);
33250}
33251
33252/* CheckUnpickleChecksumError (used by CheckUnpickleChecksum) */
33253static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
33254 PyObject *pickle_module = PyImport_ImportModule("pickle");
33255 if (unlikely(!pickle_module)) return;
33256 PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
33257 Py_DECREF(pickle_module);
33258 if (unlikely(!pickle_error)) return;
33259 if (checksum2 == checksum1) {
33260 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
33261 checksum, checksum1, members);
33262 } else if (checksum3 == checksum2) {
33263 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
33264 checksum, checksum1, checksum2, members);
33265 } else {
33266 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
33267 checksum, checksum1, checksum2, checksum3, members);
33268 }
33269 Py_DECREF(pickle_error);
33270}
33271
33272/* CheckUnpickleChecksum */
33273static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
33274 int found = 0;
33275 found |= checksum1 == checksum;
33276 found |= checksum2 == checksum;
33277 found |= checksum3 == checksum;
33278 if (likely(found))
33279 return 0;
33280 __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
33281 return -1;
33282}
33283
33284/* CIntFromPy */
33285static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
33286static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(void) {
33287 const char* type_name = "long";
33288 PyErr_Format(PyExc_OverflowError,
33289 "can't convert negative value to %.200s", type_name);
33290 return (long) -1;
33291}
33292static long __Pyx_raise_overflow___Pyx_PyLong_As_long(void) {
33293 const char* type_name = "long";
33294 PyErr_Format(PyExc_OverflowError,
33295 "value too large to convert to %.200s", type_name);
33296 return (long) -1;
33297}
33298static CYTHON_INLINE long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
33299 const int is_unsigned = 1;
33300#if CYTHON_USE_PYLONG_INTERNALS
33301 {
33302 const digit* digits = __Pyx_PyLong_Digits(x);
33303 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33304 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
33305 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
33306 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33307 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
33308 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33309 }
33310 } else
33311 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
33312 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
33313 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33314 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
33315 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33316 }
33317 } else
33318 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
33319 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
33320 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33321 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
33322 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33323 }
33324 } else
33325 {}
33326 }
33327#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33328 if (unlikely(Py_SIZE(x) < 0)) {
33329 goto raise_neg_overflow;
33330 }
33331#else
33332 {
33333 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33334 if (unlikely(result < 0))
33335 return (long) -1;
33336 if (unlikely(result == 1))
33337 goto raise_neg_overflow;
33338 }
33339#endif
33340 if ((sizeof(long) <= sizeof(unsigned long))) {
33341 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
33342 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
33343 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33344 }
33345 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
33346raise_neg_overflow:
33347 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
33348raise_overflow:
33349 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
33350}
33351static CYTHON_INLINE long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
33352 const int is_unsigned = 0;
33353#if CYTHON_USE_PYLONG_INTERNALS
33354 if (__Pyx_PyLong_IsNeg(x)) {
33355 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33356 const digit* digits = __Pyx_PyLong_Digits(x);
33357 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
33358 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
33359 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
33360 __PYX_VERIFY_RETURN_INT(long, long, ival)
33361 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
33362 return (long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33363 }
33364 } else
33365 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
33366 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
33367 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
33368 __PYX_VERIFY_RETURN_INT(long, long, ival)
33369 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
33370 return (long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33371 }
33372 } else
33373 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
33374 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
33375 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
33376 __PYX_VERIFY_RETURN_INT(long, long, ival)
33377 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
33378 return (long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33379 }
33380 } else
33381 {}
33382 } else {
33383 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33384 const digit* digits = __Pyx_PyLong_Digits(x);
33385 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
33386 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
33387 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33388 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
33389 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33390 }
33391 } else
33392 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
33393 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
33394 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33395 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
33396 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33397 }
33398 } else
33399 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
33400 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
33401 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33402 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
33403 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33404 }
33405 } else
33406 {}
33407 }
33408#endif
33409 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
33410 if ((sizeof(long) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
33411 __PYX_VERIFY_RETURN_INT_EXC(long, int, PyLong_AsInt(x))
33412 } else
33413 #endif
33414 if ((sizeof(long) <= sizeof(long))) {
33415 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
33416 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
33417 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
33418 }
33419 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
33420raise_neg_overflow:
33421 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
33422raise_overflow:
33423 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
33424}
33425static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
33426#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33427#pragma GCC diagnostic push
33428#pragma GCC diagnostic ignored "-Wconversion"
33429#endif
33430 const long neg_one = (long) -1, const_zero = (long) 0;
33431#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33432#pragma GCC diagnostic pop
33433#endif
33434 const int is_unsigned = neg_one > const_zero;
33435 long val;
33436 int ret = -1;
33437#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
33438 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
33439 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
33440 if (unlikely(bytes_copied == -1)) {
33441 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
33442 goto raise_overflow;
33443 } else {
33444 ret = 0;
33445 }
33446#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
33447 int one = 1; int is_little = (int)*(unsigned char *)&one;
33448 unsigned char *bytes = (unsigned char *)&val;
33449 ret = _PyLong_AsByteArray((PyLongObject *)x,
33450 bytes, sizeof(val),
33451 is_little, !is_unsigned);
33452 if ((0)) goto raise_overflow;
33453#else
33454 PyObject *v;
33455 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
33456 int bits, remaining_bits, is_negative = 0;
33457 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
33458 if (likely(PyLong_CheckExact(x))) {
33459 v = __Pyx_NewRef(x);
33460 } else {
33461 v = PyNumber_Long(x);
33462 if (unlikely(!v)) return (long) -1;
33463 assert(PyLong_CheckExact(v));
33464 }
33465 {
33466 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
33467 if (unlikely(result < 0)) {
33468 Py_DECREF(v);
33469 return (long) -1;
33470 }
33471 is_negative = result == 1;
33472 }
33473 if (is_unsigned && unlikely(is_negative)) {
33474 Py_DECREF(v);
33475 PyErr_SetString(PyExc_OverflowError,
33476 "can't convert negative value to long");
33477 return (long) -1;
33478 } else if (is_negative) {
33479 stepval = PyNumber_Invert(v);
33480 Py_DECREF(v);
33481 if (unlikely(!stepval))
33482 return (long) -1;
33483 } else {
33484 stepval = v;
33485 }
33486 v = NULL;
33487 val = (long) 0;
33488 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
33489 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
33490 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
33491 PyObject *tmp, *digit;
33492 long idigit;
33493 digit = PyNumber_And(stepval, mask);
33494 if (unlikely(!digit)) goto done;
33495 idigit = PyLong_AsLong(digit);
33496 Py_DECREF(digit);
33497 if (unlikely(idigit < 0)) goto done;
33498 val |= ((long) idigit) << bits;
33499 tmp = PyNumber_Rshift(stepval, shift);
33500 if (unlikely(!tmp)) goto done;
33501 Py_DECREF(stepval); stepval = tmp;
33502 }
33503 Py_DECREF(shift); shift = NULL;
33504 Py_DECREF(mask); mask = NULL;
33505 {
33506 long idigit = PyLong_AsLong(stepval);
33507 if (unlikely(idigit < 0)) goto done;
33508 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
33509 if (unlikely(idigit >= (1L << remaining_bits)))
33510 goto raise_overflow;
33511 val |= ((long) idigit) << bits;
33512 }
33513 if (!is_unsigned) {
33514 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
33515 goto raise_overflow;
33516 if (is_negative)
33517 val = ~val;
33518 }
33519 ret = 0;
33520done:
33521 Py_XDECREF(shift);
33522 Py_XDECREF(mask);
33523 Py_XDECREF(stepval);
33524#endif
33525 if (unlikely(ret))
33526 return (long) -1;
33527 return val;
33528raise_overflow:
33529 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
33530}
33531static CYTHON_INLINE long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
33532#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33533#pragma GCC diagnostic push
33534#pragma GCC diagnostic ignored "-Wconversion"
33535#endif
33536 const long neg_one = (long) -1, const_zero = (long) 0;
33537#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33538#pragma GCC diagnostic pop
33539#endif
33540 const int is_unsigned = neg_one > const_zero;
33541 if (is_unsigned) {
33542 #if CYTHON_USE_PYLONG_INTERNALS
33543 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
33544 goto raise_neg_overflow;
33545 } else if (__Pyx_PyLong_IsCompact(x)) {
33546 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
33547 } else
33548 #endif
33549 {
33550 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
33551 }
33552 } else {
33553 #if CYTHON_USE_PYLONG_INTERNALS
33554 if (__Pyx_PyLong_IsCompact(x)) {
33555 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
33556 } else
33557 #endif
33558 {
33559 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
33560 }
33561 }
33562#if CYTHON_USE_PYLONG_INTERNALS
33563raise_neg_overflow:
33564 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
33565raise_overflow:
33566 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
33567#endif
33568}
33569static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
33570 long val;
33571 PyObject *tmp = __Pyx_PyNumber_Long(x);
33572 if (!tmp) return (long) -1;
33573 val = __Pyx_PyLong_As_long(tmp);
33574 Py_DECREF(tmp);
33575 return val;
33576}
33577static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
33578 if (likely(PyLong_Check(x))) {
33579 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
33580 } else {
33581 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
33582 }
33583}
33584
33585/* CIntToPy */
33586static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
33587#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33588#pragma GCC diagnostic push
33589#pragma GCC diagnostic ignored "-Wconversion"
33590#endif
33591 const long neg_one = (long) -1, const_zero = (long) 0;
33592#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33593#pragma GCC diagnostic pop
33594#endif
33595 const int is_unsigned = neg_one > const_zero;
33596 if (is_unsigned) {
33597 if (sizeof(long) < sizeof(long)) {
33598 return PyLong_FromLong((long) value);
33599 } else if (sizeof(long) <= sizeof(unsigned long)) {
33600 return PyLong_FromUnsignedLong((unsigned long) value);
33601#if !CYTHON_COMPILING_IN_PYPY
33602 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
33603 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
33604#endif
33605 }
33606 } else {
33607 if (sizeof(long) <= sizeof(long)) {
33608 return PyLong_FromLong((long) value);
33609 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
33610 return PyLong_FromLongLong((PY_LONG_LONG) value);
33611 }
33612 }
33613 {
33614 unsigned char *bytes = (unsigned char *)&value;
33615#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
33616 if (is_unsigned) {
33617 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
33618 } else {
33619 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
33620 }
33621#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
33622 int one = 1; int little = (int)*(unsigned char *)&one;
33623 return _PyLong_FromByteArray(bytes, sizeof(long),
33624 little, !is_unsigned);
33625#else
33626 int one = 1; int little = (int)*(unsigned char *)&one;
33627 PyObject *result = NULL, *kwds = NULL;
33628 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
33629 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
33630 if (!py_bytes) goto limited_bad;
33631 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
33632 if (!from_bytes_str) goto limited_bad;
33633 order_str = PyUnicode_FromString(little ? "little" : "big");
33634 if (!order_str) goto limited_bad;
33635 {
33636 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
33637 if (!is_unsigned) {
33638 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
33639 if (!signed_str) goto limited_bad;
33640#if CYTHON_VECTORCALL
33641 kwds = PyTuple_Pack(1, signed_str);
33642#else
33643 {
33644 PyObject *keys[] = {signed_str};
33645 PyObject *values[] = {Py_True};
33646 kwds = __Pyx_MakeKwargDict(keys, values, 1);
33647 }
33648#endif
33649 Py_DECREF(signed_str);
33650 if (unlikely(!kwds)) goto limited_bad;
33651 }
33652 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
33653 }
33654 limited_bad:
33655 Py_XDECREF(kwds);
33656 Py_XDECREF(order_str);
33657 Py_XDECREF(py_bytes);
33658 Py_XDECREF(from_bytes_str);
33659 return result;
33660#endif
33661 }
33662}
33663
33664/* CIntFromPy */
33665static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x);
33666static char __Pyx_raise_neg_overflow___Pyx_PyLong_As_char(void) {
33667 const char* type_name = "char";
33668 PyErr_Format(PyExc_OverflowError,
33669 "can't convert negative value to %.200s", type_name);
33670 return (char) -1;
33671}
33672static char __Pyx_raise_overflow___Pyx_PyLong_As_char(void) {
33673 const char* type_name = "char";
33674 PyErr_Format(PyExc_OverflowError,
33675 "value too large to convert to %.200s", type_name);
33676 return (char) -1;
33677}
33678static CYTHON_INLINE char __Pyx_PyULong___Pyx_PyLong_As_char(PyObject *x) {
33679 const int is_unsigned = 1;
33680#if CYTHON_USE_PYLONG_INTERNALS
33681 {
33682 const digit* digits = __Pyx_PyLong_Digits(x);
33683 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33684 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
33685 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
33686 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33687 } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
33688 return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33689 }
33690 } else
33691 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
33692 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
33693 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33694 } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
33695 return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33696 }
33697 } else
33698 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
33699 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
33700 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33701 } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
33702 return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33703 }
33704 } else
33705 {}
33706 }
33707#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33708 if (unlikely(Py_SIZE(x) < 0)) {
33709 goto raise_neg_overflow;
33710 }
33711#else
33712 {
33713 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33714 if (unlikely(result < 0))
33715 return (char) -1;
33716 if (unlikely(result == 1))
33717 goto raise_neg_overflow;
33718 }
33719#endif
33720 if ((sizeof(char) <= sizeof(unsigned long))) {
33721 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
33722 } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
33723 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33724 }
33725 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
33726raise_neg_overflow:
33727 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
33728raise_overflow:
33729 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
33730}
33731static CYTHON_INLINE char __Pyx_PySLong___Pyx_PyLong_As_char(PyObject *x) {
33732 const int is_unsigned = 0;
33733#if CYTHON_USE_PYLONG_INTERNALS
33734 if (__Pyx_PyLong_IsNeg(x)) {
33735 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33736 const digit* digits = __Pyx_PyLong_Digits(x);
33737 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
33738 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
33739 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
33740 __PYX_VERIFY_RETURN_INT(char, long, ival)
33741 } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
33742 return (char) (((char) -1) * (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33743 }
33744 } else
33745 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
33746 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
33747 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
33748 __PYX_VERIFY_RETURN_INT(char, long, ival)
33749 } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
33750 return (char) (((char) -1) * (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33751 }
33752 } else
33753 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
33754 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
33755 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
33756 __PYX_VERIFY_RETURN_INT(char, long, ival)
33757 } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
33758 return (char) (((char) -1) * (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33759 }
33760 } else
33761 {}
33762 } else {
33763 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
33764 const digit* digits = __Pyx_PyLong_Digits(x);
33765 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
33766 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
33767 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33768 } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
33769 return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33770 }
33771 } else
33772 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
33773 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
33774 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33775 } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
33776 return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33777 }
33778 } else
33779 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
33780 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
33781 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33782 } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
33783 return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33784 }
33785 } else
33786 {}
33787 }
33788#endif
33789 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
33790 if ((sizeof(char) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
33791 __PYX_VERIFY_RETURN_INT_EXC(char, int, PyLong_AsInt(x))
33792 } else
33793 #endif
33794 if ((sizeof(char) <= sizeof(long))) {
33795 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
33796 } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
33797 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
33798 }
33799 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
33800raise_neg_overflow:
33801 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
33802raise_overflow:
33803 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
33804}
33805static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x) {
33806#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33807#pragma GCC diagnostic push
33808#pragma GCC diagnostic ignored "-Wconversion"
33809#endif
33810 const char neg_one = (char) -1, const_zero = (char) 0;
33811#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33812#pragma GCC diagnostic pop
33813#endif
33814 const int is_unsigned = neg_one > const_zero;
33815 char val;
33816 int ret = -1;
33817#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
33818 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
33819 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
33820 if (unlikely(bytes_copied == -1)) {
33821 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
33822 goto raise_overflow;
33823 } else {
33824 ret = 0;
33825 }
33826#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
33827 int one = 1; int is_little = (int)*(unsigned char *)&one;
33828 unsigned char *bytes = (unsigned char *)&val;
33829 ret = _PyLong_AsByteArray((PyLongObject *)x,
33830 bytes, sizeof(val),
33831 is_little, !is_unsigned);
33832 if ((0)) goto raise_overflow;
33833#else
33834 PyObject *v;
33835 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
33836 int bits, remaining_bits, is_negative = 0;
33837 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
33838 if (likely(PyLong_CheckExact(x))) {
33839 v = __Pyx_NewRef(x);
33840 } else {
33841 v = PyNumber_Long(x);
33842 if (unlikely(!v)) return (char) -1;
33843 assert(PyLong_CheckExact(v));
33844 }
33845 {
33846 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
33847 if (unlikely(result < 0)) {
33848 Py_DECREF(v);
33849 return (char) -1;
33850 }
33851 is_negative = result == 1;
33852 }
33853 if (is_unsigned && unlikely(is_negative)) {
33854 Py_DECREF(v);
33855 PyErr_SetString(PyExc_OverflowError,
33856 "can't convert negative value to char");
33857 return (char) -1;
33858 } else if (is_negative) {
33859 stepval = PyNumber_Invert(v);
33860 Py_DECREF(v);
33861 if (unlikely(!stepval))
33862 return (char) -1;
33863 } else {
33864 stepval = v;
33865 }
33866 v = NULL;
33867 val = (char) 0;
33868 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
33869 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
33870 for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
33871 PyObject *tmp, *digit;
33872 long idigit;
33873 digit = PyNumber_And(stepval, mask);
33874 if (unlikely(!digit)) goto done;
33875 idigit = PyLong_AsLong(digit);
33876 Py_DECREF(digit);
33877 if (unlikely(idigit < 0)) goto done;
33878 val |= ((char) idigit) << bits;
33879 tmp = PyNumber_Rshift(stepval, shift);
33880 if (unlikely(!tmp)) goto done;
33881 Py_DECREF(stepval); stepval = tmp;
33882 }
33883 Py_DECREF(shift); shift = NULL;
33884 Py_DECREF(mask); mask = NULL;
33885 {
33886 long idigit = PyLong_AsLong(stepval);
33887 if (unlikely(idigit < 0)) goto done;
33888 remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
33889 if (unlikely(idigit >= (1L << remaining_bits)))
33890 goto raise_overflow;
33891 val |= ((char) idigit) << bits;
33892 }
33893 if (!is_unsigned) {
33894 if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
33895 goto raise_overflow;
33896 if (is_negative)
33897 val = ~val;
33898 }
33899 ret = 0;
33900done:
33901 Py_XDECREF(shift);
33902 Py_XDECREF(mask);
33903 Py_XDECREF(stepval);
33904#endif
33905 if (unlikely(ret))
33906 return (char) -1;
33907 return val;
33908raise_overflow:
33909 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
33910}
33911static CYTHON_INLINE char __Pyx_PyLong___Pyx_PyLong_As_char(PyObject *x) {
33912#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33913#pragma GCC diagnostic push
33914#pragma GCC diagnostic ignored "-Wconversion"
33915#endif
33916 const char neg_one = (char) -1, const_zero = (char) 0;
33917#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33918#pragma GCC diagnostic pop
33919#endif
33920 const int is_unsigned = neg_one > const_zero;
33921 if (is_unsigned) {
33922 #if CYTHON_USE_PYLONG_INTERNALS
33923 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
33924 goto raise_neg_overflow;
33925 } else if (__Pyx_PyLong_IsCompact(x)) {
33926 __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
33927 } else
33928 #endif
33929 {
33930 return __Pyx_PyULong___Pyx_PyLong_As_char(x);
33931 }
33932 } else {
33933 #if CYTHON_USE_PYLONG_INTERNALS
33934 if (__Pyx_PyLong_IsCompact(x)) {
33935 __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
33936 } else
33937 #endif
33938 {
33939 return __Pyx_PySLong___Pyx_PyLong_As_char(x);
33940 }
33941 }
33942#if CYTHON_USE_PYLONG_INTERNALS
33943raise_neg_overflow:
33944 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
33945raise_overflow:
33946 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
33947#endif
33948}
33949static char __Pyx_NonPyLong___Pyx_PyLong_As_char(PyObject *x) {
33950 char val;
33951 PyObject *tmp = __Pyx_PyNumber_Long(x);
33952 if (!tmp) return (char) -1;
33953 val = __Pyx_PyLong_As_char(tmp);
33954 Py_DECREF(tmp);
33955 return val;
33956}
33957static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *x) {
33958 if (likely(PyLong_Check(x))) {
33959 return __Pyx_PyLong___Pyx_PyLong_As_char(x);
33960 } else {
33961 return __Pyx_NonPyLong___Pyx_PyLong_As_char(x);
33962 }
33963}
33964
33965/* GetRuntimeVersion */
33966#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
33967void __Pyx_init_runtime_version(void) {
33968 if (__Pyx_cached_runtime_version == 0) {
33969 const char* rt_version = Py_GetVersion();
33970 unsigned long version = 0;
33971 unsigned long factor = 0x01000000UL;
33972 unsigned int digit = 0;
33973 int i = 0;
33974 while (factor) {
33975 while ('0' <= rt_version[i] && rt_version[i] <= '9') {
33976 digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
33977 ++i;
33978 }
33979 version += factor * digit;
33980 if (rt_version[i] != '.')
33981 break;
33982 digit = 0;
33983 factor >>= 8;
33984 ++i;
33985 }
33986 __Pyx_cached_runtime_version = version;
33987 }
33988}
33989#endif
33990static unsigned long __Pyx_get_runtime_version(void) {
33991#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
33992 return Py_Version & ~0xFFUL;
33993#else
33994 return __Pyx_cached_runtime_version;
33995#endif
33996}
33997
33998/* CheckBinaryVersion */
33999static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
34000 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
34001 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
34002 return 0;
34003 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
34004 return 1;
34005 {
34006 char message[200];
34007 PyOS_snprintf(message, sizeof(message),
34008 "compile time Python version %d.%d "
34009 "of module '%.100s' "
34010 "%s "
34011 "runtime version %d.%d",
34012 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
34013 __Pyx_MODULE_NAME,
34014 (allow_newer) ? "was newer than" : "does not match",
34015 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
34016 );
34017 return PyErr_WarnEx(NULL, message, 1);
34018 }
34019}
34020
34021/* NewCodeObj */
34022#if CYTHON_COMPILING_IN_LIMITED_API
34023 static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
34024 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
34025 PyObject *fv, PyObject *cell, PyObject* fn,
34026 PyObject *name, int fline, PyObject *lnos) {
34027 PyObject *exception_table = NULL;
34028 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
34029 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
34030 PyObject *version_info;
34031 PyObject *py_minor_version = NULL;
34032 #endif
34033 long minor_version = 0;
34034 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
34035 minor_version = 11;
34036 #else
34037 if (!(version_info = PySys_GetObject("version_info"))) goto end;
34038 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
34039 minor_version = PyLong_AsLong(py_minor_version);
34040 Py_DECREF(py_minor_version);
34041 if (minor_version == -1 && PyErr_Occurred()) goto end;
34042 #endif
34043 if (!(types_module = PyImport_ImportModule("types"))) goto end;
34044 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
34045 if (minor_version <= 10) {
34046 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
34047 c, n, v, fn, name, fline, lnos, fv, cell);
34048 } else {
34049 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
34050 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
34051 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
34052 }
34053 end:
34054 Py_XDECREF(code_type);
34055 Py_XDECREF(exception_table);
34056 Py_XDECREF(types_module);
34057 if (!result) {
34058 PyObject *exc_type, *exc_value, *exc_tb;
34059 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
34060 if (PyErr_WarnFormat(
34061 PyExc_RuntimeWarning, 1,
34062 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
34063 exc_value ? exc_value : exc_type) == 0) {
34064 result = Py_None;
34065 Py_INCREF(result);
34066 }
34067 Py_DECREF(exc_type);
34068 Py_XDECREF(exc_value);
34069 Py_XDECREF(exc_tb);
34070 }
34071 return result;
34072 }
34073#elif PY_VERSION_HEX >= 0x030B0000
34074 static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
34075 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
34076 PyObject *fv, PyObject *cell, PyObject* fn,
34077 PyObject *name, int fline, PyObject *lnos) {
34078 PyCodeObject *result;
34079 result =
34080 #if PY_VERSION_HEX >= 0x030C0000
34081 PyUnstable_Code_NewWithPosOnlyArgs
34082 #else
34083 PyCode_NewWithPosOnlyArgs
34084 #endif
34085 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
34086 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
34087 if (likely(result))
34088 result->_co_firsttraceable = 0;
34089 #endif
34090 return result;
34091 }
34092#elif !CYTHON_COMPILING_IN_PYPY
34093 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
34094 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
34095#else
34096 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
34097 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
34098#endif
34099static PyObject* __Pyx_PyCode_New(
34100 const __Pyx_PyCode_New_function_description descr,
34101 PyObject * const *varnames,
34102 PyObject *filename,
34103 PyObject *funcname,
34104 PyObject *line_table,
34105 PyObject *tuple_dedup_map
34106) {
34107 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
34108 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
34109 PyObject *varnames_tuple = PyTuple_New(var_count);
34110 if (unlikely(!varnames_tuple)) return NULL;
34111 for (Py_ssize_t i=0; i < var_count; i++) {
34112 Py_INCREF(varnames[i]);
34113 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
34114 }
34115 #if CYTHON_COMPILING_IN_LIMITED_API
34116 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
34117 if (!varnames_tuple_dedup) {
34118 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
34119 varnames_tuple_dedup = varnames_tuple;
34120 }
34121 #else
34122 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
34123 if (unlikely(!varnames_tuple_dedup)) goto done;
34124 #endif
34125 #if CYTHON_AVOID_BORROWED_REFS
34126 Py_INCREF(varnames_tuple_dedup);
34127 #endif
34128 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
34129 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
34130 #if !CYTHON_ASSUME_SAFE_SIZE
34131 if (unlikely(line_table_length == -1)) goto done;
34132 #endif
34133 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
34134 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
34135 if (unlikely(!code_bytes)) goto done;
34136 char* c_code_bytes = PyBytes_AsString(code_bytes);
34137 if (unlikely(!c_code_bytes)) goto done;
34138 memset(c_code_bytes, 0, (size_t) code_len);
34139 }
34140 code_obj = (PyObject*) __Pyx__PyCode_New(
34141 (int) descr.argcount,
34142 (int) descr.num_posonly_args,
34143 (int) descr.num_kwonly_args,
34144 (int) descr.nlocals,
34145 0,
34146 (int) descr.flags,
34147 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
34148 __pyx_mstate_global->__pyx_empty_tuple,
34149 __pyx_mstate_global->__pyx_empty_tuple,
34150 varnames_tuple_dedup,
34151 __pyx_mstate_global->__pyx_empty_tuple,
34152 __pyx_mstate_global->__pyx_empty_tuple,
34153 filename,
34154 funcname,
34155 (int) descr.first_line,
34156 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
34157 );
34158done:
34159 Py_XDECREF(code_bytes);
34160 #if CYTHON_AVOID_BORROWED_REFS
34161 Py_XDECREF(varnames_tuple_dedup);
34162 #endif
34163 Py_DECREF(varnames_tuple);
34164 return code_obj;
34165}
34166
34167/* DecompressString */
34168CYTHON_UNUSED
34169static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
34170#ifdef __Pyx_DecompressString_UNUSED
34171 CYTHON_UNUSED_VAR(s);
34172 CYTHON_UNUSED_VAR(length);
34173 CYTHON_UNUSED_VAR(algo);
34174 return NULL;
34175#else
34176 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
34177 const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
34178 PyObject *methodname = PyUnicode_FromString("decompress");
34179 if (unlikely(!methodname)) return NULL;
34180 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
34181 if (algo == 3) {
34182 PyObject *fromlist = Py_BuildValue("[O]", methodname);
34183 if (unlikely(!fromlist)) goto bad;
34184 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
34185 Py_DECREF(fromlist);
34186 } else
34187 #endif
34188 module = PyImport_ImportModule(module_name);
34189 if (unlikely(!module)) goto import_failed;
34190 decompress = PyObject_GetAttr(module, methodname);
34191 if (unlikely(!decompress)) goto import_failed;
34192 {
34193 #ifdef __cplusplus
34194 char *memview_bytes = const_cast<char*>(s);
34195 #else
34196 #if defined(__clang__)
34197 #pragma clang diagnostic push
34198 #pragma clang diagnostic ignored "-Wcast-qual"
34199 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
34200 #pragma GCC diagnostic push
34201 #pragma GCC diagnostic ignored "-Wcast-qual"
34202 #endif
34203 char *memview_bytes = (char*) s;
34204 #if defined(__clang__)
34205 #pragma clang diagnostic pop
34206 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
34207 #pragma GCC diagnostic pop
34208 #endif
34209 #endif
34210 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
34211 int memview_flags = 0x100;
34212 #else
34213 int memview_flags = PyBUF_READ;
34214 #endif
34215 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
34216 }
34217 if (unlikely(!compressed_bytes)) {
34218 Py_DECREF(decompress);
34219 goto bad;
34220 }
34221 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
34222 Py_DECREF(compressed_bytes);
34223 Py_DECREF(decompress);
34224 Py_DECREF(module);
34225 Py_DECREF(methodname);
34226 return decompressed;
34227import_failed:
34228 PyErr_Format(PyExc_ImportError,
34229 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
34230 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
34231 module_name, algo);
34232bad:
34233 Py_XDECREF(module);
34234 Py_DECREF(methodname);
34235 return NULL;
34236#endif
34237}
34238
34239/* DecompressString_LZSS */
34240#ifndef __Pyx_DecompressString_LZSS_UNUSED
34241CYTHON_UNUSED
34242static CYTHON_SMALL_CODE size_t __pyx_lzss_decompress(const uint8_t* src, uint8_t* dst, size_t dst_len) {
34243 size_t pos = 0, out_pos = 0;
34244 while (1) {
34245 uint32_t flags = src[pos++] | 0xFF00;
34246 while (flags & 0x100) {
34247 if (flags & 1) {
34248 dst[out_pos++] = src[pos++];
34249 } else {
34250 uint32_t lo = src[pos++], hi = src[pos++];
34251 uint32_t end_offset_of_last_occurrence, match_length;
34252 if (!(lo & 0x80)) {
34253 end_offset_of_last_occurrence = lo;
34254 match_length = hi;
34255 } else if (!(hi & 0x80)) {
34256 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
34257 match_length = hi & 0x1F;
34258 } else {
34259 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
34260 match_length = src[pos++];
34261 }
34262 match_length += 3;
34263 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
34264 memcpy(dst + out_pos, dst + ref_pos, match_length);
34265 out_pos += match_length;
34266 }
34267 if (out_pos >= dst_len) return pos;
34268 flags >>= 1;
34269 }
34270 }
34271}
34272#endif
34273static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length) {
34274#ifdef __Pyx_DecompressString_LZSS_UNUSED
34275 CYTHON_UNUSED_VAR(s);
34276 CYTHON_UNUSED_VAR(compressed_length);
34277 CYTHON_UNUSED_VAR(uncompressed_length);
34278 return NULL;
34279#else
34280 PyObject *result;
34281 unsigned char *result_data;
34282 size_t src_length;
34283 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
34284 if (unlikely(!result)) return NULL;
34285 result_data = __Pyx_PyBytes_AsWritableUString(result);
34286 if (unlikely(!result_data)) goto bad;
34287 src_length = __pyx_lzss_decompress((const uint8_t*) s, result_data, uncompressed_length);
34288 if (unlikely(src_length != compressed_length)) goto decompression_failed;
34289 return result;
34290decompression_failed:
34291 PyErr_SetString(PyExc_RuntimeError, "LZSS string data decompression failed");
34292bad:
34293 Py_DECREF(result);
34294 return NULL;
34295#endif
34296}
34297
34298#include <string.h>
34299static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
34300 size_t len = strlen(s);
34301 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
34302 PyErr_SetString(PyExc_OverflowError, "byte string is too long");
34303 return -1;
34304 }
34305 return (Py_ssize_t) len;
34306}
34307static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
34308 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
34309 if (unlikely(len < 0)) return NULL;
34310 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
34311}
34312static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
34313 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
34314 if (unlikely(len < 0)) return NULL;
34315 return PyByteArray_FromStringAndSize(c_str, len);
34316}
34317static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
34318 Py_ssize_t ignore;
34319 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
34320}
34321#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
34322static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
34323 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
34324#if CYTHON_COMPILING_IN_LIMITED_API
34325 {
34326 const char* result;
34327 Py_ssize_t unicode_length;
34328 CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
34329 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
34330 if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
34331 #else
34332 result = PyUnicode_AsUTF8AndSize(o, length);
34333 #endif
34334 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
34335 unicode_length = PyUnicode_GetLength(o);
34336 if (unlikely(unicode_length < 0)) return NULL;
34337 if (unlikely(unicode_length != *length)) {
34338 PyUnicode_AsASCIIString(o);
34339 return NULL;
34340 }
34341 #endif
34342 return result;
34343 }
34344#else
34345#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
34346 if (likely(PyUnicode_IS_ASCII(o))) {
34347 *length = PyUnicode_GET_LENGTH(o);
34348 return PyUnicode_AsUTF8(o);
34349 } else {
34350 PyUnicode_AsASCIIString(o);
34351 return NULL;
34352 }
34353#else
34354 return PyUnicode_AsUTF8AndSize(o, length);
34355#endif
34356#endif
34357}
34358#endif
34359static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
34360#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
34361 if (PyUnicode_Check(o)) {
34362 return __Pyx_PyUnicode_AsStringAndSize(o, length);
34363 } else
34364#endif
34365 if (PyByteArray_Check(o)) {
34366#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
34367 *length = PyByteArray_GET_SIZE(o);
34368 return PyByteArray_AS_STRING(o);
34369#else
34370 *length = PyByteArray_Size(o);
34371 if (*length == -1) return NULL;
34372 return PyByteArray_AsString(o);
34373#endif
34374 } else
34375 {
34376 char* result;
34377 int r = PyBytes_AsStringAndSize(o, &result, length);
34378 if (unlikely(r < 0)) {
34379 return NULL;
34380 } else {
34381 return result;
34382 }
34383 }
34384}
34385static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
34386 int is_true = x == Py_True;
34387 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
34388 else return PyObject_IsTrue(x);
34389}
34390static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
34391 int retval;
34392 if (unlikely(!x)) return -1;
34393 retval = __Pyx_PyObject_IsTrue(x);
34394 Py_DECREF(x);
34395 return retval;
34396}
34397static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
34398 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
34399 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
34400 if (unlikely(!result_type_name)) goto bad;
34401 #endif
34402 if (PyLong_Check(result)) {
34403 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
34404 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
34405 "The ability to return an instance of a strict subclass of int is deprecated, "
34406 "and may be removed in a future version of Python.",
34407 result_type_name)) {
34408 __Pyx_DECREF_TypeName(result_type_name);
34409 goto bad;
34410 }
34411 __Pyx_DECREF_TypeName(result_type_name);
34412 return result;
34413 }
34414 PyErr_Format(PyExc_TypeError,
34415 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
34416 result_type_name);
34417 __Pyx_DECREF_TypeName(result_type_name);
34418bad:
34419 Py_DECREF(result);
34420 return NULL;
34421}
34422static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
34423#if CYTHON_USE_TYPE_SLOTS
34424 PyNumberMethods *m;
34425#endif
34426 PyObject *res = NULL;
34427 if (likely(PyLong_Check(x)))
34428 return __Pyx_NewRef(x);
34429#if CYTHON_USE_TYPE_SLOTS
34430 m = Py_TYPE(x)->tp_as_number;
34431 if (likely(m && m->nb_int)) {
34432 res = m->nb_int(x);
34433 }
34434#else
34435 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
34436 res = PyNumber_Long(x);
34437 }
34438#endif
34439 if (likely(res)) {
34440 if (unlikely(!PyLong_CheckExact(res))) {
34441 return __Pyx_PyNumber_LongWrongResultType(res);
34442 }
34443 }
34444 else if (!PyErr_Occurred()) {
34445 PyErr_SetString(PyExc_TypeError,
34446 "an integer is required");
34447 }
34448 return res;
34449}
34450static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
34451 #if CYTHON_USE_PYLONG_INTERNALS
34452 Py_ssize_t ival;
34453 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
34454 const int is_neg = __Pyx_PyLong_IsNeg(b);
34455 const digit* digits = __Pyx_PyLong_Digits(b);
34456 if (size == 0) return 0;
34457 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
34458 if (size == 1) {
34459 ival = (Py_ssize_t) (((size_t)digits[0]));
34460 } else
34461 #endif
34462 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
34463 if (size == 2) {
34464 ival = (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34465 } else
34466 #endif
34467 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
34468 if (size == 3) {
34469 ival = (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34470 } else
34471 #endif
34472 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
34473 if (size == 4) {
34474 ival = (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34475 } else
34476 #endif
34477 return PyLong_AsSsize_t(b);
34478 return is_neg ? -ival : ival;
34479 #else
34480 return PyLong_AsSsize_t(b);
34481 #endif
34482}
34483static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
34484 if (likely(PyLong_Check(b))) {
34485 return __Pyx_PyLong_AsSsize_t(b);
34486 } else {
34487 Py_ssize_t ival;
34488 PyObject *x = PyNumber_Index(b);
34489 if (unlikely(!x)) return -1;
34490 ival = __Pyx_PyLong_AsSsize_t(x);
34491 Py_DECREF(x);
34492 return ival;
34493 }
34494}
34495static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
34496 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
34497 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
34498 } else {
34499 Py_ssize_t ival;
34500 PyObject *x;
34501 x = PyNumber_Index(o);
34502 if (!x) return -1;
34503 ival = PyLong_AsLong(x);
34504 Py_DECREF(x);
34505 return ival;
34506 }
34507}
34508static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
34509 CYTHON_UNUSED_VAR(b);
34510 return __Pyx_NewRef(Py_None);
34511}
34512static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
34513 return __Pyx_NewRef(b ? Py_True: Py_False);
34514}
34515static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
34516 return PyLong_FromSize_t(ival);
34517}
34518
34519
34520/* MultiPhaseInitModuleState */
34521#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
34522#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34523#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
34524 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
34525#else
34526 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
34527#endif
34528#endif
34529#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
34530#error "Module state with PEP489 requires atomics. Currently that's one of\
34531 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
34532#endif
34533#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34534#define __Pyx_ModuleStateLookup_Lock()
34535#define __Pyx_ModuleStateLookup_Unlock()
34536#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
34537static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
34538#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
34539#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
34540#elif defined(__cplusplus) && __cplusplus >= 201103L
34541#include <mutex>
34542static std::mutex __Pyx_ModuleStateLookup_mutex;
34543#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
34544#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
34545#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
34546#include <threads.h>
34547static mtx_t __Pyx_ModuleStateLookup_mutex;
34548static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
34549static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
34550 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
34551}
34552#define __Pyx_ModuleStateLookup_Lock()\
34553 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
34554 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
34555#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
34556#elif defined(HAVE_PTHREAD_H)
34557#include <pthread.h>
34558static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
34559#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
34560#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
34561#elif defined(_WIN32)
34562#include <Windows.h> // synchapi.h on its own doesn't work
34563static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
34564#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
34565#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
34566#else
34567#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
34568 Requires C standard >= C11, or C++ standard >= C++11,\
34569 or pthreads, or the Windows 32 API, or Python >= 3.13."
34570#endif
34571typedef struct {
34572 int64_t id;
34573 PyObject *module;
34574} __Pyx_InterpreterIdAndModule;
34575typedef struct {
34576 char interpreter_id_as_index;
34577 Py_ssize_t count;
34578 Py_ssize_t allocated;
34579 __Pyx_InterpreterIdAndModule table[1];
34580} __Pyx_ModuleStateLookupData;
34581#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
34582#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34583static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
34584#endif
34585#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34586static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
34587#else
34588static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
34589#endif
34590static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
34591 __Pyx_InterpreterIdAndModule* table,
34592 Py_ssize_t count,
34593 int64_t interpreterId) {
34594 __Pyx_InterpreterIdAndModule* begin = table;
34595 __Pyx_InterpreterIdAndModule* end = begin + count;
34596 if (begin->id == interpreterId) {
34597 return begin;
34598 }
34599 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
34600 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
34601 if (halfway->id == interpreterId) {
34602 return halfway;
34603 }
34604 if (halfway->id < interpreterId) {
34605 begin = halfway;
34606 } else {
34607 end = halfway;
34608 }
34609 }
34610 for (; begin < end; ++begin) {
34611 if (begin->id >= interpreterId) return begin;
34612 }
34613 return begin;
34614}
34615static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
34616 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
34617 if (interpreter_id == -1) return NULL;
34618#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34619 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
34620 {
34621 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
34622 if (likely(data)) {
34623 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
34624 if (likely(data == new_data)) {
34625 goto read_finished;
34626 }
34627 }
34628 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
34629 __Pyx_ModuleStateLookup_Lock();
34630 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
34631 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
34632 __Pyx_ModuleStateLookup_Unlock();
34633 }
34634 read_finished:;
34635#else
34636 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
34637#endif
34638 __Pyx_InterpreterIdAndModule* found = NULL;
34639 if (unlikely(!data)) goto end;
34640 if (data->interpreter_id_as_index) {
34641 if (interpreter_id < data->count) {
34642 found = data->table+interpreter_id;
34643 }
34644 } else {
34645 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
34646 data->table, data->count, interpreter_id);
34647 }
34648 end:
34649 {
34650 PyObject *result=NULL;
34651 if (found && found->id == interpreter_id) {
34652 result = found->module;
34653 }
34654#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34655 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
34656#endif
34657 return result;
34658 }
34659}
34660#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34661static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
34662 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
34663}
34664#else
34665#define __Pyx_ModuleStateLookup_wait_until_no_readers()
34666#endif
34667static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
34668 Py_ssize_t to_allocate = (*old_data)->allocated;
34669 while (to_allocate <= interpreter_id) {
34670 if (to_allocate == 0) to_allocate = 1;
34671 else to_allocate *= 2;
34672 }
34673 __Pyx_ModuleStateLookupData *new_data = *old_data;
34674 if (to_allocate != (*old_data)->allocated) {
34675 new_data = (__Pyx_ModuleStateLookupData *)realloc(
34676 *old_data,
34677 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
34678 if (!new_data) {
34679 PyErr_NoMemory();
34680 return -1;
34681 }
34682 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
34683 new_data->table[i].id = i;
34684 new_data->table[i].module = NULL;
34685 }
34686 new_data->allocated = to_allocate;
34687 }
34688 new_data->table[interpreter_id].module = module;
34689 if (new_data->count < interpreter_id+1) {
34690 new_data->count = interpreter_id+1;
34691 }
34692 *old_data = new_data;
34693 return 0;
34694}
34695static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
34696 __Pyx_InterpreterIdAndModule *read = data->table;
34697 __Pyx_InterpreterIdAndModule *write = data->table;
34698 __Pyx_InterpreterIdAndModule *end = read + data->count;
34699 for (; read<end; ++read) {
34700 if (read->module) {
34701 write->id = read->id;
34702 write->module = read->module;
34703 ++write;
34704 }
34705 }
34706 data->count = write - data->table;
34707 for (; write<end; ++write) {
34708 write->id = 0;
34709 write->module = NULL;
34710 }
34711 data->interpreter_id_as_index = 0;
34712}
34713static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
34714 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
34715 if (interpreter_id == -1) return -1;
34716 int result = 0;
34717 __Pyx_ModuleStateLookup_Lock();
34718#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34719 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
34720 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
34721#else
34722 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
34723#endif
34724 __Pyx_ModuleStateLookupData *new_data = old_data;
34725 if (!new_data) {
34726 new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
34727 if (!new_data) {
34728 result = -1;
34729 PyErr_NoMemory();
34730 goto end;
34731 }
34732 new_data->allocated = 1;
34733 new_data->interpreter_id_as_index = 1;
34734 }
34735 __Pyx_ModuleStateLookup_wait_until_no_readers();
34736 if (new_data->interpreter_id_as_index) {
34737 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
34738 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
34739 goto end;
34740 }
34741 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
34742 }
34743 {
34744 Py_ssize_t insert_at = 0;
34745 {
34746 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
34747 new_data->table, new_data->count, interpreter_id);
34748 assert(lower_bound);
34749 insert_at = lower_bound - new_data->table;
34750 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
34751 lower_bound->module = module;
34752 goto end; // already in table, nothing more to do
34753 }
34754 }
34755 if (new_data->count+1 >= new_data->allocated) {
34756 Py_ssize_t to_allocate = (new_data->count+1)*2;
34757 new_data =
34758 (__Pyx_ModuleStateLookupData*)realloc(
34759 new_data,
34760 sizeof(__Pyx_ModuleStateLookupData) +
34761 (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
34762 if (!new_data) {
34763 result = -1;
34764 new_data = old_data;
34765 PyErr_NoMemory();
34766 goto end;
34767 }
34768 new_data->allocated = to_allocate;
34769 }
34770 ++new_data->count;
34771 int64_t last_id = interpreter_id;
34772 PyObject *last_module = module;
34773 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
34774 int64_t current_id = new_data->table[i].id;
34775 new_data->table[i].id = last_id;
34776 last_id = current_id;
34777 PyObject *current_module = new_data->table[i].module;
34778 new_data->table[i].module = last_module;
34779 last_module = current_module;
34780 }
34781 }
34782 end:
34783#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34784 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
34785#else
34786 __Pyx_ModuleStateLookup_data = new_data;
34787#endif
34788 __Pyx_ModuleStateLookup_Unlock();
34789 return result;
34790}
34791static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
34792 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
34793 if (interpreter_id == -1) return -1;
34794 __Pyx_ModuleStateLookup_Lock();
34795#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34796 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
34797 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
34798#else
34799 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
34800#endif
34801 if (data->interpreter_id_as_index) {
34802 if (interpreter_id < data->count) {
34803 data->table[interpreter_id].module = NULL;
34804 }
34805 goto done;
34806 }
34807 {
34808 __Pyx_ModuleStateLookup_wait_until_no_readers();
34809 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
34810 data->table, data->count, interpreter_id);
34811 if (!lower_bound) goto done;
34812 if (lower_bound->id != interpreter_id) goto done;
34813 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
34814 for (;lower_bound<end-1; ++lower_bound) {
34815 lower_bound->id = (lower_bound+1)->id;
34816 lower_bound->module = (lower_bound+1)->module;
34817 }
34818 }
34819 --data->count;
34820 if (data->count == 0) {
34821 free(data);
34822 data = NULL;
34823 }
34824 done:
34825#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
34826 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
34827#else
34828 __Pyx_ModuleStateLookup_data = data;
34829#endif
34830 __Pyx_ModuleStateLookup_Unlock();
34831 return 0;
34832}
34833#endif
34834
34835/* #### Code section: utility_code_pragmas_end ### */
34836#ifdef _MSC_VER
34837#pragma warning( pop )
34838#endif
34839
34840
34841
34842/* #### Code section: end ### */
34843#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
Double f
Definition Headers.h:64
Double s
Definition Headers.h:84
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