proteus 1.9.0
C/C++/Fortran libraries
Loading...
Searching...
No Matches
csmoothers.c
Go to the documentation of this file.
1/* Generated by Cython 3.3.0 */
2
3/* BEGIN: Cython Metadata
4{
5 "distutils": {
6 "define_macros": [
7 [
8 "PROTEUS_SUPERLU_H",
9 "\"slu_ddefs.h\""
10 ],
11 [
12 "PROTEUS_LAPACK_H",
13 "\"proteus_lapack.h\""
14 ],
15 [
16 "PROTEUS_LAPACK_INTEGER",
17 "int"
18 ],
19 [
20 "PROTEUS_BLAS_H",
21 "\"proteus_blas.h\""
22 ]
23 ],
24 "depends": [
25 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayobject.h",
26 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayscalars.h",
27 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarrayobject.h",
28 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarraytypes.h",
29 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ufuncobject.h",
30 "proteus/smoothers.h"
31 ],
32 "extra_compile_args": [
33 "-Wall",
34 "-DF77_POST_UNDERSCORE",
35 "-DUSE_BLAS",
36 "-DCMRVEC_BOUNDS_CHECK",
37 "-DMV_VECTOR_BOUNDS_CHECK",
38 "-DPETSC_INCLUDE_AS_C",
39 "-DPETSC_SKIP_COMPLEX"
40 ],
41 "extra_link_args": [
42 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
43 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
44 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
45 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
46 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
47 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
48 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
49 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib"
50 ],
51 "include_dirs": [
52 "proteus",
53 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include",
54 "/work/cekees/miniforge3/envs/proteus-jupyterhub/include"
55 ],
56 "language": "c",
57 "libraries": [
58 "m",
59 "superlu",
60 "lapack",
61 "blas",
62 "metis"
63 ],
64 "library_dirs": [
65 "/work/cekees/miniforge3/envs/proteus-jupyterhub/include",
66 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib"
67 ],
68 "name": "csmoothers",
69 "sources": [
70 "proteus/csmoothers.pyx",
71 "proteus/smoothers.c"
72 ]
73 },
74 "module_name": "csmoothers"
75}
76END: Cython Metadata */
77
78#ifndef PY_SSIZE_T_CLEAN
79#define PY_SSIZE_T_CLEAN
80#endif /* PY_SSIZE_T_CLEAN */
81/* InitLimitedAPI */
82#if defined(Py_LIMITED_API)
83 #if !defined(CYTHON_LIMITED_API)
84 #define CYTHON_LIMITED_API 1
85 #endif
86#elif defined(CYTHON_LIMITED_API)
87 #ifdef _MSC_VER
88 #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
89 #else
90 #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
91 #endif
92#endif
93
94#include "Python.h"
95#ifndef Py_PYTHON_H
96 #error Python headers needed to compile C extensions, please install development version of Python.
97#elif PY_VERSION_HEX < 0x03090000
98 #error Cython requires Python 3.9+.
99#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
100 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
101#else
102#define __PYX_ABI_VERSION "3_3_0"
103#define CYTHON_HEX_VERSION 0x030300F0
104#define CYTHON_FUTURE_DIVISION 1
105/* CModulePreamble */
106#include <stddef.h>
107#ifndef offsetof
108 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
109#endif
110#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
111 #ifndef __stdcall
112 #define __stdcall
113 #endif
114 #ifndef __cdecl
115 #define __cdecl
116 #endif
117 #ifndef __fastcall
118 #define __fastcall
119 #endif
120#endif
121#ifdef __has_builtin
122 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
123#else
124 #define __Pyx_has_cbuiltin(name) (0)
125#endif
126#ifndef DL_IMPORT
127 #define DL_IMPORT(t) t
128#endif
129#ifndef DL_EXPORT
130 #define DL_EXPORT(t) t
131#endif
132#define __PYX_COMMA ,
133#ifndef PY_LONG_LONG
134 #define PY_LONG_LONG LONG_LONG
135#endif
136#ifndef Py_HUGE_VAL
137 #define Py_HUGE_VAL HUGE_VAL
138#endif
139#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
140#if defined(CYTHON_LIMITED_API)
141 #ifdef Py_LIMITED_API
142 #undef __PYX_LIMITED_VERSION_HEX
143 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
144 #if Py_LIMITED_API < 0x03090000
145 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
146 #endif
147 #endif
148 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
149 #ifdef _MSC_VER
150 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
151 code for PyPy and GraalPy and is unlikely to work.")
152 #else
153 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
154 code for PyPy and GraalPy and is unlikely to work."
155 #endif
156 #endif
157 #define CYTHON_COMPILING_IN_PYPY 0
158 #define CYTHON_COMPILING_IN_CPYTHON 0
159 #define CYTHON_COMPILING_IN_LIMITED_API 1
160 #define CYTHON_COMPILING_IN_GRAAL 0
161 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
162 #undef CYTHON_USE_TYPE_SLOTS
163 #define CYTHON_USE_TYPE_SLOTS 0
164 #undef CYTHON_USE_TYPE_SPECS
165 #define CYTHON_USE_TYPE_SPECS 1
166 #undef CYTHON_USE_PYTYPE_LOOKUP
167 #define CYTHON_USE_PYTYPE_LOOKUP 0
168 #undef CYTHON_USE_PYLIST_INTERNALS
169 #define CYTHON_USE_PYLIST_INTERNALS 0
170 #undef CYTHON_USE_UNICODE_INTERNALS
171 #define CYTHON_USE_UNICODE_INTERNALS 0
172 #ifndef CYTHON_USE_UNICODE_WRITER
173 #define CYTHON_USE_UNICODE_WRITER 0
174 #endif
175 #undef CYTHON_USE_PYLONG_INTERNALS
176 #define CYTHON_USE_PYLONG_INTERNALS 0
177 #ifndef CYTHON_AVOID_BORROWED_REFS
178 #define CYTHON_AVOID_BORROWED_REFS 0
179 #endif
180 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
181 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
182 #endif
183 #undef CYTHON_ASSUME_SAFE_MACROS
184 #define CYTHON_ASSUME_SAFE_MACROS 0
185 #undef CYTHON_ASSUME_SAFE_SIZE
186 #define CYTHON_ASSUME_SAFE_SIZE 0
187 #undef CYTHON_UNPACK_METHODS
188 #define CYTHON_UNPACK_METHODS 0
189 #undef CYTHON_FAST_THREAD_STATE
190 #define CYTHON_FAST_THREAD_STATE 0
191 #undef CYTHON_FAST_GIL
192 #define CYTHON_FAST_GIL 0
193 #undef CYTHON_VECTORCALL
194 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
195 #ifndef CYTHON_VECTORCALL_TPNEW
196 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
197 #endif
198 #ifndef CYTHON_PEP487_INIT_SUBCLASS
199 #define CYTHON_PEP487_INIT_SUBCLASS 1
200 #endif
201 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
202 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
203 #endif
204 #ifndef CYTHON_USE_MODULE_STATE
205 #define CYTHON_USE_MODULE_STATE 0
206 #endif
207 #undef CYTHON_USE_SYS_MONITORING
208 #define CYTHON_USE_SYS_MONITORING 0
209 #ifndef CYTHON_USE_TP_FINALIZE
210 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
211 #endif
212 #ifndef CYTHON_USE_AM_SEND
213 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
214 #endif
215 #undef CYTHON_USE_DICT_VERSIONS
216 #define CYTHON_USE_DICT_VERSIONS 0
217 #undef CYTHON_USE_EXC_INFO_STACK
218 #define CYTHON_USE_EXC_INFO_STACK 0
219 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
220 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
221 #endif
222 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
223 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
224 #endif
225 #ifndef CYTHON_USE_FREELISTS
226 #define CYTHON_USE_FREELISTS 1
227 #endif
228 #undef CYTHON_IMMORTAL_CONSTANTS
229 #define CYTHON_IMMORTAL_CONSTANTS 0
230 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
231 #undef CYTHON_OPAQUE_OBJECTS
232 #define CYTHON_OPAQUE_OBJECTS 0
233 #elif !defined(CYTHON_OPAQUE_OBJECTS)
234 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
235 #endif
236#elif defined(GRAALVM_PYTHON)
237 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
238 The existence of this section does not imply that anything works or is even tested */
239 #define CYTHON_COMPILING_IN_PYPY 0
240 #define CYTHON_COMPILING_IN_CPYTHON 0
241 #define CYTHON_COMPILING_IN_LIMITED_API 0
242 #define CYTHON_COMPILING_IN_GRAAL 1
243 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
244 #ifndef CYTHON_USE_TYPE_SLOTS
245 #define CYTHON_USE_TYPE_SLOTS 0
246 #endif
247 #undef CYTHON_USE_TYPE_SPECS
248 #define CYTHON_USE_TYPE_SPECS 0
249 #undef CYTHON_USE_PYTYPE_LOOKUP
250 #define CYTHON_USE_PYTYPE_LOOKUP 0
251 #undef CYTHON_USE_PYLIST_INTERNALS
252 #define CYTHON_USE_PYLIST_INTERNALS 0
253 #undef CYTHON_USE_UNICODE_INTERNALS
254 #define CYTHON_USE_UNICODE_INTERNALS 0
255 #undef CYTHON_USE_UNICODE_WRITER
256 #define CYTHON_USE_UNICODE_WRITER 0
257 #undef CYTHON_USE_PYLONG_INTERNALS
258 #define CYTHON_USE_PYLONG_INTERNALS 0
259 #undef CYTHON_AVOID_BORROWED_REFS
260 #define CYTHON_AVOID_BORROWED_REFS 1
261 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
262 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
263 #undef CYTHON_ASSUME_SAFE_MACROS
264 #define CYTHON_ASSUME_SAFE_MACROS 0
265 #undef CYTHON_ASSUME_SAFE_SIZE
266 #define CYTHON_ASSUME_SAFE_SIZE 0
267 #undef CYTHON_UNPACK_METHODS
268 #define CYTHON_UNPACK_METHODS 0
269 #undef CYTHON_FAST_THREAD_STATE
270 #define CYTHON_FAST_THREAD_STATE 0
271 #undef CYTHON_FAST_GIL
272 #define CYTHON_FAST_GIL 0
273 #ifndef CYTHON_VECTORCALL
274 #define CYTHON_VECTORCALL 1
275 #endif
276 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
277 #undef CYTHON_VECTORCALL_TPNEW
278 #define CYTHON_VECTORCALL_TPNEW 0
279 #elif !defined(CYTHON_VECTORCALL_TPNEW)
280 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
281 #endif
282 #ifndef CYTHON_PEP487_INIT_SUBCLASS
283 #define CYTHON_PEP487_INIT_SUBCLASS 1
284 #endif
285 #undef CYTHON_PEP489_MULTI_PHASE_INIT
286 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
287 #undef CYTHON_USE_MODULE_STATE
288 #define CYTHON_USE_MODULE_STATE 0
289 #undef CYTHON_USE_SYS_MONITORING
290 #define CYTHON_USE_SYS_MONITORING 0
291 #undef CYTHON_USE_TP_FINALIZE
292 #define CYTHON_USE_TP_FINALIZE 0
293 #undef CYTHON_USE_AM_SEND
294 #define CYTHON_USE_AM_SEND 0
295 #undef CYTHON_USE_DICT_VERSIONS
296 #define CYTHON_USE_DICT_VERSIONS 0
297 #undef CYTHON_USE_EXC_INFO_STACK
298 #define CYTHON_USE_EXC_INFO_STACK 1
299 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
300 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
301 #endif
302 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
303 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
304 #endif
305 #undef CYTHON_USE_FREELISTS
306 #define CYTHON_USE_FREELISTS 0
307 #undef CYTHON_IMMORTAL_CONSTANTS
308 #define CYTHON_IMMORTAL_CONSTANTS 0
309 #undef CYTHON_OPAQUE_OBJECTS
310 #define CYTHON_OPAQUE_OBJECTS 0
311#elif defined(PYPY_VERSION)
312 #define CYTHON_COMPILING_IN_PYPY 1
313 #define CYTHON_COMPILING_IN_CPYTHON 0
314 #define CYTHON_COMPILING_IN_LIMITED_API 0
315 #define CYTHON_COMPILING_IN_GRAAL 0
316 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
317 #undef CYTHON_USE_TYPE_SLOTS
318 #define CYTHON_USE_TYPE_SLOTS 1
319 #ifndef CYTHON_USE_TYPE_SPECS
320 #define CYTHON_USE_TYPE_SPECS 0
321 #endif
322 #undef CYTHON_USE_PYTYPE_LOOKUP
323 #define CYTHON_USE_PYTYPE_LOOKUP 0
324 #undef CYTHON_USE_PYLIST_INTERNALS
325 #define CYTHON_USE_PYLIST_INTERNALS 0
326 #undef CYTHON_USE_UNICODE_INTERNALS
327 #define CYTHON_USE_UNICODE_INTERNALS 0
328 #undef CYTHON_USE_UNICODE_WRITER
329 #define CYTHON_USE_UNICODE_WRITER 0
330 #undef CYTHON_USE_PYLONG_INTERNALS
331 #define CYTHON_USE_PYLONG_INTERNALS 0
332 #undef CYTHON_AVOID_BORROWED_REFS
333 #define CYTHON_AVOID_BORROWED_REFS 1
334 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
335 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
336 #undef CYTHON_ASSUME_SAFE_MACROS
337 #define CYTHON_ASSUME_SAFE_MACROS 0
338 #ifndef CYTHON_ASSUME_SAFE_SIZE
339 #define CYTHON_ASSUME_SAFE_SIZE 1
340 #endif
341 #undef CYTHON_UNPACK_METHODS
342 #define CYTHON_UNPACK_METHODS 0
343 #undef CYTHON_FAST_THREAD_STATE
344 #define CYTHON_FAST_THREAD_STATE 0
345 #undef CYTHON_FAST_GIL
346 #define CYTHON_FAST_GIL 0
347 #ifndef CYTHON_VECTORCALL
348 #define CYTHON_VECTORCALL 1
349 #endif
350 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
351 #undef CYTHON_VECTORCALL_TPNEW
352 #define CYTHON_VECTORCALL_TPNEW 0
353 #elif !defined(CYTHON_VECTORCALL_TPNEW)
354 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
355 #endif
356 #ifndef CYTHON_PEP487_INIT_SUBCLASS
357 #define CYTHON_PEP487_INIT_SUBCLASS 1
358 #endif
359 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
360 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
361 #endif
362 #undef CYTHON_USE_MODULE_STATE
363 #define CYTHON_USE_MODULE_STATE 0
364 #undef CYTHON_USE_SYS_MONITORING
365 #define CYTHON_USE_SYS_MONITORING 0
366 #ifndef CYTHON_USE_TP_FINALIZE
367 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
368 #endif
369 #undef CYTHON_USE_AM_SEND
370 #define CYTHON_USE_AM_SEND 0
371 #undef CYTHON_USE_DICT_VERSIONS
372 #define CYTHON_USE_DICT_VERSIONS 0
373 #undef CYTHON_USE_EXC_INFO_STACK
374 #define CYTHON_USE_EXC_INFO_STACK 0
375 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
376 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
377 #endif
378 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
379 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
380 #endif
381 #undef CYTHON_USE_FREELISTS
382 #define CYTHON_USE_FREELISTS 0
383 #undef CYTHON_IMMORTAL_CONSTANTS
384 #define CYTHON_IMMORTAL_CONSTANTS 0
385 #undef CYTHON_OPAQUE_OBJECTS
386 #define CYTHON_OPAQUE_OBJECTS 0
387#else
388 #define CYTHON_COMPILING_IN_PYPY 0
389 #define CYTHON_COMPILING_IN_CPYTHON 1
390 #define CYTHON_COMPILING_IN_LIMITED_API 0
391 #define CYTHON_COMPILING_IN_GRAAL 0
392 #ifdef Py_GIL_DISABLED
393 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
394 #else
395 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
396 #endif
397 #if PY_VERSION_HEX < 0x030A0000
398 #undef CYTHON_USE_TYPE_SLOTS
399 #define CYTHON_USE_TYPE_SLOTS 1
400 #elif !defined(CYTHON_USE_TYPE_SLOTS)
401 #define CYTHON_USE_TYPE_SLOTS 1
402 #endif
403 #ifndef CYTHON_USE_TYPE_SPECS
404 #define CYTHON_USE_TYPE_SPECS 0
405 #endif
406 #ifndef CYTHON_USE_PYTYPE_LOOKUP
407 #define CYTHON_USE_PYTYPE_LOOKUP 1
408 #endif
409 #ifndef CYTHON_USE_PYLONG_INTERNALS
410 #define CYTHON_USE_PYLONG_INTERNALS 1
411 #endif
412 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
413 #undef CYTHON_USE_PYLIST_INTERNALS
414 #define CYTHON_USE_PYLIST_INTERNALS 0
415 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
416 #define CYTHON_USE_PYLIST_INTERNALS 1
417 #endif
418 #ifndef CYTHON_USE_UNICODE_INTERNALS
419 #define CYTHON_USE_UNICODE_INTERNALS 1
420 #endif
421 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
422 #undef CYTHON_USE_UNICODE_WRITER
423 #define CYTHON_USE_UNICODE_WRITER 0
424 #elif !defined(CYTHON_USE_UNICODE_WRITER)
425 #define CYTHON_USE_UNICODE_WRITER 1
426 #endif
427 #ifndef CYTHON_AVOID_BORROWED_REFS
428 #define CYTHON_AVOID_BORROWED_REFS 0
429 #endif
430 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
431 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
432 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
433 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
434 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
435 #endif
436 #ifndef CYTHON_ASSUME_SAFE_MACROS
437 #define CYTHON_ASSUME_SAFE_MACROS 1
438 #endif
439 #ifndef CYTHON_ASSUME_SAFE_SIZE
440 #define CYTHON_ASSUME_SAFE_SIZE 1
441 #endif
442 #ifndef CYTHON_UNPACK_METHODS
443 #define CYTHON_UNPACK_METHODS 1
444 #endif
445 #ifndef CYTHON_FAST_THREAD_STATE
446 #define CYTHON_FAST_THREAD_STATE 1
447 #endif
448 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
449 #undef CYTHON_FAST_GIL
450 #define CYTHON_FAST_GIL 0
451 #elif !defined(CYTHON_FAST_GIL)
452 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
453 #endif
454 #ifndef CYTHON_VECTORCALL
455 #define CYTHON_VECTORCALL 1
456 #endif
457 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
458 #undef CYTHON_VECTORCALL_TPNEW
459 #define CYTHON_VECTORCALL_TPNEW 0
460 #elif !defined(CYTHON_VECTORCALL_TPNEW)
461 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
462 #endif
463 #ifndef CYTHON_PEP487_INIT_SUBCLASS
464 #define CYTHON_PEP487_INIT_SUBCLASS 1
465 #endif
466 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
467 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
468 #endif
469 #ifndef CYTHON_USE_MODULE_STATE
470 #define CYTHON_USE_MODULE_STATE 0
471 #endif
472 #ifndef CYTHON_USE_SYS_MONITORING
473 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
474 #endif
475 #ifndef CYTHON_USE_TP_FINALIZE
476 #define CYTHON_USE_TP_FINALIZE 1
477 #endif
478 #ifndef CYTHON_USE_AM_SEND
479 #define CYTHON_USE_AM_SEND 1
480 #endif
481 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
482 #undef CYTHON_USE_DICT_VERSIONS
483 #define CYTHON_USE_DICT_VERSIONS 0
484 #elif !defined(CYTHON_USE_DICT_VERSIONS)
485 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
486 #endif
487 #ifndef CYTHON_USE_EXC_INFO_STACK
488 #define CYTHON_USE_EXC_INFO_STACK 1
489 #endif
490 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
491 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
492 #endif
493 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
494 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
495 #endif
496 #ifndef CYTHON_USE_FREELISTS
497 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
498 #endif
499 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
500 #undef CYTHON_IMMORTAL_CONSTANTS
501 #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work
502 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
503 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
504 #endif
505 #ifndef CYTHON_OPAQUE_OBJECTS
506 #define CYTHON_OPAQUE_OBJECTS 0
507 #endif
508#endif
509#if CYTHON_USE_PYLONG_INTERNALS
510 #undef SHIFT
511 #undef BASE
512 #undef MASK
513 #ifdef SIZEOF_VOID_P
514 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
515 #endif
516#endif
517#ifndef __has_attribute
518 #define __has_attribute(x) 0
519#endif
520#ifndef __has_cpp_attribute
521 #define __has_cpp_attribute(x) 0
522#endif
523#ifndef CYTHON_RESTRICT
524 #if defined(__GNUC__)
525 #define CYTHON_RESTRICT __restrict__
526 #elif defined(_MSC_VER) && _MSC_VER >= 1400
527 #define CYTHON_RESTRICT __restrict
528 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
529 #define CYTHON_RESTRICT restrict
530 #else
531 #define CYTHON_RESTRICT
532 #endif
533#endif
534#ifndef CYTHON_UNUSED
535 #if defined(__cplusplus)
536 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
537 * but leads to warnings with -pedantic, since it is a C++17 feature */
538 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
539 #if __has_cpp_attribute(maybe_unused)
540 #define CYTHON_UNUSED [[maybe_unused]]
541 #endif
542 #endif
543 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
544 #define CYTHON_UNUSED [[maybe_unused]]
545 #endif
546#endif
547#ifndef CYTHON_UNUSED
548# if defined(__GNUC__)
549# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
550# define CYTHON_UNUSED __attribute__ ((__unused__))
551# else
552# define CYTHON_UNUSED
553# endif
554# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
555# define CYTHON_UNUSED __attribute__ ((__unused__))
556# else
557# define CYTHON_UNUSED
558# endif
559#endif
560#ifndef CYTHON_UNUSED_VAR
561# if defined(__cplusplus)
562 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
563# else
564# define CYTHON_UNUSED_VAR(x) (void)(x)
565# endif
566#endif
567#ifndef CYTHON_MAYBE_UNUSED_VAR
568 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
569#endif
570#ifndef CYTHON_NCP_UNUSED
571# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
572# define CYTHON_NCP_UNUSED
573# else
574# define CYTHON_NCP_UNUSED CYTHON_UNUSED
575# endif
576#endif
577#ifndef CYTHON_USE_CPP_STD_MOVE
578 #if defined(__cplusplus) && (\
579 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
580 #define CYTHON_USE_CPP_STD_MOVE 1
581 #else
582 #define CYTHON_USE_CPP_STD_MOVE 0
583 #endif
584#endif
585#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
586#include <stdint.h>
587typedef uintptr_t __pyx_uintptr_t;
588#ifndef CYTHON_FALLTHROUGH
589 #if defined(__cplusplus)
590 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
591 * but leads to warnings with -pedantic, since it is a C++17 feature */
592 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
593 #if __has_cpp_attribute(fallthrough)
594 #define CYTHON_FALLTHROUGH [[fallthrough]]
595 #endif
596 #endif
597 #ifndef CYTHON_FALLTHROUGH
598 #if __has_cpp_attribute(clang::fallthrough)
599 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
600 #elif __has_cpp_attribute(gnu::fallthrough)
601 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
602 #endif
603 #endif
604 #endif
605 #ifndef CYTHON_FALLTHROUGH
606 #if __has_attribute(fallthrough)
607 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
608 #else
609 #define CYTHON_FALLTHROUGH
610 #endif
611 #endif
612 #if defined(__clang__) && defined(__apple_build_version__)
613 #if __apple_build_version__ < 7000000
614 #undef CYTHON_FALLTHROUGH
615 #define CYTHON_FALLTHROUGH
616 #endif
617 #endif
618#endif
619#ifdef Py_UNREACHABLE
620 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
621#elif __Pyx_has_cbuiltin(__builtin_unreachable)
622 #define __Pyx_UNREACHABLE() __builtin_unreachable()
623#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
624 #define __Pyx_UNREACHABLE() __builtin_unreachable()
625#elif defined(_MSC_VER)
626 #define __Pyx_UNREACHABLE() __assume(0)
627#else
628 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
629#endif
630#ifndef Py_UNREACHABLE
631 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
632#endif
633#ifdef __cplusplus
634 template <typename T>
635 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
636 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
637#else
638 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
639#endif
640#if CYTHON_COMPILING_IN_PYPY == 1
641 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
642#else
643 #define __PYX_NEED_TP_PRINT_SLOT 0
644#endif
645#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
646#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
647#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
648#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
649#else
650#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
651#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
652#endif
653
654/* CInitCode */
655#ifndef CYTHON_INLINE
656 #if defined(__clang__)
657 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
658 #elif defined(__GNUC__)
659 #define CYTHON_INLINE __inline__
660 #elif defined(_MSC_VER)
661 #define CYTHON_INLINE __inline
662 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
663 #define CYTHON_INLINE inline
664 #else
665 #define CYTHON_INLINE
666 #endif
667#endif
668
669/* PythonCompatibility */
670#define __PYX_BUILD_PY_SSIZE_T "n"
671#define CYTHON_FORMAT_SSIZE_T "z"
672#define __Pyx_BUILTIN_MODULE_NAME "builtins"
673#define __Pyx_DefaultClassType PyType_Type
674#if CYTHON_COMPILING_IN_LIMITED_API
675 #ifndef CO_OPTIMIZED
676 static int CO_OPTIMIZED;
677 #endif
678 #ifndef CO_NEWLOCALS
679 static int CO_NEWLOCALS;
680 #endif
681 #ifndef CO_VARARGS
682 static int CO_VARARGS;
683 #endif
684 #ifndef CO_VARKEYWORDS
685 static int CO_VARKEYWORDS;
686 #endif
687 #ifndef CO_ASYNC_GENERATOR
688 static int CO_ASYNC_GENERATOR;
689 #endif
690 #ifndef CO_GENERATOR
691 static int CO_GENERATOR;
692 #endif
693 #ifndef CO_COROUTINE
694 static int CO_COROUTINE;
695 #endif
696#else
697 #ifndef CO_COROUTINE
698 #define CO_COROUTINE 0x80
699 #endif
700 #ifndef CO_ASYNC_GENERATOR
701 #define CO_ASYNC_GENERATOR 0x200
702 #endif
703#endif
704static int __Pyx_init_co_variables(void);
705#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
706 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
707#else
708 #define __Pyx_Py_Is(x, y) ((x) == (y))
709#endif
710#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
711 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
712#else
713 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
714#endif
715#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
716 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
717#else
718 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
719#endif
720#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
721 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
722#else
723 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
724#endif
725#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
726#if CYTHON_COMPILING_IN_PYPY
727 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
728#else
729 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
730#endif
731#if CYTHON_COMPILING_IN_LIMITED_API
732static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
733static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
734#else
735#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
736#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
737#endif
738static int __Pyx_init_tpflags_variables(void);
739#ifndef Py_TPFLAGS_HAVE_FINALIZE
740 #define Py_TPFLAGS_HAVE_FINALIZE 0
741#endif
742#ifndef Py_TPFLAGS_SEQUENCE
743 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
744#endif
745#ifndef Py_TPFLAGS_MAPPING
746 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
747#endif
748#ifndef Py_TPFLAGS_IMMUTABLETYPE
749 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
750#endif
751#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
752 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
753#endif
754#ifndef METH_STACKLESS
755 #define METH_STACKLESS 0
756#endif
757#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
758 #ifndef METH_FASTCALL
759 #define METH_FASTCALL 0x80
760 #endif
761 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
762 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
763 Py_ssize_t nargs, PyObject *kwnames);
764#else
765 #if PY_VERSION_HEX >= 0x030d00A4
766 # define __Pyx_PyCFunctionFast PyCFunctionFast
767 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
768 #else
769 # define __Pyx_PyCFunctionFast _PyCFunctionFast
770 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
771 #endif
772#endif
773#if CYTHON_VECTORCALL
774 #define __Pyx_METH_FASTCALL METH_FASTCALL
775 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
776 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
777#else
778 #define __Pyx_METH_FASTCALL METH_VARARGS
779 #define __Pyx_PyCFunction_FastCall PyCFunction
780 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
781#endif
782#if CYTHON_VECTORCALL
783 #define __pyx_vectorcallfunc vectorcallfunc
784 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
785 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
786#else
787 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
788 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
789#endif
790#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
791#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
792#if CYTHON_COMPILING_IN_CPYTHON
793#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
794#elif !CYTHON_COMPILING_IN_LIMITED_API
795#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
796#endif
797#if CYTHON_COMPILING_IN_CPYTHON
798#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
799static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
800 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
801}
802#endif
803static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
804#if CYTHON_COMPILING_IN_LIMITED_API
805 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
806#else
807 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
808#endif
809}
810#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
811#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
812 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
813#else
814 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
815#endif
816#if CYTHON_COMPILING_IN_PYPY
817 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
818#else
819 #define __Pyx_PyCMethod PyCMethod
820#endif
821#ifndef METH_METHOD
822 #define METH_METHOD 0x200
823#endif
824#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
825 #define PyObject_Malloc(s) PyMem_Malloc(s)
826 #define PyObject_Free(p) PyMem_Free(p)
827 #define PyObject_Realloc(p) PyMem_Realloc(p)
828#endif
829#if CYTHON_COMPILING_IN_LIMITED_API
830 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
831#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
832 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
833 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
834#elif CYTHON_COMPILING_IN_GRAAL
835 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
836 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
837#else
838 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
839 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
840#endif
841#if CYTHON_COMPILING_IN_LIMITED_API
842 #define __Pyx_PyThreadState_Current PyThreadState_Get()
843#elif !CYTHON_FAST_THREAD_STATE
844 #define __Pyx_PyThreadState_Current PyThreadState_GET()
845#elif PY_VERSION_HEX >= 0x030d00A1
846 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
847#else
848 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
849#endif
850#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
851 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
852 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
853 #define CYTHON_OPAQUE_SHARED_TYPES 1
854#else
855 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
856 #define __PYX_SHARED_RELATIVE_OFFSET 0
857 #define CYTHON_OPAQUE_SHARED_TYPES 0
858#endif
859#if CYTHON_USE_MODULE_STATE
860static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
861{
862 void *result;
863 result = PyModule_GetState(op);
864 if (!result)
865 Py_FatalError("Couldn't find the module state");
866 return result;
867}
868#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
869#else
870#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
871#endif
872#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
873#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
874#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
875#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
876#if CYTHON_USE_TYPE_SLOTS
877 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
878 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
879 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
880 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
881#else
882 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
883 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
884 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
885 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
886 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
887 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
888 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
889#endif
890#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
891#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
892#else
893#define __Pyx_PyDict_NewPresized(n) PyDict_New()
894#endif
895#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
896#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
897#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
898#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
899static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
900 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
901 if (res == NULL && PyErr_Occurred()) {
902 PyErr_WriteUnraisable(NULL);
903 }
904 return res;
905}
906#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
907#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
908#define __Pyx_PyDict_GetItemStr PyDict_GetItem
909#else
910static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
911#if CYTHON_COMPILING_IN_PYPY
912 return PyDict_GetItem(dict, name);
913#else
914 PyDictEntry *ep;
915 PyDictObject *mp = (PyDictObject*) dict;
916 long hash = ((PyStringObject *) name)->ob_shash;
917 assert(hash != -1);
918 ep = (mp->ma_lookup)(mp, name, hash);
919 if (ep == NULL) {
920 return NULL;
921 }
922 return ep->me_value;
923#endif
924}
925#define __Pyx_PyDict_GetItemStr PyDict_GetItem
926#endif
927#if CYTHON_USE_TYPE_SLOTS
928 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
929 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
930#else
931 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
932 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
933#endif
934#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
935#if CYTHON_USE_TYPE_SPECS
936#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
937 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
938 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
939 PyObject_GC_Del(obj);\
940 Py_DECREF(type);\
941}
942#else
943#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
944#endif
945#if CYTHON_COMPILING_IN_LIMITED_API
946 #define __Pyx_PyUnicode_READY(op) (0)
947 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
948 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
949 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
950 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
951 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
952 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
953 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
954#else
955 #if PY_VERSION_HEX >= 0x030C0000
956 #define __Pyx_PyUnicode_READY(op) (0)
957 #else
958 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
959 0 : _PyUnicode_Ready((PyObject *)(op)))
960 #endif
961 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
962 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
963 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
964 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
965 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
966 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
967 #if PY_VERSION_HEX >= 0x030C0000
968 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
969 #else
970 #if CYTHON_COMPILING_IN_CPYTHON
971 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
972 #else
973 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
974 #endif
975 #endif
976 static CYTHON_INLINE int __Pyx_PyUnicode_KIND_04(PyObject *o) {
977 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
978 }
979#endif
980#if CYTHON_COMPILING_IN_PYPY
981 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
982 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
983#else
984 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
985 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
986 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
987#endif
988#if CYTHON_COMPILING_IN_PYPY
989 #if !defined(PyUnicode_DecodeUnicodeEscape)
990 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
991 #endif
992 #if !defined(PyUnicode_Contains)
993 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
994 #endif
995 #if !defined(PyByteArray_Check)
996 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
997 #endif
998 #if !defined(PyObject_Format)
999 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1000 #endif
1001#endif
1002#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1003#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
1004 #define __Pyx_PySequence_ListKeepNew(obj)\
1005 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1006#elif CYTHON_COMPILING_IN_CPYTHON
1007 #define __Pyx_PySequence_ListKeepNew(obj)\
1008 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1009#else
1010 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1011#endif
1012#ifndef PySet_CheckExact
1013 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
1014#endif
1015enum __Pyx_ReferenceSharing {
1016 __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
1017 __Pyx_ReferenceSharing_OwnStrongReference,
1018 __Pyx_ReferenceSharing_FunctionArgument,
1019 __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
1020};
1021#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
1022#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
1023 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
1024 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
1025 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
1026#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
1027#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
1028#else
1029#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1030#endif
1031#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1032 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1033#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1034 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1035 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1036 #else
1037 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1038 #endif
1039#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1040 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1041#else
1042 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1043 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1044#endif
1045#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1046 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1047 __Pyx_PyList_GetItemRef(o, i))
1048#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1049 #if CYTHON_ASSUME_SAFE_MACROS
1050 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1051 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1052 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1053 #else
1054 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1055 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1056 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1057 #endif
1058#elif CYTHON_ASSUME_SAFE_MACROS
1059 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1060 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1061#else
1062 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1063 __Pyx_XNewRef(PyList_GetItem(o, i)))
1064#endif
1065#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1066#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1067#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1068static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1069 *result = PyObject_GetItem(dict, key);
1070 if (*result == NULL) {
1071 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1072 PyErr_Clear();
1073 return 0;
1074 }
1075 return -1;
1076 }
1077 return 1;
1078}
1079#else
1080static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1081 *result = PyDict_GetItemWithError(dict, key);
1082 if (*result == NULL) {
1083 return PyErr_Occurred() ? -1 : 0;
1084 }
1085 Py_INCREF(*result);
1086 return 1;
1087}
1088#endif
1089#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1090 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1091#else
1092 #define __Pyx_VISIT_CONST(obj)
1093#endif
1094#if CYTHON_ASSUME_SAFE_MACROS
1095 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1096 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1097 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1098 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1099 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1100 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1101#else
1102 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1103 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1104 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1105 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1106 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1107 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1108#endif
1109#if CYTHON_ASSUME_SAFE_SIZE
1110 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1111 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1112 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1113 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1114 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1115 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1116 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1117#else
1118 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1119 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1120 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1121 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1122 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1123 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1124 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1125#endif
1126#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1127 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1128#endif
1129#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1130#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1131#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1132 #define __Pyx_PySendResult PySendResult
1133#else
1134 typedef enum {
1135 PYGEN_RETURN = 0,
1136 PYGEN_ERROR = -1,
1137 PYGEN_NEXT = 1,
1138 } __Pyx_PySendResult;
1139#endif
1140#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1141 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1142#else
1143 #define __Pyx_pyiter_sendfunc sendfunc
1144#endif
1145#if !CYTHON_USE_AM_SEND
1146#define __PYX_HAS_PY_AM_SEND 0
1147#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1148#define __PYX_HAS_PY_AM_SEND 1
1149#else
1150#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
1151#endif
1152#if __PYX_HAS_PY_AM_SEND < 2
1153 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1154#else
1155 typedef struct {
1156 unaryfunc am_await;
1157 unaryfunc am_aiter;
1158 unaryfunc am_anext;
1159 __Pyx_pyiter_sendfunc am_send;
1160 } __Pyx_PyAsyncMethodsStruct;
1161 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1162#endif
1163#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1164 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1165#else
1166 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1167#endif
1168#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1169#ifdef __cplusplus
1170extern "C"
1171#endif
1172PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
1173#endif
1174#if CYTHON_COMPILING_IN_LIMITED_API
1175static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
1176 int value;
1177 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1178 if (!py_value) return 0;
1179 value = (int) PyLong_AsLong(py_value);
1180 Py_DECREF(py_value);
1181 *write_to = value;
1182 return value != -1 || !PyErr_Occurred();
1183}
1184static int __Pyx_init_co_variables(void) {
1185 PyObject *inspect;
1186 int result;
1187 inspect = PyImport_ImportModule("inspect");
1188 result =
1189#if !defined(CO_OPTIMIZED)
1190 __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
1191#endif
1192#if !defined(CO_NEWLOCALS)
1193 __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
1194#endif
1195#if !defined(CO_VARARGS)
1196 __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
1197#endif
1198#if !defined(CO_VARKEYWORDS)
1199 __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1200#endif
1201#if !defined(CO_ASYNC_GENERATOR)
1202 __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1203#endif
1204#if !defined(CO_GENERATOR)
1205 __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
1206#endif
1207#if !defined(CO_COROUTINE)
1208 __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
1209#endif
1210 1;
1211 Py_DECREF(inspect);
1212 return result ? 0 : -1;
1213}
1214static int __Pyx_init_tpflags_bitcount(unsigned long flag) {
1215 int count = 0;
1216 while (flag) {
1217 count += (int) (flag & 1);
1218 flag >>= 1;
1219 }
1220 return count;
1221}
1222static int __Pyx_init_tpflags_variables(void) {
1223 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1224 return 0;
1225 }
1226 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
1227 if (!collections_abc) return -1;
1228 int result = 0;
1229 PyObject *sequence = NULL, *mapping = NULL;
1230#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1231 if (PyObject_GetOptionalAttrString(collections_abc, "Sequence", &sequence) != 1) goto fail;
1232 if (PyObject_GetOptionalAttrString(collections_abc, "Mapping", &mapping) != 1) goto fail;
1233#else
1234 sequence = PyObject_GetAttrString(collections_abc, "Sequence");
1235 if (!sequence) goto fail_attr_lookup;
1236 mapping = PyObject_GetAttrString(collections_abc, "Mapping");
1237 if (!mapping) goto fail_attr_lookup;
1238#endif
1239 if (!PyType_Check(sequence) || !PyType_Check(mapping)) goto fail;
1240 {
1241 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1242 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1243 unsigned long mutual_flags = sequence_flags & mapping_flags;
1244 sequence_flags = sequence_flags ^ mutual_flags;
1245 mapping_flags = mapping_flags ^ mutual_flags;
1246 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1247 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1248 }
1249 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1250 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1251 }
1252 }
1253 cleanup:
1254 Py_XDECREF(mapping);
1255 Py_XDECREF(sequence);
1256 Py_DECREF(collections_abc);
1257 return result;
1258#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1259 fail_attr_lookup:
1260 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1261 PyErr_Clear();
1262 }
1263#endif
1264 fail:
1265 result = PyErr_Occurred() ? -1 : 0;
1266 goto cleanup;
1267}
1268#else
1269static int __Pyx_init_co_variables(void) {
1270 return 0; // It's a limited API-only feature
1271}
1272static int __Pyx_init_tpflags_variables(void) {
1273 return 0; // It's a limited API-only feature
1274}
1275#endif
1276
1277/* MathInitCode */
1278#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1279 #ifndef _USE_MATH_DEFINES
1280 #define _USE_MATH_DEFINES
1281 #endif
1282#endif
1283#include <math.h>
1284#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1285#define __Pyx_truncl trunc
1286#else
1287#define __Pyx_truncl truncl
1288#endif
1289
1290#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1291#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1292#endif
1293#ifndef CYTHON_CLINE_IN_TRACEBACK
1294#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1295#endif
1296#if CYTHON_CLINE_IN_TRACEBACK
1297#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
1298#else
1299#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
1300#endif
1301#define __PYX_ERR(f_index, lineno, Ln_error) \
1302 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1303
1304#ifdef CYTHON_EXTERN_C
1305 #undef __PYX_EXTERN_C
1306 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1307#elif defined(__PYX_EXTERN_C)
1308 #ifdef _MSC_VER
1309 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1310 #else
1311 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1312 #endif
1313#else
1314 #ifdef __cplusplus
1315 #define __PYX_EXTERN_C extern "C"
1316 #else
1317 #define __PYX_EXTERN_C extern
1318 #endif
1319#endif
1320
1321#define __PYX_HAVE__csmoothers
1322#define __PYX_HAVE_API__csmoothers
1323/* Early includes */
1324#include <string.h>
1325#include <stdio.h>
1326
1327 /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1328
1329#include "numpy/arrayobject.h"
1330#include "numpy/ndarrayobject.h"
1331#include "numpy/ndarraytypes.h"
1332#include "numpy/arrayscalars.h"
1333#include "numpy/ufuncobject.h"
1334#include "proteus_superlu.h"
1335#include "smoothers.h"
1336#include "pythread.h"
1337
1338 typedef int (*__pyx_memoryview_to_dtype_func_type)(char*, PyObject*);
1339
1340#include <stdlib.h>
1341#ifdef _OPENMP
1342#include <omp.h>
1343#endif /* _OPENMP */
1344
1345#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1346#define CYTHON_WITHOUT_ASSERTIONS
1347#endif
1348
1349#ifdef CYTHON_FREETHREADING_COMPATIBLE
1350#if CYTHON_FREETHREADING_COMPATIBLE
1351#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1352#else
1353#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1354#endif
1355#else
1356#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1357#endif
1358#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1359#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1360#define __PYX_DEFAULT_STRING_ENCODING ""
1361#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1362#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1363#define __Pyx_uchar_cast(c) ((unsigned char)c)
1364#define __Pyx_long_cast(x) ((long)x)
1365#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1366 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1367 (sizeof(type) > sizeof(Py_ssize_t) &&\
1368 likely(v < (type)PY_SSIZE_T_MAX ||\
1369 v == (type)PY_SSIZE_T_MAX) &&\
1370 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1371 v == (type)PY_SSIZE_T_MIN))) ||\
1372 (sizeof(type) == sizeof(Py_ssize_t) &&\
1373 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1374 v == (type)PY_SSIZE_T_MAX))) )
1375static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1376 return (size_t) i < (size_t) limit;
1377}
1378#if defined (__cplusplus) && __cplusplus >= 201103L
1379 #include <cstdlib>
1380 #define __Pyx_sst_abs(value) std::abs(value)
1381#elif SIZEOF_INT >= SIZEOF_SIZE_T
1382 #define __Pyx_sst_abs(value) abs(value)
1383#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1384 #define __Pyx_sst_abs(value) labs(value)
1385#elif defined (_MSC_VER)
1386 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1387#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1388 #define __Pyx_sst_abs(value) llabs(value)
1389#elif defined (__GNUC__)
1390 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1391#else
1392 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1393#endif
1394static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1395static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1396static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1397static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1398#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1399#define __Pyx_PyBytes_FromString PyBytes_FromString
1400#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1401static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1402#if CYTHON_ASSUME_SAFE_MACROS
1403 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1404 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1405 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1406 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1407 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1408 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1409 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1410#else
1411 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1412 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1413 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1414 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1415 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1416 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1417 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1418#endif
1419#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1420#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1421#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1422#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1423#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1424#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1425#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1426#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1427#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1428#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1429#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1430static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1431#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1432 return Py_NewRef(obj);
1433#else
1434 Py_INCREF(obj);
1435 return obj;
1436#endif
1437}
1438static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1439#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1440 return Py_XNewRef(obj);
1441#else
1442 Py_XINCREF(obj);
1443 return obj;
1444#endif
1445}
1446static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
1447static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1448static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1449static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1450static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1451#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1452#define __Pyx_PySequence_Tuple(obj)\
1453 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1454static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1455static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
1456static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1457#if CYTHON_ASSUME_SAFE_MACROS
1458#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1459#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1460#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1461#else
1462#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1463#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1464#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1465#endif
1466#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1467#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1468#if CYTHON_USE_PYLONG_INTERNALS
1469 #if PY_VERSION_HEX >= 0x030C00A7
1470 #ifndef _PyLong_SIGN_MASK
1471 #define _PyLong_SIGN_MASK 3
1472 #endif
1473 #ifndef _PyLong_NON_SIZE_BITS
1474 #define _PyLong_NON_SIZE_BITS 3
1475 #endif
1476 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1477 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1478 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1479 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1480 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1481 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1482 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1483 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1484 #define __Pyx_PyLong_SignedDigitCount(x)\
1485 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1486 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1487 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1488 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1489 #else
1490 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1491 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1492 #endif
1493 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1494 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1495 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1496 if (tag_a == tag_b) return 0;
1497 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1498 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1499 if (sign_a > sign_b) return -1;
1500 if (sign_a < sign_b) return 1;
1501 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1502 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1503 return (1 - sign_a) * (size_a - size_b);
1504 }
1505 typedef Py_ssize_t __Pyx_compact_pylong;
1506 typedef size_t __Pyx_compact_upylong;
1507 #else
1508 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1509 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1510 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1511 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1512 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1513 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1514 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1515 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1516 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1517 #define __Pyx_PyLong_CompactValue(x)\
1518 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1519 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1520 typedef sdigit __Pyx_compact_pylong;
1521 typedef digit __Pyx_compact_upylong;
1522 #endif
1523 #if PY_VERSION_HEX >= 0x030C00A5
1524 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1525 #else
1526 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1527 #endif
1528 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1529#else
1530 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1531#endif
1532#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1533 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1534#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1535 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1536#else
1537 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1538#endif
1539
1540
1541/* Test for GCC > 2.95 */
1542#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1543 #define likely(x) __builtin_expect(!!(x), 1)
1544 #define unlikely(x) __builtin_expect(!!(x), 0)
1545#else /* !__GNUC__ or GCC < 2.95 */
1546 #define likely(x) (x)
1547 #define unlikely(x) (x)
1548#endif /* __GNUC__ */
1549/* PretendToInitialize */
1550#ifdef __cplusplus
1551#if __cplusplus > 201103L
1552#include <type_traits>
1553#endif
1554template <typename T>
1555static void __Pyx_pretend_to_initialize(T* ptr) {
1556#if __cplusplus > 201103L
1557 if ((std::is_trivially_default_constructible<T>::value))
1558#endif
1559 *ptr = T();
1560 (void)ptr;
1561}
1562#else
1563static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1564#endif
1565
1566
1567#if !CYTHON_USE_MODULE_STATE
1568static PyObject *__pyx_m = NULL;
1569#endif
1570static const char * const __pyx_cfilenm = __FILE__;
1571
1572/* Header.proto */
1573#if !defined(CYTHON_CCOMPLEX)
1574 #if defined(__cplusplus)
1575 #define CYTHON_CCOMPLEX 1
1576 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1577 #define CYTHON_CCOMPLEX 1
1578 #else
1579 #define CYTHON_CCOMPLEX 0
1580 #endif
1581#endif
1582#if CYTHON_CCOMPLEX
1583 #ifdef __cplusplus
1584 #include <complex>
1585 #else
1586 #include <complex.h>
1587 #endif
1588#endif
1589#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1590 #undef _Complex_I
1591 #define _Complex_I 1.0fj
1592#endif
1593
1594/* #### Code section: filename_table ### */
1595
1596static const char* const __pyx_f[] = {
1597 "proteus/csmoothers.pyx",
1598 "View.MemoryView",
1599 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1600 "cpython/type.pxd",
1601 "proteus/superluWrappers.pxd",
1602};
1603/* #### Code section: utility_code_proto_before_types ### */
1604/* Atomics.proto (used by UnpackUnboundCMethod) */
1605#include <pythread.h>
1606#ifndef CYTHON_ATOMICS
1607 #define CYTHON_ATOMICS 1
1608#endif
1609#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1610#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1611#define __pyx_atomic_int_type int
1612#define __pyx_nonatomic_int_type int
1613#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1614 (__STDC_VERSION__ >= 201112L) &&\
1615 !defined(__STDC_NO_ATOMICS__))
1616 #include <stdatomic.h>
1617#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1618 (__cplusplus >= 201103L) ||\
1619 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1620 #include <atomic>
1621#endif
1622#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1623 (__STDC_VERSION__ >= 201112L) &&\
1624 !defined(__STDC_NO_ATOMICS__) &&\
1625 ATOMIC_INT_LOCK_FREE == 2)
1626 #undef __pyx_atomic_int_type
1627 #define __pyx_atomic_int_type atomic_int
1628 #define __pyx_atomic_ptr_type atomic_uintptr_t
1629 #define __pyx_nonatomic_ptr_type uintptr_t
1630 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1631 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1632 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1633 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1634 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1635 #define __pyx_atomic_load(value) atomic_load(value)
1636 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1637 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1638 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1639 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1640 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1641 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1642 #pragma message ("Using standard C atomics")
1643 #elif defined(__PYX_DEBUG_ATOMICS)
1644 #warning "Using standard C atomics"
1645 #endif
1646#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1647 (__cplusplus >= 201103L) ||\
1648\
1649 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1650 ATOMIC_INT_LOCK_FREE == 2)
1651 #undef __pyx_atomic_int_type
1652 #define __pyx_atomic_int_type std::atomic_int
1653 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1654 #define __pyx_nonatomic_ptr_type uintptr_t
1655 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1656 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1657 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1658 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1659 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1660 #define __pyx_atomic_load(value) std::atomic_load(value)
1661 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1662 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1663 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1664 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1665 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1666 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1667 #pragma message ("Using standard C++ atomics")
1668 #elif defined(__PYX_DEBUG_ATOMICS)
1669 #warning "Using standard C++ atomics"
1670 #endif
1671#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1672 (__GNUC_MINOR__ > 1 ||\
1673 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1674 #define __pyx_atomic_ptr_type void*
1675 #define __pyx_nonatomic_ptr_type void*
1676 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1677 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1678 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1679 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1680 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1681 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1682 int result = old == *expected;
1683 *expected = old;
1684 return result;
1685 }
1686 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1687 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1688 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1689 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1690 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1691 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1692 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1693 int result = old == *expected;
1694 *expected = old;
1695 return result;
1696 }
1697 #ifdef __PYX_DEBUG_ATOMICS
1698 #warning "Using GNU atomics"
1699 #endif
1700#elif CYTHON_ATOMICS && defined(_MSC_VER)
1701 #include <intrin.h>
1702 #undef __pyx_atomic_int_type
1703 #define __pyx_atomic_int_type long
1704 #define __pyx_atomic_ptr_type void*
1705 #undef __pyx_nonatomic_int_type
1706 #define __pyx_nonatomic_int_type long
1707 #define __pyx_nonatomic_ptr_type void*
1708 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1709 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1710 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1711 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1712 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1713 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1714 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1715 int result = old == *expected;
1716 *expected = old;
1717 return result;
1718 }
1719 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1720 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1721 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1722 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1723 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1724 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1725 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1726 int result = old == *expected;
1727 *expected = old;
1728 return result;
1729 }
1730 #ifdef __PYX_DEBUG_ATOMICS
1731 #pragma message ("Using MSVC atomics")
1732 #endif
1733#else
1734 #undef CYTHON_ATOMICS
1735 #define CYTHON_ATOMICS 0
1736 #ifdef __PYX_DEBUG_ATOMICS
1737 #warning "Not using atomics"
1738 #endif
1739#endif
1740
1741/* CriticalSectionsDefinition.proto (used by CriticalSections) */
1742#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1743#define __Pyx_PyCriticalSection void*
1744#define __Pyx_PyCriticalSection2 void*
1745#define __Pyx_PyCriticalSection_End(cs)
1746#define __Pyx_PyCriticalSection2_End(cs)
1747#else
1748#define __Pyx_PyCriticalSection PyCriticalSection
1749#define __Pyx_PyCriticalSection2 PyCriticalSection2
1750#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1751#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1752#endif
1753
1754/* CriticalSections.proto (used by ParseKeywordsImpl) */
1755#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1756#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1757#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1758#else
1759#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1760#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1761#endif
1762#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1763#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1764#define __Pyx_END_CRITICAL_SECTION() }
1765#else
1766#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1767#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1768#endif
1769
1770/* ForceInitThreads.proto */
1771#ifndef __PYX_FORCE_INIT_THREADS
1772 #define __PYX_FORCE_INIT_THREADS 0
1773#endif
1774
1775/* NoFastGil.proto */
1776#define __Pyx_PyGILState_Ensure PyGILState_Ensure
1777#define __Pyx_PyGILState_Release PyGILState_Release
1778#define __Pyx_FastGIL_Remember()
1779#define __Pyx_FastGIL_Forget()
1780#define __Pyx_FastGilFuncInit()
1781
1782/* IncludeStructmemberH.proto (used by CythonFunctionShared) */
1783#include <structmember.h>
1784
1785/* BufferFormatStructs.proto */
1786struct __Pyx_StructField_;
1787#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1788typedef struct {
1789 const char* name;
1790 const struct __Pyx_StructField_* fields;
1791 size_t size;
1792 size_t arraysize[8];
1793 int ndim;
1794 char typegroup;
1795 char is_unsigned;
1796 int flags;
1797} __Pyx_TypeInfo;
1798typedef struct __Pyx_StructField_ {
1799 const __Pyx_TypeInfo* type;
1800 const char* name;
1801 size_t offset;
1802} __Pyx_StructField;
1803typedef struct {
1804 const __Pyx_StructField* field;
1805 size_t parent_offset;
1806} __Pyx_BufFmt_StackElem;
1807typedef struct {
1808 __Pyx_StructField root;
1809 __Pyx_BufFmt_StackElem* head;
1810 size_t fmt_offset;
1811 size_t new_count, enc_count;
1812 size_t struct_alignment;
1813 int is_complex;
1814 char enc_type;
1815 char new_packmode;
1816 char enc_packmode;
1817 char is_valid_array;
1818} __Pyx_BufFmt_Context;
1819
1820/* MemviewSliceStruct.proto */
1821struct __pyx_memoryview_obj;
1822typedef struct {
1823 struct __pyx_memoryview_obj *memview;
1824 char *data;
1825 Py_ssize_t shape[8];
1826 Py_ssize_t strides[8];
1827 Py_ssize_t suboffsets[8];
1828} __Pyx_memviewslice;
1829#define __Pyx_MemoryView_Len(m) (m.shape[0])
1830#define __Pyx_MEMVIEW_DIRECT 1
1831#define __Pyx_MEMVIEW_PTR 2
1832#define __Pyx_MEMVIEW_FULL 4
1833#define __Pyx_MEMVIEW_CONTIG 8
1834#define __Pyx_MEMVIEW_STRIDED 16
1835#define __Pyx_MEMVIEW_FOLLOW 32
1836#define __Pyx_IS_C_CONTIG 1
1837#define __Pyx_IS_F_CONTIG 2
1838#define __Pyx_MEMSLICE_INIT { 0, 0, { 0 }, { 0 }, { 0 } }
1839#if CYTHON_ATOMICS
1840 #define __pyx_add_acquisition_count(memview)\
1841 __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
1842 #define __pyx_sub_acquisition_count(memview)\
1843 __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
1844#else
1845 #define __pyx_add_acquisition_count(memview)\
1846 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1847 #define __pyx_sub_acquisition_count(memview)\
1848 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1849#endif
1850
1851/* #### Code section: numeric_typedefs ### */
1852
1853/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":761
1854 * # in Cython to enable them only on the right systems.
1855 *
1856 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1857 * ctypedef npy_int16 int16_t
1858 * ctypedef npy_int32 int32_t
1859*/
1860typedef npy_int8 __pyx_t_5numpy_int8_t;
1861
1862/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":762
1863 *
1864 * ctypedef npy_int8 int8_t
1865 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1866 * ctypedef npy_int32 int32_t
1867 * ctypedef npy_int64 int64_t
1868*/
1869typedef npy_int16 __pyx_t_5numpy_int16_t;
1870
1871/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":763
1872 * ctypedef npy_int8 int8_t
1873 * ctypedef npy_int16 int16_t
1874 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1875 * ctypedef npy_int64 int64_t
1876 *
1877*/
1878typedef npy_int32 __pyx_t_5numpy_int32_t;
1879
1880/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":764
1881 * ctypedef npy_int16 int16_t
1882 * ctypedef npy_int32 int32_t
1883 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1884 *
1885 * ctypedef npy_uint8 uint8_t
1886*/
1887typedef npy_int64 __pyx_t_5numpy_int64_t;
1888
1889/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":766
1890 * ctypedef npy_int64 int64_t
1891 *
1892 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1893 * ctypedef npy_uint16 uint16_t
1894 * ctypedef npy_uint32 uint32_t
1895*/
1896typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1897
1898/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":767
1899 *
1900 * ctypedef npy_uint8 uint8_t
1901 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1902 * ctypedef npy_uint32 uint32_t
1903 * ctypedef npy_uint64 uint64_t
1904*/
1905typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1906
1907/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":768
1908 * ctypedef npy_uint8 uint8_t
1909 * ctypedef npy_uint16 uint16_t
1910 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1911 * ctypedef npy_uint64 uint64_t
1912 *
1913*/
1914typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1915
1916/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":769
1917 * ctypedef npy_uint16 uint16_t
1918 * ctypedef npy_uint32 uint32_t
1919 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1920 *
1921 * ctypedef npy_float32 float32_t
1922*/
1923typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1924
1925/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":771
1926 * ctypedef npy_uint64 uint64_t
1927 *
1928 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1929 * ctypedef npy_float64 float64_t
1930 * #ctypedef npy_float80 float80_t
1931*/
1932typedef npy_float32 __pyx_t_5numpy_float32_t;
1933
1934/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":772
1935 *
1936 * ctypedef npy_float32 float32_t
1937 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1938 * #ctypedef npy_float80 float80_t
1939 * #ctypedef npy_float128 float128_t
1940*/
1941typedef npy_float64 __pyx_t_5numpy_float64_t;
1942
1943/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":779
1944 * ctypedef double complex complex128_t
1945 *
1946 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1947 * ctypedef npy_ulonglong ulonglong_t
1948 *
1949*/
1950typedef npy_longlong __pyx_t_5numpy_longlong_t;
1951
1952/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":780
1953 *
1954 * ctypedef npy_longlong longlong_t
1955 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1956 *
1957 * ctypedef npy_intp intp_t
1958*/
1959typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1960
1961/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":782
1962 * ctypedef npy_ulonglong ulonglong_t
1963 *
1964 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1965 * ctypedef npy_uintp uintp_t
1966 *
1967*/
1968typedef npy_intp __pyx_t_5numpy_intp_t;
1969
1970/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":783
1971 *
1972 * ctypedef npy_intp intp_t
1973 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1974 *
1975 * ctypedef npy_double float_t
1976*/
1977typedef npy_uintp __pyx_t_5numpy_uintp_t;
1978
1979/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":785
1980 * ctypedef npy_uintp uintp_t
1981 *
1982 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1983 * ctypedef npy_double double_t
1984 * ctypedef npy_longdouble longdouble_t
1985*/
1986typedef npy_double __pyx_t_5numpy_float_t;
1987
1988/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":786
1989 *
1990 * ctypedef npy_double float_t
1991 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1992 * ctypedef npy_longdouble longdouble_t
1993 *
1994*/
1995typedef npy_double __pyx_t_5numpy_double_t;
1996
1997/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":787
1998 * ctypedef npy_double float_t
1999 * ctypedef npy_double double_t
2000 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
2001 *
2002 * ctypedef float complex cfloat_t
2003*/
2004typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
2005
2006/* "csmoothers.pxd":4
2007 * from proteus cimport superluWrappers
2008 *
2009 * ctypedef int PROTEUS_LAPACK_INTEGER # <<<<<<<<<<<<<<
2010 * # ARB - the compiler macro does not seem to be picking this up...
2011 * ctypedef double [:] DDATA
2012*/
2013typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
2014/* #### Code section: complex_type_declarations ### */
2015/* Declarations.proto */
2016#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2017 #ifdef __cplusplus
2018 typedef ::std::complex< float > __pyx_t_float_complex;
2019 #else
2020 typedef float _Complex __pyx_t_float_complex;
2021 #endif
2022#else
2023 typedef struct { float real, imag; } __pyx_t_float_complex;
2024#endif
2025static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
2026
2027/* Declarations.proto */
2028#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2029 #ifdef __cplusplus
2030 typedef ::std::complex< double > __pyx_t_double_complex;
2031 #else
2032 typedef double _Complex __pyx_t_double_complex;
2033 #endif
2034#else
2035 typedef struct { double real, imag; } __pyx_t_double_complex;
2036#endif
2037static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
2038
2039/* Declarations.proto */
2040#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2041 #ifdef __cplusplus
2042 typedef ::std::complex< long double > __pyx_t_long_double_complex;
2043 #else
2044 typedef long double _Complex __pyx_t_long_double_complex;
2045 #endif
2046#else
2047 typedef struct { long double real, imag; } __pyx_t_long_double_complex;
2048#endif
2049static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
2050
2051/* #### Code section: type_declarations ### */
2052
2053/*--- Type declarations ---*/
2054struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
2055struct __pyx_obj_10csmoothers_cASMFactor;
2056struct __pyx_obj_10csmoothers_cBASMFactor;
2057struct __pyx_array_obj;
2058struct __pyx_MemviewEnum_obj;
2059struct __pyx_memoryview_obj;
2060struct __pyx_memoryviewslice_obj;
2061struct __pyx_t_7proteus_15superluWrappers__NRformat;
2062
2063/* "superluWrappers.pxd":62
2064 * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
2065 *
2066 * cdef struct _NRformat: # <<<<<<<<<<<<<<
2067 * np.int32_t nnz
2068 * np.float64_t * nzval
2069*/
2070struct __pyx_t_7proteus_15superluWrappers__NRformat {
2071 __pyx_t_5numpy_int32_t nnz;
2072 __pyx_t_5numpy_float64_t *nzval;
2073 __pyx_t_5numpy_int32_t *colind;
2074 __pyx_t_5numpy_int32_t *rowptr;
2075};
2076
2077/* "csmoothers.pxd":6
2078 * ctypedef int PROTEUS_LAPACK_INTEGER
2079 * # ARB - the compiler macro does not seem to be picking this up...
2080 * ctypedef double [:] DDATA # <<<<<<<<<<<<<<
2081 * ctypedef int [:] IDATA
2082 * ctypedef superluWrappers._SuperMatrix SuperMatrix
2083*/
2084typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
2085
2086/* "csmoothers.pxd":7
2087 * # ARB - the compiler macro does not seem to be picking this up...
2088 * ctypedef double [:] DDATA
2089 * ctypedef int [:] IDATA # <<<<<<<<<<<<<<
2090 * ctypedef superluWrappers._SuperMatrix SuperMatrix
2091 *
2092*/
2093typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
2094
2095/* "csmoothers.pxd":8
2096 * ctypedef double [:] DDATA
2097 * ctypedef int [:] IDATA
2098 * ctypedef superluWrappers._SuperMatrix SuperMatrix # <<<<<<<<<<<<<<
2099 *
2100 * cdef extern from "smoothers.h":
2101*/
2102typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
2103
2104/* "superluWrappers.pxd":68
2105 * np.int32_t * rowptr
2106 *
2107 * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
2108 * cdef np.int32_t dim[2]
2109 * cdef _NRformat A
2110*/
2111struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
2112 PyObject_HEAD
2113 __pyx_t_5numpy_int32_t dim[2];
2114 struct __pyx_t_7proteus_15superluWrappers__NRformat A;
2115};
2116
2117
2118/* "csmoothers.pxd":26
2119 * void cbasm_NR_solve "basm_NR_solve"(int rowBlocks, int N, superluWrappers._SuperMatrix *A, double w, double** subdomainL, int* subdomain_dim, int** l2g_L, double* R, double** subdomainR, int* node_order, double** subdomain_dX, double* dX, PROTEUS_LAPACK_INTEGER** subdomainPivots, PROTEUS_LAPACK_INTEGER** subdomainColPivots)
2120 *
2121 * cdef class cASMFactor(object): # <<<<<<<<<<<<<<
2122 * cdef int N
2123 * cdef int *subdomain_dim
2124*/
2125struct __pyx_obj_10csmoothers_cASMFactor {
2126 PyObject_HEAD
2127 int N;
2128 int *subdomain_dim;
2129 int **l2g_L;
2130 double **subdomain_L;
2131 double **subdomain_R;
2132 double **subdomain_dX;
2133 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
2134};
2135
2136
2137/* "csmoothers.pxd":35
2138 * cdef PROTEUS_LAPACK_INTEGER **subdomain_pivots
2139 *
2140 * cdef class cBASMFactor(object): # <<<<<<<<<<<<<<
2141 * cdef int N
2142 * cdef int bs
2143*/
2144struct __pyx_obj_10csmoothers_cBASMFactor {
2145 PyObject_HEAD
2146 int N;
2147 int bs;
2148 int *subdomain_dim;
2149 int **l2g_L;
2150 double **subdomain_L;
2151 double **subdomain_R;
2152 double **subdomain_dX;
2153 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
2154 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
2155};
2156
2157
2158/* "View.MemoryView":128
2159 *
2160 *
2161 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2162 * @cname("__pyx_array")
2163 * cdef class array:
2164*/
2165struct __pyx_array_obj {
2166 PyObject_HEAD
2167 struct __pyx_vtabstruct_array *__pyx_vtab;
2168 char *data;
2169 Py_ssize_t len;
2170 char *format;
2171 int ndim;
2172 Py_ssize_t *_shape;
2173 Py_ssize_t *_strides;
2174 Py_ssize_t itemsize;
2175 PyObject *mode;
2176 PyObject *_format;
2177 void (*callback_free_data)(void *);
2178 int free_data;
2179 int dtype_is_object;
2180};
2181
2182
2183/* "View.MemoryView":318
2184 *
2185 *
2186 * @cname('__pyx_MemviewEnum') # <<<<<<<<<<<<<<
2187 * cdef class Enum(object):
2188 * cdef object name
2189*/
2190struct __pyx_MemviewEnum_obj {
2191 PyObject_HEAD
2192 PyObject *name;
2193};
2194
2195
2196/* "View.MemoryView":353
2197 *
2198 *
2199 * @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
2200 * cdef class memoryview:
2201 *
2202*/
2203struct __pyx_memoryview_obj {
2204 PyObject_HEAD
2205 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2206 PyObject *obj;
2207 PyObject *_size;
2208 void *_unused;
2209 PyThread_type_lock lock;
2210 __pyx_atomic_int_type acquisition_count;
2211 Py_buffer view;
2212 int flags;
2213 int dtype_is_object;
2214 __Pyx_TypeInfo const *typeinfo;
2215};
2216
2217
2218/* "View.MemoryView":947
2219 *
2220 *
2221 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2222 * @cname('__pyx_memoryviewslice')
2223 * cdef class _memoryviewslice(memoryview):
2224*/
2225struct __pyx_memoryviewslice_obj {
2226 struct __pyx_memoryview_obj __pyx_base;
2227 __Pyx_memviewslice from_slice;
2228 PyObject *from_object;
2229 PyObject *(*to_object_func)(char *);
2230 __pyx_memoryview_to_dtype_func_type to_dtype_func;
2231};
2232
2233
2234
2235/* "View.MemoryView":128
2236 *
2237 *
2238 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2239 * @cname("__pyx_array")
2240 * cdef class array:
2241*/
2242
2243struct __pyx_vtabstruct_array {
2244 PyObject *(*get_memview)(struct __pyx_array_obj *);
2245};
2246static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2247
2248
2249/* "View.MemoryView":353
2250 *
2251 *
2252 * @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
2253 * cdef class memoryview:
2254 *
2255*/
2256
2257struct __pyx_vtabstruct_memoryview {
2258 char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
2259 PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
2260 PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2261 PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
2262 PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2263 PyObject *(*setitem_indexed1)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2264 PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
2265 PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
2266 PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
2267};
2268static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2269
2270
2271/* "View.MemoryView":947
2272 *
2273 *
2274 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2275 * @cname('__pyx_memoryviewslice')
2276 * cdef class _memoryviewslice(memoryview):
2277*/
2278
2279struct __pyx_vtabstruct__memoryviewslice {
2280 struct __pyx_vtabstruct_memoryview __pyx_base;
2281};
2282static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2283/* #### Code section: utility_code_proto ### */
2284
2285/* --- Runtime support code (head) --- */
2286/* Refnanny.proto */
2287#ifndef CYTHON_REFNANNY
2288 #define CYTHON_REFNANNY 0
2289#endif
2290#if CYTHON_REFNANNY
2291 typedef struct {
2292 void (*INCREF)(void*, PyObject*, Py_ssize_t);
2293 void (*DECREF)(void*, PyObject*, Py_ssize_t);
2294 void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2295 void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2296 void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2297 void (*FinishContext)(void**);
2298 } __Pyx_RefNannyAPIStruct;
2299 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2300 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2301 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2302 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2303 if (acquire_gil) {\
2304 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2305 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2306 PyGILState_Release(__pyx_gilstate_save);\
2307 } else {\
2308 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2309 }
2310 #define __Pyx_RefNannyFinishContextNogil() {\
2311 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2312 __Pyx_RefNannyFinishContext();\
2313 PyGILState_Release(__pyx_gilstate_save);\
2314 }
2315 #define __Pyx_RefNannyFinishContextNogil() {\
2316 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2317 __Pyx_RefNannyFinishContext();\
2318 PyGILState_Release(__pyx_gilstate_save);\
2319 }
2320 #define __Pyx_RefNannyFinishContext()\
2321 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2322 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2323 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2324 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2325 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2326 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2327 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2328 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2329 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2330#else
2331 #define __Pyx_RefNannyDeclarations
2332 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2333 #define __Pyx_RefNannyFinishContextNogil()
2334 #define __Pyx_RefNannyFinishContext()
2335 #define __Pyx_INCREF(r) Py_INCREF(r)
2336 #define __Pyx_DECREF(r) Py_DECREF(r)
2337 #define __Pyx_GOTREF(r)
2338 #define __Pyx_GIVEREF(r)
2339 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2340 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2341 #define __Pyx_XGOTREF(r)
2342 #define __Pyx_XGIVEREF(r)
2343#endif
2344#define __Pyx_Py_XDECREF_SET(r, v) do {\
2345 PyObject *tmp = (PyObject *) r;\
2346 r = v; Py_XDECREF(tmp);\
2347 } while (0)
2348#define __Pyx_XDECREF_SET(r, v) do {\
2349 PyObject *tmp = (PyObject *) r;\
2350 r = v; __Pyx_XDECREF(tmp);\
2351 } while (0)
2352#define __Pyx_DECREF_SET(r, v) do {\
2353 PyObject *tmp = (PyObject *) r;\
2354 r = v; __Pyx_DECREF(tmp);\
2355 } while (0)
2356#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2357#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2358
2359/* FastTypeChecks.proto (used by GivenExceptionMatches) */
2360#if CYTHON_COMPILING_IN_CPYTHON
2361#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2362#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2363static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2364static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2365#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2366#else
2367#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2368#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2369#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2370#endif
2371
2372/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
2373#if CYTHON_FAST_THREAD_STATE
2374#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2375#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2376#if PY_VERSION_HEX >= 0x030C00A6
2377#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2378#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2379#else
2380#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2381#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2382#endif
2383#else
2384#define __Pyx_PyThreadState_declare
2385#define __Pyx_PyThreadState_assign
2386#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2387#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2388#endif
2389
2390/* PyErrFetchRestore.proto (used by GivenExceptionMatches) */
2391#if CYTHON_FAST_THREAD_STATE
2392#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2393#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2394#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2395#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2396#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2397static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2398static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2399#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2400#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2401#else
2402#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2403#endif
2404#else
2405#define __Pyx_PyErr_Clear() PyErr_Clear()
2406#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2407#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2408#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2409#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2410#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2411#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2412#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2413#endif
2414
2415/* GivenExceptionMatches.proto (used by PyErrExceptionMatches) */
2416#if CYTHON_COMPILING_IN_CPYTHON
2417static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2418static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2419#else
2420#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2421static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2422 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2423}
2424#endif
2425#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2426
2427/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
2428#if CYTHON_FAST_THREAD_STATE
2429#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2430static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2431#else
2432#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2433#endif
2434
2435/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */
2436#if CYTHON_USE_TYPE_SLOTS
2437static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2438#else
2439#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2440#endif
2441
2442/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */
2443static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2444
2445/* GetBuiltinName.proto */
2446static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2447
2448/* CopyObjectArray.proto (used by TupleOrListFromArrayImpl) */
2449#if CYTHON_COMPILING_IN_CPYTHON
2450static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2451#endif
2452
2453/* TupleOrListFromArrayImpl.proto (used by TupleFromArray) */
2454#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2455#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2456#else
2457CYTHON_UNUSED static PyObject *
2458__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2459#endif
2460
2461/* TupleFromArray.proto (used by fastcall) */
2462
2463
2464/* IncludeStringH.proto (used by PyObjectCompare) */
2465#include <string.h>
2466
2467/* PyObjectCompare.proto (used by UnicodeEquals) */
2468static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop);
2469
2470/* UnicodeEquals.proto (used by fastcall) */
2471#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2472
2473/* fastcall.proto */
2474#if CYTHON_AVOID_BORROWED_REFS
2475 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2476#elif CYTHON_ASSUME_SAFE_MACROS
2477 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2478#else
2479 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2480#endif
2481#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2482#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2483#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2484#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2485#if CYTHON_VECTORCALL
2486 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2487 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2488 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2489 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2490 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2491 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2492 #else
2493 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2494 #endif
2495#else
2496 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2497 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2498 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2499 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2500 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2501#endif
2502#if CYTHON_VECTORCALL_TPNEW
2503 #if !CYTHON_VECTORCALL
2504 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2505 #endif
2506 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2507 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2508 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2509 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2510 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2511#else
2512 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2513 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2514 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2515 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2516 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2517#endif
2518#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2519#if CYTHON_VECTORCALL
2520#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2521#else
2522#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2523#endif
2524
2525/* py_dict_items.proto (used by OwnedDictNext) */
2526#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2527#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2528#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2529static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2530
2531/* CallCFunction.proto (used by CallUnboundCMethod0) */
2532#define __Pyx_CallCFunction(cfunc, self, args)\
2533 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2534#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2535 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2536#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2537 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2538#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2539 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2540
2541/* PyObjectCall.proto (used by PyObjectFastCall) */
2542#if CYTHON_COMPILING_IN_CPYTHON
2543static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2544#else
2545#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2546#endif
2547
2548/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
2549#if CYTHON_COMPILING_IN_CPYTHON
2550static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2551#endif
2552
2553/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */
2554#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2555static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargsf, PyObject *kwargs);
2556
2557/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
2558static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2559
2560/* UnpackUnboundCMethod_decl.proto (used by UnpackUnboundCMethod) */
2561typedef struct {
2562 PyObject *type;
2563 PyObject **method_name;
2564 PyCFunction func;
2565 PyObject *method;
2566 int flag;
2567#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2568 __pyx_atomic_int_type initialized;
2569#endif
2570} __Pyx_CachedCFunction;
2571
2572/* IgnoreException.proto (used by UnpackUnboundCMethod_impl) */
2573static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2574#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2575
2576/* UnpackUnboundCMethod_impl.export */
2577static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2578
2579/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
2580#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2581static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2582#if !CYTHON_ATOMICS
2583 return 1;
2584#else
2585 __pyx_nonatomic_int_type expected = 0;
2586 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2587 return 0;
2588 }
2589 return expected;
2590#endif
2591}
2592static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2593#if CYTHON_ATOMICS
2594 __pyx_atomic_store(&cfunc->initialized, 2);
2595#endif
2596}
2597#else
2598#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2599#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2600#endif
2601
2602/* CallUnboundCMethod0.proto */
2603CYTHON_UNUSED
2604static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2605#if CYTHON_COMPILING_IN_CPYTHON
2606static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2607#else
2608#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2609#endif
2610
2611/* py_dict_values.proto (used by OwnedDictNext) */
2612#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2613#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2614#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2615static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2616
2617/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
2618#if CYTHON_AVOID_BORROWED_REFS
2619static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2620#else
2621CYTHON_INLINE
2622static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2623#endif
2624
2625/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
2626static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2627
2628/* ParseKeywordsImpl.export */
2629static int __Pyx_ParseKeywordsTuple(
2630 PyObject *kwds,
2631 PyObject * const *kwvalues,
2632 PyObject ** const argnames[],
2633 PyObject *kwds2,
2634 PyObject *values[],
2635 Py_ssize_t num_pos_args,
2636 Py_ssize_t num_kwargs,
2637 const char* function_name,
2638 int ignore_unknown_kwargs
2639);
2640static int __Pyx_ParseKeywordDictToDict(
2641 PyObject *kwds,
2642 PyObject ** const argnames[],
2643 PyObject *kwds2,
2644 PyObject *values[],
2645 Py_ssize_t num_pos_args,
2646 const char* function_name
2647);
2648static int __Pyx_ParseKeywordDict(
2649 PyObject *kwds,
2650 PyObject ** const argnames[],
2651 PyObject *values[],
2652 Py_ssize_t num_pos_args,
2653 Py_ssize_t num_kwargs,
2654 const char* function_name,
2655 int ignore_unknown_kwargs
2656);
2657
2658/* CallUnboundCMethod2.proto */
2659CYTHON_UNUSED
2660static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2661#if CYTHON_COMPILING_IN_CPYTHON
2662static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2663#else
2664#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2665#endif
2666
2667/* ParseKeywords.proto */
2668static CYTHON_INLINE int __Pyx_ParseKeywords(
2669 PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
2670 PyObject *kwds2, PyObject *values[],
2671 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2672 const char* function_name,
2673 int ignore_unknown_kwargs
2674);
2675
2676/* RaiseArgTupleInvalid.export */
2677static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2678 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2679
2680/* ArgTypeTestError.export */
2681static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2682
2683/* ArgTypeTest.proto */
2684static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact);
2685
2686/* PyObjectFastCallMethod.proto */
2687#if CYTHON_VECTORCALL
2688#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
2689#else
2690static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
2691#endif
2692
2693/* FormatTypeName.proto (used by RaiseErrorWithObjectType1) */
2694#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2695typedef PyObject *__Pyx_TypeName;
2696#define __Pyx_FMT_TYPENAME "%N"
2697#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2698#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2699#elif CYTHON_COMPILING_IN_LIMITED_API
2700typedef PyObject *__Pyx_TypeName;
2701#define __Pyx_FMT_TYPENAME "%U"
2702#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2703static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2704#else // !LIMITED_API
2705typedef const char *__Pyx_TypeName;
2706#define __Pyx_FMT_TYPENAME "%.200s"
2707#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2708#define __Pyx_DECREF_TypeName(obj)
2709#endif
2710
2711/* RaiseErrorWithObjectType1.proto (used by RaiseUnexpectedTypeError) */
2712#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
2713#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
2714CYTHON_UNUSED
2715static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj);
2716
2717/* RaiseUnexpectedTypeError.proto */
2718CYTHON_UNUSED
2719static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2720
2721/* PyMemoryError_Check.proto */
2722#define __Pyx_PyExc_MemoryError_Check(obj) __Pyx_TypeCheck(obj, PyExc_MemoryError)
2723
2724/* RaiseException.export */
2725static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2726
2727/* PyValueError_Check.proto */
2728#define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError)
2729
2730/* BuildPyUnicode.proto (used by COrdinalToPyUnicode) */
2731static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
2732 int prepend_sign, char padding_char);
2733
2734/* COrdinalToPyUnicode.proto (used by CIntToPyUnicode) */
2735static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value);
2736static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char);
2737
2738/* GCCDiagnostics.proto (used by CIntToPyUnicode) */
2739#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2740#define __Pyx_HAS_GCC_DIAGNOSTIC
2741#endif
2742
2743/* IncludeStdlibH.proto (used by CIntToPyUnicode) */
2744#include <stdlib.h>
2745
2746/* CIntToPyUnicode.proto */
2747#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\
2748 ((format_char) == ('c')) ?\
2749 __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\
2750 __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\
2751 )
2752static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char);
2753static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
2754
2755/* CIntToPyUnicode.proto */
2756#define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\
2757 ((format_char) == ('c')) ?\
2758 __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
2759 __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
2760 )
2761static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char);
2762static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
2763
2764/* JoinPyUnicode.proto */
2765#define __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH\
2766 (!CYTHON_COMPILING_IN_GRAAL && !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API)
2767
2768/* JoinPyUnicode.export */
2769static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind);
2770
2771/* UnicodeEqualsUCS4.proto (used by UnicodeEquals_uchar) */
2772#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
2773#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2774 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2775 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2776 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2777 )
2778#else
2779#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2780 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2781 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2782 (likely((s1_is_str) || PyUnicode_CheckExact(s1)) ?\
2783 __Pyx__PyUnicode_EqualsUCS4(s1, ch2, equals) :\
2784 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2785 ))
2786static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals);
2787#endif
2788
2789/* UnicodeEquals_uchar.proto */
2790#define __Pyx_PyObject_Equals_obj_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 0)
2791
2792/* PyObjectCompare.proto */
2793static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop);
2794
2795/* PyObjectFormatSimple.proto */
2796#if CYTHON_COMPILING_IN_PYPY
2797 #define __Pyx_PyObject_FormatSimple(s, f) (\
2798 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2799 PyObject_Format(s, f))
2800#elif CYTHON_USE_TYPE_SLOTS
2801 #define __Pyx_PyObject_FormatSimple(s, f) (\
2802 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2803 likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2804 likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2805 PyObject_Format(s, f))
2806#else
2807 #define __Pyx_PyObject_FormatSimple(s, f) (\
2808 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2809 PyObject_Format(s, f))
2810#endif
2811
2812/* PyObjectCompare.proto */
2813static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2, int pyop);
2814
2815CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2816/* UnicodeEquals_uchar.proto */
2817#define __Pyx_PyObject_Equals_str_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 1)
2818
2819static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2820/* GetAttr.proto */
2821static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2822
2823/* PyFrozenDict.proto (used by GetItemInt) */
2824#if CYTHON_COMPILING_IN_LIMITED_API
2825#define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
2826#define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
2827static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
2828#define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
2829#define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
2830#define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
2831#define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
2832static CYTHON_INLINE int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
2833 return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
2834}
2835#define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
2836static CYTHON_INLINE int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
2837 return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
2838}
2839#elif PY_VERSION_HEX >= 0x030f00a6 ||\
2840 (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
2841#define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
2842#define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
2843#define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
2844#define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
2845#define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
2846#define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
2847#define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
2848#else
2849#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
2850static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
2851 if (!it) {
2852 return PyDict_New();
2853 } else if (PyDict_Check(it)) {
2854 return PyDict_Copy(it);
2855 } else {
2856 PyObject *dict = PyDict_New();
2857 if (!dict) return NULL;
2858 PyObject *result = PyNumber_InPlaceOr(dict, it);
2859 Py_DECREF(dict);
2860 return result;
2861 }
2862}
2863#define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
2864#define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
2865#define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
2866#define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
2867#define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
2868#endif
2869
2870/* GetItemInt.proto */
2871#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2872 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2873 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2874 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
2875#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2876 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2877 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2878 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2879static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2880 int wraparound, int boundscheck, int unsafe_shared);
2881#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2882 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2883 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2884 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2885static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2886 int wraparound, int boundscheck, int unsafe_shared);
2887static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2888static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2889 int wraparound, int boundscheck, int unsafe_shared);
2890
2891/* RaiseErrorWithObjectType.proto (used by ObjectGetItem) */
2892#define __Pyx_RaiseTypeErrorWithObjectType(message, obj) __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
2893#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj) __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
2894CYTHON_UNUSED
2895static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj);
2896
2897/* ObjectGetItem.proto */
2898#if CYTHON_USE_TYPE_SLOTS
2899static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2900#else
2901#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2902#endif
2903
2904/* RejectKeywords.export */
2905static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);
2906
2907/* PyTypeError_Check.proto */
2908#define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError)
2909
2910/* DivInt[Py_ssize_t].proto */
2911static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);
2912
2913/* UnaryNegOverflows.proto */
2914#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2915 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2916
2917/* GetAttr3.proto */
2918static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2919
2920/* PyDictVersioning.proto (used by GetModuleGlobalName) */
2921#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2922#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2923#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2924#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2925 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2926 (cache_var) = (value);
2927#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2928 static PY_UINT64_T __pyx_dict_version = 0;\
2929 static PyObject *__pyx_dict_cached_value = NULL;\
2930 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2931 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2932 } else {\
2933 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2934 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2935 }\
2936}
2937static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2938static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2939static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2940#else
2941#define __PYX_GET_DICT_VERSION(dict) (0)
2942#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2943#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2944#endif
2945
2946/* GetModuleGlobalName.proto */
2947#if CYTHON_USE_DICT_VERSIONS
2948#define __Pyx_GetModuleGlobalName(var, name) do {\
2949 static PY_UINT64_T __pyx_dict_version = 0;\
2950 static PyObject *__pyx_dict_cached_value = NULL;\
2951 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
2952 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2953 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2954} while(0)
2955#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2956 PY_UINT64_T __pyx_dict_version;\
2957 PyObject *__pyx_dict_cached_value;\
2958 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2959} while(0)
2960static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2961#else
2962#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2963#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2964static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2965#endif
2966
2967/* AssertionsEnabled.proto */
2968#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
2969 static int __pyx_assertions_enabled_flag;
2970 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2971 #if __clang__ || __GNUC__
2972 __attribute__((no_sanitize("thread")))
2973 #endif
2974 static int __Pyx_init_assertions_enabled(void) {
2975 PyObject *builtins, *debug, *debug_str;
2976 int flag;
2977 builtins = PyEval_GetBuiltins();
2978 if (!builtins) goto bad;
2979 debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2980 if (!debug_str) goto bad;
2981 debug = PyObject_GetItem(builtins, debug_str);
2982 Py_DECREF(debug_str);
2983 if (!debug) goto bad;
2984 flag = PyObject_IsTrue(debug);
2985 Py_DECREF(debug);
2986 if (flag == -1) goto bad;
2987 __pyx_assertions_enabled_flag = flag;
2988 return 0;
2989 bad:
2990 __pyx_assertions_enabled_flag = 1;
2991 return -1;
2992 }
2993#else
2994 #define __Pyx_init_assertions_enabled() (0)
2995 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2996#endif
2997
2998/* PyAssertionError_Check.proto */
2999#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
3000
3001/* RaiseTooManyValuesToUnpack.proto */
3002static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
3003
3004/* RaiseNeedMoreValuesToUnpack.proto */
3005static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
3006
3007/* RaiseNoneIterError.proto */
3008static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
3009
3010/* GetTopmostException.proto (used by SaveResetException) */
3011#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
3012static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
3013#endif
3014
3015/* SaveResetException.proto */
3016#if CYTHON_FAST_THREAD_STATE
3017#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
3018static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3019#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
3020static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
3021#else
3022#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
3023#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
3024#endif
3025
3026/* RaiseErrorWithObjectTypes.proto (used by ExtTypeTest) */
3027#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
3028#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
3029#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
3030CYTHON_UNUSED
3031static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
3032
3033/* ExtTypeTest.proto */
3034static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
3035
3036/* GetException.proto */
3037#if CYTHON_FAST_THREAD_STATE
3038#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
3039static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3040#else
3041static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
3042#endif
3043
3044/* SwapException.proto */
3045#if CYTHON_FAST_THREAD_STATE
3046#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
3047static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3048#else
3049static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
3050#endif
3051
3052/* HasAttr.proto (used by ImportImpl) */
3053#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
3054#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
3055#else
3056static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
3057#endif
3058
3059/* TupleOrListFromArrayImpl.proto (used by ListFromArray) */
3060CYTHON_UNUSED static PyObject *
3061__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
3062
3063/* ListFromArray.proto (used by ImportImpl) */
3064
3065
3066/* ImportImpl.export */
3067static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);
3068
3069/* Import.proto */
3070static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);
3071
3072CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3073/* ListCompAppendAndDecref.proto */
3074static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x);
3075
3076/* PySequenceMultiply.proto */
3077#define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
3078#if !CYTHON_USE_TYPE_SLOTS
3079#define __Pyx_PySequence_Multiply PySequence_Repeat
3080#else
3081static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
3082#endif
3083
3084/* PyNumberBinop.proto */
3085#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
3086#define __Pyx_PyNumber_Multiply_object_int(op1, op2) PyNumber_Multiply(op1, op2)
3087#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
3088#else
3089#define __Pyx_PyNumber_Multiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 0)
3090#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 1)
3091static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2, int inplace);
3092#endif
3093
3094/* PyObjectFormatAndDecref.proto */
3095static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
3096static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
3097
3098/* PyObjectFormat.proto */
3099#if CYTHON_USE_UNICODE_WRITER
3100static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
3101#else
3102#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
3103#endif
3104
3105/* PyObject_Unicode.proto */
3106#define __Pyx_PyObject_Unicode(obj)\
3107 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
3108
3109/* SetItemInt.proto */
3110#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
3111 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3112 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, wraparound, boundscheck, unsafe_shared) :\
3113 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
3114static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
3115static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
3116 int wraparound, int boundscheck, int unsafe_shared);
3117
3118/* RaiseUnboundLocalError.proto */
3119static void __Pyx_RaiseUnboundLocalError(const char *varname);
3120
3121/* DivInt[long].proto */
3122static CYTHON_INLINE long __Pyx_div_long(long, long, int b_is_constant);
3123
3124/* PyException_Check.proto */
3125#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3126
3127/* PyImportError_Check.proto */
3128#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
3129
3130/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */
3131#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
3132#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
3133#else
3134#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
3135#endif
3136
3137/* PyObjectSetAttrStr.proto */
3138#if CYTHON_USE_TYPE_SLOTS
3139#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
3140static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
3141#else
3142#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n)
3143#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
3144#endif
3145
3146/* BufferIndexError.proto */
3147static void __Pyx_RaiseBufferIndexError(int axis);
3148
3149/* AllocateExtensionType.proto */
3150static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);
3151
3152/* CallSlotAsVectorcall.proto */
3153#if CYTHON_VECTORCALL_TPNEW
3154typedef PyObject * (*__Pyx_tpnewvectorcallfunc)(PyTypeObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
3155static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k);
3156#endif
3157
3158/* CallNewInitFromVectorcall.proto */
3159#if CYTHON_VECTORCALL_TPNEW
3160static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3161#endif
3162
3163/* DeallocKeepAlive.proto */
3164#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3165#define __Pyx_DeallocKeepAliveBegin(o) do {\
3166 _Py_atomic_store_uintptr_relaxed(&(o)->ob_tid, _Py_ThreadId());\
3167 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 1);\
3168 _Py_atomic_store_ssize_relaxed(&(o)->ob_ref_shared, 0);\
3169 } while (0)
3170#define __Pyx_DeallocKeepAliveEnd(o)\
3171 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 0)
3172#else
3173#define __Pyx_DeallocKeepAliveBegin(o) Py_SET_REFCNT(o, Py_REFCNT(o) + 1)
3174#define __Pyx_DeallocKeepAliveEnd(o) Py_SET_REFCNT(o, Py_REFCNT(o) - 1)
3175#endif
3176
3177/* CallSlotAsVectorcall.proto */
3178#if CYTHON_VECTORCALL_TPNEW
3179typedef int (*__Pyx_tpinitvectorcallfunc)(PyObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
3180static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k);
3181#endif
3182
3183/* CallTypeTraverse.proto */
3184#if !CYTHON_USE_TYPE_SPECS
3185#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
3186#else
3187static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
3188#endif
3189
3190/* PyObjectCallMethod0.proto (used by PyType_Ready) */
3191static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
3192
3193/* GetTypeDictOffset.proto (used by ValidateBasesTuple) */
3194#if !CYTHON_USE_TYPE_SLOTS
3195CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result);
3196#endif
3197
3198/* ValidateBasesTuple.proto (used by PyType_Ready) */
3199#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
3200static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases);
3201#endif
3202
3203/* PyType_Ready.export */
3204CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
3205
3206/* LimitedApiGetTypeTypeDict.proto (used by DelItemOnTypeDict) */
3207#if CYTHON_COMPILING_IN_LIMITED_API
3208static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp);
3209#endif
3210
3211/* DelItemOnTypeDict.proto (used by SetupReduce) */
3212#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)
3213
3214/* DelItemOnTypeDict.export */
3215static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
3216
3217/* SetItemOnTypeDict.proto (used by SetupReduce) */
3218#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
3219
3220/* SetItemOnTypeDict.export */
3221static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
3222
3223/* SetupReduce.export */
3224static int __Pyx_setup_reduce(PyObject* type_obj);
3225
3226/* ApplySequenceOrMappingFlag.proto */
3227#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3228int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence);
3229#else
3230#define __Pyx_ApplySequenceOrMappingFlag(tp, is_sequence) (0)
3231#endif
3232
3233/* GetVTable.proto (used by MergeVTables) */
3234static int __Pyx_GetVtable(PyTypeObject *type, void** table);
3235
3236/* MergeVTables.proto (used by SetVTable) */
3237static int __Pyx_MergeVtables(PyTypeObject *type);
3238
3239/* SetVTable.export */
3240static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
3241
3242/* TypeImport.proto */
3243#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
3244#define __PYX_HAVE_RT_ImportType_proto_3_3_0
3245#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
3246#include <stdalign.h>
3247#endif
3248#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
3249#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
3250#else
3251#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
3252#endif
3253enum __Pyx_ImportType_CheckSize_3_3_0 {
3254 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
3255 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
3256 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
3257};
3258static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size);
3259#endif
3260
3261/* Py3UpdateBases.export */
3262static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);
3263
3264/* CalculateMetaclass.proto */
3265static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
3266
3267/* dict_setdefault.proto (used by FetchCommonType) */
3268static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
3269
3270/* AddModuleRef.proto (used by FetchSharedCythonModule) */
3271#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
3272 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
3273 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
3274#else
3275 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
3276#endif
3277
3278/* FetchSharedCythonModule.proto (used by FetchCommonType) */
3279static PyObject *__Pyx_FetchSharedCythonABIModule(void);
3280
3281/* VerifyCachedType.proto (used by FetchCommonType) */
3282static int __Pyx_VerifyCachedType(PyObject *cached_type,
3283 const char *name,
3284 Py_ssize_t expected_basicsize);
3285
3286/* FetchCommonType.proto (used by CommonTypesMetaclass) */
3287static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
3288
3289/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
3290static int __pyx_CommonTypesMetaclass_init(PyObject *module);
3291#define __Pyx_CommonTypesMetaclass_USED
3292
3293/* CythonFunctionPerModule.proto (used by CythonFunctionShared) */
3294#define __Pyx_CyFunction_USED
3295#if CYTHON_OPAQUE_SHARED_TYPES
3296#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
3297#else
3298#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
3299#endif
3300#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
3301#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
3302#define __Pyx_CYFUNCTION_CCLASS 0x04
3303#define __Pyx_CYFUNCTION_COROUTINE 0x08
3304#define __Pyx_CyFunction_GetClosure(f)\
3305 ((__Pyx_as_CyFunctionObject(f))->func_closure)
3306#if CYTHON_COMPILING_IN_LIMITED_API
3307 #define __Pyx__CyFunction_GetClassObj(f)\
3308 ((f)->func_classobj)
3309#else
3310 #define __Pyx__CyFunction_GetClassObj(f)\
3311 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
3312#endif
3313#define __Pyx_CyFunction_GetClassObj(f)\
3314 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
3315#define __Pyx_CyFunction_SetClassObj(f, classobj)\
3316 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
3317#define __Pyx_CyFunction_Defaults(type, f)\
3318 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
3319#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
3320 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
3321typedef struct {
3322#if CYTHON_COMPILING_IN_LIMITED_API
3323#if !CYTHON_OPAQUE_OBJECTS
3324 PyObject_HEAD
3325#endif
3326 PyMethodDef *func_methoddef;
3327 PyObject *func_module;
3328#else
3329 PyCMethodObject func;
3330#endif
3331#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
3332 __pyx_vectorcallfunc func_vectorcall;
3333#endif
3334#if CYTHON_COMPILING_IN_LIMITED_API
3335 PyObject *func_weakreflist;
3336#endif
3337#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
3338 PyObject *func_dict;
3339#endif
3340 PyObject *func_name;
3341 PyObject *func_qualname;
3342 PyObject *func_doc;
3343 PyObject *func_globals;
3344 PyObject *func_code;
3345 PyObject *func_closure;
3346#if CYTHON_COMPILING_IN_LIMITED_API
3347 PyObject *func_classobj;
3348#endif
3349 PyObject *defaults;
3350 int flags;
3351 PyObject *defaults_tuple;
3352 PyObject *defaults_kwdict;
3353 PyObject *(*defaults_getter)(PyObject *);
3354 PyObject *func_annotations;
3355#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
3356 PyObject *func_is_coroutine;
3357#endif
3358} __pyx_CyFunctionObject;
3359#undef __Pyx_CyOrPyCFunction_Check
3360#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3361#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
3362#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3363static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
3364#undef __Pyx_IsSameCFunction
3365#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
3366static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
3367static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
3368 PyTypeObject *defaults_type);
3369static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
3370 PyObject *tuple);
3371static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3372 PyObject *dict);
3373static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
3374 PyObject *dict);
3375static int __pyx_CyFunction_init(PyObject *module);
3376#if CYTHON_VECTORCALL
3377#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3378#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
3379#else
3380#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3381#endif
3382#endif
3383
3384/* PyMethodNew.proto (used by CythonFunctionShared) */
3385static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
3386
3387/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
3388#if CYTHON_VECTORCALL
3389static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
3390#endif
3391
3392/* CythonFunctionShared.proto (used by CythonFunction) */
3393static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
3394 int flags, PyObject* qualname,
3395 PyObject *closure,
3396 PyObject *module, PyObject *globals,
3397 PyObject* code);
3398#if CYTHON_VECTORCALL
3399static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3400static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3401static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3402static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3403#endif
3404
3405/* CythonFunction.export */
3406static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3407 int flags, PyObject* qualname,
3408 PyObject *closure,
3409 PyObject *module, PyObject *globals,
3410 PyObject* code);
3411static PyTypeObject *__Pyx_Get_CyFunction_Type(void);
3412
3413/* SetNameInClass.proto */
3414#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
3415#define __Pyx_SetNameInClass(ns, name, value)\
3416 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
3417#elif CYTHON_COMPILING_IN_CPYTHON
3418#define __Pyx_SetNameInClass(ns, name, value)\
3419 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
3420#else
3421#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
3422#endif
3423
3424/* PyObjectCall2Args.proto (used by Py3ClassCreate) */
3425static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
3426
3427/* PyObjectLookupSpecial.proto (used by Py3ClassCreate) */
3428#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3429#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
3430#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
3431static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
3432#else
3433#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
3434#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
3435#endif
3436
3437/* Py3ClassCreate.export */
3438static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
3439 PyObject *mkw, PyObject *modname, PyObject *doc);
3440static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
3441 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
3442
3443/* CLineInTraceback.proto (used by AddTraceback) */
3444#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
3445static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3446#else
3447#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3448#endif
3449
3450/* CodeObjectCache.proto (used by AddTraceback) */
3451#if CYTHON_COMPILING_IN_LIMITED_API
3452typedef PyObject __Pyx_CachedCodeObjectType;
3453#else
3454typedef PyCodeObject __Pyx_CachedCodeObjectType;
3455#endif
3456typedef struct {
3457 __Pyx_CachedCodeObjectType* code_object;
3458 int code_line;
3459} __Pyx_CodeObjectCacheEntry;
3460struct __Pyx_CodeObjectCache {
3461 int count;
3462 int max_count;
3463 __Pyx_CodeObjectCacheEntry* entries;
3464 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3465 __pyx_atomic_int_type accessor_count;
3466 #endif
3467};
3468static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3469static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
3470static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);
3471
3472/* AddTraceback.proto */
3473static void __Pyx_AddTraceback(const char *funcname, int c_line,
3474 int py_line, const char *filename);
3475
3476/* BufferStructDeclare.proto */
3477typedef struct {
3478 Py_ssize_t shape, strides, suboffsets;
3479} __Pyx_Buf_DimInfo;
3480typedef struct {
3481 size_t refcount;
3482 Py_buffer pybuffer;
3483} __Pyx_Buffer;
3484typedef struct {
3485 __Pyx_Buffer *rcbuffer;
3486 char *data;
3487 __Pyx_Buf_DimInfo diminfo[8];
3488} __Pyx_LocalBuf_ND;
3489
3490/* MemviewRefcount.proto */
3491static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3492 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3493static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3494 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3495#define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3496#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3497#define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3498static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3499static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
3500
3501/* MemviewSliceIsContig.proto */
3502static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3503
3504/* OverlappingSlices.proto */
3505static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3506 __Pyx_memviewslice *slice2,
3507 int ndim, size_t itemsize);
3508
3509/* MemviewSliceInit.proto */
3510static int __Pyx_init_memviewslice(
3511 struct __pyx_memoryview_obj *memview,
3512 int ndim,
3513 __Pyx_memviewslice *memviewslice,
3514 int memview_is_new_reference);
3515
3516/* SliceMemoryviewSlice.proto */
3517static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
3518 __Pyx_memviewslice *dst,
3519 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
3520 int dim, int new_ndim, int *suboffset_dim,
3521 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
3522 int have_start, int have_stop, int have_step,
3523 int is_slice);
3524
3525/* IsLittleEndian.proto (used by BufferFormatCheck) */
3526static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
3527
3528/* BufferFormatCheck.proto (used by MemviewSliceValidateAndInit) */
3529static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
3530static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
3531 __Pyx_BufFmt_StackElem* stack,
3532 const __Pyx_TypeInfo* type);
3533
3534/* TypeInfoCompare.proto (used by MemviewSliceValidateAndInit) */
3535static int __pyx_typeinfo_cmp(const __Pyx_TypeInfo *a, const __Pyx_TypeInfo *b);
3536
3537/* MemviewSliceValidateAndInit.export */
3538static int __Pyx_ValidateAndInit_memviewslice(
3539 int *axes_specs,
3540 int c_or_f_flag,
3541 int buf_flags,
3542 int ndim,
3543 const __Pyx_TypeInfo *dtype,
3544 __Pyx_BufFmt_StackElem stack[],
3545 __Pyx_memviewslice *memviewslice,
3546 PyObject *original_obj);
3547
3548/* ObjectToMemviewSlice.proto */
3549static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
3550
3551/* ObjectToMemviewSlice.proto */
3552static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
3553
3554/* RealImag.proto */
3555#if CYTHON_CCOMPLEX
3556 #ifdef __cplusplus
3557 #define __Pyx_CREAL(z) ((z).real())
3558 #define __Pyx_CIMAG(z) ((z).imag())
3559 #else
3560 #define __Pyx_CREAL(z) (__real__(z))
3561 #define __Pyx_CIMAG(z) (__imag__(z))
3562 #endif
3563#else
3564 #define __Pyx_CREAL(z) ((z).real)
3565 #define __Pyx_CIMAG(z) ((z).imag)
3566#endif
3567#if defined(__cplusplus) && CYTHON_CCOMPLEX\
3568 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3569 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3570 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3571#else
3572 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3573 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3574#endif
3575
3576/* Arithmetic.proto */
3577#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3578 #define __Pyx_c_eq_float(a, b) ((a)==(b))
3579 #define __Pyx_c_sum_float(a, b) ((a)+(b))
3580 #define __Pyx_c_diff_float(a, b) ((a)-(b))
3581 #define __Pyx_c_prod_float(a, b) ((a)*(b))
3582 #define __Pyx_c_quot_float(a, b) ((a)/(b))
3583 #define __Pyx_c_neg_float(a) (-(a))
3584 #ifdef __cplusplus
3585 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3586 #define __Pyx_c_conj_float(z) (::std::conj(z))
3587 #if 1
3588 #define __Pyx_c_abs_float(z) (::std::abs(z))
3589 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3590 #endif
3591 #else
3592 #define __Pyx_c_is_zero_float(z) ((z)==0)
3593 #define __Pyx_c_conj_float(z) (conjf(z))
3594 #if 1
3595 #define __Pyx_c_abs_float(z) (cabsf(z))
3596 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3597 #endif
3598 #endif
3599#else
3600 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3601 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3602 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3603 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3604 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3605 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3606 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3607 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3608 #if 1
3609 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3610 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3611 #endif
3612#endif
3613
3614/* Arithmetic.proto */
3615#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3616 #define __Pyx_c_eq_double(a, b) ((a)==(b))
3617 #define __Pyx_c_sum_double(a, b) ((a)+(b))
3618 #define __Pyx_c_diff_double(a, b) ((a)-(b))
3619 #define __Pyx_c_prod_double(a, b) ((a)*(b))
3620 #define __Pyx_c_quot_double(a, b) ((a)/(b))
3621 #define __Pyx_c_neg_double(a) (-(a))
3622 #ifdef __cplusplus
3623 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3624 #define __Pyx_c_conj_double(z) (::std::conj(z))
3625 #if 1
3626 #define __Pyx_c_abs_double(z) (::std::abs(z))
3627 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3628 #endif
3629 #else
3630 #define __Pyx_c_is_zero_double(z) ((z)==0)
3631 #define __Pyx_c_conj_double(z) (conj(z))
3632 #if 1
3633 #define __Pyx_c_abs_double(z) (cabs(z))
3634 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3635 #endif
3636 #endif
3637#else
3638 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3639 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3640 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3641 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3642 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3643 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3644 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3645 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3646 #if 1
3647 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3648 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3649 #endif
3650#endif
3651
3652/* Arithmetic.proto */
3653#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3654 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3655 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3656 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3657 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3658 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3659 #define __Pyx_c_neg_long__double(a) (-(a))
3660 #ifdef __cplusplus
3661 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3662 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3663 #if 1
3664 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3665 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3666 #endif
3667 #else
3668 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3669 #define __Pyx_c_conj_long__double(z) (conjl(z))
3670 #if 1
3671 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3672 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3673 #endif
3674 #endif
3675#else
3676 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3677 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3678 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3679 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3680 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3681 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3682 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3683 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3684 #if 1
3685 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3686 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3687 #endif
3688#endif
3689
3690/* MemviewSliceCopy.proto */
3691static __Pyx_memviewslice
3692__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3693 const char *mode, int ndim,
3694 Py_ssize_t sizeof_dtype, int contig_flag,
3695 int dtype_is_object);
3696
3697/* CIntFromPy.proto */
3698static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
3699
3700/* PyObjectCallMethod1.proto (used by UpdateUnpickledDict) */
3701static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3702
3703/* UpdateUnpickledDict.export */
3704static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);
3705
3706/* CheckUnpickleChecksumError.export */
3707static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
3708
3709/* CheckUnpickleChecksum.proto */
3710static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
3711
3712/* CIntFromPy.proto */
3713static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
3714
3715/* PyObjectVectorcallKwds.proto (used by PyObjectVectorcallMethodKwds) */
3716#if CYTHON_VECTORCALL
3717#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
3718CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
3719#else
3720#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
3721CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n);
3722CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
3723#endif
3724
3725/* PyObjectVectorcallMethodKwds.proto (used by CIntToPy) */
3726#if CYTHON_VECTORCALL
3727#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
3728#else
3729static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3730#endif
3731
3732/* CIntToPy.proto */
3733static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value);
3734
3735/* CIntToPy.proto */
3736static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
3737
3738/* CIntFromPy.proto */
3739static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *);
3740
3741/* GetRuntimeVersion.proto */
3742#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
3743static unsigned long __Pyx_cached_runtime_version = 0;
3744static void __Pyx_init_runtime_version(void);
3745#else
3746#define __Pyx_init_runtime_version()
3747#endif
3748static unsigned long __Pyx_get_runtime_version(void);
3749
3750/* CheckBinaryVersion.proto */
3751static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3752
3753/* DecompressString.proto */
3754static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
3755
3756/* DecompressString_LZSS.proto */
3757static PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length);
3758
3759/* MultiPhaseInitModuleState.proto */
3760#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
3761#include <stdlib.h>
3762static PyObject *__Pyx_State_FindModule(void*);
3763static int __Pyx_State_AddModule(PyObject* module, void*);
3764static int __Pyx_State_RemoveModule(void*);
3765#elif CYTHON_USE_MODULE_STATE
3766#define __Pyx_State_FindModule PyState_FindModule
3767#define __Pyx_State_AddModule PyState_AddModule
3768#define __Pyx_State_RemoveModule PyState_RemoveModule
3769#endif
3770
3771/* #### Code section: module_declarations ### */
3772/* CythonABIVersion.proto */
3773#if CYTHON_COMPILING_IN_LIMITED_API
3774 #if CYTHON_VECTORCALL
3775 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
3776 #else
3777 #define __PYX_VECTORCALL_ABI_SUFFIX
3778 #endif
3779 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
3780#else
3781 #define __PYX_LIMITED_ABI_SUFFIX
3782#endif
3783#if __PYX_HAS_PY_AM_SEND == 1
3784 #define __PYX_AM_SEND_ABI_SUFFIX
3785#elif __PYX_HAS_PY_AM_SEND == 2
3786 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
3787#else
3788 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
3789#endif
3790#ifndef __PYX_MONITORING_ABI_SUFFIX
3791 #define __PYX_MONITORING_ABI_SUFFIX
3792#endif
3793#if CYTHON_USE_TP_FINALIZE
3794 #define __PYX_TP_FINALIZE_ABI_SUFFIX
3795#else
3796 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
3797#endif
3798#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
3799 #define __PYX_FREELISTS_ABI_SUFFIX
3800#else
3801 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
3802#endif
3803#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
3804 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
3805#else
3806 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3807#endif
3808#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3809#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
3810#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
3811
3812static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3813static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3814static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3815static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3816static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
3817static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value); /* proto*/
3818static PyObject *__pyx_memoryview_setitem_indexed1(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3819static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3820static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3821static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
3822static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3823static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3824static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
3825static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3826static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3827static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3828static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3829static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3830static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3831static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3832static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3833static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3834static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3835static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3836static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3837static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3838static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3839static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3840static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3841static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3842static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self); /* proto*/
3843static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self); /* proto*/
3844static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self); /* proto*/
3845static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self); /* proto*/
3846static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self); /* proto*/
3847static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self); /* proto*/
3848static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self); /* proto*/
3849static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3850static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3851static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3852static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3853static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3854static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3855static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3856static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3857static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3858static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3859static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3860
3861/* Module declarations from "proteus" */
3862
3863/* Module declarations from "libc.string" */
3864
3865/* Module declarations from "libc.stdio" */
3866
3867/* Module declarations from "__builtin__" */
3868
3869/* Module declarations from "cpython.type" */
3870
3871/* Module declarations from "cpython" */
3872
3873/* Module declarations from "cpython.object" */
3874
3875/* Module declarations from "cpython.ref" */
3876
3877/* Module declarations from "numpy" */
3878
3879/* Module declarations from "numpy" */
3880
3881/* Module declarations from "proteus.superluWrappers" */
3882
3883/* Module declarations from "cython.view" */
3884
3885/* Module declarations from "cython.dataclasses" */
3886
3887/* Module declarations from "cython" */
3888
3889/* Module declarations from "csmoothers" */
3890static PyObject *__pyx_collections_abc_Sequence = 0;
3891static PyObject *generic = 0;
3892static PyObject *strided = 0;
3893static PyObject *indirect = 0;
3894static PyObject *contiguous = 0;
3895static PyObject *indirect_contiguous = 0;
3896static int __pyx_memoryview_thread_locks_used;
3897static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3898static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
3899static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
3900static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
3901static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
3902static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
3903static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
3904static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cASMFactor *); /*proto*/
3905static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
3906static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cBASMFactor *); /*proto*/
3907static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
3908static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
3909static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char const *, char *); /*proto*/
3910static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo const *); /*proto*/
3911static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3912static int __pyx_memoryview_err_invalid_index(PyObject *); /*proto*/
3913static PyObject *_unellipsify_index_tuple(PyObject *, int); /*proto*/
3914static PyObject *_unellipsify(PyObject *, int); /*proto*/
3915static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3916static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3917static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3918static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3919static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), __pyx_memoryview_to_dtype_func_type, int); /*proto*/
3920static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3921static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3922static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3923static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3924static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3925static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3926static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3927static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3928static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3929static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3930static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3931static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3932static int __pyx_memoryview_err_dim(PyObject *, char const *, int); /*proto*/
3933static int __pyx_memoryview_err(PyObject *, char const *); /*proto*/
3934static int __pyx_memoryview_err_no_memory(void); /*proto*/
3935static int __pyx_memoryview_err_ValueError(char const *); /*proto*/
3936static int __pyx_memoryview_err_IndexError(char const *, Py_ssize_t); /*proto*/
3937static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3938static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3939static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3940static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3941static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3942static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3943static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3944static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3945/* #### Code section: typeinfo ### */
3946static const __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
3947static const __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, __PYX_IS_UNSIGNED(int) ? 'U' : 'I', __PYX_IS_UNSIGNED(int), 0 };
3948/* #### Code section: before_global_var ### */
3949#define __Pyx_MODULE_NAME "csmoothers"
3950extern int __pyx_module_is_main_csmoothers;
3951int __pyx_module_is_main_csmoothers = 0;
3952
3953/* Implementation of "csmoothers" */
3954/* #### Code section: global_var ### */
3955static PyObject *__pyx_builtin_object;
3956static PyObject *__pyx_builtin___import__;
3957static PyObject *__pyx_builtin_enumerate;
3958static PyObject *__pyx_builtin_Ellipsis;
3959static PyObject *__pyx_builtin_id;
3960/* #### Code section: string_decls ### */
3961static const char __pyx_k_c[] = "c";
3962static const char __pyx_k_name[] = "name";
3963static const char __pyx_k_fortran[] = "fortran";
3964static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
3965static const char __pyx_k_Cannot_index_with_type_200U[] = "Cannot index with type \047%.200U\047";
3966static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3967static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3968static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3969static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3970static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
3971static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3972static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3973static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %zd)";
3974static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3975static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %zd and %zd)";
3976/* #### Code section: decls ### */
3977static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
3978static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3979static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3980static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3981static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3982static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3983static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3984static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
3985static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3986static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3987static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3988static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3989static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3990static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3991static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3992static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3993static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3994static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3995static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3996static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3997static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3998static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3999static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4000static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4001static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4002static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4003static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4004static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4005static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4006static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4007static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4008static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4009static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4010static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4011static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4012static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4013static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4014static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4015static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4016static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4017static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
4018static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L); /* proto */
4019static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L); /* proto */
4020static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
4021static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
4022static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4023static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs); /* proto */
4024static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs); /* proto */
4025static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
4026static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
4027static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4028static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
4029static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
4030static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
4031static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
4032static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
4033static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
4034static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor); /* proto */
4035static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
4036static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor); /* proto */
4037static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
4038static PyObject *__pyx_tp_new__initialisation_10csmoothers_cASMFactor(PyObject *o,
4039#if CYTHON_VECTORCALL_TPNEW
4040 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4041#else
4042 PyObject *a, PyObject *k
4043#endif
4044); /*proto*/
4045static PyObject *__pyx_tp_new_vectorcall_10csmoothers_cASMFactor(PyTypeObject *t,
4046#if CYTHON_VECTORCALL_TPNEW
4047 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4048#else
4049 PyObject *a, PyObject *k
4050#endif
4051); /*proto*/
4052#if CYTHON_VECTORCALL_TPNEW
4053static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4054#endif
4055#if !CYTHON_VECTORCALL_TPNEW
4056#define __pyx_tp_new_10csmoothers_cASMFactor __pyx_tp_new_vectorcall_10csmoothers_cASMFactor
4057#endif
4058#if CYTHON_VECTORCALL_TPNEW
4059static PyObject *__pyx_tp_vectorcall_10csmoothers_cASMFactor(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4060#endif
4061static PyObject *__pyx_tp_new__initialisation_10csmoothers_cBASMFactor(PyObject *o,
4062#if CYTHON_VECTORCALL_TPNEW
4063 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4064#else
4065 PyObject *a, PyObject *k
4066#endif
4067); /*proto*/
4068static PyObject *__pyx_tp_new_vectorcall_10csmoothers_cBASMFactor(PyTypeObject *t,
4069#if CYTHON_VECTORCALL_TPNEW
4070 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4071#else
4072 PyObject *a, PyObject *k
4073#endif
4074); /*proto*/
4075#if CYTHON_VECTORCALL_TPNEW
4076static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4077#endif
4078#if !CYTHON_VECTORCALL_TPNEW
4079#define __pyx_tp_new_10csmoothers_cBASMFactor __pyx_tp_new_vectorcall_10csmoothers_cBASMFactor
4080#endif
4081#if CYTHON_VECTORCALL_TPNEW
4082static PyObject *__pyx_tp_vectorcall_10csmoothers_cBASMFactor(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4083#endif
4084static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
4085#if CYTHON_VECTORCALL_TPNEW
4086 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4087#else
4088 PyObject *a, PyObject *k
4089#endif
4090); /*proto*/
4091static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
4092#if CYTHON_VECTORCALL_TPNEW
4093 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4094#else
4095 PyObject *a, PyObject *k
4096#endif
4097); /*proto*/
4098#if CYTHON_VECTORCALL_TPNEW
4099static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4100#endif
4101#if !CYTHON_VECTORCALL_TPNEW
4102#define __pyx_tp_new_array __pyx_tp_new_vectorcall_array
4103#endif
4104#if CYTHON_VECTORCALL_TPNEW
4105static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4106#endif
4107static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
4108#if CYTHON_VECTORCALL_TPNEW
4109 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4110#else
4111 PyObject *a, PyObject *k
4112#endif
4113); /*proto*/
4114static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
4115#if CYTHON_VECTORCALL_TPNEW
4116 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4117#else
4118 PyObject *a, PyObject *k
4119#endif
4120); /*proto*/
4121#if CYTHON_VECTORCALL_TPNEW
4122static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4123#endif
4124#if !CYTHON_VECTORCALL_TPNEW
4125#define __pyx_tp_new_Enum __pyx_tp_new_vectorcall_Enum
4126#endif
4127#if CYTHON_VECTORCALL_TPNEW
4128static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4129#endif
4130#if CYTHON_VECTORCALL_TPNEW
4131static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
4132#endif
4133#if !CYTHON_VECTORCALL_TPNEW
4134#define __pyx_tp_init_Enum __pyx_MemviewEnum___init__
4135#endif
4136static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
4137#if CYTHON_VECTORCALL_TPNEW
4138 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4139#else
4140 PyObject *a, PyObject *k
4141#endif
4142); /*proto*/
4143static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
4144#if CYTHON_VECTORCALL_TPNEW
4145 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4146#else
4147 PyObject *a, PyObject *k
4148#endif
4149); /*proto*/
4150#if CYTHON_VECTORCALL_TPNEW
4151static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4152#endif
4153#if !CYTHON_VECTORCALL_TPNEW
4154#define __pyx_tp_new_memoryview __pyx_tp_new_vectorcall_memoryview
4155#endif
4156#if CYTHON_VECTORCALL_TPNEW
4157static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4158#endif
4159static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
4160#if CYTHON_VECTORCALL_TPNEW
4161 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4162#else
4163 PyObject *a, PyObject *k
4164#endif
4165); /*proto*/
4166static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
4167#if CYTHON_VECTORCALL_TPNEW
4168 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4169#else
4170 PyObject *a, PyObject *k
4171#endif
4172); /*proto*/
4173#if CYTHON_VECTORCALL_TPNEW
4174static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4175#endif
4176#if !CYTHON_VECTORCALL_TPNEW
4177#define __pyx_tp_new__memoryviewslice __pyx_tp_new_vectorcall__memoryviewslice
4178#endif
4179#if CYTHON_VECTORCALL_TPNEW
4180static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4181#endif
4182/* #### Code section: late_includes ### */
4183/* #### Code section: module_state ### */
4184/* SmallCodeConfig */
4185#ifndef CYTHON_SMALL_CODE
4186#if defined(__clang__)
4187 #define CYTHON_SMALL_CODE
4188#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
4189 #define CYTHON_SMALL_CODE __attribute__((cold))
4190#else
4191 #define CYTHON_SMALL_CODE
4192#endif
4193#endif
4194
4195#ifdef __cplusplus
4196namespace {
4197 #endif
4198 typedef struct {
4199 PyObject *__pyx_d;
4200 PyObject *__pyx_b;
4201 PyObject *__pyx_cython_runtime;
4202 PyObject *__pyx_empty_tuple;
4203 PyObject *__pyx_empty_bytes;
4204 PyObject *__pyx_empty_unicode;
4205 PyTypeObject *__pyx_ptype_7cpython_4type_type;
4206 PyTypeObject *__pyx_ptype_5numpy_dtype;
4207 PyTypeObject *__pyx_ptype_5numpy_flatiter;
4208 PyTypeObject *__pyx_ptype_5numpy_broadcast;
4209 PyTypeObject *__pyx_ptype_5numpy_ndarray;
4210 PyTypeObject *__pyx_ptype_5numpy_generic;
4211 PyTypeObject *__pyx_ptype_5numpy_number;
4212 PyTypeObject *__pyx_ptype_5numpy_integer;
4213 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
4214 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
4215 PyTypeObject *__pyx_ptype_5numpy_inexact;
4216 PyTypeObject *__pyx_ptype_5numpy_floating;
4217 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
4218 PyTypeObject *__pyx_ptype_5numpy_flexible;
4219 PyTypeObject *__pyx_ptype_5numpy_character;
4220 PyTypeObject *__pyx_ptype_5numpy_ufunc;
4221 PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix;
4222 PyObject *__pyx_type_10csmoothers_cASMFactor;
4223 PyObject *__pyx_type_10csmoothers_cBASMFactor;
4224 PyObject *__pyx_type___pyx_array;
4225 PyObject *__pyx_type___pyx_MemviewEnum;
4226 PyObject *__pyx_type___pyx_memoryview;
4227 PyObject *__pyx_type___pyx_memoryviewslice;
4228 PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor;
4229 PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor;
4230 PyTypeObject *__pyx_array_type;
4231 PyTypeObject *__pyx_MemviewEnum_type;
4232 PyTypeObject *__pyx_memoryview_type;
4233 PyTypeObject *__pyx_memoryviewslice_type;
4234 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
4235 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
4236 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
4237 PyObject *__pyx_slice[1];
4238 PyObject *__pyx_tuple[6];
4239 PyObject *__pyx_codeobj_tab[16];
4240 PyObject *__pyx_string_tab[156];
4241 PyObject *__pyx_number_tab[3];
4242/* #### Code section: module_state_contents ### */
4243/* PyFrozenDict.module_state_decls */
4244#if CYTHON_COMPILING_IN_LIMITED_API
4245PyObject *__Pyx_PyFrozenDictType;
4246#endif
4247
4248/* CommonTypesMetaclass.module_state_decls */
4249PyTypeObject *__pyx_CommonTypesMetaclassType;
4250
4251/* CachedMethodType.module_state_decls */
4252#if CYTHON_COMPILING_IN_LIMITED_API
4253PyObject *__Pyx_CachedMethodType;
4254#endif
4255
4256/* CythonFunctionPerModule.module_state_decls */
4257PyTypeObject *__pyx_CyFunctionType;
4258
4259/* CodeObjectCache.module_state_decls */
4260struct __Pyx_CodeObjectCache __pyx_code_cache;
4261
4262/* #### Code section: module_state_end ### */
4263} __pyx_mstatetype;
4264#ifdef __cplusplus
4265} /* anonymous namespace */
4266#endif
4267
4268#if CYTHON_USE_MODULE_STATE
4269#ifdef __cplusplus
4270namespace {
4271extern struct PyModuleDef __pyx_moduledef;
4272} /* anonymous namespace */
4273#else
4274static struct PyModuleDef __pyx_moduledef;
4275#endif
4276
4277#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
4278
4279#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
4280#else
4281static __pyx_mstatetype __pyx_mstate_global_static =
4282#ifdef __cplusplus
4283 {};
4284#else
4285 {0};
4286#endif
4287static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
4288#endif
4289/* #### Code section: constant_name_defines ### */
4290#define __pyx_kp_u_at_0x __pyx_string_tab[0]
4291#define __pyx_kp_u_object_2 __pyx_string_tab[1]
4292#define __pyx_kp_u_tree_fragment __pyx_string_tab[2]
4293#define __pyx_kp_u__3 __pyx_string_tab[3]
4294#define __pyx_kp_u__2 __pyx_string_tab[4]
4295#define __pyx_kp_u_MemoryView_of __pyx_string_tab[5]
4296#define __pyx_kp_u_contiguous_and_direct __pyx_string_tab[6]
4297#define __pyx_kp_u_contiguous_and_indirect __pyx_string_tab[7]
4298#define __pyx_kp_u_strided_and_direct_or_indirect __pyx_string_tab[8]
4299#define __pyx_kp_u_strided_and_direct __pyx_string_tab[9]
4300#define __pyx_kp_u_strided_and_indirect __pyx_string_tab[10]
4301#define __pyx_kp_u__4 __pyx_string_tab[11]
4302#define __pyx_kp_u_ __pyx_string_tab[12]
4303#define __pyx_kp_u_Cannot_assign_to_read_only_memor __pyx_string_tab[13]
4304#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_string_tab[14]
4305#define __pyx_kp_u_Invalid_shape_in_axis __pyx_string_tab[15]
4306#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[16]
4307#define __pyx_kp_u_add_note __pyx_string_tab[17]
4308#define __pyx_kp_u_collections_abc __pyx_string_tab[18]
4309#define __pyx_kp_u_disable __pyx_string_tab[19]
4310#define __pyx_kp_u_enable __pyx_string_tab[20]
4311#define __pyx_kp_u_gc __pyx_string_tab[21]
4312#define __pyx_kp_u_isenabled __pyx_string_tab[22]
4313#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[23]
4314#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[24]
4315#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[25]
4316#define __pyx_kp_u_proteus_csmoothers_pyx __pyx_string_tab[26]
4317#define __pyx_kp_u_unable_to_allocate_array_data __pyx_string_tab[27]
4318#define __pyx_kp_u_unable_to_allocate_shape_and_str __pyx_string_tab[28]
4319#define __pyx_n_u_A __pyx_string_tab[29]
4320#define __pyx_n_u_ASCII __pyx_string_tab[30]
4321#define __pyx_n_u_ASMFactor __pyx_string_tab[31]
4322#define __pyx_n_u_ASMFactor___init __pyx_string_tab[32]
4323#define __pyx_n_u_BASMFactor __pyx_string_tab[33]
4324#define __pyx_n_u_BASMFactor___init __pyx_string_tab[34]
4325#define __pyx_n_u_Ellipsis __pyx_string_tab[35]
4326#define __pyx_n_u_L __pyx_string_tab[36]
4327#define __pyx_n_u_M __pyx_string_tab[37]
4328#define __pyx_n_u_R __pyx_string_tab[38]
4329#define __pyx_n_u_Sequence __pyx_string_tab[39]
4330#define __pyx_n_u_View_MemoryView __pyx_string_tab[40]
4331#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[41]
4332#define __pyx_n_u_annotate __pyx_string_tab[42]
4333#define __pyx_n_u_class __pyx_string_tab[43]
4334#define __pyx_n_u_class_getitem __pyx_string_tab[44]
4335#define __pyx_n_u_dict __pyx_string_tab[45]
4336#define __pyx_n_u_doc __pyx_string_tab[46]
4337#define __pyx_n_u_func __pyx_string_tab[47]
4338#define __pyx_n_u_getstate __pyx_string_tab[48]
4339#define __pyx_n_u_import __pyx_string_tab[49]
4340#define __pyx_n_u_init __pyx_string_tab[50]
4341#define __pyx_n_u_main __pyx_string_tab[51]
4342#define __pyx_n_u_metaclass __pyx_string_tab[52]
4343#define __pyx_n_u_module __pyx_string_tab[53]
4344#define __pyx_n_u_mro_entries __pyx_string_tab[54]
4345#define __pyx_n_u_name_2 __pyx_string_tab[55]
4346#define __pyx_n_u_new __pyx_string_tab[56]
4347#define __pyx_n_u_prepare __pyx_string_tab[57]
4348#define __pyx_n_u_pyx_checksum __pyx_string_tab[58]
4349#define __pyx_n_u_pyx_state __pyx_string_tab[59]
4350#define __pyx_n_u_pyx_type __pyx_string_tab[60]
4351#define __pyx_n_u_pyx_unpickle_Enum __pyx_string_tab[61]
4352#define __pyx_n_u_pyx_vtable __pyx_string_tab[62]
4353#define __pyx_n_u_qualname __pyx_string_tab[63]
4354#define __pyx_n_u_reduce __pyx_string_tab[64]
4355#define __pyx_n_u_reduce_cython __pyx_string_tab[65]
4356#define __pyx_n_u_reduce_ex __pyx_string_tab[66]
4357#define __pyx_n_u_set_name __pyx_string_tab[67]
4358#define __pyx_n_u_setstate __pyx_string_tab[68]
4359#define __pyx_n_u_setstate_cython __pyx_string_tab[69]
4360#define __pyx_n_u_test __pyx_string_tab[70]
4361#define __pyx_n_u_cASMFactor __pyx_string_tab[71]
4362#define __pyx_n_u_cBASMFactor __pyx_string_tab[72]
4363#define __pyx_n_u_cSparseMatrix __pyx_string_tab[73]
4364#define __pyx_n_u_is_coroutine __pyx_string_tab[74]
4365#define __pyx_n_u_abc __pyx_string_tab[75]
4366#define __pyx_n_u_allocate_buffer __pyx_string_tab[76]
4367#define __pyx_n_u_asmFactor __pyx_string_tab[77]
4368#define __pyx_n_u_asm_NR_prepare __pyx_string_tab[78]
4369#define __pyx_n_u_asm_NR_solve __pyx_string_tab[79]
4370#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[80]
4371#define __pyx_n_u_base __pyx_string_tab[81]
4372#define __pyx_n_u_basmFactor __pyx_string_tab[82]
4373#define __pyx_n_u_basm_NR_prepare __pyx_string_tab[83]
4374#define __pyx_n_u_basm_NR_solve __pyx_string_tab[84]
4375#define __pyx_n_u_bs __pyx_string_tab[85]
4376#define __pyx_n_u_c __pyx_string_tab[86]
4377#define __pyx_n_u_cASMFactor_2 __pyx_string_tab[87]
4378#define __pyx_n_u_cASMFactor___reduce_cython __pyx_string_tab[88]
4379#define __pyx_n_u_cASMFactor___setstate_cython __pyx_string_tab[89]
4380#define __pyx_n_u_cBASMFactor_2 __pyx_string_tab[90]
4381#define __pyx_n_u_cBASMFactor___reduce_cython __pyx_string_tab[91]
4382#define __pyx_n_u_cBASMFactor___setstate_cython __pyx_string_tab[92]
4383#define __pyx_n_u_cline_in_traceback __pyx_string_tab[93]
4384#define __pyx_n_u_count __pyx_string_tab[94]
4385#define __pyx_n_u_csmoothers __pyx_string_tab[95]
4386#define __pyx_n_u_dX __pyx_string_tab[96]
4387#define __pyx_n_u_dtype_is_object __pyx_string_tab[97]
4388#define __pyx_n_u_encode __pyx_string_tab[98]
4389#define __pyx_n_u_enumerate __pyx_string_tab[99]
4390#define __pyx_n_u_error __pyx_string_tab[100]
4391#define __pyx_n_u_flags __pyx_string_tab[101]
4392#define __pyx_n_u_format __pyx_string_tab[102]
4393#define __pyx_n_u_fortran __pyx_string_tab[103]
4394#define __pyx_n_u_gauss_seidel_NR_preare __pyx_string_tab[104]
4395#define __pyx_n_u_gauss_seidel_NR_solve __pyx_string_tab[105]
4396#define __pyx_n_u_id __pyx_string_tab[106]
4397#define __pyx_n_u_index __pyx_string_tab[107]
4398#define __pyx_n_u_items __pyx_string_tab[108]
4399#define __pyx_n_u_itemsize __pyx_string_tab[109]
4400#define __pyx_n_u_jacobi_NR_prepare __pyx_string_tab[110]
4401#define __pyx_n_u_jacobi_NR_solve __pyx_string_tab[111]
4402#define __pyx_n_u_memview __pyx_string_tab[112]
4403#define __pyx_n_u_mode __pyx_string_tab[113]
4404#define __pyx_n_u_name __pyx_string_tab[114]
4405#define __pyx_n_u_nc __pyx_string_tab[115]
4406#define __pyx_n_u_ndim __pyx_string_tab[116]
4407#define __pyx_n_u_nl_gauss_seidel_NR_solve __pyx_string_tab[117]
4408#define __pyx_n_u_nl_jacobi_NR_solve __pyx_string_tab[118]
4409#define __pyx_n_u_node_order __pyx_string_tab[119]
4410#define __pyx_n_u_np __pyx_string_tab[120]
4411#define __pyx_n_u_nr __pyx_string_tab[121]
4412#define __pyx_n_u_numpy __pyx_string_tab[122]
4413#define __pyx_n_u_obj __pyx_string_tab[123]
4414#define __pyx_n_u_object __pyx_string_tab[124]
4415#define __pyx_n_u_pack __pyx_string_tab[125]
4416#define __pyx_n_u_pop __pyx_string_tab[126]
4417#define __pyx_n_u_register __pyx_string_tab[127]
4418#define __pyx_n_u_self __pyx_string_tab[128]
4419#define __pyx_n_u_setdefault __pyx_string_tab[129]
4420#define __pyx_n_u_shape __pyx_string_tab[130]
4421#define __pyx_n_u_size __pyx_string_tab[131]
4422#define __pyx_n_u_start __pyx_string_tab[132]
4423#define __pyx_n_u_step __pyx_string_tab[133]
4424#define __pyx_n_u_stop __pyx_string_tab[134]
4425#define __pyx_n_u_struct __pyx_string_tab[135]
4426#define __pyx_n_u_tol __pyx_string_tab[136]
4427#define __pyx_n_u_unpack __pyx_string_tab[137]
4428#define __pyx_n_u_update __pyx_string_tab[138]
4429#define __pyx_n_u_values __pyx_string_tab[139]
4430#define __pyx_n_u_w __pyx_string_tab[140]
4431#define __pyx_n_u_x __pyx_string_tab[141]
4432#define __pyx_n_b_O __pyx_string_tab[142]
4433#define __pyx_kp_b_iso88591_Q __pyx_string_tab[143]
4434#define __pyx_kp_b_iso88591_1AQ_Q __pyx_string_tab[144]
4435#define __pyx_kp_b_iso88591_AQa_q __pyx_string_tab[145]
4436#define __pyx_kp_b_iso88591_Qa_8_5 __pyx_string_tab[146]
4437#define __pyx_kp_b_iso88591_1A_c_a __pyx_string_tab[147]
4438#define __pyx_kp_b_iso88591_1A_6c_L __pyx_string_tab[148]
4439#define __pyx_kp_b_iso88591_Cs_a __pyx_string_tab[149]
4440#define __pyx_kp_b_iso88591_1_1 __pyx_string_tab[150]
4441#define __pyx_kp_b_iso88591_1A_Q __pyx_string_tab[151]
4442#define __pyx_kp_b_iso88591_aq_9_L_5PQ __pyx_string_tab[152]
4443#define __pyx_kp_b_iso88591_Qaq __pyx_string_tab[153]
4444#define __pyx_kp_b_iso88591_A_E_F_Kq_Ba_A __pyx_string_tab[154]
4445#define __pyx_kp_b_iso88591_A_E_O_Qd_A __pyx_string_tab[155]
4446#define __pyx_int_0 __pyx_number_tab[0]
4447#define __pyx_int_neg_1 __pyx_number_tab[1]
4448#define __pyx_int_136983863 __pyx_number_tab[2]
4449/* #### Code section: module_state_clear ### */
4450#if CYTHON_USE_MODULE_STATE
4451static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
4452 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
4453 if (!clear_module_state) return 0;
4454 Py_CLEAR(clear_module_state->__pyx_d);
4455 Py_CLEAR(clear_module_state->__pyx_b);
4456 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4457 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4458 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4459 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4460 #if CYTHON_PEP489_MULTI_PHASE_INIT
4461 __Pyx_State_RemoveModule(NULL);
4462 #endif
4463 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4464 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4465 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4466 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4467 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4468 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4469 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4470 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4471 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4472 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4473 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4474 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4475 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4476 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4477 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4478 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4479 Py_CLEAR(clear_module_state->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix);
4480 Py_CLEAR(clear_module_state->__pyx_ptype_10csmoothers_cASMFactor);
4481 Py_CLEAR(clear_module_state->__pyx_type_10csmoothers_cASMFactor);
4482 Py_CLEAR(clear_module_state->__pyx_ptype_10csmoothers_cBASMFactor);
4483 Py_CLEAR(clear_module_state->__pyx_type_10csmoothers_cBASMFactor);
4484 Py_CLEAR(clear_module_state->__pyx_array_type);
4485 Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
4486 Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
4487 Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
4488 Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4489 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4490 Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4491 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4492 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
4493 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
4494 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
4495 for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
4496 for (int i=0; i<6; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
4497 for (int i=0; i<16; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
4498 for (int i=0; i<156; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
4499 for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
4500/* #### Code section: module_state_clear_contents ### */
4501/* CommonTypesMetaclass.module_state_clear */
4502Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
4503
4504/* CythonFunctionPerModule.module_state_clear */
4505Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4506
4507/* #### Code section: module_state_clear_end ### */
4508return 0;
4509}
4510#endif
4511/* #### Code section: module_state_traverse ### */
4512#if CYTHON_USE_MODULE_STATE
4513static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4514 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
4515 if (!traverse_module_state) return 0;
4516 Py_VISIT(traverse_module_state->__pyx_d);
4517 Py_VISIT(traverse_module_state->__pyx_b);
4518 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4519 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
4520 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
4521 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
4522 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4523 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4524 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4525 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4526 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4527 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4528 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4529 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4530 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4531 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4532 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4533 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4534 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4535 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4536 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4537 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4538 Py_VISIT(traverse_module_state->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix);
4539 Py_VISIT(traverse_module_state->__pyx_ptype_10csmoothers_cASMFactor);
4540 Py_VISIT(traverse_module_state->__pyx_type_10csmoothers_cASMFactor);
4541 Py_VISIT(traverse_module_state->__pyx_ptype_10csmoothers_cBASMFactor);
4542 Py_VISIT(traverse_module_state->__pyx_type_10csmoothers_cBASMFactor);
4543 Py_VISIT(traverse_module_state->__pyx_array_type);
4544 Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4545 Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4546 Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4547 Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4548 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4549 Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4550 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4551 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
4552 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
4553 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
4554 for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
4555 for (int i=0; i<6; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
4556 for (int i=0; i<16; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
4557 for (int i=0; i<156; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4558 for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
4559/* #### Code section: module_state_traverse_contents ### */
4560/* CommonTypesMetaclass.module_state_traverse */
4561Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
4562
4563/* CythonFunctionPerModule.module_state_traverse */
4564Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4565
4566/* #### Code section: module_state_traverse_end ### */
4567return 0;
4568}
4569#endif
4570/* #### Code section: module_code ### */
4571
4572/* "View.MemoryView":147
4573 * cdef bint dtype_is_object
4574 *
4575 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4576 * mode="c", bint allocate_buffer=True):
4577 *
4578*/
4579
4580/* Python wrapper */
4581static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4582#if CYTHON_VECTORCALL_TPNEW
4583PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4584#else
4585PyObject *__pyx_args, PyObject *__pyx_kwds
4586#endif
4587); /*proto*/
4588static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4589#if CYTHON_VECTORCALL_TPNEW
4590PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4591#else
4592PyObject *__pyx_args, PyObject *__pyx_kwds
4593#endif
4594) {
4595 PyObject *__pyx_v_shape = 0;
4596 Py_ssize_t __pyx_v_itemsize;
4597 PyObject *__pyx_v_format = 0;
4598 PyObject *__pyx_v_mode = 0;
4599 int __pyx_v_allocate_buffer;
4600 #if !CYTHON_VECTORCALL_TPNEW
4601 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
4602 #endif
4603 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
4604 PyObject* values[5] = {0,0,0,0,0};
4605 int __pyx_lineno = 0;
4606 const char *__pyx_filename = NULL;
4607 int __pyx_clineno = 0;
4608 int __pyx_r;
4609 __Pyx_RefNannyDeclarations
4610 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4611 #if !CYTHON_VECTORCALL_TPNEW
4612 #if CYTHON_ASSUME_SAFE_SIZE
4613 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
4614 #else
4615 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
4616 #endif
4617 #endif
4618 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
4619 {
4620 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shape,&__pyx_mstate_global->__pyx_n_u_itemsize,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_allocate_buffer,0};
4621 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
4622 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 147, __pyx_L3_error)
4623 if (__pyx_kwds_len > 0) {
4624 switch (__pyx_nargs) {
4625 case 5:
4626 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4627 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4628 CYTHON_FALLTHROUGH;
4629 case 4:
4630 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4631 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4632 CYTHON_FALLTHROUGH;
4633 case 3:
4634 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4635 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4636 CYTHON_FALLTHROUGH;
4637 case 2:
4638 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4639 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4640 CYTHON_FALLTHROUGH;
4641 case 1:
4642 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4643 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4644 CYTHON_FALLTHROUGH;
4645 case 0: break;
4646 default: goto __pyx_L5_argtuple_error;
4647 }
4648 const Py_ssize_t kwd_pos_args = __pyx_nargs;
4649 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(1, 147, __pyx_L3_error)
4650 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4651 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
4652 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, i); __PYX_ERR(1, 147, __pyx_L3_error) }
4653 }
4654 } else {
4655 switch (__pyx_nargs) {
4656 case 5:
4657 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4658 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4659 CYTHON_FALLTHROUGH;
4660 case 4:
4661 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4662 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4663 CYTHON_FALLTHROUGH;
4664 case 3:
4665 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4666 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4667 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4668 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4669 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4670 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4671 break;
4672 default: goto __pyx_L5_argtuple_error;
4673 }
4674 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4675 }
4676 __pyx_v_shape = ((PyObject*)values[0]);
4677 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L3_error)
4678 __pyx_v_format = values[2];
4679 __pyx_v_mode = values[3];
4680 if (values[4]) {
4681 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 148, __pyx_L3_error)
4682 } else {
4683
4684 /* "View.MemoryView":148
4685 *
4686 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
4687 * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
4688 *
4689 * cdef int idx
4690*/
4691 __pyx_v_allocate_buffer = ((int)1);
4692 }
4693 }
4694 goto __pyx_L6_skip;
4695 __pyx_L5_argtuple_error:;
4696 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 147, __pyx_L3_error)
4697 __pyx_L6_skip:;
4698 goto __pyx_L4_argument_unpacking_done;
4699 __pyx_L3_error:;
4700 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4701 Py_XDECREF(values[__pyx_temp]);
4702 }
4703 __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4704 __Pyx_RefNannyFinishContext();
4705 return -1;
4706 __pyx_L4_argument_unpacking_done:;
4707 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 147, __pyx_L1_error)
4708 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
4709 PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 147, __pyx_L1_error)
4710 }
4711 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
4712
4713 /* "View.MemoryView":147
4714 * cdef bint dtype_is_object
4715 *
4716 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4717 * mode="c", bint allocate_buffer=True):
4718 *
4719*/
4720
4721 /* function exit code */
4722 goto __pyx_L0;
4723 __pyx_L1_error:;
4724 __pyx_r = -1;
4725 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4726 Py_XDECREF(values[__pyx_temp]);
4727 }
4728 goto __pyx_L7_cleaned_up;
4729 __pyx_L0:;
4730 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4731 Py_XDECREF(values[__pyx_temp]);
4732 }
4733 __pyx_L7_cleaned_up:;
4734
4735
4736 __Pyx_RefNannyFinishContext();
4737 return __pyx_r;
4738}
4739
4740static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
4741 int __pyx_v_idx;
4742 Py_ssize_t __pyx_v_dim;
4743 char __pyx_v_order;
4744 int __pyx_r;
4745 __Pyx_RefNannyDeclarations
4746 Py_ssize_t __pyx_t_1;
4747 int __pyx_t_2;
4748 int __pyx_t_3;
4749 int __pyx_t_4;
4750 PyObject *__pyx_t_5 = NULL;
4751 PyObject *__pyx_t_6 = NULL;
4752 size_t __pyx_t_7;
4753 char *__pyx_t_8;
4754 Py_ssize_t __pyx_t_9;
4755 PyObject *__pyx_t_10 = NULL;
4756 PyObject *__pyx_t_11[5];
4757 int __pyx_t_12;
4758 PyObject *__pyx_t_13 = NULL;
4759 int __pyx_lineno = 0;
4760 const char *__pyx_filename = NULL;
4761 int __pyx_clineno = 0;
4762 __Pyx_RefNannySetupContext("__cinit__", 0);
4763 __Pyx_INCREF(__pyx_v_format);
4764
4765 /* "View.MemoryView":153
4766 * cdef Py_ssize_t dim
4767 *
4768 * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
4769 * self.itemsize = itemsize
4770 *
4771*/
4772 if (unlikely(__pyx_v_shape == Py_None)) {
4773 PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
4774 __PYX_ERR(1, 153, __pyx_L1_error)
4775 }
4776 __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 153, __pyx_L1_error)
4777 __pyx_v_self->ndim = ((int)__pyx_t_1);
4778
4779
4780 /* "View.MemoryView":154
4781 *
4782 * self.ndim = <int> len(shape)
4783 * self.itemsize = itemsize # <<<<<<<<<<<<<<
4784 *
4785 * if cython.unlikely(not self.ndim):
4786*/
4787 __pyx_v_self->itemsize = __pyx_v_itemsize;
4788
4789 /* "View.MemoryView":156
4790 * self.itemsize = itemsize
4791 *
4792 * if cython.unlikely(not self.ndim): # <<<<<<<<<<<<<<
4793 * _err_ValueError("Empty shape tuple for cython.array")
4794 *
4795*/
4796 __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
4797
4798 if (unlikely(__pyx_t_2)) {
4799
4800
4801 /* "View.MemoryView":157
4802 *
4803 * if cython.unlikely(not self.ndim):
4804 * _err_ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
4805 *
4806 * if cython.unlikely(itemsize <= 0):
4807*/
4808 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_Empty_shape_tuple_for_cython_arr); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 157, __pyx_L1_error)
4809
4810
4811 /* "View.MemoryView":156
4812 * self.itemsize = itemsize
4813 *
4814 * if cython.unlikely(not self.ndim): # <<<<<<<<<<<<<<
4815 * _err_ValueError("Empty shape tuple for cython.array")
4816 *
4817*/
4818 }
4819
4820 /* "View.MemoryView":159
4821 * _err_ValueError("Empty shape tuple for cython.array")
4822 *
4823 * if cython.unlikely(itemsize <= 0): # <<<<<<<<<<<<<<
4824 * _err_ValueError("itemsize <= 0 for cython.array")
4825 *
4826*/
4827 __pyx_t_2 = (__pyx_v_itemsize <= 0);
4828
4829 if (unlikely(__pyx_t_2)) {
4830
4831
4832 /* "View.MemoryView":160
4833 *
4834 * if cython.unlikely(itemsize <= 0):
4835 * _err_ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
4836 *
4837 * if not isinstance(format, bytes):
4838*/
4839 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_itemsize_0_for_cython_array); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 160, __pyx_L1_error)
4840
4841
4842 /* "View.MemoryView":159
4843 * _err_ValueError("Empty shape tuple for cython.array")
4844 *
4845 * if cython.unlikely(itemsize <= 0): # <<<<<<<<<<<<<<
4846 * _err_ValueError("itemsize <= 0 for cython.array")
4847 *
4848*/
4849 }
4850
4851 /* "View.MemoryView":162
4852 * _err_ValueError("itemsize <= 0 for cython.array")
4853 *
4854 * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
4855 * format = format.encode('ASCII')
4856 * self._format = format # keep a reference to the byte string
4857*/
4858 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
4859 __pyx_t_4 = (!__pyx_t_2);
4860
4861
4862 if (__pyx_t_4) {
4863
4864
4865 /* "View.MemoryView":163
4866 *
4867 * if not isinstance(format, bytes):
4868 * format = format.encode('ASCII') # <<<<<<<<<<<<<<
4869 * self._format = format # keep a reference to the byte string
4870 * self.format = self._format
4871*/
4872 __pyx_t_6 = __pyx_v_format;
4873 __Pyx_INCREF(__pyx_t_6);
4874 __pyx_t_7 = 0;
4875 {
4876 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ASCII};
4877 __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
4878 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4879 if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
4880 __Pyx_GOTREF(__pyx_t_5);
4881 }
4882 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
4883 __pyx_t_5 = 0;
4884
4885 /* "View.MemoryView":162
4886 * _err_ValueError("itemsize <= 0 for cython.array")
4887 *
4888 * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
4889 * format = format.encode('ASCII')
4890 * self._format = format # keep a reference to the byte string
4891*/
4892 }
4893
4894 /* "View.MemoryView":164
4895 * if not isinstance(format, bytes):
4896 * format = format.encode('ASCII')
4897 * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
4898 * self.format = self._format
4899 *
4900*/
4901 __pyx_t_5 = __pyx_v_format;
4902 __Pyx_INCREF(__pyx_t_5);
4903 if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(1, 164, __pyx_L1_error)
4904 __Pyx_GIVEREF(__pyx_t_5);
4905 __Pyx_GOTREF(__pyx_v_self->_format);
4906 __Pyx_DECREF(__pyx_v_self->_format);
4907 __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
4908 __pyx_t_5 = 0;
4909
4910 /* "View.MemoryView":165
4911 * format = format.encode('ASCII')
4912 * self._format = format # keep a reference to the byte string
4913 * self.format = self._format # <<<<<<<<<<<<<<
4914 *
4915 *
4916*/
4917 if (unlikely(__pyx_v_self->_format == Py_None)) {
4918 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
4919 __PYX_ERR(1, 165, __pyx_L1_error)
4920 }
4921 __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 165, __pyx_L1_error)
4922 __pyx_v_self->format = __pyx_t_8;
4923
4924 /* "View.MemoryView":168
4925 *
4926 *
4927 * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t> self.ndim) # <<<<<<<<<<<<<<
4928 * self._strides = self._shape + self.ndim
4929 *
4930*/
4931 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_self->ndim))));
4932
4933 /* "View.MemoryView":169
4934 *
4935 * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t> self.ndim)
4936 * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
4937 *
4938 * if not self._shape:
4939*/
4940 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
4941
4942 /* "View.MemoryView":171
4943 * self._strides = self._shape + self.ndim
4944 *
4945 * if not self._shape: # <<<<<<<<<<<<<<
4946 * raise MemoryError, "unable to allocate shape and strides."
4947 *
4948*/
4949 __pyx_t_4 = (!(__pyx_v_self->_shape != 0));
4950
4951 if (unlikely(__pyx_t_4)) {
4952
4953
4954 /* "View.MemoryView":172
4955 *
4956 * if not self._shape:
4957 * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
4958 *
4959 *
4960*/
4961 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_shape_and_str, 0, 0);
4962 __PYX_ERR(1, 172, __pyx_L1_error)
4963
4964 /* "View.MemoryView":171
4965 * self._strides = self._shape + self.ndim
4966 *
4967 * if not self._shape: # <<<<<<<<<<<<<<
4968 * raise MemoryError, "unable to allocate shape and strides."
4969 *
4970*/
4971 }
4972
4973 /* "View.MemoryView":175
4974 *
4975 *
4976 * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
4977 * if dim <= 0:
4978 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
4979*/
4980
4981 __pyx_t_3 = 0;
4982 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5);
4983 __pyx_t_1 = 0;
4984 for (;;) {
4985 {
4986 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
4987 #if !CYTHON_ASSUME_SAFE_SIZE
4988 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 175, __pyx_L1_error)
4989 #endif
4990 if (__pyx_t_1 >= __pyx_temp) break;
4991 }
4992 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4993 __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1));
4994 #else
4995 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_1);
4996 #endif
4997 ++__pyx_t_1;
4998 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 175, __pyx_L1_error)
4999 __Pyx_GOTREF(__pyx_t_6);
5000 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L1_error)
5001 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5002 __pyx_v_dim = __pyx_t_9;
5003 __pyx_v_idx = __pyx_t_3;
5004 __pyx_t_3 = (__pyx_t_3 + 1);
5005
5006 /* "View.MemoryView":176
5007 *
5008 * for idx, dim in enumerate(shape):
5009 * if dim <= 0: # <<<<<<<<<<<<<<
5010 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5011 * self._shape[idx] = dim
5012*/
5013 __pyx_t_4 = (__pyx_v_dim <= 0);
5014
5015 if (unlikely(__pyx_t_4)) {
5016
5017
5018 /* "View.MemoryView":177
5019 * for idx, dim in enumerate(shape):
5020 * if dim <= 0:
5021 * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
5022 * self._shape[idx] = dim
5023 *
5024*/
5025 __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
5026 __Pyx_GOTREF(__pyx_t_6);
5027 __pyx_t_10 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
5028 __Pyx_GOTREF(__pyx_t_10);
5029 __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis;
5030 __pyx_t_11[1] = __pyx_t_6;
5031 __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u__2;
5032 __pyx_t_11[3] = __pyx_t_10;
5033 __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__3;
5034 __pyx_t_9 = 25;
5035 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
5036 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]);
5037 #endif
5038 __pyx_t_12 = 0;
5039 __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_9, __pyx_t_12);
5040 if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 177, __pyx_L1_error)
5041 __Pyx_GOTREF(__pyx_t_13);
5042 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5043 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5044 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
5045 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5046 __PYX_ERR(1, 177, __pyx_L1_error)
5047
5048 /* "View.MemoryView":176
5049 *
5050 * for idx, dim in enumerate(shape):
5051 * if dim <= 0: # <<<<<<<<<<<<<<
5052 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5053 * self._shape[idx] = dim
5054*/
5055 }
5056
5057 /* "View.MemoryView":178
5058 * if dim <= 0:
5059 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5060 * self._shape[idx] = dim # <<<<<<<<<<<<<<
5061 *
5062 * cdef char order
5063*/
5064 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
5065
5066 /* "View.MemoryView":175
5067 *
5068 *
5069 * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5070 * if dim <= 0:
5071 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5072*/
5073 }
5074 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5075
5076 /* "View.MemoryView":181
5077 *
5078 * cdef char order
5079 * if mode == 'c': # <<<<<<<<<<<<<<
5080 * order = b'C'
5081 * self.mode = u'c'
5082*/
5083 __pyx_t_4 = (__Pyx_PyObject_Equals_obj_ch99(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 181, __pyx_L1_error)
5084 if (__pyx_t_4) {
5085
5086
5087 /* "View.MemoryView":182
5088 * cdef char order
5089 * if mode == 'c':
5090 * order = b'C' # <<<<<<<<<<<<<<
5091 * self.mode = u'c'
5092 * elif mode == 'fortran':
5093*/
5094 __pyx_v_order = 'C';
5095
5096 /* "View.MemoryView":183
5097 * if mode == 'c':
5098 * order = b'C'
5099 * self.mode = u'c' # <<<<<<<<<<<<<<
5100 * elif mode == 'fortran':
5101 * order = b'F'
5102*/
5103 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
5104 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_c);
5105 __Pyx_GOTREF(__pyx_v_self->mode);
5106 __Pyx_DECREF(__pyx_v_self->mode);
5107 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_c;
5108
5109 /* "View.MemoryView":181
5110 *
5111 * cdef char order
5112 * if mode == 'c': # <<<<<<<<<<<<<<
5113 * order = b'C'
5114 * self.mode = u'c'
5115*/
5116 goto __pyx_L11;
5117 }
5118
5119 /* "View.MemoryView":184
5120 * order = b'C'
5121 * self.mode = u'c'
5122 * elif mode == 'fortran': # <<<<<<<<<<<<<<
5123 * order = b'F'
5124 * self.mode = u'fortran'
5125*/
5126 __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 184, __pyx_L1_error)
5127 if (likely(__pyx_t_4)) {
5128
5129
5130 /* "View.MemoryView":185
5131 * self.mode = u'c'
5132 * elif mode == 'fortran':
5133 * order = b'F' # <<<<<<<<<<<<<<
5134 * self.mode = u'fortran'
5135 * else:
5136*/
5137 __pyx_v_order = 'F';
5138
5139 /* "View.MemoryView":186
5140 * elif mode == 'fortran':
5141 * order = b'F'
5142 * self.mode = u'fortran' # <<<<<<<<<<<<<<
5143 * else:
5144 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5145*/
5146 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
5147 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fortran);
5148 __Pyx_GOTREF(__pyx_v_self->mode);
5149 __Pyx_DECREF(__pyx_v_self->mode);
5150 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_fortran;
5151
5152 /* "View.MemoryView":184
5153 * order = b'C'
5154 * self.mode = u'c'
5155 * elif mode == 'fortran': # <<<<<<<<<<<<<<
5156 * order = b'F'
5157 * self.mode = u'fortran'
5158*/
5159 goto __pyx_L11;
5160 }
5161
5162 /* "View.MemoryView":188
5163 * self.mode = u'fortran'
5164 * else:
5165 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
5166 *
5167 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5168*/
5169 /*else*/ {
5170 __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 188, __pyx_L1_error)
5171 __Pyx_GOTREF(__pyx_t_5);
5172 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 188, __pyx_L1_error)
5173 __Pyx_GOTREF(__pyx_t_13);
5174 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5175 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
5176 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5177 __PYX_ERR(1, 188, __pyx_L1_error)
5178 }
5179 __pyx_L11:;
5180
5181 /* "View.MemoryView":190
5182 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5183 *
5184 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
5185 *
5186 * self.free_data = allocate_buffer
5187*/
5188 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
5189
5190 /* "View.MemoryView":192
5191 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5192 *
5193 * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
5194 * self.dtype_is_object = format == b'O'
5195 *
5196*/
5197 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
5198
5199 /* "View.MemoryView":193
5200 *
5201 * self.free_data = allocate_buffer
5202 * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
5203 *
5204 * if allocate_buffer:
5205*/
5206 __pyx_t_13 = __Pyx_PyObject_CompareEq_object_bytes(__pyx_v_format, __pyx_mstate_global->__pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 193, __pyx_L1_error)
5207 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 193, __pyx_L1_error)
5208 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5209 __pyx_v_self->dtype_is_object = __pyx_t_4;
5210
5211 /* "View.MemoryView":195
5212 * self.dtype_is_object = format == b'O'
5213 *
5214 * if allocate_buffer: # <<<<<<<<<<<<<<
5215 * _allocate_buffer(self)
5216 *
5217*/
5218 if (__pyx_v_allocate_buffer) {
5219
5220 /* "View.MemoryView":196
5221 *
5222 * if allocate_buffer:
5223 * _allocate_buffer(self) # <<<<<<<<<<<<<<
5224 *
5225 * @cname('getbuffer')
5226*/
5227 __pyx_t_3 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 196, __pyx_L1_error)
5228
5229
5230 /* "View.MemoryView":195
5231 * self.dtype_is_object = format == b'O'
5232 *
5233 * if allocate_buffer: # <<<<<<<<<<<<<<
5234 * _allocate_buffer(self)
5235 *
5236*/
5237 }
5238
5239 /* "View.MemoryView":147
5240 * cdef bint dtype_is_object
5241 *
5242 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5243 * mode="c", bint allocate_buffer=True):
5244 *
5245*/
5246
5247 /* function exit code */
5248 __pyx_r = 0;
5249 goto __pyx_L0;
5250 __pyx_L1_error:;
5251 __Pyx_XDECREF(__pyx_t_5);
5252 __Pyx_XDECREF(__pyx_t_6);
5253 __Pyx_XDECREF(__pyx_t_10);
5254 __Pyx_XDECREF(__pyx_t_13);
5255 __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5256 __pyx_r = -1;
5257 __pyx_L0:;
5258
5259
5260
5261 __Pyx_XDECREF(__pyx_v_format);
5262
5263 __Pyx_RefNannyFinishContext();
5264 return __pyx_r;
5265}
5266
5267/* "View.MemoryView":198
5268 * _allocate_buffer(self)
5269 *
5270 * @cname('getbuffer') # <<<<<<<<<<<<<<
5271 * def __getbuffer__(self, Py_buffer *info, int flags):
5272 * cdef int bufmode = -1
5273*/
5274
5275/* Python wrapper */
5276CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5277CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5278 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5279 int __pyx_r;
5280 __Pyx_RefNannyDeclarations
5281 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5282 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5283 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
5284
5285 /* function exit code */
5286
5287
5288 __Pyx_RefNannyFinishContext();
5289 return __pyx_r;
5290}
5291
5292static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5293 int __pyx_v_bufmode;
5294 int __pyx_r;
5295 __Pyx_RefNannyDeclarations
5296 int __pyx_t_1;
5297 int __pyx_t_2;
5298 char *__pyx_t_3;
5299 Py_ssize_t __pyx_t_4;
5300 Py_ssize_t *__pyx_t_5;
5301 int __pyx_lineno = 0;
5302 const char *__pyx_filename = NULL;
5303 int __pyx_clineno = 0;
5304 if (unlikely(__pyx_v_info == NULL)) {
5305 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5306 return -1;
5307 }
5308 __Pyx_RefNannySetupContext("__getbuffer__", 0);
5309 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5310 __Pyx_GIVEREF(__pyx_v_info->obj);
5311
5312 /* "View.MemoryView":200
5313 * @cname('getbuffer')
5314 * def __getbuffer__(self, Py_buffer *info, int flags):
5315 * cdef int bufmode = -1 # <<<<<<<<<<<<<<
5316 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5317 * if self.mode == u"c":
5318*/
5319 __pyx_v_bufmode = -1;
5320
5321 /* "View.MemoryView":201
5322 * def __getbuffer__(self, Py_buffer *info, int flags):
5323 * cdef int bufmode = -1
5324 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5325 * if self.mode == u"c":
5326 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5327*/
5328 __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
5329
5330 if (__pyx_t_1) {
5331
5332
5333 /* "View.MemoryView":202
5334 * cdef int bufmode = -1
5335 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5336 * if self.mode == u"c": # <<<<<<<<<<<<<<
5337 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5338 * elif self.mode == u"fortran":
5339*/
5340 __pyx_t_1 = (__Pyx_PyObject_Equals_str_ch99(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 202, __pyx_L1_error)
5341 if (__pyx_t_1) {
5342
5343
5344 /* "View.MemoryView":203
5345 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5346 * if self.mode == u"c":
5347 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5348 * elif self.mode == u"fortran":
5349 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5350*/
5351 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5352
5353 /* "View.MemoryView":202
5354 * cdef int bufmode = -1
5355 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5356 * if self.mode == u"c": # <<<<<<<<<<<<<<
5357 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5358 * elif self.mode == u"fortran":
5359*/
5360 goto __pyx_L4;
5361 }
5362
5363 /* "View.MemoryView":204
5364 * if self.mode == u"c":
5365 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5366 * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5367 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5368 * if cython.unlikely(not (flags & bufmode)):
5369*/
5370 __pyx_t_1 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 204, __pyx_L1_error)
5371 if (__pyx_t_1) {
5372
5373
5374 /* "View.MemoryView":205
5375 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5376 * elif self.mode == u"fortran":
5377 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5378 * if cython.unlikely(not (flags & bufmode)):
5379 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5380*/
5381 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5382
5383 /* "View.MemoryView":204
5384 * if self.mode == u"c":
5385 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5386 * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5387 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5388 * if cython.unlikely(not (flags & bufmode)):
5389*/
5390 }
5391 __pyx_L4:;
5392
5393 /* "View.MemoryView":206
5394 * elif self.mode == u"fortran":
5395 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5396 * if cython.unlikely(not (flags & bufmode)): # <<<<<<<<<<<<<<
5397 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5398 * info.buf = self.data
5399*/
5400 __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5401
5402 if (unlikely(__pyx_t_1)) {
5403
5404
5405 /* "View.MemoryView":207
5406 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5407 * if cython.unlikely(not (flags & bufmode)):
5408 * _err_ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
5409 * info.buf = self.data
5410 * info.len = self.len
5411*/
5412 __pyx_t_2 = __pyx_memoryview_err_ValueError(__pyx_k_Can_only_create_a_buffer_that_is); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 207, __pyx_L1_error)
5413
5414
5415 /* "View.MemoryView":206
5416 * elif self.mode == u"fortran":
5417 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5418 * if cython.unlikely(not (flags & bufmode)): # <<<<<<<<<<<<<<
5419 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5420 * info.buf = self.data
5421*/
5422 }
5423
5424 /* "View.MemoryView":201
5425 * def __getbuffer__(self, Py_buffer *info, int flags):
5426 * cdef int bufmode = -1
5427 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5428 * if self.mode == u"c":
5429 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5430*/
5431 }
5432
5433 /* "View.MemoryView":208
5434 * if cython.unlikely(not (flags & bufmode)):
5435 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5436 * info.buf = self.data # <<<<<<<<<<<<<<
5437 * info.len = self.len
5438 *
5439*/
5440 __pyx_t_3 = __pyx_v_self->data;
5441
5442 __pyx_v_info->buf = __pyx_t_3;
5443
5444 /* "View.MemoryView":209
5445 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5446 * info.buf = self.data
5447 * info.len = self.len # <<<<<<<<<<<<<<
5448 *
5449 * if flags & PyBUF_STRIDES:
5450*/
5451 __pyx_t_4 = __pyx_v_self->len;
5452
5453 __pyx_v_info->len = __pyx_t_4;
5454
5455 /* "View.MemoryView":211
5456 * info.len = self.len
5457 *
5458 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5459 * info.ndim = self.ndim
5460 * info.shape = self._shape
5461*/
5462 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5463
5464 if (__pyx_t_1) {
5465
5466
5467 /* "View.MemoryView":212
5468 *
5469 * if flags & PyBUF_STRIDES:
5470 * info.ndim = self.ndim # <<<<<<<<<<<<<<
5471 * info.shape = self._shape
5472 * info.strides = self._strides
5473*/
5474 __pyx_t_2 = __pyx_v_self->ndim;
5475
5476 __pyx_v_info->ndim = __pyx_t_2;
5477
5478 /* "View.MemoryView":213
5479 * if flags & PyBUF_STRIDES:
5480 * info.ndim = self.ndim
5481 * info.shape = self._shape # <<<<<<<<<<<<<<
5482 * info.strides = self._strides
5483 * else:
5484*/
5485 __pyx_t_5 = __pyx_v_self->_shape;
5486
5487 __pyx_v_info->shape = __pyx_t_5;
5488
5489 /* "View.MemoryView":214
5490 * info.ndim = self.ndim
5491 * info.shape = self._shape
5492 * info.strides = self._strides # <<<<<<<<<<<<<<
5493 * else:
5494 * info.ndim = 1
5495*/
5496 __pyx_t_5 = __pyx_v_self->_strides;
5497
5498 __pyx_v_info->strides = __pyx_t_5;
5499
5500 /* "View.MemoryView":211
5501 * info.len = self.len
5502 *
5503 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5504 * info.ndim = self.ndim
5505 * info.shape = self._shape
5506*/
5507 goto __pyx_L6;
5508 }
5509
5510 /* "View.MemoryView":216
5511 * info.strides = self._strides
5512 * else:
5513 * info.ndim = 1 # <<<<<<<<<<<<<<
5514 * info.shape = &self.len if flags & PyBUF_ND else NULL
5515 * info.strides = NULL
5516*/
5517 /*else*/ {
5518 __pyx_v_info->ndim = 1;
5519
5520 /* "View.MemoryView":217
5521 * else:
5522 * info.ndim = 1
5523 * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
5524 * info.strides = NULL
5525 *
5526*/
5527 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5528
5529 if (__pyx_t_1) {
5530
5531 __pyx_t_5 = (&__pyx_v_self->len);
5532 } else {
5533
5534 __pyx_t_5 = NULL;
5535 }
5536
5537 __pyx_v_info->shape = __pyx_t_5;
5538
5539 /* "View.MemoryView":218
5540 * info.ndim = 1
5541 * info.shape = &self.len if flags & PyBUF_ND else NULL
5542 * info.strides = NULL # <<<<<<<<<<<<<<
5543 *
5544 * info.suboffsets = NULL
5545*/
5546 __pyx_v_info->strides = NULL;
5547 }
5548 __pyx_L6:;
5549
5550 /* "View.MemoryView":220
5551 * info.strides = NULL
5552 *
5553 * info.suboffsets = NULL # <<<<<<<<<<<<<<
5554 * info.itemsize = self.itemsize
5555 * info.readonly = 0
5556*/
5557 __pyx_v_info->suboffsets = NULL;
5558
5559 /* "View.MemoryView":221
5560 *
5561 * info.suboffsets = NULL
5562 * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
5563 * info.readonly = 0
5564 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5565*/
5566 __pyx_t_4 = __pyx_v_self->itemsize;
5567
5568 __pyx_v_info->itemsize = __pyx_t_4;
5569
5570 /* "View.MemoryView":222
5571 * info.suboffsets = NULL
5572 * info.itemsize = self.itemsize
5573 * info.readonly = 0 # <<<<<<<<<<<<<<
5574 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5575 * info.obj = self
5576*/
5577 __pyx_v_info->readonly = 0;
5578
5579 /* "View.MemoryView":223
5580 * info.itemsize = self.itemsize
5581 * info.readonly = 0
5582 * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
5583 * info.obj = self
5584 *
5585*/
5586 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5587
5588 if (__pyx_t_1) {
5589
5590 __pyx_t_3 = __pyx_v_self->format;
5591 } else {
5592
5593 __pyx_t_3 = NULL;
5594 }
5595
5596 __pyx_v_info->format = __pyx_t_3;
5597
5598 /* "View.MemoryView":224
5599 * info.readonly = 0
5600 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5601 * info.obj = self # <<<<<<<<<<<<<<
5602 *
5603 * def __dealloc__(array self):
5604*/
5605 __Pyx_INCREF((PyObject *)__pyx_v_self);
5606 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5607 __Pyx_GOTREF(__pyx_v_info->obj);
5608 __Pyx_DECREF(__pyx_v_info->obj);
5609 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5610
5611 /* "View.MemoryView":198
5612 * _allocate_buffer(self)
5613 *
5614 * @cname('getbuffer') # <<<<<<<<<<<<<<
5615 * def __getbuffer__(self, Py_buffer *info, int flags):
5616 * cdef int bufmode = -1
5617*/
5618
5619 /* function exit code */
5620 __pyx_r = 0;
5621 goto __pyx_L0;
5622 __pyx_L1_error:;
5623 __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5624 __pyx_r = -1;
5625 if (__pyx_v_info->obj != NULL) {
5626 __Pyx_GOTREF(__pyx_v_info->obj);
5627 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5628 }
5629 goto __pyx_L2;
5630 __pyx_L0:;
5631 if (__pyx_v_info->obj == Py_None) {
5632 __Pyx_GOTREF(__pyx_v_info->obj);
5633 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5634 }
5635 __pyx_L2:;
5636
5637
5638 __Pyx_RefNannyFinishContext();
5639 return __pyx_r;
5640}
5641
5642/* "View.MemoryView":226
5643 * info.obj = self
5644 *
5645 * def __dealloc__(array self): # <<<<<<<<<<<<<<
5646 * if self.callback_free_data != NULL:
5647 * self.callback_free_data(self.data)
5648*/
5649
5650/* Python wrapper */
5651static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
5652static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
5653 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5654 __Pyx_RefNannyDeclarations
5655 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
5656 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5657 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
5658
5659 /* function exit code */
5660 __Pyx_RefNannyFinishContext();
5661}
5662
5663static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
5664 int __pyx_t_1;
5665 int __pyx_t_2;
5666
5667 /* "View.MemoryView":227
5668 *
5669 * def __dealloc__(array self):
5670 * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
5671 * self.callback_free_data(self.data)
5672 * elif self.free_data and self.data is not NULL:
5673*/
5674 __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
5675
5676 if (__pyx_t_1) {
5677
5678
5679 /* "View.MemoryView":228
5680 * def __dealloc__(array self):
5681 * if self.callback_free_data != NULL:
5682 * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
5683 * elif self.free_data and self.data is not NULL:
5684 * if self.dtype_is_object:
5685*/
5686 __pyx_v_self->callback_free_data(__pyx_v_self->data);
5687
5688 /* "View.MemoryView":227
5689 *
5690 * def __dealloc__(array self):
5691 * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
5692 * self.callback_free_data(self.data)
5693 * elif self.free_data and self.data is not NULL:
5694*/
5695 goto __pyx_L3;
5696 }
5697
5698 /* "View.MemoryView":229
5699 * if self.callback_free_data != NULL:
5700 * self.callback_free_data(self.data)
5701 * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
5702 * if self.dtype_is_object:
5703 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5704*/
5705 if (__pyx_v_self->free_data) {
5706 } else {
5707
5708 __pyx_t_1 = __pyx_v_self->free_data;
5709 goto __pyx_L4_bool_binop_done;
5710 }
5711 __pyx_t_2 = (__pyx_v_self->data != NULL);
5712
5713
5714 __pyx_t_1 = __pyx_t_2;
5715
5716 __pyx_L4_bool_binop_done:;
5717 if (__pyx_t_1) {
5718
5719
5720 /* "View.MemoryView":230
5721 * self.callback_free_data(self.data)
5722 * elif self.free_data and self.data is not NULL:
5723 * if self.dtype_is_object: # <<<<<<<<<<<<<<
5724 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5725 * free(self.data)
5726*/
5727 if (__pyx_v_self->dtype_is_object) {
5728
5729 /* "View.MemoryView":231
5730 * elif self.free_data and self.data is not NULL:
5731 * if self.dtype_is_object:
5732 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
5733 * free(self.data)
5734 * PyObject_Free(self._shape)
5735*/
5736 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
5737
5738 /* "View.MemoryView":230
5739 * self.callback_free_data(self.data)
5740 * elif self.free_data and self.data is not NULL:
5741 * if self.dtype_is_object: # <<<<<<<<<<<<<<
5742 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5743 * free(self.data)
5744*/
5745 }
5746
5747 /* "View.MemoryView":232
5748 * if self.dtype_is_object:
5749 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5750 * free(self.data) # <<<<<<<<<<<<<<
5751 * PyObject_Free(self._shape)
5752 *
5753*/
5754 free(__pyx_v_self->data);
5755
5756 /* "View.MemoryView":229
5757 * if self.callback_free_data != NULL:
5758 * self.callback_free_data(self.data)
5759 * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
5760 * if self.dtype_is_object:
5761 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5762*/
5763 }
5764 __pyx_L3:;
5765
5766 /* "View.MemoryView":233
5767 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5768 * free(self.data)
5769 * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
5770 *
5771 * @property
5772*/
5773 PyObject_Free(__pyx_v_self->_shape);
5774
5775 /* "View.MemoryView":226
5776 * info.obj = self
5777 *
5778 * def __dealloc__(array self): # <<<<<<<<<<<<<<
5779 * if self.callback_free_data != NULL:
5780 * self.callback_free_data(self.data)
5781*/
5782
5783 /* function exit code */
5784
5785}
5786
5787/* "View.MemoryView":235
5788 * PyObject_Free(self._shape)
5789 *
5790 * @property # <<<<<<<<<<<<<<
5791 * def memview(self):
5792 * return array.get_memview(self)
5793*/
5794
5795/* Python wrapper */
5796static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
5797static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
5798 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5799 PyObject *__pyx_r = 0;
5800 __Pyx_RefNannyDeclarations
5801 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5802 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5803 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
5804
5805 /* function exit code */
5806 __Pyx_RefNannyFinishContext();
5807 return __pyx_r;
5808}
5809
5810static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
5811 PyObject *__pyx_r = NULL;
5812 __Pyx_RefNannyDeclarations
5813 PyObject *__pyx_t_1 = NULL;
5814 int __pyx_lineno = 0;
5815 const char *__pyx_filename = NULL;
5816 int __pyx_clineno = 0;
5817 __Pyx_RefNannySetupContext("__get__", 0);
5818
5819 /* "View.MemoryView":237
5820 * @property
5821 * def memview(self):
5822 * return array.get_memview(self) # <<<<<<<<<<<<<<
5823 *
5824 *
5825*/
5826 __pyx_t_1 = __pyx_array_get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
5827 __Pyx_GOTREF(__pyx_t_1);
5828 {
5829 PyObject *__pyx_temp;
5830 {
5831 __pyx_temp = __pyx_r;
5832 __pyx_r = __pyx_t_1;
5833 }
5834 __Pyx_XDECREF(__pyx_temp);
5835 }
5836 __pyx_t_1 = 0;
5837 goto __pyx_L0;
5838
5839 /* "View.MemoryView":235
5840 * PyObject_Free(self._shape)
5841 *
5842 * @property # <<<<<<<<<<<<<<
5843 * def memview(self):
5844 * return array.get_memview(self)
5845*/
5846
5847 /* function exit code */
5848 __pyx_L1_error:;
5849 __Pyx_XDECREF(__pyx_t_1);
5850 __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5851 __pyx_r = NULL;
5852 __pyx_L0:;
5853 __Pyx_XGIVEREF(__pyx_r);
5854 __Pyx_RefNannyFinishContext();
5855 return __pyx_r;
5856}
5857
5858/* "View.MemoryView":240
5859 *
5860 *
5861 * @cname('get_memview') # <<<<<<<<<<<<<<
5862 * cdef get_memview(self):
5863 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5864*/
5865
5866static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
5867 int __pyx_v_flags;
5868 PyObject *__pyx_r = NULL;
5869 __Pyx_RefNannyDeclarations
5870 PyObject *__pyx_t_1 = NULL;
5871 PyObject *__pyx_t_2 = NULL;
5872 PyObject *__pyx_t_3 = NULL;
5873 PyObject *__pyx_t_4 = NULL;
5874 size_t __pyx_t_5;
5875 int __pyx_lineno = 0;
5876 const char *__pyx_filename = NULL;
5877 int __pyx_clineno = 0;
5878 __Pyx_RefNannySetupContext("get_memview", 0);
5879
5880 /* "View.MemoryView":242
5881 * @cname('get_memview')
5882 * cdef get_memview(self):
5883 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
5884 * return memoryview(self, flags, self.dtype_is_object)
5885 *
5886*/
5887 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
5888
5889 /* "View.MemoryView":243
5890 * cdef get_memview(self):
5891 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5892 * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
5893 *
5894 * def __len__(self):
5895*/
5896 __pyx_t_2 = NULL;
5897 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 243, __pyx_L1_error)
5898 __Pyx_GOTREF(__pyx_t_3);
5899 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 243, __pyx_L1_error)
5900 __Pyx_GOTREF(__pyx_t_4);
5901 __pyx_t_5 = 1;
5902 {
5903 PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4};
5904 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5905 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5906 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5907 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5908 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
5909 __Pyx_GOTREF((PyObject *)__pyx_t_1);
5910 }
5911 {
5912 PyObject *__pyx_temp;
5913 {
5914 __pyx_temp = __pyx_r;
5915 __pyx_r = ((PyObject *)__pyx_t_1);
5916 }
5917 __Pyx_XDECREF(__pyx_temp);
5918 }
5919 __pyx_t_1 = 0;
5920 goto __pyx_L0;
5921
5922 /* "View.MemoryView":240
5923 *
5924 *
5925 * @cname('get_memview') # <<<<<<<<<<<<<<
5926 * cdef get_memview(self):
5927 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5928*/
5929
5930 /* function exit code */
5931 __pyx_L1_error:;
5932 __Pyx_XDECREF(__pyx_t_1);
5933 __Pyx_XDECREF(__pyx_t_2);
5934 __Pyx_XDECREF(__pyx_t_3);
5935 __Pyx_XDECREF(__pyx_t_4);
5936 __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
5937 __pyx_r = 0;
5938 __pyx_L0:;
5939
5940 __Pyx_XGIVEREF(__pyx_r);
5941 __Pyx_RefNannyFinishContext();
5942 return __pyx_r;
5943}
5944
5945/* "View.MemoryView":245
5946 * return memoryview(self, flags, self.dtype_is_object)
5947 *
5948 * def __len__(self): # <<<<<<<<<<<<<<
5949 * return self._shape[0]
5950 *
5951*/
5952
5953/* Python wrapper */
5954static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
5955static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
5956 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5957 Py_ssize_t __pyx_r;
5958 __Pyx_RefNannyDeclarations
5959 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
5960 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5961 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
5962
5963 /* function exit code */
5964 __Pyx_RefNannyFinishContext();
5965 return __pyx_r;
5966}
5967
5968static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
5969 Py_ssize_t __pyx_r;
5970
5971 /* "View.MemoryView":246
5972 *
5973 * def __len__(self):
5974 * return self._shape[0] # <<<<<<<<<<<<<<
5975 *
5976 * def __getattr__(self, attr):
5977*/
5978 {
5979
5980 __pyx_r = (__pyx_v_self->_shape[0]);
5981 }
5982 goto __pyx_L0;
5983
5984 /* "View.MemoryView":245
5985 * return memoryview(self, flags, self.dtype_is_object)
5986 *
5987 * def __len__(self): # <<<<<<<<<<<<<<
5988 * return self._shape[0]
5989 *
5990*/
5991
5992 /* function exit code */
5993 __pyx_L0:;
5994
5995 return __pyx_r;
5996}
5997
5998/* "View.MemoryView":248
5999 * return self._shape[0]
6000 *
6001 * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6002 * return getattr(self.memview, attr)
6003 *
6004*/
6005
6006/* Python wrapper */
6007static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
6008static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
6009 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6010 PyObject *__pyx_r = 0;
6011 __Pyx_RefNannyDeclarations
6012 __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
6013 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6014 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
6015
6016 /* function exit code */
6017 __Pyx_RefNannyFinishContext();
6018 return __pyx_r;
6019}
6020
6021static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
6022 PyObject *__pyx_r = NULL;
6023 __Pyx_RefNannyDeclarations
6024 PyObject *__pyx_t_1 = NULL;
6025 PyObject *__pyx_t_2 = NULL;
6026 int __pyx_lineno = 0;
6027 const char *__pyx_filename = NULL;
6028 int __pyx_clineno = 0;
6029 __Pyx_RefNannySetupContext("__getattr__", 0);
6030
6031 /* "View.MemoryView":249
6032 *
6033 * def __getattr__(self, attr):
6034 * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
6035 *
6036 * def __getitem__(self, item):
6037*/
6038 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error)
6039 __Pyx_GOTREF(__pyx_t_1);
6040 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
6041 __Pyx_GOTREF(__pyx_t_2);
6042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6043 {
6044 PyObject *__pyx_temp;
6045 {
6046 __pyx_temp = __pyx_r;
6047 __pyx_r = __pyx_t_2;
6048 }
6049 __Pyx_XDECREF(__pyx_temp);
6050 }
6051 __pyx_t_2 = 0;
6052 goto __pyx_L0;
6053
6054 /* "View.MemoryView":248
6055 * return self._shape[0]
6056 *
6057 * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6058 * return getattr(self.memview, attr)
6059 *
6060*/
6061
6062 /* function exit code */
6063 __pyx_L1_error:;
6064 __Pyx_XDECREF(__pyx_t_1);
6065 __Pyx_XDECREF(__pyx_t_2);
6066 __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6067 __pyx_r = NULL;
6068 __pyx_L0:;
6069 __Pyx_XGIVEREF(__pyx_r);
6070 __Pyx_RefNannyFinishContext();
6071 return __pyx_r;
6072}
6073
6074/* "View.MemoryView":251
6075 * return getattr(self.memview, attr)
6076 *
6077 * def __getitem__(self, item): # <<<<<<<<<<<<<<
6078 * return self.memview[item]
6079 *
6080*/
6081
6082/* Python wrapper */
6083static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
6084static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
6085 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6086 PyObject *__pyx_r = 0;
6087 __Pyx_RefNannyDeclarations
6088 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
6089 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6090 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
6091
6092 /* function exit code */
6093 __Pyx_RefNannyFinishContext();
6094 return __pyx_r;
6095}
6096
6097static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
6098 PyObject *__pyx_r = NULL;
6099 __Pyx_RefNannyDeclarations
6100 PyObject *__pyx_t_1 = NULL;
6101 PyObject *__pyx_t_2 = NULL;
6102 int __pyx_lineno = 0;
6103 const char *__pyx_filename = NULL;
6104 int __pyx_clineno = 0;
6105 __Pyx_RefNannySetupContext("__getitem__", 0);
6106
6107 /* "View.MemoryView":252
6108 *
6109 * def __getitem__(self, item):
6110 * return self.memview[item] # <<<<<<<<<<<<<<
6111 *
6112 * def __setitem__(self, item, value):
6113*/
6114 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 252, __pyx_L1_error)
6115 __Pyx_GOTREF(__pyx_t_1);
6116 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
6117 __Pyx_GOTREF(__pyx_t_2);
6118 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6119 {
6120 PyObject *__pyx_temp;
6121 {
6122 __pyx_temp = __pyx_r;
6123 __pyx_r = __pyx_t_2;
6124 }
6125 __Pyx_XDECREF(__pyx_temp);
6126 }
6127 __pyx_t_2 = 0;
6128 goto __pyx_L0;
6129
6130 /* "View.MemoryView":251
6131 * return getattr(self.memview, attr)
6132 *
6133 * def __getitem__(self, item): # <<<<<<<<<<<<<<
6134 * return self.memview[item]
6135 *
6136*/
6137
6138 /* function exit code */
6139 __pyx_L1_error:;
6140 __Pyx_XDECREF(__pyx_t_1);
6141 __Pyx_XDECREF(__pyx_t_2);
6142 __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6143 __pyx_r = NULL;
6144 __pyx_L0:;
6145 __Pyx_XGIVEREF(__pyx_r);
6146 __Pyx_RefNannyFinishContext();
6147 return __pyx_r;
6148}
6149
6150/* "View.MemoryView":254
6151 * return self.memview[item]
6152 *
6153 * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6154 * self.memview[item] = value
6155 *
6156*/
6157
6158/* Python wrapper */
6159static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
6160static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6161 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6162 int __pyx_r;
6163 __Pyx_RefNannyDeclarations
6164 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
6165 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6166 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
6167
6168 /* function exit code */
6169 __Pyx_RefNannyFinishContext();
6170 return __pyx_r;
6171}
6172
6173static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6174 int __pyx_r;
6175 __Pyx_RefNannyDeclarations
6176 PyObject *__pyx_t_1 = NULL;
6177 int __pyx_lineno = 0;
6178 const char *__pyx_filename = NULL;
6179 int __pyx_clineno = 0;
6180 __Pyx_RefNannySetupContext("__setitem__", 0);
6181
6182 /* "View.MemoryView":255
6183 *
6184 * def __setitem__(self, item, value):
6185 * self.memview[item] = value # <<<<<<<<<<<<<<
6186 *
6187 *
6188*/
6189 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 255, __pyx_L1_error)
6190 __Pyx_GOTREF(__pyx_t_1);
6191 if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 255, __pyx_L1_error)
6192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6193
6194 /* "View.MemoryView":254
6195 * return self.memview[item]
6196 *
6197 * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6198 * self.memview[item] = value
6199 *
6200*/
6201
6202 /* function exit code */
6203 __pyx_r = 0;
6204 goto __pyx_L0;
6205 __pyx_L1_error:;
6206 __Pyx_XDECREF(__pyx_t_1);
6207 __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6208 __pyx_r = -1;
6209 __pyx_L0:;
6210
6211 __Pyx_RefNannyFinishContext();
6212 return __pyx_r;
6213}
6214
6215/* "(tree fragment)":1
6216 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6217 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6218 * def __setstate_cython__(self, __pyx_state):
6219*/
6220
6221/* Python wrapper */
6222static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6223#if CYTHON_VECTORCALL
6224PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6225#else
6226PyObject *__pyx_args, PyObject *__pyx_kwds
6227#endif
6228); /*proto*/
6229static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6230#if CYTHON_VECTORCALL
6231PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6232#else
6233PyObject *__pyx_args, PyObject *__pyx_kwds
6234#endif
6235) {
6236 #if !CYTHON_VECTORCALL
6237 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6238 #endif
6239 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6240 PyObject *__pyx_r = 0;
6241 __Pyx_RefNannyDeclarations
6242 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6243 #if !CYTHON_VECTORCALL
6244 #if CYTHON_ASSUME_SAFE_SIZE
6245 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6246 #else
6247 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6248 #endif
6249 #endif
6250 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6251 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
6252 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6253 if (unlikely(__pyx_kwds_len < 0)) return NULL;
6254 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
6255 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
6256
6257 /* function exit code */
6258 __Pyx_RefNannyFinishContext();
6259 return __pyx_r;
6260}
6261
6262static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
6263 PyObject *__pyx_r = NULL;
6264 __Pyx_RefNannyDeclarations
6265 int __pyx_lineno = 0;
6266 const char *__pyx_filename = NULL;
6267 int __pyx_clineno = 0;
6268 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6269
6270 /* "(tree fragment)":2
6271 * def __reduce_cython__(self):
6272 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6273 * def __setstate_cython__(self, __pyx_state):
6274 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6275*/
6276 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6277 __PYX_ERR(1, 2, __pyx_L1_error)
6278
6279 /* "(tree fragment)":1
6280 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6281 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6282 * def __setstate_cython__(self, __pyx_state):
6283*/
6284
6285 /* function exit code */
6286 __pyx_L1_error:;
6287 __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6288 __pyx_r = NULL;
6289 __Pyx_XGIVEREF(__pyx_r);
6290 __Pyx_RefNannyFinishContext();
6291 return __pyx_r;
6292}
6293
6294/* "(tree fragment)":3
6295 * def __reduce_cython__(self):
6296 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6297 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6298 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6299*/
6300
6301/* Python wrapper */
6302static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6303#if CYTHON_VECTORCALL
6304PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6305#else
6306PyObject *__pyx_args, PyObject *__pyx_kwds
6307#endif
6308); /*proto*/
6309static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6310#if CYTHON_VECTORCALL
6311PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6312#else
6313PyObject *__pyx_args, PyObject *__pyx_kwds
6314#endif
6315) {
6316 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6317 #if !CYTHON_VECTORCALL
6318 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6319 #endif
6320 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6321 PyObject* values[1] = {0};
6322 int __pyx_lineno = 0;
6323 const char *__pyx_filename = NULL;
6324 int __pyx_clineno = 0;
6325 PyObject *__pyx_r = 0;
6326 __Pyx_RefNannyDeclarations
6327 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6328 #if !CYTHON_VECTORCALL
6329 #if CYTHON_ASSUME_SAFE_SIZE
6330 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6331 #else
6332 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6333 #endif
6334 #endif
6335 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6336 {
6337 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
6338 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6339 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
6340 if (__pyx_kwds_len > 0) {
6341 switch (__pyx_nargs) {
6342 case 1:
6343 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6344 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6345 CYTHON_FALLTHROUGH;
6346 case 0: break;
6347 default: goto __pyx_L5_argtuple_error;
6348 }
6349 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6350 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
6351 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6352 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
6353 }
6354 } else if (unlikely(__pyx_nargs != 1)) {
6355 goto __pyx_L5_argtuple_error;
6356 } else {
6357 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6358 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6359 }
6360 __pyx_v___pyx_state = values[0];
6361 }
6362 goto __pyx_L6_skip;
6363 __pyx_L5_argtuple_error:;
6364 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6365 __pyx_L6_skip:;
6366 goto __pyx_L4_argument_unpacking_done;
6367 __pyx_L3_error:;
6368 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6369 Py_XDECREF(values[__pyx_temp]);
6370 }
6371 __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6372 __Pyx_RefNannyFinishContext();
6373 return NULL;
6374 __pyx_L4_argument_unpacking_done:;
6375 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
6376
6377 /* function exit code */
6378 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6379 Py_XDECREF(values[__pyx_temp]);
6380 }
6381 __Pyx_RefNannyFinishContext();
6382 return __pyx_r;
6383}
6384
6385static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6386 PyObject *__pyx_r = NULL;
6387 __Pyx_RefNannyDeclarations
6388 int __pyx_lineno = 0;
6389 const char *__pyx_filename = NULL;
6390 int __pyx_clineno = 0;
6391 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6392
6393 /* "(tree fragment)":4
6394 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6395 * def __setstate_cython__(self, __pyx_state):
6396 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6397*/
6398 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6399 __PYX_ERR(1, 4, __pyx_L1_error)
6400
6401 /* "(tree fragment)":3
6402 * def __reduce_cython__(self):
6403 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6404 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6405 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6406*/
6407
6408 /* function exit code */
6409 __pyx_L1_error:;
6410 __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6411 __pyx_r = NULL;
6412 __Pyx_XGIVEREF(__pyx_r);
6413 __Pyx_RefNannyFinishContext();
6414 return __pyx_r;
6415}
6416
6417/* "View.MemoryView":264
6418 * pass
6419 *
6420 * @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
6421 * cdef int _allocate_buffer(array self) except -1:
6422 *
6423*/
6424
6425static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
6426 Py_ssize_t __pyx_v_i;
6427 PyObject **__pyx_v_p;
6428 int __pyx_r;
6429 int __pyx_t_1;
6430 Py_ssize_t __pyx_t_2;
6431 Py_ssize_t __pyx_t_3;
6432 Py_ssize_t __pyx_t_4;
6433 int __pyx_lineno = 0;
6434 const char *__pyx_filename = NULL;
6435 int __pyx_clineno = 0;
6436
6437 /* "View.MemoryView":271
6438 * cdef PyObject **p
6439 *
6440 * self.free_data = True # <<<<<<<<<<<<<<
6441 * self.data = <char *>malloc(<size_t> self.len)
6442 * if not self.data:
6443*/
6444 __pyx_v_self->free_data = 1;
6445
6446 /* "View.MemoryView":272
6447 *
6448 * self.free_data = True
6449 * self.data = <char *>malloc(<size_t> self.len) # <<<<<<<<<<<<<<
6450 * if not self.data:
6451 * raise MemoryError, "unable to allocate array data."
6452*/
6453 __pyx_v_self->data = ((char *)malloc(((size_t)__pyx_v_self->len)));
6454
6455 /* "View.MemoryView":273
6456 * self.free_data = True
6457 * self.data = <char *>malloc(<size_t> self.len)
6458 * if not self.data: # <<<<<<<<<<<<<<
6459 * raise MemoryError, "unable to allocate array data."
6460 *
6461*/
6462 __pyx_t_1 = (!(__pyx_v_self->data != 0));
6463
6464 if (unlikely(__pyx_t_1)) {
6465
6466
6467 /* "View.MemoryView":274
6468 * self.data = <char *>malloc(<size_t> self.len)
6469 * if not self.data:
6470 * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
6471 *
6472 * if self.dtype_is_object:
6473*/
6474 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_array_data, 0, 0);
6475 __PYX_ERR(1, 274, __pyx_L1_error)
6476
6477 /* "View.MemoryView":273
6478 * self.free_data = True
6479 * self.data = <char *>malloc(<size_t> self.len)
6480 * if not self.data: # <<<<<<<<<<<<<<
6481 * raise MemoryError, "unable to allocate array data."
6482 *
6483*/
6484 }
6485
6486 /* "View.MemoryView":276
6487 * raise MemoryError, "unable to allocate array data."
6488 *
6489 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6490 * p = <PyObject **> self.data
6491 * for i in range(self.len // self.itemsize):
6492*/
6493 if (__pyx_v_self->dtype_is_object) {
6494
6495 /* "View.MemoryView":277
6496 *
6497 * if self.dtype_is_object:
6498 * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6499 * for i in range(self.len // self.itemsize):
6500 * p[i] = Py_None
6501*/
6502 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6503
6504 /* "View.MemoryView":278
6505 * if self.dtype_is_object:
6506 * p = <PyObject **> self.data
6507 * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
6508 * p[i] = Py_None
6509 * Py_INCREF(Py_None)
6510*/
6511 if (unlikely(__pyx_v_self->itemsize == 0)) {
6512 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6513 __PYX_ERR(1, 278, __pyx_L1_error)
6514 }
6515 else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6516 PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6517 __PYX_ERR(1, 278, __pyx_L1_error)
6518 }
6519
6520 __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize, 0);
6521 __pyx_t_3 = __pyx_t_2;
6522
6523 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6524 __pyx_v_i = __pyx_t_4;
6525
6526 /* "View.MemoryView":279
6527 * p = <PyObject **> self.data
6528 * for i in range(self.len // self.itemsize):
6529 * p[i] = Py_None # <<<<<<<<<<<<<<
6530 * Py_INCREF(Py_None)
6531 * return 0
6532*/
6533 (__pyx_v_p[__pyx_v_i]) = Py_None;
6534
6535 /* "View.MemoryView":280
6536 * for i in range(self.len // self.itemsize):
6537 * p[i] = Py_None
6538 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6539 * return 0
6540 *
6541*/
6542 Py_INCREF(Py_None);
6543 }
6544
6545
6546 /* "View.MemoryView":276
6547 * raise MemoryError, "unable to allocate array data."
6548 *
6549 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6550 * p = <PyObject **> self.data
6551 * for i in range(self.len // self.itemsize):
6552*/
6553 }
6554
6555 /* "View.MemoryView":281
6556 * p[i] = Py_None
6557 * Py_INCREF(Py_None)
6558 * return 0 # <<<<<<<<<<<<<<
6559 *
6560 *
6561*/
6562 {
6563
6564 __pyx_r = 0;
6565 }
6566 goto __pyx_L0;
6567
6568 /* "View.MemoryView":264
6569 * pass
6570 *
6571 * @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
6572 * cdef int _allocate_buffer(array self) except -1:
6573 *
6574*/
6575
6576 /* function exit code */
6577 __pyx_L1_error:;
6578 __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6579 __pyx_r = -1;
6580 __pyx_L0:;
6581
6582
6583
6584 return __pyx_r;
6585}
6586
6587/* "View.MemoryView":284
6588 *
6589 *
6590 * @cname("__pyx_array_new") # <<<<<<<<<<<<<<
6591 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6592 * cdef array result
6593*/
6594
6595static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char const *__pyx_v_c_mode, char *__pyx_v_buf) {
6596 struct __pyx_array_obj *__pyx_v_result = 0;
6597 PyObject *__pyx_v_mode = 0;
6598 struct __pyx_array_obj *__pyx_r = NULL;
6599 __Pyx_RefNannyDeclarations
6600 PyObject *__pyx_t_1 = NULL;
6601 int __pyx_t_2;
6602 PyObject *__pyx_t_3 = NULL;
6603 PyObject *__pyx_t_4 = NULL;
6604 int __pyx_lineno = 0;
6605 const char *__pyx_filename = NULL;
6606 int __pyx_clineno = 0;
6607 __Pyx_RefNannySetupContext("array_cwrapper", 0);
6608
6609 /* "View.MemoryView":287
6610 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6611 * cdef array result
6612 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
6613 *
6614 * if buf is NULL:
6615*/
6616 __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
6617
6618 if (__pyx_t_2) {
6619 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
6620 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
6621 } else {
6622 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
6623 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
6624 }
6625
6626 __pyx_v_mode = ((PyObject*)__pyx_t_1);
6627 __pyx_t_1 = 0;
6628
6629 /* "View.MemoryView":289
6630 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6631 *
6632 * if buf is NULL: # <<<<<<<<<<<<<<
6633 * result = array.__new__(array, shape, itemsize, format, mode)
6634 * else:
6635*/
6636 __pyx_t_2 = (__pyx_v_buf == NULL);
6637
6638 if (__pyx_t_2) {
6639
6640
6641 /* "View.MemoryView":290
6642 *
6643 * if buf is NULL:
6644 * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
6645 * else:
6646 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6647*/
6648 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
6649 __Pyx_GOTREF(__pyx_t_1);
6650 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
6651 __Pyx_GOTREF(__pyx_t_3);
6652 __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 290, __pyx_L1_error)
6653 __Pyx_GOTREF(__pyx_t_4);
6654 __Pyx_INCREF(__pyx_v_shape);
6655 __Pyx_GIVEREF(__pyx_v_shape);
6656 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6657 __Pyx_GIVEREF(__pyx_t_1);
6658 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6659 __Pyx_GIVEREF(__pyx_t_3);
6660 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6661 __Pyx_INCREF(__pyx_v_mode);
6662 __Pyx_GIVEREF(__pyx_v_mode);
6663 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6664 __pyx_t_1 = 0;
6665 __pyx_t_3 = 0;
6666 __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
6667 __Pyx_GOTREF(__pyx_t_3);
6668 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6669 __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6670 __pyx_t_3 = 0;
6671
6672 /* "View.MemoryView":289
6673 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6674 *
6675 * if buf is NULL: # <<<<<<<<<<<<<<
6676 * result = array.__new__(array, shape, itemsize, format, mode)
6677 * else:
6678*/
6679 goto __pyx_L3;
6680 }
6681
6682 /* "View.MemoryView":292
6683 * result = array.__new__(array, shape, itemsize, format, mode)
6684 * else:
6685 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
6686 * result.data = buf
6687 *
6688*/
6689 /*else*/ {
6690 __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
6691 __Pyx_GOTREF(__pyx_t_3);
6692 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6693 __Pyx_GOTREF(__pyx_t_4);
6694 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
6695 __Pyx_GOTREF(__pyx_t_1);
6696 __Pyx_INCREF(__pyx_v_shape);
6697 __Pyx_GIVEREF(__pyx_v_shape);
6698 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6699 __Pyx_GIVEREF(__pyx_t_3);
6700 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6701 __Pyx_GIVEREF(__pyx_t_4);
6702 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6703 __Pyx_INCREF(__pyx_v_mode);
6704 __Pyx_GIVEREF(__pyx_v_mode);
6705 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6706 __pyx_t_3 = 0;
6707 __pyx_t_4 = 0;
6708 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6709 __Pyx_GOTREF(__pyx_t_4);
6710 if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_allocate_buffer, Py_False) < (0)) __PYX_ERR(1, 292, __pyx_L1_error)
6711 __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
6712 __Pyx_GOTREF(__pyx_t_3);
6713 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6714 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6715 __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6716 __pyx_t_3 = 0;
6717
6718 /* "View.MemoryView":293
6719 * else:
6720 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6721 * result.data = buf # <<<<<<<<<<<<<<
6722 *
6723 * return result
6724*/
6725 __pyx_v_result->data = __pyx_v_buf;
6726 }
6727 __pyx_L3:;
6728
6729 /* "View.MemoryView":295
6730 * result.data = buf
6731 *
6732 * return result # <<<<<<<<<<<<<<
6733 *
6734 *
6735*/
6736 {
6737 struct __pyx_array_obj *__pyx_temp;
6738 {
6739 __pyx_temp = __pyx_r;
6740 __Pyx_INCREF((PyObject *)__pyx_v_result);
6741 __pyx_r = __pyx_v_result;
6742 }
6743 __Pyx_XDECREF((PyObject *)__pyx_temp);
6744 }
6745 goto __pyx_L0;
6746
6747 /* "View.MemoryView":284
6748 *
6749 *
6750 * @cname("__pyx_array_new") # <<<<<<<<<<<<<<
6751 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6752 * cdef array result
6753*/
6754
6755 /* function exit code */
6756 __pyx_L1_error:;
6757 __Pyx_XDECREF(__pyx_t_1);
6758 __Pyx_XDECREF(__pyx_t_3);
6759 __Pyx_XDECREF(__pyx_t_4);
6760 __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
6761 __pyx_r = 0;
6762 __pyx_L0:;
6763 __Pyx_XDECREF((PyObject *)__pyx_v_result);
6764 __Pyx_XDECREF(__pyx_v_mode);
6765 __Pyx_XGIVEREF((PyObject *)__pyx_r);
6766 __Pyx_RefNannyFinishContext();
6767 return __pyx_r;
6768}
6769
6770/* "View.MemoryView":321
6771 * cdef class Enum(object):
6772 * cdef object name
6773 * def __init__(self, name): # <<<<<<<<<<<<<<
6774 * self.name = name
6775 * def __repr__(self):
6776*/
6777
6778/* Python wrapper */
6779static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6780#if CYTHON_VECTORCALL_TPNEW
6781PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6782#else
6783PyObject *__pyx_args, PyObject *__pyx_kwds
6784#endif
6785); /*proto*/
6786static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6787#if CYTHON_VECTORCALL_TPNEW
6788PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6789#else
6790PyObject *__pyx_args, PyObject *__pyx_kwds
6791#endif
6792) {
6793 PyObject *__pyx_v_name = 0;
6794 #if !CYTHON_VECTORCALL_TPNEW
6795 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6796 #endif
6797 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6798 PyObject* values[1] = {0};
6799 int __pyx_lineno = 0;
6800 const char *__pyx_filename = NULL;
6801 int __pyx_clineno = 0;
6802 int __pyx_r;
6803 __Pyx_RefNannyDeclarations
6804 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
6805 #if !CYTHON_VECTORCALL_TPNEW
6806 #if CYTHON_ASSUME_SAFE_SIZE
6807 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6808 #else
6809 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
6810 #endif
6811 #endif
6812 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
6813 {
6814 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
6815 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
6816 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 321, __pyx_L3_error)
6817 if (__pyx_kwds_len > 0) {
6818 switch (__pyx_nargs) {
6819 case 1:
6820 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6821 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6822 CYTHON_FALLTHROUGH;
6823 case 0: break;
6824 default: goto __pyx_L5_argtuple_error;
6825 }
6826 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6827 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(1, 321, __pyx_L3_error)
6828 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6829 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(1, 321, __pyx_L3_error) }
6830 }
6831 } else if (unlikely(__pyx_nargs != 1)) {
6832 goto __pyx_L5_argtuple_error;
6833 } else {
6834 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6835 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6836 }
6837 __pyx_v_name = values[0];
6838 }
6839 goto __pyx_L6_skip;
6840 __pyx_L5_argtuple_error:;
6841 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 321, __pyx_L3_error)
6842 __pyx_L6_skip:;
6843 goto __pyx_L4_argument_unpacking_done;
6844 __pyx_L3_error:;
6845 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6846 Py_XDECREF(values[__pyx_temp]);
6847 }
6848 __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6849 __Pyx_RefNannyFinishContext();
6850 return -1;
6851 __pyx_L4_argument_unpacking_done:;
6852 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
6853
6854 /* function exit code */
6855 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6856 Py_XDECREF(values[__pyx_temp]);
6857 }
6858 __Pyx_RefNannyFinishContext();
6859 return __pyx_r;
6860}
6861
6862static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
6863 int __pyx_r;
6864 __Pyx_RefNannyDeclarations
6865 __Pyx_RefNannySetupContext("__init__", 0);
6866
6867 /* "View.MemoryView":322
6868 * cdef object name
6869 * def __init__(self, name):
6870 * self.name = name # <<<<<<<<<<<<<<
6871 * def __repr__(self):
6872 * return self.name
6873*/
6874 __Pyx_INCREF(__pyx_v_name);
6875 __Pyx_GIVEREF(__pyx_v_name);
6876 __Pyx_GOTREF(__pyx_v_self->name);
6877 __Pyx_DECREF(__pyx_v_self->name);
6878 __pyx_v_self->name = __pyx_v_name;
6879
6880 /* "View.MemoryView":321
6881 * cdef class Enum(object):
6882 * cdef object name
6883 * def __init__(self, name): # <<<<<<<<<<<<<<
6884 * self.name = name
6885 * def __repr__(self):
6886*/
6887
6888 /* function exit code */
6889 __pyx_r = 0;
6890
6891 __Pyx_RefNannyFinishContext();
6892 return __pyx_r;
6893}
6894
6895/* "View.MemoryView":323
6896 * def __init__(self, name):
6897 * self.name = name
6898 * def __repr__(self): # <<<<<<<<<<<<<<
6899 * return self.name
6900 *
6901*/
6902
6903/* Python wrapper */
6904static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
6905static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
6906 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6907 PyObject *__pyx_r = 0;
6908 __Pyx_RefNannyDeclarations
6909 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
6910 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6911 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6912
6913 /* function exit code */
6914 __Pyx_RefNannyFinishContext();
6915 return __pyx_r;
6916}
6917
6918static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6919 PyObject *__pyx_r = NULL;
6920 __Pyx_RefNannyDeclarations
6921 __Pyx_RefNannySetupContext("__repr__", 0);
6922
6923 /* "View.MemoryView":324
6924 * self.name = name
6925 * def __repr__(self):
6926 * return self.name # <<<<<<<<<<<<<<
6927 *
6928 * cdef generic = Enum("<strided and direct or indirect>")
6929*/
6930 {
6931 PyObject *__pyx_temp;
6932 {
6933 __pyx_temp = __pyx_r;
6934 __Pyx_INCREF(__pyx_v_self->name);
6935 __pyx_r = __pyx_v_self->name;
6936 }
6937 __Pyx_XDECREF(__pyx_temp);
6938 }
6939 goto __pyx_L0;
6940
6941 /* "View.MemoryView":323
6942 * def __init__(self, name):
6943 * self.name = name
6944 * def __repr__(self): # <<<<<<<<<<<<<<
6945 * return self.name
6946 *
6947*/
6948
6949 /* function exit code */
6950 __pyx_L0:;
6951 __Pyx_XGIVEREF(__pyx_r);
6952 __Pyx_RefNannyFinishContext();
6953 return __pyx_r;
6954}
6955
6956/* "(tree fragment)":1
6957 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6958 * cdef tuple state
6959 * cdef object _dict
6960*/
6961
6962/* Python wrapper */
6963static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
6964#if CYTHON_VECTORCALL
6965PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6966#else
6967PyObject *__pyx_args, PyObject *__pyx_kwds
6968#endif
6969); /*proto*/
6970static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
6971#if CYTHON_VECTORCALL
6972PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6973#else
6974PyObject *__pyx_args, PyObject *__pyx_kwds
6975#endif
6976) {
6977 #if !CYTHON_VECTORCALL
6978 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6979 #endif
6980 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6981 PyObject *__pyx_r = 0;
6982 __Pyx_RefNannyDeclarations
6983 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6984 #if !CYTHON_VECTORCALL
6985 #if CYTHON_ASSUME_SAFE_SIZE
6986 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6987 #else
6988 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6989 #endif
6990 #endif
6991 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6992 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
6993 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6994 if (unlikely(__pyx_kwds_len < 0)) return NULL;
6995 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
6996 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6997
6998 /* function exit code */
6999 __Pyx_RefNannyFinishContext();
7000 return __pyx_r;
7001}
7002
7003static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7004 PyObject *__pyx_v_state = 0;
7005 PyObject *__pyx_v__dict = 0;
7006 int __pyx_v_use_setstate;
7007 PyObject *__pyx_r = NULL;
7008 __Pyx_RefNannyDeclarations
7009 PyObject *__pyx_t_1 = NULL;
7010 PyObject *__pyx_t_2 = NULL;
7011 int __pyx_t_3;
7012 int __pyx_t_4;
7013 PyObject *__pyx_t_5 = NULL;
7014 int __pyx_lineno = 0;
7015 const char *__pyx_filename = NULL;
7016 int __pyx_clineno = 0;
7017 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7018
7019 /* "(tree fragment)":5
7020 * cdef object _dict
7021 * cdef bint use_setstate
7022 * with CRITICAL_SECTION(self): # <<<<<<<<<<<<<<
7023 * state = (self.name,)
7024 * _dict = getattr(self, '__dict__', None)
7025*/
7026 {
7027 __Pyx_PyCriticalSection __pyx_cs;
7028 __pyx_t_1 = ((PyObject *)__pyx_v_self);
7029 __Pyx_INCREF(__pyx_t_1);
7030 __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
7031 /*try:*/ {
7032
7033 /* "(tree fragment)":6
7034 * cdef bint use_setstate
7035 * with CRITICAL_SECTION(self):
7036 * state = (self.name,) # <<<<<<<<<<<<<<
7037 * _dict = getattr(self, '__dict__', None)
7038 * if _dict is not None and _dict:
7039*/
7040 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L4_error)
7041 __Pyx_GOTREF(__pyx_t_2);
7042 __Pyx_INCREF(__pyx_v_self->name);
7043 __Pyx_GIVEREF(__pyx_v_self->name);
7044 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name) != (0)) __PYX_ERR(1, 6, __pyx_L4_error);
7045 __pyx_v_state = ((PyObject*)__pyx_t_2);
7046 __pyx_t_2 = 0;
7047
7048 /* "(tree fragment)":7
7049 * with CRITICAL_SECTION(self):
7050 * state = (self.name,)
7051 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
7052 * if _dict is not None and _dict:
7053 * state += (_dict,)
7054*/
7055 __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L4_error)
7056 __Pyx_GOTREF(__pyx_t_2);
7057 __pyx_v__dict = __pyx_t_2;
7058 __pyx_t_2 = 0;
7059 }
7060
7061 /* "(tree fragment)":5
7062 * cdef object _dict
7063 * cdef bint use_setstate
7064 * with CRITICAL_SECTION(self): # <<<<<<<<<<<<<<
7065 * state = (self.name,)
7066 * _dict = getattr(self, '__dict__', None)
7067*/
7068 /*finally:*/ {
7069 /*normal exit:*/{
7070 __Pyx_PyCriticalSection_End(&__pyx_cs);
7071 goto __pyx_L5;
7072 }
7073 __pyx_L4_error: {
7074 __Pyx_PyCriticalSection_End(&__pyx_cs);
7075 goto __pyx_L1_error;
7076 }
7077 __pyx_L5:;
7078 }
7079 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7080 }
7081
7082 /* "(tree fragment)":8
7083 * state = (self.name,)
7084 * _dict = getattr(self, '__dict__', None)
7085 * if _dict is not None and _dict: # <<<<<<<<<<<<<<
7086 * state += (_dict,)
7087 * use_setstate = True
7088*/
7089 __pyx_t_4 = (__pyx_v__dict != Py_None);
7090 if (__pyx_t_4) {
7091
7092 } else {
7093
7094 __pyx_t_3 = __pyx_t_4;
7095
7096 goto __pyx_L7_bool_binop_done;
7097 }
7098 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 8, __pyx_L1_error)
7099
7100 __pyx_t_3 = __pyx_t_4;
7101
7102 __pyx_L7_bool_binop_done:;
7103 if (__pyx_t_3) {
7104
7105
7106 /* "(tree fragment)":9
7107 * _dict = getattr(self, '__dict__', None)
7108 * if _dict is not None and _dict:
7109 * state += (_dict,) # <<<<<<<<<<<<<<
7110 * use_setstate = True
7111 * else:
7112*/
7113 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
7114 __Pyx_GOTREF(__pyx_t_1);
7115 __Pyx_INCREF(__pyx_v__dict);
7116 __Pyx_GIVEREF(__pyx_v__dict);
7117 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 9, __pyx_L1_error);
7118 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
7119 __Pyx_GOTREF(__pyx_t_2);
7120 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7121 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
7122 __pyx_t_2 = 0;
7123
7124 /* "(tree fragment)":10
7125 * if _dict is not None and _dict:
7126 * state += (_dict,)
7127 * use_setstate = True # <<<<<<<<<<<<<<
7128 * else:
7129 * use_setstate = self.name is not None
7130*/
7131 __pyx_v_use_setstate = 1;
7132
7133 /* "(tree fragment)":8
7134 * state = (self.name,)
7135 * _dict = getattr(self, '__dict__', None)
7136 * if _dict is not None and _dict: # <<<<<<<<<<<<<<
7137 * state += (_dict,)
7138 * use_setstate = True
7139*/
7140 goto __pyx_L6;
7141 }
7142
7143 /* "(tree fragment)":12
7144 * use_setstate = True
7145 * else:
7146 * use_setstate = self.name is not None # <<<<<<<<<<<<<<
7147 * if use_setstate:
7148 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7149*/
7150 /*else*/ {
7151 __pyx_t_3 = (__pyx_v_self->name != Py_None);
7152 __pyx_v_use_setstate = __pyx_t_3;
7153 }
7154 __pyx_L6:;
7155
7156 /* "(tree fragment)":13
7157 * else:
7158 * use_setstate = self.name is not None
7159 * if use_setstate: # <<<<<<<<<<<<<<
7160 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7161 * else:
7162*/
7163 if (__pyx_v_use_setstate) {
7164
7165 /* "(tree fragment)":14
7166 * use_setstate = self.name is not None
7167 * if use_setstate:
7168 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
7169 * else:
7170 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7171*/
7172 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
7173 __Pyx_GOTREF(__pyx_t_2);
7174 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
7175 __Pyx_GOTREF(__pyx_t_1);
7176 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7177 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7178 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7179 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
7180 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
7181 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7182 __Pyx_INCREF(Py_None);
7183 __Pyx_GIVEREF(Py_None);
7184 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7185 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
7186 __Pyx_GOTREF(__pyx_t_5);
7187 __Pyx_GIVEREF(__pyx_t_2);
7188 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7189 __Pyx_GIVEREF(__pyx_t_1);
7190 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7191 __Pyx_INCREF(__pyx_v_state);
7192 __Pyx_GIVEREF(__pyx_v_state);
7193 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7194 __pyx_t_2 = 0;
7195 __pyx_t_1 = 0;
7196 {
7197 PyObject *__pyx_temp;
7198 {
7199 __pyx_temp = __pyx_r;
7200 __pyx_r = __pyx_t_5;
7201 }
7202 __Pyx_XDECREF(__pyx_temp);
7203 }
7204 __pyx_t_5 = 0;
7205 goto __pyx_L0;
7206
7207 /* "(tree fragment)":13
7208 * else:
7209 * use_setstate = self.name is not None
7210 * if use_setstate: # <<<<<<<<<<<<<<
7211 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7212 * else:
7213*/
7214 }
7215
7216 /* "(tree fragment)":16
7217 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7218 * else:
7219 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
7220 * def __setstate_cython__(self, __pyx_state):
7221 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7222*/
7223 /*else*/ {
7224 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 16, __pyx_L1_error)
7225 __Pyx_GOTREF(__pyx_t_5);
7226 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
7227 __Pyx_GOTREF(__pyx_t_1);
7228 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7229 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7230 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7231 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
7232 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
7233 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7234 __Pyx_INCREF(__pyx_v_state);
7235 __Pyx_GIVEREF(__pyx_v_state);
7236 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7237 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
7238 __Pyx_GOTREF(__pyx_t_2);
7239 __Pyx_GIVEREF(__pyx_t_5);
7240 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7241 __Pyx_GIVEREF(__pyx_t_1);
7242 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7243 __pyx_t_5 = 0;
7244 __pyx_t_1 = 0;
7245 {
7246 PyObject *__pyx_temp;
7247 {
7248 __pyx_temp = __pyx_r;
7249 __pyx_r = __pyx_t_2;
7250 }
7251 __Pyx_XDECREF(__pyx_temp);
7252 }
7253 __pyx_t_2 = 0;
7254 goto __pyx_L0;
7255 }
7256
7257 /* "(tree fragment)":1
7258 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7259 * cdef tuple state
7260 * cdef object _dict
7261*/
7262
7263 /* function exit code */
7264 __pyx_L1_error:;
7265 __Pyx_XDECREF(__pyx_t_1);
7266 __Pyx_XDECREF(__pyx_t_2);
7267 __Pyx_XDECREF(__pyx_t_5);
7268 __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7269 __pyx_r = NULL;
7270 __pyx_L0:;
7271 __Pyx_XDECREF(__pyx_v_state);
7272 __Pyx_XDECREF(__pyx_v__dict);
7273
7274 __Pyx_XGIVEREF(__pyx_r);
7275 __Pyx_RefNannyFinishContext();
7276 return __pyx_r;
7277}
7278
7279/* "(tree fragment)":17
7280 * else:
7281 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7282 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7283 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7284*/
7285
7286/* Python wrapper */
7287static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7288#if CYTHON_VECTORCALL
7289PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7290#else
7291PyObject *__pyx_args, PyObject *__pyx_kwds
7292#endif
7293); /*proto*/
7294static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7295#if CYTHON_VECTORCALL
7296PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7297#else
7298PyObject *__pyx_args, PyObject *__pyx_kwds
7299#endif
7300) {
7301 PyObject *__pyx_v___pyx_state = 0;
7302 #if !CYTHON_VECTORCALL
7303 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7304 #endif
7305 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7306 PyObject* values[1] = {0};
7307 int __pyx_lineno = 0;
7308 const char *__pyx_filename = NULL;
7309 int __pyx_clineno = 0;
7310 PyObject *__pyx_r = 0;
7311 __Pyx_RefNannyDeclarations
7312 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7313 #if !CYTHON_VECTORCALL
7314 #if CYTHON_ASSUME_SAFE_SIZE
7315 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7316 #else
7317 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7318 #endif
7319 #endif
7320 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7321 {
7322 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
7323 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7324 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 17, __pyx_L3_error)
7325 if (__pyx_kwds_len > 0) {
7326 switch (__pyx_nargs) {
7327 case 1:
7328 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7329 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7330 CYTHON_FALLTHROUGH;
7331 case 0: break;
7332 default: goto __pyx_L5_argtuple_error;
7333 }
7334 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7335 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 17, __pyx_L3_error)
7336 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
7337 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 17, __pyx_L3_error) }
7338 }
7339 } else if (unlikely(__pyx_nargs != 1)) {
7340 goto __pyx_L5_argtuple_error;
7341 } else {
7342 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7343 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7344 }
7345 __pyx_v___pyx_state = values[0];
7346 }
7347 goto __pyx_L6_skip;
7348 __pyx_L5_argtuple_error:;
7349 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 17, __pyx_L3_error)
7350 __pyx_L6_skip:;
7351 goto __pyx_L4_argument_unpacking_done;
7352 __pyx_L3_error:;
7353 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7354 Py_XDECREF(values[__pyx_temp]);
7355 }
7356 __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7357 __Pyx_RefNannyFinishContext();
7358 return NULL;
7359 __pyx_L4_argument_unpacking_done:;
7360 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
7361
7362 /* function exit code */
7363 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7364 Py_XDECREF(values[__pyx_temp]);
7365 }
7366 __Pyx_RefNannyFinishContext();
7367 return __pyx_r;
7368}
7369
7370static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7371 PyObject *__pyx_r = NULL;
7372 __Pyx_RefNannyDeclarations
7373 PyObject *__pyx_t_1 = NULL;
7374 PyObject *__pyx_t_2 = NULL;
7375 int __pyx_lineno = 0;
7376 const char *__pyx_filename = NULL;
7377 int __pyx_clineno = 0;
7378 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7379
7380 /* "(tree fragment)":18
7381 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7382 * def __setstate_cython__(self, __pyx_state):
7383 * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
7384*/
7385 __pyx_t_1 = __pyx_v___pyx_state;
7386 __Pyx_INCREF(__pyx_t_1);
7387 if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 18, __pyx_L1_error)
7388 if (unlikely(__pyx_t_1 == Py_None)) {
7389 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
7390 __PYX_ERR(1, 18, __pyx_L1_error)
7391 }
7392 __pyx_t_2 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 18, __pyx_L1_error)
7393 __Pyx_GOTREF(__pyx_t_2);
7394 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7395 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7396
7397 /* "(tree fragment)":17
7398 * else:
7399 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7400 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7401 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7402*/
7403
7404 /* function exit code */
7405 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7406 goto __pyx_L0;
7407 __pyx_L1_error:;
7408 __Pyx_XDECREF(__pyx_t_1);
7409 __Pyx_XDECREF(__pyx_t_2);
7410 __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7411 __pyx_r = NULL;
7412 __pyx_L0:;
7413 __Pyx_XGIVEREF(__pyx_r);
7414 __Pyx_RefNannyFinishContext();
7415 return __pyx_r;
7416}
7417
7418/* "View.MemoryView":367
7419 * cdef const __Pyx_TypeInfo *typeinfo
7420 *
7421 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7422 * self.obj = obj
7423 * self.flags = flags
7424*/
7425
7426/* Python wrapper */
7427static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7428#if CYTHON_VECTORCALL_TPNEW
7429PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7430#else
7431PyObject *__pyx_args, PyObject *__pyx_kwds
7432#endif
7433); /*proto*/
7434static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7435#if CYTHON_VECTORCALL_TPNEW
7436PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7437#else
7438PyObject *__pyx_args, PyObject *__pyx_kwds
7439#endif
7440) {
7441 PyObject *__pyx_v_obj = 0;
7442 int __pyx_v_flags;
7443 int __pyx_v_dtype_is_object;
7444 #if !CYTHON_VECTORCALL_TPNEW
7445 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7446 #endif
7447 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7448 PyObject* values[3] = {0,0,0};
7449 int __pyx_lineno = 0;
7450 const char *__pyx_filename = NULL;
7451 int __pyx_clineno = 0;
7452 int __pyx_r;
7453 __Pyx_RefNannyDeclarations
7454 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7455 #if !CYTHON_VECTORCALL_TPNEW
7456 #if CYTHON_ASSUME_SAFE_SIZE
7457 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7458 #else
7459 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7460 #endif
7461 #endif
7462 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
7463 {
7464 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_obj,&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_dtype_is_object,0};
7465 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
7466 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 367, __pyx_L3_error)
7467 if (__pyx_kwds_len > 0) {
7468 switch (__pyx_nargs) {
7469 case 3:
7470 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7471 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7472 CYTHON_FALLTHROUGH;
7473 case 2:
7474 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7475 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7476 CYTHON_FALLTHROUGH;
7477 case 1:
7478 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7479 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7480 CYTHON_FALLTHROUGH;
7481 case 0: break;
7482 default: goto __pyx_L5_argtuple_error;
7483 }
7484 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7485 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(1, 367, __pyx_L3_error)
7486 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
7487 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, i); __PYX_ERR(1, 367, __pyx_L3_error) }
7488 }
7489 } else {
7490 switch (__pyx_nargs) {
7491 case 3:
7492 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7493 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7494 CYTHON_FALLTHROUGH;
7495 case 2:
7496 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7497 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7498 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7499 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7500 break;
7501 default: goto __pyx_L5_argtuple_error;
7502 }
7503 }
7504 __pyx_v_obj = values[0];
7505 __pyx_v_flags = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 367, __pyx_L3_error)
7506 if (values[2]) {
7507 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 367, __pyx_L3_error)
7508 } else {
7509 __pyx_v_dtype_is_object = ((int)0);
7510 }
7511 }
7512 goto __pyx_L6_skip;
7513 __pyx_L5_argtuple_error:;
7514 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 367, __pyx_L3_error)
7515 __pyx_L6_skip:;
7516 goto __pyx_L4_argument_unpacking_done;
7517 __pyx_L3_error:;
7518 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7519 Py_XDECREF(values[__pyx_temp]);
7520 }
7521 __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7522 __Pyx_RefNannyFinishContext();
7523 return -1;
7524 __pyx_L4_argument_unpacking_done:;
7525 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
7526
7527 /* function exit code */
7528 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7529 Py_XDECREF(values[__pyx_temp]);
7530 }
7531
7532
7533 __Pyx_RefNannyFinishContext();
7534 return __pyx_r;
7535}
7536
7537static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
7538 int __pyx_r;
7539 __Pyx_RefNannyDeclarations
7540 int __pyx_t_1;
7541 int __pyx_t_2;
7542 int __pyx_t_3;
7543 int __pyx_lineno = 0;
7544 const char *__pyx_filename = NULL;
7545 int __pyx_clineno = 0;
7546 __Pyx_RefNannySetupContext("__cinit__", 0);
7547
7548 /* "View.MemoryView":368
7549 *
7550 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7551 * self.obj = obj # <<<<<<<<<<<<<<
7552 * self.flags = flags
7553 * if type(self) is memoryview or obj is not None:
7554*/
7555 __Pyx_INCREF(__pyx_v_obj);
7556 __Pyx_GIVEREF(__pyx_v_obj);
7557 __Pyx_GOTREF(__pyx_v_self->obj);
7558 __Pyx_DECREF(__pyx_v_self->obj);
7559 __pyx_v_self->obj = __pyx_v_obj;
7560
7561 /* "View.MemoryView":369
7562 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7563 * self.obj = obj
7564 * self.flags = flags # <<<<<<<<<<<<<<
7565 * if type(self) is memoryview or obj is not None:
7566 * PyObject_GetBuffer(obj, &self.view, flags)
7567*/
7568 __pyx_v_self->flags = __pyx_v_flags;
7569
7570 /* "View.MemoryView":370
7571 * self.obj = obj
7572 * self.flags = flags
7573 * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7574 * PyObject_GetBuffer(obj, &self.view, flags)
7575 * if <PyObject *> self.view.obj == NULL:
7576*/
7577 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type));
7578 if (!__pyx_t_2) {
7579
7580 } else {
7581
7582 __pyx_t_1 = __pyx_t_2;
7583
7584 goto __pyx_L4_bool_binop_done;
7585 }
7586 __pyx_t_2 = (__pyx_v_obj != Py_None);
7587
7588 __pyx_t_1 = __pyx_t_2;
7589
7590 __pyx_L4_bool_binop_done:;
7591 if (__pyx_t_1) {
7592
7593
7594 /* "View.MemoryView":371
7595 * self.flags = flags
7596 * if type(self) is memoryview or obj is not None:
7597 * PyObject_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
7598 * if <PyObject *> self.view.obj == NULL:
7599 * (<__pyx_buffer *> &self.view).obj = Py_None
7600*/
7601 __pyx_t_3 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 371, __pyx_L1_error)
7602
7603
7604 /* "View.MemoryView":372
7605 * if type(self) is memoryview or obj is not None:
7606 * PyObject_GetBuffer(obj, &self.view, flags)
7607 * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7608 * (<__pyx_buffer *> &self.view).obj = Py_None
7609 * Py_INCREF(Py_None)
7610*/
7611 __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
7612
7613 if (__pyx_t_1) {
7614
7615
7616 /* "View.MemoryView":373
7617 * PyObject_GetBuffer(obj, &self.view, flags)
7618 * if <PyObject *> self.view.obj == NULL:
7619 * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
7620 * Py_INCREF(Py_None)
7621 *
7622*/
7623 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7624
7625 /* "View.MemoryView":374
7626 * if <PyObject *> self.view.obj == NULL:
7627 * (<__pyx_buffer *> &self.view).obj = Py_None
7628 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7629 *
7630 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7631*/
7632 Py_INCREF(Py_None);
7633
7634 /* "View.MemoryView":372
7635 * if type(self) is memoryview or obj is not None:
7636 * PyObject_GetBuffer(obj, &self.view, flags)
7637 * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7638 * (<__pyx_buffer *> &self.view).obj = Py_None
7639 * Py_INCREF(Py_None)
7640*/
7641 }
7642
7643 /* "View.MemoryView":370
7644 * self.obj = obj
7645 * self.flags = flags
7646 * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7647 * PyObject_GetBuffer(obj, &self.view, flags)
7648 * if <PyObject *> self.view.obj == NULL:
7649*/
7650 }
7651
7652 /* "View.MemoryView":376
7653 * Py_INCREF(Py_None)
7654 *
7655 * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7656 * global __pyx_memoryview_thread_locks_used
7657 * if (__pyx_memoryview_thread_locks_used < 8 and
7658*/
7659 __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
7660
7661 if (__pyx_t_1) {
7662
7663
7664 /* "View.MemoryView":378
7665 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7666 * global __pyx_memoryview_thread_locks_used
7667 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
7668 *
7669 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7670*/
7671 __pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
7672
7673 if (__pyx_t_2) {
7674
7675 } else {
7676
7677 __pyx_t_1 = __pyx_t_2;
7678
7679 goto __pyx_L9_bool_binop_done;
7680 }
7681
7682 /* "View.MemoryView":380
7683 * if (__pyx_memoryview_thread_locks_used < 8 and
7684 *
7685 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()): # <<<<<<<<<<<<<<
7686 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7687 * __pyx_memoryview_thread_locks_used += 1
7688*/
7689 __pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
7690
7691
7692 __pyx_t_1 = __pyx_t_2;
7693
7694 __pyx_L9_bool_binop_done:;
7695
7696 /* "View.MemoryView":378
7697 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7698 * global __pyx_memoryview_thread_locks_used
7699 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
7700 *
7701 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7702*/
7703 if (__pyx_t_1) {
7704
7705
7706 /* "View.MemoryView":381
7707 *
7708 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7709 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
7710 * __pyx_memoryview_thread_locks_used += 1
7711 * if self.lock is NULL:
7712*/
7713 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7714
7715 /* "View.MemoryView":382
7716 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7717 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7718 * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
7719 * if self.lock is NULL:
7720 * self.lock = PyThread_allocate_lock()
7721*/
7722 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
7723
7724 /* "View.MemoryView":378
7725 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7726 * global __pyx_memoryview_thread_locks_used
7727 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
7728 *
7729 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
7730*/
7731 }
7732
7733 /* "View.MemoryView":383
7734 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7735 * __pyx_memoryview_thread_locks_used += 1
7736 * if self.lock is NULL: # <<<<<<<<<<<<<<
7737 * self.lock = PyThread_allocate_lock()
7738 * if self.lock is NULL:
7739*/
7740 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7741
7742 if (__pyx_t_1) {
7743
7744
7745 /* "View.MemoryView":384
7746 * __pyx_memoryview_thread_locks_used += 1
7747 * if self.lock is NULL:
7748 * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
7749 * if self.lock is NULL:
7750 * raise MemoryError
7751*/
7752 __pyx_v_self->lock = PyThread_allocate_lock();
7753
7754 /* "View.MemoryView":385
7755 * if self.lock is NULL:
7756 * self.lock = PyThread_allocate_lock()
7757 * if self.lock is NULL: # <<<<<<<<<<<<<<
7758 * raise MemoryError
7759 *
7760*/
7761 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7762
7763 if (unlikely(__pyx_t_1)) {
7764
7765
7766 /* "View.MemoryView":386
7767 * self.lock = PyThread_allocate_lock()
7768 * if self.lock is NULL:
7769 * raise MemoryError # <<<<<<<<<<<<<<
7770 *
7771 * if flags & PyBUF_FORMAT:
7772*/
7773 PyErr_NoMemory(); __PYX_ERR(1, 386, __pyx_L1_error)
7774
7775 /* "View.MemoryView":385
7776 * if self.lock is NULL:
7777 * self.lock = PyThread_allocate_lock()
7778 * if self.lock is NULL: # <<<<<<<<<<<<<<
7779 * raise MemoryError
7780 *
7781*/
7782 }
7783
7784 /* "View.MemoryView":383
7785 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7786 * __pyx_memoryview_thread_locks_used += 1
7787 * if self.lock is NULL: # <<<<<<<<<<<<<<
7788 * self.lock = PyThread_allocate_lock()
7789 * if self.lock is NULL:
7790*/
7791 }
7792
7793 /* "View.MemoryView":376
7794 * Py_INCREF(Py_None)
7795 *
7796 * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7797 * global __pyx_memoryview_thread_locks_used
7798 * if (__pyx_memoryview_thread_locks_used < 8 and
7799*/
7800 }
7801
7802 /* "View.MemoryView":388
7803 * raise MemoryError
7804 *
7805 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7806 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7807 * else:
7808*/
7809 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7810
7811 if (__pyx_t_1) {
7812
7813
7814 /* "View.MemoryView":389
7815 *
7816 * if flags & PyBUF_FORMAT:
7817 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
7818 * else:
7819 * self.dtype_is_object = dtype_is_object
7820*/
7821 __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
7822
7823 if (__pyx_t_2) {
7824
7825 } else {
7826
7827 __pyx_t_1 = __pyx_t_2;
7828
7829 goto __pyx_L14_bool_binop_done;
7830 }
7831 __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
7832
7833
7834 __pyx_t_1 = __pyx_t_2;
7835
7836 __pyx_L14_bool_binop_done:;
7837 __pyx_v_self->dtype_is_object = __pyx_t_1;
7838
7839 /* "View.MemoryView":388
7840 * raise MemoryError
7841 *
7842 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7843 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7844 * else:
7845*/
7846 goto __pyx_L13;
7847 }
7848
7849 /* "View.MemoryView":391
7850 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7851 * else:
7852 * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
7853 *
7854 * with cython.cdivision(True):
7855*/
7856 /*else*/ {
7857 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
7858 }
7859 __pyx_L13:;
7860
7861 /* "View.MemoryView":394
7862 *
7863 * with cython.cdivision(True):
7864 * assert <uintptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
7865 * self.typeinfo = NULL
7866 *
7867*/
7868 #ifndef CYTHON_WITHOUT_ASSERTIONS
7869 if (unlikely(__pyx_assertions_enabled())) {
7870 __pyx_t_1 = ((((__pyx_uintptr_t)(&__pyx_v_self->acquisition_count)) % (sizeof(__pyx_atomic_int_type))) == 0);
7871
7872 if (unlikely(!__pyx_t_1)) {
7873 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
7874 __PYX_ERR(1, 394, __pyx_L1_error)
7875 }
7876
7877 }
7878 #else
7879 if ((1)); else __PYX_ERR(1, 394, __pyx_L1_error)
7880 #endif
7881
7882 /* "View.MemoryView":395
7883 * with cython.cdivision(True):
7884 * assert <uintptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
7885 * self.typeinfo = NULL # <<<<<<<<<<<<<<
7886 *
7887 * def __dealloc__(memoryview self):
7888*/
7889 __pyx_v_self->typeinfo = NULL;
7890
7891 /* "View.MemoryView":367
7892 * cdef const __Pyx_TypeInfo *typeinfo
7893 *
7894 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7895 * self.obj = obj
7896 * self.flags = flags
7897*/
7898
7899 /* function exit code */
7900 __pyx_r = 0;
7901 goto __pyx_L0;
7902 __pyx_L1_error:;
7903 __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7904 __pyx_r = -1;
7905 __pyx_L0:;
7906
7907 __Pyx_RefNannyFinishContext();
7908 return __pyx_r;
7909}
7910
7911/* "View.MemoryView":397
7912 * self.typeinfo = NULL
7913 *
7914 * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
7915 * if self.obj is not None:
7916 * PyBuffer_Release(&self.view)
7917*/
7918
7919/* Python wrapper */
7920static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
7921static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
7922 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7923 __Pyx_RefNannyDeclarations
7924 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7925 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7926 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
7927
7928 /* function exit code */
7929 __Pyx_RefNannyFinishContext();
7930}
7931
7932static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
7933 int __pyx_v_i;
7934 int __pyx_t_1;
7935 Py_ssize_t __pyx_t_2;
7936 Py_ssize_t __pyx_t_3;
7937 int __pyx_t_4;
7938 PyThread_type_lock __pyx_t_5;
7939 PyThread_type_lock __pyx_t_6;
7940
7941 /* "View.MemoryView":398
7942 *
7943 * def __dealloc__(memoryview self):
7944 * if self.obj is not None: # <<<<<<<<<<<<<<
7945 * PyBuffer_Release(&self.view)
7946 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7947*/
7948 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
7949 if (__pyx_t_1) {
7950
7951
7952 /* "View.MemoryView":399
7953 * def __dealloc__(memoryview self):
7954 * if self.obj is not None:
7955 * PyBuffer_Release(&self.view) # <<<<<<<<<<<<<<
7956 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7957 *
7958*/
7959 PyBuffer_Release((&__pyx_v_self->view));
7960
7961 /* "View.MemoryView":398
7962 *
7963 * def __dealloc__(memoryview self):
7964 * if self.obj is not None: # <<<<<<<<<<<<<<
7965 * PyBuffer_Release(&self.view)
7966 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7967*/
7968 goto __pyx_L3;
7969 }
7970
7971 /* "View.MemoryView":400
7972 * if self.obj is not None:
7973 * PyBuffer_Release(&self.view)
7974 * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
7975 *
7976 * (<__pyx_buffer *> &self.view).obj = NULL
7977*/
7978 __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
7979
7980 if (__pyx_t_1) {
7981
7982
7983 /* "View.MemoryView":402
7984 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7985 *
7986 * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
7987 * Py_DECREF(Py_None)
7988 *
7989*/
7990 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
7991
7992 /* "View.MemoryView":403
7993 *
7994 * (<__pyx_buffer *> &self.view).obj = NULL
7995 * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
7996 *
7997 * cdef int i
7998*/
7999 Py_DECREF(Py_None);
8000
8001 /* "View.MemoryView":400
8002 * if self.obj is not None:
8003 * PyBuffer_Release(&self.view)
8004 * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8005 *
8006 * (<__pyx_buffer *> &self.view).obj = NULL
8007*/
8008 }
8009 __pyx_L3:;
8010
8011 /* "View.MemoryView":407
8012 * cdef int i
8013 * global __pyx_memoryview_thread_locks_used
8014 * if self.lock != NULL: # <<<<<<<<<<<<<<
8015 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8016 * if __pyx_memoryview_thread_locks[i] is self.lock:
8017*/
8018 __pyx_t_1 = (__pyx_v_self->lock != NULL);
8019
8020 if (__pyx_t_1) {
8021
8022
8023 /* "View.MemoryView":408
8024 * global __pyx_memoryview_thread_locks_used
8025 * if self.lock != NULL:
8026 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
8027 * if __pyx_memoryview_thread_locks[i] is self.lock:
8028 * __pyx_memoryview_thread_locks_used -= 1
8029*/
8030 __pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
8031
8032 if (__pyx_t_1) {
8033
8034 __pyx_t_2 = 0;
8035 } else {
8036
8037 __pyx_t_2 = __pyx_memoryview_thread_locks_used;
8038 }
8039
8040 __pyx_t_3 = __pyx_t_2;
8041
8042 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
8043 __pyx_v_i = __pyx_t_4;
8044
8045 /* "View.MemoryView":409
8046 * if self.lock != NULL:
8047 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8048 * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8049 * __pyx_memoryview_thread_locks_used -= 1
8050 * if i != __pyx_memoryview_thread_locks_used:
8051*/
8052 __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
8053
8054 if (__pyx_t_1) {
8055
8056
8057 /* "View.MemoryView":410
8058 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8059 * if __pyx_memoryview_thread_locks[i] is self.lock:
8060 * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
8061 * if i != __pyx_memoryview_thread_locks_used:
8062 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8063*/
8064 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8065
8066 /* "View.MemoryView":411
8067 * if __pyx_memoryview_thread_locks[i] is self.lock:
8068 * __pyx_memoryview_thread_locks_used -= 1
8069 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8070 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8071 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8072*/
8073 __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
8074
8075 if (__pyx_t_1) {
8076
8077
8078 /* "View.MemoryView":413
8079 * if i != __pyx_memoryview_thread_locks_used:
8080 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8081 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
8082 * break
8083 * else:
8084*/
8085 __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8086
8087 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8088
8089
8090 /* "View.MemoryView":412
8091 * __pyx_memoryview_thread_locks_used -= 1
8092 * if i != __pyx_memoryview_thread_locks_used:
8093 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
8094 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8095 * break
8096*/
8097 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
8098
8099 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
8100
8101
8102 /* "View.MemoryView":411
8103 * if __pyx_memoryview_thread_locks[i] is self.lock:
8104 * __pyx_memoryview_thread_locks_used -= 1
8105 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8106 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8107 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8108*/
8109 }
8110
8111 /* "View.MemoryView":414
8112 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8113 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8114 * break # <<<<<<<<<<<<<<
8115 * else:
8116 * PyThread_free_lock(self.lock)
8117*/
8118 goto __pyx_L6_break;
8119
8120 /* "View.MemoryView":409
8121 * if self.lock != NULL:
8122 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8123 * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8124 * __pyx_memoryview_thread_locks_used -= 1
8125 * if i != __pyx_memoryview_thread_locks_used:
8126*/
8127 }
8128 }
8129 /*else*/ {
8130
8131 /* "View.MemoryView":416
8132 * break
8133 * else:
8134 * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
8135 *
8136 *
8137*/
8138 PyThread_free_lock(__pyx_v_self->lock);
8139 }
8140 __pyx_L6_break:;
8141
8142
8143
8144 /* "View.MemoryView":407
8145 * cdef int i
8146 * global __pyx_memoryview_thread_locks_used
8147 * if self.lock != NULL: # <<<<<<<<<<<<<<
8148 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8149 * if __pyx_memoryview_thread_locks[i] is self.lock:
8150*/
8151 }
8152
8153 /* "View.MemoryView":397
8154 * self.typeinfo = NULL
8155 *
8156 * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8157 * if self.obj is not None:
8158 * PyBuffer_Release(&self.view)
8159*/
8160
8161 /* function exit code */
8162
8163
8164}
8165
8166/* "View.MemoryView":419
8167 *
8168 *
8169 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL: # <<<<<<<<<<<<<<
8170 * cdef Py_ssize_t dim
8171 * cdef char *itemp = <char *> self.view.buf
8172*/
8173
8174static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8175 Py_ssize_t __pyx_v_dim;
8176 char *__pyx_v_itemp;
8177 PyObject *__pyx_v_idx = NULL;
8178 char *__pyx_r;
8179 __Pyx_RefNannyDeclarations
8180 Py_ssize_t __pyx_t_1;
8181 PyObject *__pyx_t_2 = NULL;
8182 Py_ssize_t __pyx_t_3;
8183 PyObject *__pyx_t_4 = NULL;
8184 Py_ssize_t __pyx_t_5;
8185 char *__pyx_t_6;
8186 int __pyx_lineno = 0;
8187 const char *__pyx_filename = NULL;
8188 int __pyx_clineno = 0;
8189 __Pyx_RefNannySetupContext("get_item_pointer", 0);
8190
8191 /* "View.MemoryView":421
8192 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL:
8193 * cdef Py_ssize_t dim
8194 * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
8195 *
8196 * for dim, idx in enumerate(index):
8197*/
8198 __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
8199
8200 /* "View.MemoryView":423
8201 * cdef char *itemp = <char *> self.view.buf
8202 *
8203 * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8204 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8205 *
8206*/
8207
8208 __pyx_t_1 = 0;
8209 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
8210 __pyx_t_3 = 0;
8211 for (;;) {
8212 {
8213 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
8214 #if !CYTHON_ASSUME_SAFE_SIZE
8215 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 423, __pyx_L1_error)
8216 #endif
8217 if (__pyx_t_3 >= __pyx_temp) break;
8218 }
8219 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8220 __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
8221 #else
8222 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
8223 #endif
8224 ++__pyx_t_3;
8225 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
8226 __Pyx_GOTREF(__pyx_t_4);
8227 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
8228 __pyx_t_4 = 0;
8229 __pyx_v_dim = __pyx_t_1;
8230 __pyx_t_1 = (__pyx_t_1 + 1);
8231
8232 /* "View.MemoryView":424
8233 *
8234 * for dim, idx in enumerate(index):
8235 * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
8236 *
8237 * return itemp
8238*/
8239 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 424, __pyx_L1_error)
8240 __pyx_t_6 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_5, __pyx_v_dim); if (unlikely(__pyx_t_6 == ((void *)NULL))) __PYX_ERR(1, 424, __pyx_L1_error)
8241 __pyx_v_itemp = __pyx_t_6;
8242
8243
8244 /* "View.MemoryView":423
8245 * cdef char *itemp = <char *> self.view.buf
8246 *
8247 * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8248 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8249 *
8250*/
8251 }
8252 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8253
8254 /* "View.MemoryView":426
8255 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8256 *
8257 * return itemp # <<<<<<<<<<<<<<
8258 *
8259 *
8260*/
8261 {
8262
8263 __pyx_r = __pyx_v_itemp;
8264 }
8265 goto __pyx_L0;
8266
8267 /* "View.MemoryView":419
8268 *
8269 *
8270 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL: # <<<<<<<<<<<<<<
8271 * cdef Py_ssize_t dim
8272 * cdef char *itemp = <char *> self.view.buf
8273*/
8274
8275 /* function exit code */
8276 __pyx_L1_error:;
8277 __Pyx_XDECREF(__pyx_t_2);
8278 __Pyx_XDECREF(__pyx_t_4);
8279 __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8280 __pyx_r = NULL;
8281 __pyx_L0:;
8282
8283
8284 __Pyx_XDECREF(__pyx_v_idx);
8285
8286 __Pyx_RefNannyFinishContext();
8287 return __pyx_r;
8288}
8289
8290/* "View.MemoryView":429
8291 *
8292 *
8293 * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8294 * cdef char *buffer
8295 * if self.view.ndim == 1 and isinstance(index, int):
8296*/
8297
8298/* Python wrapper */
8299static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
8300static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8301 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8302 PyObject *__pyx_r = 0;
8303 __Pyx_RefNannyDeclarations
8304 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8305 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8306 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8307
8308 /* function exit code */
8309 __Pyx_RefNannyFinishContext();
8310 return __pyx_r;
8311}
8312
8313static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8314 char *__pyx_v_buffer;
8315 int __pyx_v_have_slices;
8316 PyObject *__pyx_v_indices = NULL;
8317 char *__pyx_v_itemp;
8318 PyObject *__pyx_r = NULL;
8319 __Pyx_RefNannyDeclarations
8320 int __pyx_t_1;
8321 int __pyx_t_2;
8322 Py_ssize_t __pyx_t_3;
8323 char *__pyx_t_4;
8324 PyObject *__pyx_t_5 = NULL;
8325 PyObject *__pyx_t_6 = NULL;
8326 PyObject *__pyx_t_7 = NULL;
8327 int __pyx_lineno = 0;
8328 const char *__pyx_filename = NULL;
8329 int __pyx_clineno = 0;
8330 __Pyx_RefNannySetupContext("__getitem__", 0);
8331
8332 /* "View.MemoryView":431
8333 * def __getitem__(memoryview self, object index):
8334 * cdef char *buffer
8335 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8336 * buffer = <char *> self.view.buf
8337 * return self.convert_item_to_object(
8338*/
8339 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8340
8341 if (__pyx_t_2) {
8342
8343 } else {
8344
8345 __pyx_t_1 = __pyx_t_2;
8346
8347 goto __pyx_L4_bool_binop_done;
8348 }
8349 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8350
8351 __pyx_t_1 = __pyx_t_2;
8352
8353 __pyx_L4_bool_binop_done:;
8354 if (__pyx_t_1) {
8355
8356
8357 /* "View.MemoryView":432
8358 * cdef char *buffer
8359 * if self.view.ndim == 1 and isinstance(index, int):
8360 * buffer = <char *> self.view.buf # <<<<<<<<<<<<<<
8361 * return self.convert_item_to_object(
8362 * pybuffer_index(&self.view, buffer, index, 0))
8363*/
8364 __pyx_v_buffer = ((char *)__pyx_v_self->view.buf);
8365
8366 /* "View.MemoryView":434
8367 * buffer = <char *> self.view.buf
8368 * return self.convert_item_to_object(
8369 * pybuffer_index(&self.view, buffer, index, 0)) # <<<<<<<<<<<<<<
8370 *
8371 * if index is Ellipsis:
8372*/
8373 __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 434, __pyx_L1_error)
8374 __pyx_t_4 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_buffer, __pyx_t_3, 0); if (unlikely(__pyx_t_4 == ((void *)NULL))) __PYX_ERR(1, 434, __pyx_L1_error)
8375
8376 /* "View.MemoryView":433
8377 * if self.view.ndim == 1 and isinstance(index, int):
8378 * buffer = <char *> self.view.buf
8379 * return self.convert_item_to_object( # <<<<<<<<<<<<<<
8380 * pybuffer_index(&self.view, buffer, index, 0))
8381 *
8382*/
8383 __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 433, __pyx_L1_error)
8384 __Pyx_GOTREF(__pyx_t_5);
8385
8386
8387 {
8388 PyObject *__pyx_temp;
8389 {
8390 __pyx_temp = __pyx_r;
8391 __pyx_r = __pyx_t_5;
8392 }
8393 __Pyx_XDECREF(__pyx_temp);
8394 }
8395 __pyx_t_5 = 0;
8396 goto __pyx_L0;
8397
8398 /* "View.MemoryView":431
8399 * def __getitem__(memoryview self, object index):
8400 * cdef char *buffer
8401 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8402 * buffer = <char *> self.view.buf
8403 * return self.convert_item_to_object(
8404*/
8405 }
8406
8407 /* "View.MemoryView":436
8408 * pybuffer_index(&self.view, buffer, index, 0))
8409 *
8410 * if index is Ellipsis: # <<<<<<<<<<<<<<
8411 * return self
8412 *
8413*/
8414 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8415 if (__pyx_t_1) {
8416
8417
8418 /* "View.MemoryView":437
8419 *
8420 * if index is Ellipsis:
8421 * return self # <<<<<<<<<<<<<<
8422 *
8423 * have_slices, indices = _unellipsify(index, self.view.ndim)
8424*/
8425 {
8426 PyObject *__pyx_temp;
8427 {
8428 __pyx_temp = __pyx_r;
8429 __Pyx_INCREF((PyObject *)__pyx_v_self);
8430 __pyx_r = ((PyObject *)__pyx_v_self);
8431 }
8432 __Pyx_XDECREF(__pyx_temp);
8433 }
8434 goto __pyx_L0;
8435
8436 /* "View.MemoryView":436
8437 * pybuffer_index(&self.view, buffer, index, 0))
8438 *
8439 * if index is Ellipsis: # <<<<<<<<<<<<<<
8440 * return self
8441 *
8442*/
8443 }
8444
8445 /* "View.MemoryView":439
8446 * return self
8447 *
8448 * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8449 *
8450 * cdef char *itemp
8451*/
8452 __pyx_t_5 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 439, __pyx_L1_error)
8453 __Pyx_GOTREF(__pyx_t_5);
8454 if (likely(__pyx_t_5 != Py_None)) {
8455 PyObject* sequence = __pyx_t_5;
8456 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8457 if (unlikely(size != 2)) {
8458 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8459 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8460 __PYX_ERR(1, 439, __pyx_L1_error)
8461 }
8462 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8463 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
8464 __Pyx_INCREF(__pyx_t_6);
8465 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
8466 __Pyx_INCREF(__pyx_t_7);
8467 #else
8468 __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 439, __pyx_L1_error)
8469 __Pyx_GOTREF(__pyx_t_6);
8470 __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L1_error)
8471 __Pyx_GOTREF(__pyx_t_7);
8472 #endif
8473 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8474 } else {
8475 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 439, __pyx_L1_error)
8476 }
8477 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 439, __pyx_L1_error)
8478 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8479 if (!(likely(PyTuple_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_7))) __PYX_ERR(1, 439, __pyx_L1_error)
8480 __pyx_v_have_slices = __pyx_t_1;
8481 __pyx_v_indices = ((PyObject*)__pyx_t_7);
8482 __pyx_t_7 = 0;
8483
8484 /* "View.MemoryView":442
8485 *
8486 * cdef char *itemp
8487 * if have_slices: # <<<<<<<<<<<<<<
8488 * return memview_slice(self, indices)
8489 * else:
8490*/
8491 if (__pyx_v_have_slices) {
8492
8493 /* "View.MemoryView":443
8494 * cdef char *itemp
8495 * if have_slices:
8496 * return memview_slice(self, indices) # <<<<<<<<<<<<<<
8497 * else:
8498 * itemp = memoryview.get_item_pointer(self, <tuple> indices)
8499*/
8500 __pyx_t_5 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 443, __pyx_L1_error)
8501 __Pyx_GOTREF(__pyx_t_5);
8502 {
8503 PyObject *__pyx_temp;
8504 {
8505 __pyx_temp = __pyx_r;
8506 __pyx_r = __pyx_t_5;
8507 }
8508 __Pyx_XDECREF(__pyx_temp);
8509 }
8510 __pyx_t_5 = 0;
8511 goto __pyx_L0;
8512
8513 /* "View.MemoryView":442
8514 *
8515 * cdef char *itemp
8516 * if have_slices: # <<<<<<<<<<<<<<
8517 * return memview_slice(self, indices)
8518 * else:
8519*/
8520 }
8521
8522 /* "View.MemoryView":445
8523 * return memview_slice(self, indices)
8524 * else:
8525 * itemp = memoryview.get_item_pointer(self, <tuple> indices) # <<<<<<<<<<<<<<
8526 * return self.convert_item_to_object(itemp)
8527 *
8528*/
8529 /*else*/ {
8530 if (unlikely(__pyx_v_indices == Py_None)) {
8531 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
8532 __PYX_ERR(1, 445, __pyx_L1_error)
8533 }
8534 __pyx_t_4 = __pyx_memoryview_get_item_pointer(__pyx_v_self, ((PyObject*)__pyx_v_indices)); if (unlikely(__pyx_t_4 == ((void *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
8535 __pyx_v_itemp = __pyx_t_4;
8536
8537 /* "View.MemoryView":446
8538 * else:
8539 * itemp = memoryview.get_item_pointer(self, <tuple> indices)
8540 * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
8541 *
8542 * def __setitem__(memoryview self, object index, object value):
8543*/
8544 __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 446, __pyx_L1_error)
8545 __Pyx_GOTREF(__pyx_t_5);
8546 {
8547 PyObject *__pyx_temp;
8548 {
8549 __pyx_temp = __pyx_r;
8550 __pyx_r = __pyx_t_5;
8551 }
8552 __Pyx_XDECREF(__pyx_temp);
8553 }
8554 __pyx_t_5 = 0;
8555 goto __pyx_L0;
8556 }
8557
8558 /* "View.MemoryView":429
8559 *
8560 *
8561 * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8562 * cdef char *buffer
8563 * if self.view.ndim == 1 and isinstance(index, int):
8564*/
8565
8566 /* function exit code */
8567 __pyx_L1_error:;
8568 __Pyx_XDECREF(__pyx_t_5);
8569 __Pyx_XDECREF(__pyx_t_6);
8570 __Pyx_XDECREF(__pyx_t_7);
8571 __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8572 __pyx_r = NULL;
8573 __pyx_L0:;
8574
8575
8576 __Pyx_XDECREF(__pyx_v_indices);
8577
8578 __Pyx_XGIVEREF(__pyx_r);
8579 __Pyx_RefNannyFinishContext();
8580 return __pyx_r;
8581}
8582
8583/* "View.MemoryView":448
8584 * return self.convert_item_to_object(itemp)
8585 *
8586 * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8587 * if self.view.readonly:
8588 * raise TypeError, "Cannot assign to read-only memoryview"
8589*/
8590
8591/* Python wrapper */
8592static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
8593static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8594 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8595 int __pyx_r;
8596 __Pyx_RefNannyDeclarations
8597 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8598 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8599 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
8600
8601 /* function exit code */
8602 __Pyx_RefNannyFinishContext();
8603 return __pyx_r;
8604}
8605
8606static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8607 int __pyx_v_have_slices;
8608 PyObject *__pyx_v_indices = NULL;
8609 PyObject *__pyx_v_obj = NULL;
8610 struct __pyx_memoryview_obj *__pyx_v_target_slice = NULL;
8611 int __pyx_r;
8612 __Pyx_RefNannyDeclarations
8613 int __pyx_t_1;
8614 int __pyx_t_2;
8615 PyObject *__pyx_t_3 = NULL;
8616 PyObject *__pyx_t_4 = NULL;
8617 PyObject *__pyx_t_5 = NULL;
8618 int __pyx_lineno = 0;
8619 const char *__pyx_filename = NULL;
8620 int __pyx_clineno = 0;
8621 __Pyx_RefNannySetupContext("__setitem__", 0);
8622
8623 /* "View.MemoryView":449
8624 *
8625 * def __setitem__(memoryview self, object index, object value):
8626 * if self.view.readonly: # <<<<<<<<<<<<<<
8627 * raise TypeError, "Cannot assign to read-only memoryview"
8628 *
8629*/
8630 if (unlikely(__pyx_v_self->view.readonly)) {
8631
8632 /* "View.MemoryView":450
8633 * def __setitem__(memoryview self, object index, object value):
8634 * if self.view.readonly:
8635 * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
8636 *
8637 * if self.view.ndim == 1 and isinstance(index, int):
8638*/
8639 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_read_only_memor, 0, 0);
8640 __PYX_ERR(1, 450, __pyx_L1_error)
8641
8642 /* "View.MemoryView":449
8643 *
8644 * def __setitem__(memoryview self, object index, object value):
8645 * if self.view.readonly: # <<<<<<<<<<<<<<
8646 * raise TypeError, "Cannot assign to read-only memoryview"
8647 *
8648*/
8649 }
8650
8651 /* "View.MemoryView":452
8652 * raise TypeError, "Cannot assign to read-only memoryview"
8653 *
8654 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8655 * memoryview.setitem_indexed1(self, index, value)
8656 * return
8657*/
8658 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8659
8660 if (__pyx_t_2) {
8661
8662 } else {
8663
8664 __pyx_t_1 = __pyx_t_2;
8665
8666 goto __pyx_L5_bool_binop_done;
8667 }
8668 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8669
8670 __pyx_t_1 = __pyx_t_2;
8671
8672 __pyx_L5_bool_binop_done:;
8673 if (__pyx_t_1) {
8674
8675
8676 /* "View.MemoryView":453
8677 *
8678 * if self.view.ndim == 1 and isinstance(index, int):
8679 * memoryview.setitem_indexed1(self, index, value) # <<<<<<<<<<<<<<
8680 * return
8681 *
8682*/
8683 __pyx_t_3 = __pyx_memoryview_setitem_indexed1(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 453, __pyx_L1_error)
8684 __Pyx_GOTREF(__pyx_t_3);
8685 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8686
8687 /* "View.MemoryView":454
8688 * if self.view.ndim == 1 and isinstance(index, int):
8689 * memoryview.setitem_indexed1(self, index, value)
8690 * return # <<<<<<<<<<<<<<
8691 *
8692 * have_slices, indices = _unellipsify(index, self.view.ndim)
8693*/
8694 {
8695 __pyx_r = 0;
8696 }
8697 goto __pyx_L0;
8698
8699 /* "View.MemoryView":452
8700 * raise TypeError, "Cannot assign to read-only memoryview"
8701 *
8702 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8703 * memoryview.setitem_indexed1(self, index, value)
8704 * return
8705*/
8706 }
8707
8708 /* "View.MemoryView":456
8709 * return
8710 *
8711 * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8712 *
8713 * if have_slices:
8714*/
8715 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 456, __pyx_L1_error)
8716 __Pyx_GOTREF(__pyx_t_3);
8717 if (likely(__pyx_t_3 != Py_None)) {
8718 PyObject* sequence = __pyx_t_3;
8719 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8720 if (unlikely(size != 2)) {
8721 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8722 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8723 __PYX_ERR(1, 456, __pyx_L1_error)
8724 }
8725 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8726 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
8727 __Pyx_INCREF(__pyx_t_4);
8728 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
8729 __Pyx_INCREF(__pyx_t_5);
8730 #else
8731 __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 456, __pyx_L1_error)
8732 __Pyx_GOTREF(__pyx_t_4);
8733 __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error)
8734 __Pyx_GOTREF(__pyx_t_5);
8735 #endif
8736 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8737 } else {
8738 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 456, __pyx_L1_error)
8739 }
8740 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 456, __pyx_L1_error)
8741 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8742 if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_5))) __PYX_ERR(1, 456, __pyx_L1_error)
8743 __pyx_v_have_slices = __pyx_t_1;
8744 __pyx_v_indices = ((PyObject*)__pyx_t_5);
8745 __pyx_t_5 = 0;
8746
8747 /* "View.MemoryView":458
8748 * have_slices, indices = _unellipsify(index, self.view.ndim)
8749 *
8750 * if have_slices: # <<<<<<<<<<<<<<
8751 * obj = memoryview.is_slice(self, value)
8752 * target_slice = memview_slice(self, indices)
8753*/
8754 if (__pyx_v_have_slices) {
8755
8756 /* "View.MemoryView":459
8757 *
8758 * if have_slices:
8759 * obj = memoryview.is_slice(self, value) # <<<<<<<<<<<<<<
8760 * target_slice = memview_slice(self, indices)
8761 * if obj is not None:
8762*/
8763 __pyx_t_3 = __pyx_memoryview_is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 459, __pyx_L1_error)
8764 __Pyx_GOTREF(__pyx_t_3);
8765 __pyx_v_obj = __pyx_t_3;
8766 __pyx_t_3 = 0;
8767
8768 /* "View.MemoryView":460
8769 * if have_slices:
8770 * obj = memoryview.is_slice(self, value)
8771 * target_slice = memview_slice(self, indices) # <<<<<<<<<<<<<<
8772 * if obj is not None:
8773 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8774*/
8775 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 460, __pyx_L1_error)
8776 __Pyx_GOTREF(__pyx_t_3);
8777 __pyx_v_target_slice = ((struct __pyx_memoryview_obj *)__pyx_t_3);
8778 __pyx_t_3 = 0;
8779
8780 /* "View.MemoryView":461
8781 * obj = memoryview.is_slice(self, value)
8782 * target_slice = memview_slice(self, indices)
8783 * if obj is not None: # <<<<<<<<<<<<<<
8784 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8785 * else:
8786*/
8787 __pyx_t_1 = (__pyx_v_obj != Py_None);
8788 if (__pyx_t_1) {
8789
8790
8791 /* "View.MemoryView":462
8792 * target_slice = memview_slice(self, indices)
8793 * if obj is not None:
8794 * memoryview.setitem_slice_assignment(self, target_slice, obj) # <<<<<<<<<<<<<<
8795 * else:
8796 * memoryview.setitem_slice_assign_scalar(self, target_slice, value)
8797*/
8798 __pyx_t_3 = __pyx_memoryview_setitem_slice_assignment(__pyx_v_self, ((PyObject *)__pyx_v_target_slice), __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 462, __pyx_L1_error)
8799 __Pyx_GOTREF(__pyx_t_3);
8800 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8801
8802 /* "View.MemoryView":461
8803 * obj = memoryview.is_slice(self, value)
8804 * target_slice = memview_slice(self, indices)
8805 * if obj is not None: # <<<<<<<<<<<<<<
8806 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8807 * else:
8808*/
8809 goto __pyx_L8;
8810 }
8811
8812 /* "View.MemoryView":464
8813 * memoryview.setitem_slice_assignment(self, target_slice, obj)
8814 * else:
8815 * memoryview.setitem_slice_assign_scalar(self, target_slice, value) # <<<<<<<<<<<<<<
8816 * else:
8817 * memoryview.setitem_indexed(self, <tuple> indices, value)
8818*/
8819 /*else*/ {
8820 __pyx_t_3 = __pyx_memoryview_setitem_slice_assign_scalar(__pyx_v_self, __pyx_v_target_slice, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 464, __pyx_L1_error)
8821 __Pyx_GOTREF(__pyx_t_3);
8822 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8823 }
8824 __pyx_L8:;
8825
8826 /* "View.MemoryView":458
8827 * have_slices, indices = _unellipsify(index, self.view.ndim)
8828 *
8829 * if have_slices: # <<<<<<<<<<<<<<
8830 * obj = memoryview.is_slice(self, value)
8831 * target_slice = memview_slice(self, indices)
8832*/
8833 goto __pyx_L7;
8834 }
8835
8836 /* "View.MemoryView":466
8837 * memoryview.setitem_slice_assign_scalar(self, target_slice, value)
8838 * else:
8839 * memoryview.setitem_indexed(self, <tuple> indices, value) # <<<<<<<<<<<<<<
8840 *
8841 *
8842*/
8843 /*else*/ {
8844 if (unlikely(__pyx_v_indices == Py_None)) {
8845 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
8846 __PYX_ERR(1, 466, __pyx_L1_error)
8847 }
8848 __pyx_t_3 = __pyx_memoryview_setitem_indexed(__pyx_v_self, ((PyObject*)__pyx_v_indices), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 466, __pyx_L1_error)
8849 __Pyx_GOTREF(__pyx_t_3);
8850 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8851 }
8852 __pyx_L7:;
8853
8854 /* "View.MemoryView":448
8855 * return self.convert_item_to_object(itemp)
8856 *
8857 * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8858 * if self.view.readonly:
8859 * raise TypeError, "Cannot assign to read-only memoryview"
8860*/
8861
8862 /* function exit code */
8863 __pyx_r = 0;
8864 goto __pyx_L0;
8865 __pyx_L1_error:;
8866 __Pyx_XDECREF(__pyx_t_3);
8867 __Pyx_XDECREF(__pyx_t_4);
8868 __Pyx_XDECREF(__pyx_t_5);
8869 __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8870 __pyx_r = -1;
8871 __pyx_L0:;
8872
8873 __Pyx_XDECREF(__pyx_v_indices);
8874 __Pyx_XDECREF(__pyx_v_obj);
8875 __Pyx_XDECREF((PyObject *)__pyx_v_target_slice);
8876
8877 __Pyx_RefNannyFinishContext();
8878 return __pyx_r;
8879}
8880
8881/* "View.MemoryView":469
8882 *
8883 *
8884 * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8885 * if not isinstance(obj, memoryview):
8886 * try:
8887*/
8888
8889static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
8890 PyObject *__pyx_r = NULL;
8891 __Pyx_RefNannyDeclarations
8892 int __pyx_t_1;
8893 int __pyx_t_2;
8894 PyObject *__pyx_t_3 = NULL;
8895 PyObject *__pyx_t_4 = NULL;
8896 PyObject *__pyx_t_5 = NULL;
8897 PyObject *__pyx_t_6 = NULL;
8898 PyObject *__pyx_t_7 = NULL;
8899 PyObject *__pyx_t_8 = NULL;
8900 PyObject *__pyx_t_9 = NULL;
8901 size_t __pyx_t_10;
8902 int __pyx_t_11;
8903 int __pyx_lineno = 0;
8904 const char *__pyx_filename = NULL;
8905 int __pyx_clineno = 0;
8906 __Pyx_RefNannySetupContext("is_slice", 0);
8907 __Pyx_INCREF(__pyx_v_obj);
8908
8909 /* "View.MemoryView":470
8910 *
8911 * cdef is_slice(self, obj):
8912 * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8913 * try:
8914 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8915*/
8916 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_memoryview_type);
8917 __pyx_t_2 = (!__pyx_t_1);
8918
8919
8920 if (__pyx_t_2) {
8921
8922
8923 /* "View.MemoryView":471
8924 * cdef is_slice(self, obj):
8925 * if not isinstance(obj, memoryview):
8926 * try: # <<<<<<<<<<<<<<
8927 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8928 * self.dtype_is_object)
8929*/
8930 {
8931 __Pyx_PyThreadState_declare
8932 __Pyx_PyThreadState_assign
8933 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8934 __Pyx_XGOTREF(__pyx_t_3);
8935 __Pyx_XGOTREF(__pyx_t_4);
8936 __Pyx_XGOTREF(__pyx_t_5);
8937 /*try:*/ {
8938
8939 /* "View.MemoryView":472
8940 * if not isinstance(obj, memoryview):
8941 * try:
8942 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8943 * self.dtype_is_object)
8944 * except TypeError:
8945*/
8946 __pyx_t_7 = NULL;
8947 __pyx_t_8 = __Pyx_PyLong_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 472, __pyx_L4_error)
8948 __Pyx_GOTREF(__pyx_t_8);
8949
8950 /* "View.MemoryView":473
8951 * try:
8952 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8953 * self.dtype_is_object) # <<<<<<<<<<<<<<
8954 * except TypeError:
8955 * return None
8956*/
8957 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 473, __pyx_L4_error)
8958 __Pyx_GOTREF(__pyx_t_9);
8959 __pyx_t_10 = 1;
8960 {
8961 PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_obj, __pyx_t_8, __pyx_t_9};
8962 __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8963 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8964 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8965 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8966 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 472, __pyx_L4_error)
8967 __Pyx_GOTREF((PyObject *)__pyx_t_6);
8968 }
8969 __Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
8970 __pyx_t_6 = 0;
8971
8972 /* "View.MemoryView":471
8973 * cdef is_slice(self, obj):
8974 * if not isinstance(obj, memoryview):
8975 * try: # <<<<<<<<<<<<<<
8976 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8977 * self.dtype_is_object)
8978*/
8979 }
8980 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8981 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8982 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8983 goto __pyx_L9_try_end;
8984 __pyx_L4_error:;
8985 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8986 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8987 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8988 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8989
8990 /* "View.MemoryView":474
8991 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8992 * self.dtype_is_object)
8993 * except TypeError: # <<<<<<<<<<<<<<
8994 * return None
8995 *
8996*/
8997 __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
8998 if (__pyx_t_11) {
8999 __Pyx_ErrRestore(0,0,0);
9000
9001 /* "View.MemoryView":475
9002 * self.dtype_is_object)
9003 * except TypeError:
9004 * return None # <<<<<<<<<<<<<<
9005 *
9006 * return obj
9007*/
9008 {
9009 PyObject *__pyx_temp;
9010 {
9011 __pyx_temp = __pyx_r;
9012 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9013 }
9014 __Pyx_XDECREF(__pyx_temp);
9015 }
9016 goto __pyx_L7_except_return;
9017 }
9018 goto __pyx_L6_except_error;
9019
9020 /* "View.MemoryView":471
9021 * cdef is_slice(self, obj):
9022 * if not isinstance(obj, memoryview):
9023 * try: # <<<<<<<<<<<<<<
9024 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9025 * self.dtype_is_object)
9026*/
9027 __pyx_L6_except_error:;
9028 __Pyx_XGIVEREF(__pyx_t_3);
9029 __Pyx_XGIVEREF(__pyx_t_4);
9030 __Pyx_XGIVEREF(__pyx_t_5);
9031 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9032 goto __pyx_L1_error;
9033 __pyx_L7_except_return:;
9034 __Pyx_XGIVEREF(__pyx_t_3);
9035 __Pyx_XGIVEREF(__pyx_t_4);
9036 __Pyx_XGIVEREF(__pyx_t_5);
9037 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9038 goto __pyx_L0;
9039 __pyx_L9_try_end:;
9040 }
9041
9042 /* "View.MemoryView":470
9043 *
9044 * cdef is_slice(self, obj):
9045 * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9046 * try:
9047 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9048*/
9049 }
9050
9051 /* "View.MemoryView":477
9052 * return None
9053 *
9054 * return obj # <<<<<<<<<<<<<<
9055 *
9056 *
9057*/
9058 {
9059 PyObject *__pyx_temp;
9060 {
9061 __pyx_temp = __pyx_r;
9062 __Pyx_INCREF(__pyx_v_obj);
9063 __pyx_r = __pyx_v_obj;
9064 }
9065 __Pyx_XDECREF(__pyx_temp);
9066 }
9067 goto __pyx_L0;
9068
9069 /* "View.MemoryView":469
9070 *
9071 *
9072 * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9073 * if not isinstance(obj, memoryview):
9074 * try:
9075*/
9076
9077 /* function exit code */
9078 __pyx_L1_error:;
9079 __Pyx_XDECREF(__pyx_t_6);
9080 __Pyx_XDECREF(__pyx_t_7);
9081 __Pyx_XDECREF(__pyx_t_8);
9082 __Pyx_XDECREF(__pyx_t_9);
9083 __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9084 __pyx_r = 0;
9085 __pyx_L0:;
9086 __Pyx_XDECREF(__pyx_v_obj);
9087 __Pyx_XGIVEREF(__pyx_r);
9088 __Pyx_RefNannyFinishContext();
9089 return __pyx_r;
9090}
9091
9092/* "View.MemoryView":480
9093 *
9094 *
9095 * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9096 * cdef __Pyx_memviewslice dst_slice
9097 * cdef __Pyx_memviewslice src_slice
9098*/
9099
9100static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
9101 __Pyx_memviewslice __pyx_v_dst_slice;
9102 __Pyx_memviewslice __pyx_v_src_slice;
9103 __Pyx_memviewslice __pyx_v_msrc;
9104 __Pyx_memviewslice __pyx_v_mdst;
9105 PyObject *__pyx_r = NULL;
9106 __Pyx_RefNannyDeclarations
9107 __Pyx_memviewslice *__pyx_t_1;
9108 PyObject *__pyx_t_2 = NULL;
9109 int __pyx_t_3;
9110 int __pyx_t_4;
9111 int __pyx_t_5;
9112 int __pyx_lineno = 0;
9113 const char *__pyx_filename = NULL;
9114 int __pyx_clineno = 0;
9115 __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
9116
9117 /* "View.MemoryView":483
9118 * cdef __Pyx_memviewslice dst_slice
9119 * cdef __Pyx_memviewslice src_slice
9120 * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
9121 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9122 *
9123*/
9124 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 483, __pyx_L1_error)
9125 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 483, __pyx_L1_error)
9126 __pyx_v_msrc = (__pyx_t_1[0]);
9127
9128
9129 /* "View.MemoryView":484
9130 * cdef __Pyx_memviewslice src_slice
9131 * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
9132 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
9133 *
9134 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9135*/
9136 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 484, __pyx_L1_error)
9137 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
9138 __pyx_v_mdst = (__pyx_t_1[0]);
9139
9140
9141 /* "View.MemoryView":486
9142 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9143 *
9144 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
9145 *
9146 *
9147*/
9148 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 486, __pyx_L1_error)
9149 __Pyx_GOTREF(__pyx_t_2);
9150 __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 486, __pyx_L1_error)
9151 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9152 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 486, __pyx_L1_error)
9153 __Pyx_GOTREF(__pyx_t_2);
9154 __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 486, __pyx_L1_error)
9155 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9156 __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 486, __pyx_L1_error)
9157
9158
9159
9160
9161 /* "View.MemoryView":480
9162 *
9163 *
9164 * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9165 * cdef __Pyx_memviewslice dst_slice
9166 * cdef __Pyx_memviewslice src_slice
9167*/
9168
9169 /* function exit code */
9170 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9171 goto __pyx_L0;
9172 __pyx_L1_error:;
9173 __Pyx_XDECREF(__pyx_t_2);
9174 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9175 __pyx_r = 0;
9176 __pyx_L0:;
9177
9178
9179
9180
9181 __Pyx_XGIVEREF(__pyx_r);
9182 __Pyx_RefNannyFinishContext();
9183 return __pyx_r;
9184}
9185
9186/* "View.MemoryView":489
9187 *
9188 *
9189 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9190 * cdef int array[128]
9191 * cdef void *tmp = NULL
9192*/
9193
9194static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
9195 int __pyx_v_array[128];
9196 void *__pyx_v_tmp;
9197 void *__pyx_v_item;
9198 __Pyx_memviewslice *__pyx_v_dst_slice;
9199 __Pyx_memviewslice __pyx_v_tmp_slice;
9200 PyObject *__pyx_r = NULL;
9201 __Pyx_RefNannyDeclarations
9202 __Pyx_memviewslice *__pyx_t_1;
9203 int __pyx_t_2;
9204 PyObject *__pyx_t_3 = NULL;
9205 int __pyx_t_4;
9206 int __pyx_t_5;
9207 char const *__pyx_t_6;
9208 PyObject *__pyx_t_7 = NULL;
9209 PyObject *__pyx_t_8 = NULL;
9210 PyObject *__pyx_t_9 = NULL;
9211 PyObject *__pyx_t_10 = NULL;
9212 PyObject *__pyx_t_11 = NULL;
9213 PyObject *__pyx_t_12 = NULL;
9214 int __pyx_lineno = 0;
9215 const char *__pyx_filename = NULL;
9216 int __pyx_clineno = 0;
9217 __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
9218
9219 /* "View.MemoryView":491
9220 * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9221 * cdef int array[128]
9222 * cdef void *tmp = NULL # <<<<<<<<<<<<<<
9223 * cdef void *item
9224 *
9225*/
9226 __pyx_v_tmp = NULL;
9227
9228 /* "View.MemoryView":496
9229 * cdef __Pyx_memviewslice *dst_slice
9230 * cdef __Pyx_memviewslice tmp_slice
9231 * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
9232 *
9233 * if <size_t>self.view.itemsize > sizeof(array):
9234*/
9235 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 496, __pyx_L1_error)
9236 __pyx_v_dst_slice = __pyx_t_1;
9237
9238 /* "View.MemoryView":498
9239 * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9240 *
9241 * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9242 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9243 * if tmp == NULL:
9244*/
9245 __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
9246
9247 if (__pyx_t_2) {
9248
9249
9250 /* "View.MemoryView":499
9251 *
9252 * if <size_t>self.view.itemsize > sizeof(array):
9253 * tmp = PyMem_Malloc(<size_t> self.view.itemsize) # <<<<<<<<<<<<<<
9254 * if tmp == NULL:
9255 * raise MemoryError
9256*/
9257 __pyx_v_tmp = PyMem_Malloc(((size_t)__pyx_v_self->view.itemsize));
9258
9259 /* "View.MemoryView":500
9260 * if <size_t>self.view.itemsize > sizeof(array):
9261 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9262 * if tmp == NULL: # <<<<<<<<<<<<<<
9263 * raise MemoryError
9264 * item = tmp
9265*/
9266 __pyx_t_2 = (__pyx_v_tmp == NULL);
9267
9268 if (unlikely(__pyx_t_2)) {
9269
9270
9271 /* "View.MemoryView":501
9272 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9273 * if tmp == NULL:
9274 * raise MemoryError # <<<<<<<<<<<<<<
9275 * item = tmp
9276 * else:
9277*/
9278 PyErr_NoMemory(); __PYX_ERR(1, 501, __pyx_L1_error)
9279
9280 /* "View.MemoryView":500
9281 * if <size_t>self.view.itemsize > sizeof(array):
9282 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9283 * if tmp == NULL: # <<<<<<<<<<<<<<
9284 * raise MemoryError
9285 * item = tmp
9286*/
9287 }
9288
9289 /* "View.MemoryView":502
9290 * if tmp == NULL:
9291 * raise MemoryError
9292 * item = tmp # <<<<<<<<<<<<<<
9293 * else:
9294 * item = <void *> array
9295*/
9296 __pyx_v_item = __pyx_v_tmp;
9297
9298 /* "View.MemoryView":498
9299 * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9300 *
9301 * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9302 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9303 * if tmp == NULL:
9304*/
9305 goto __pyx_L3;
9306 }
9307
9308 /* "View.MemoryView":504
9309 * item = tmp
9310 * else:
9311 * item = <void *> array # <<<<<<<<<<<<<<
9312 *
9313 * try:
9314*/
9315 /*else*/ {
9316 __pyx_v_item = ((void *)__pyx_v_array);
9317 }
9318 __pyx_L3:;
9319
9320 /* "View.MemoryView":506
9321 * item = <void *> array
9322 *
9323 * try: # <<<<<<<<<<<<<<
9324 * if self.dtype_is_object:
9325 * (<PyObject **> item)[0] = <PyObject *> value
9326*/
9327 /*try:*/ {
9328
9329 /* "View.MemoryView":507
9330 *
9331 * try:
9332 * if self.dtype_is_object: # <<<<<<<<<<<<<<
9333 * (<PyObject **> item)[0] = <PyObject *> value
9334 * else:
9335*/
9336 if (__pyx_v_self->dtype_is_object) {
9337
9338 /* "View.MemoryView":508
9339 * try:
9340 * if self.dtype_is_object:
9341 * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
9342 * else:
9343 * self.assign_item_from_object(<char *> item, value)
9344*/
9345 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9346
9347 /* "View.MemoryView":507
9348 *
9349 * try:
9350 * if self.dtype_is_object: # <<<<<<<<<<<<<<
9351 * (<PyObject **> item)[0] = <PyObject *> value
9352 * else:
9353*/
9354 goto __pyx_L8;
9355 }
9356
9357 /* "View.MemoryView":510
9358 * (<PyObject **> item)[0] = <PyObject *> value
9359 * else:
9360 * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
9361 *
9362 *
9363*/
9364 /*else*/ {
9365 __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 510, __pyx_L6_error)
9366 __Pyx_GOTREF(__pyx_t_3);
9367 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9368 }
9369 __pyx_L8:;
9370
9371 /* "View.MemoryView":514
9372 *
9373 *
9374 * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9375 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9376 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9377*/
9378 __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9379
9380 if (__pyx_t_2) {
9381
9382
9383 /* "View.MemoryView":515
9384 *
9385 * if self.view.suboffsets != NULL:
9386 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
9387 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9388 * item, self.dtype_is_object)
9389*/
9390 __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 515, __pyx_L6_error)
9391
9392
9393 /* "View.MemoryView":514
9394 *
9395 *
9396 * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9397 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9398 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9399*/
9400 }
9401
9402 /* "View.MemoryView":516
9403 * if self.view.suboffsets != NULL:
9404 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9405 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize, # <<<<<<<<<<<<<<
9406 * item, self.dtype_is_object)
9407 * finally:
9408*/
9409 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, ((size_t)__pyx_v_self->view.itemsize), __pyx_v_item, __pyx_v_self->dtype_is_object);
9410 }
9411
9412 /* "View.MemoryView":519
9413 * item, self.dtype_is_object)
9414 * finally:
9415 * PyMem_Free(tmp) # <<<<<<<<<<<<<<
9416 *
9417 *
9418*/
9419 /*finally:*/ {
9420 /*normal exit:*/{
9421 PyMem_Free(__pyx_v_tmp);
9422 goto __pyx_L7;
9423 }
9424 __pyx_L6_error:;
9425 /*exception exit:*/{
9426 __Pyx_PyThreadState_declare
9427 __Pyx_PyThreadState_assign
9428 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9429 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9430 __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9431 if ( unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
9432 __Pyx_XGOTREF(__pyx_t_7);
9433 __Pyx_XGOTREF(__pyx_t_8);
9434 __Pyx_XGOTREF(__pyx_t_9);
9435 __Pyx_XGOTREF(__pyx_t_10);
9436 __Pyx_XGOTREF(__pyx_t_11);
9437 __Pyx_XGOTREF(__pyx_t_12);
9438 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9439 {
9440 PyMem_Free(__pyx_v_tmp);
9441 }
9442 __Pyx_XGIVEREF(__pyx_t_10);
9443 __Pyx_XGIVEREF(__pyx_t_11);
9444 __Pyx_XGIVEREF(__pyx_t_12);
9445 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9446 __Pyx_XGIVEREF(__pyx_t_7);
9447 __Pyx_XGIVEREF(__pyx_t_8);
9448 __Pyx_XGIVEREF(__pyx_t_9);
9449 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9450 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9451 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9452 goto __pyx_L1_error;
9453 }
9454 __pyx_L7:;
9455 }
9456
9457 /* "View.MemoryView":489
9458 *
9459 *
9460 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9461 * cdef int array[128]
9462 * cdef void *tmp = NULL
9463*/
9464
9465 /* function exit code */
9466 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9467 goto __pyx_L0;
9468 __pyx_L1_error:;
9469 __Pyx_XDECREF(__pyx_t_3);
9470 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9471 __pyx_r = 0;
9472 __pyx_L0:;
9473
9474
9475
9476
9477
9478 __Pyx_XGIVEREF(__pyx_r);
9479 __Pyx_RefNannyFinishContext();
9480 return __pyx_r;
9481}
9482
9483/* "View.MemoryView":522
9484 *
9485 *
9486 * cdef setitem_indexed(self, indices: tuple, value): # <<<<<<<<<<<<<<
9487 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9488 * self.assign_item_from_object(itemp, value)
9489*/
9490
9491static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value) {
9492 char *__pyx_v_itemp;
9493 PyObject *__pyx_r = NULL;
9494 __Pyx_RefNannyDeclarations
9495 char *__pyx_t_1;
9496 PyObject *__pyx_t_2 = NULL;
9497 int __pyx_lineno = 0;
9498 const char *__pyx_filename = NULL;
9499 int __pyx_clineno = 0;
9500 __Pyx_RefNannySetupContext("setitem_indexed", 0);
9501
9502 /* "View.MemoryView":523
9503 *
9504 * cdef setitem_indexed(self, indices: tuple, value):
9505 * cdef char *itemp = memoryview.get_item_pointer(self, indices) # <<<<<<<<<<<<<<
9506 * self.assign_item_from_object(itemp, value)
9507 *
9508*/
9509 __pyx_t_1 = __pyx_memoryview_get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 523, __pyx_L1_error)
9510 __pyx_v_itemp = __pyx_t_1;
9511
9512 /* "View.MemoryView":524
9513 * cdef setitem_indexed(self, indices: tuple, value):
9514 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9515 * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9516 *
9517 *
9518*/
9519 __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error)
9520 __Pyx_GOTREF(__pyx_t_2);
9521 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9522
9523 /* "View.MemoryView":522
9524 *
9525 *
9526 * cdef setitem_indexed(self, indices: tuple, value): # <<<<<<<<<<<<<<
9527 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9528 * self.assign_item_from_object(itemp, value)
9529*/
9530
9531 /* function exit code */
9532 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9533 goto __pyx_L0;
9534 __pyx_L1_error:;
9535 __Pyx_XDECREF(__pyx_t_2);
9536 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9537 __pyx_r = 0;
9538 __pyx_L0:;
9539
9540 __Pyx_XGIVEREF(__pyx_r);
9541 __Pyx_RefNannyFinishContext();
9542 return __pyx_r;
9543}
9544
9545/* "View.MemoryView":527
9546 *
9547 *
9548 * cdef setitem_indexed1(self, index, value): # <<<<<<<<<<<<<<
9549 * cdef char *buffer = <char *> self.view.buf
9550 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9551*/
9552
9553static PyObject *__pyx_memoryview_setitem_indexed1(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9554 char *__pyx_v_buffer;
9555 char *__pyx_v_itemp;
9556 PyObject *__pyx_r = NULL;
9557 __Pyx_RefNannyDeclarations
9558 Py_ssize_t __pyx_t_1;
9559 char *__pyx_t_2;
9560 PyObject *__pyx_t_3 = NULL;
9561 int __pyx_lineno = 0;
9562 const char *__pyx_filename = NULL;
9563 int __pyx_clineno = 0;
9564 __Pyx_RefNannySetupContext("setitem_indexed1", 0);
9565
9566 /* "View.MemoryView":528
9567 *
9568 * cdef setitem_indexed1(self, index, value):
9569 * cdef char *buffer = <char *> self.view.buf # <<<<<<<<<<<<<<
9570 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9571 * self.assign_item_from_object(itemp, value)
9572*/
9573 __pyx_v_buffer = ((char *)__pyx_v_self->view.buf);
9574
9575 /* "View.MemoryView":529
9576 * cdef setitem_indexed1(self, index, value):
9577 * cdef char *buffer = <char *> self.view.buf
9578 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0) # <<<<<<<<<<<<<<
9579 * self.assign_item_from_object(itemp, value)
9580 *
9581*/
9582 __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 529, __pyx_L1_error)
9583 __pyx_t_2 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_buffer, __pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((void *)NULL))) __PYX_ERR(1, 529, __pyx_L1_error)
9584 __pyx_v_itemp = __pyx_t_2;
9585
9586
9587 /* "View.MemoryView":530
9588 * cdef char *buffer = <char *> self.view.buf
9589 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9590 * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9591 *
9592 * cdef convert_item_to_object(self, char *itemp):
9593*/
9594 __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 530, __pyx_L1_error)
9595 __Pyx_GOTREF(__pyx_t_3);
9596 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9597
9598 /* "View.MemoryView":527
9599 *
9600 *
9601 * cdef setitem_indexed1(self, index, value): # <<<<<<<<<<<<<<
9602 * cdef char *buffer = <char *> self.view.buf
9603 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9604*/
9605
9606 /* function exit code */
9607 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9608 goto __pyx_L0;
9609 __pyx_L1_error:;
9610 __Pyx_XDECREF(__pyx_t_3);
9611 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed1", __pyx_clineno, __pyx_lineno, __pyx_filename);
9612 __pyx_r = 0;
9613 __pyx_L0:;
9614
9615
9616 __Pyx_XGIVEREF(__pyx_r);
9617 __Pyx_RefNannyFinishContext();
9618 return __pyx_r;
9619}
9620
9621/* "View.MemoryView":532
9622 * self.assign_item_from_object(itemp, value)
9623 *
9624 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9625 * """Only used if instantiated manually by the user, or if Cython doesn't
9626 * know how to convert the type"""
9627*/
9628
9629static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
9630 PyObject *__pyx_v_struct = NULL;
9631 PyObject *__pyx_v_bytesitem = 0;
9632 PyObject *__pyx_v_result = NULL;
9633 PyObject *__pyx_r = NULL;
9634 __Pyx_RefNannyDeclarations
9635 PyObject *__pyx_t_1 = NULL;
9636 PyObject *__pyx_t_2 = NULL;
9637 PyObject *__pyx_t_3 = NULL;
9638 PyObject *__pyx_t_4 = NULL;
9639 PyObject *__pyx_t_5 = NULL;
9640 PyObject *__pyx_t_6 = NULL;
9641 size_t __pyx_t_7;
9642 Py_ssize_t __pyx_t_8;
9643 int __pyx_t_9;
9644 PyObject *__pyx_t_10 = NULL;
9645 int __pyx_t_11;
9646 int __pyx_lineno = 0;
9647 const char *__pyx_filename = NULL;
9648 int __pyx_clineno = 0;
9649 __Pyx_RefNannySetupContext("convert_item_to_object", 0);
9650
9651 /* "View.MemoryView":535
9652 * """Only used if instantiated manually by the user, or if Cython doesn't
9653 * know how to convert the type"""
9654 * import struct # <<<<<<<<<<<<<<
9655 * cdef bytes bytesitem
9656 *
9657*/
9658 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error)
9659 __pyx_t_1 = __pyx_t_2;
9660 __Pyx_GOTREF(__pyx_t_1);
9661 __pyx_v_struct = __pyx_t_1;
9662 __pyx_t_1 = 0;
9663
9664 /* "View.MemoryView":538
9665 * cdef bytes bytesitem
9666 *
9667 * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
9668 * try:
9669 * result = struct.unpack(self.view.format, bytesitem)
9670*/
9671 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 538, __pyx_L1_error)
9672 __Pyx_GOTREF(__pyx_t_1);
9673 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9674 __pyx_t_1 = 0;
9675
9676 /* "View.MemoryView":539
9677 *
9678 * bytesitem = itemp[:self.view.itemsize]
9679 * try: # <<<<<<<<<<<<<<
9680 * result = struct.unpack(self.view.format, bytesitem)
9681 * except struct.error:
9682*/
9683 {
9684 __Pyx_PyThreadState_declare
9685 __Pyx_PyThreadState_assign
9686 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9687 __Pyx_XGOTREF(__pyx_t_2);
9688 __Pyx_XGOTREF(__pyx_t_3);
9689 __Pyx_XGOTREF(__pyx_t_4);
9690 /*try:*/ {
9691
9692 /* "View.MemoryView":540
9693 * bytesitem = itemp[:self.view.itemsize]
9694 * try:
9695 * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
9696 * except struct.error:
9697 * _err_ValueError("Unable to convert item to object")
9698*/
9699 __pyx_t_5 = __pyx_v_struct;
9700 __Pyx_INCREF(__pyx_t_5);
9701 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 540, __pyx_L3_error)
9702 __Pyx_GOTREF(__pyx_t_6);
9703 __pyx_t_7 = 0;
9704 {
9705 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_bytesitem};
9706 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_unpack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
9707 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9708 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9709 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L3_error)
9710 __Pyx_GOTREF(__pyx_t_1);
9711 }
9712 __pyx_v_result = __pyx_t_1;
9713 __pyx_t_1 = 0;
9714
9715 /* "View.MemoryView":539
9716 *
9717 * bytesitem = itemp[:self.view.itemsize]
9718 * try: # <<<<<<<<<<<<<<
9719 * result = struct.unpack(self.view.format, bytesitem)
9720 * except struct.error:
9721*/
9722 }
9723
9724 /* "View.MemoryView":544
9725 * _err_ValueError("Unable to convert item to object")
9726 * else:
9727 * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9728 * return result[0]
9729 * return result
9730*/
9731 /*else:*/ {
9732 __pyx_t_8 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 544, __pyx_L5_except_error)
9733 __pyx_t_9 = (__pyx_t_8 == 1);
9734
9735
9736 if (__pyx_t_9) {
9737
9738
9739 /* "View.MemoryView":545
9740 * else:
9741 * if len(self.view.format) == 1:
9742 * return result[0] # <<<<<<<<<<<<<<
9743 * return result
9744 *
9745*/
9746 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L5_except_error)
9747 __Pyx_GOTREF(__pyx_t_1);
9748 {
9749 PyObject *__pyx_temp;
9750 {
9751 __pyx_temp = __pyx_r;
9752 __pyx_r = __pyx_t_1;
9753 }
9754 __Pyx_XDECREF(__pyx_temp);
9755 }
9756 __pyx_t_1 = 0;
9757 goto __pyx_L6_except_return;
9758
9759 /* "View.MemoryView":544
9760 * _err_ValueError("Unable to convert item to object")
9761 * else:
9762 * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9763 * return result[0]
9764 * return result
9765*/
9766 }
9767
9768 /* "View.MemoryView":546
9769 * if len(self.view.format) == 1:
9770 * return result[0]
9771 * return result # <<<<<<<<<<<<<<
9772 *
9773 * cdef assign_item_from_object(self, char *itemp, object value):
9774*/
9775 {
9776 PyObject *__pyx_temp;
9777 {
9778 __pyx_temp = __pyx_r;
9779 __Pyx_INCREF(__pyx_v_result);
9780 __pyx_r = __pyx_v_result;
9781 }
9782 __Pyx_XDECREF(__pyx_temp);
9783 }
9784 goto __pyx_L6_except_return;
9785 }
9786 __pyx_L3_error:;
9787 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9788 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9789 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9790
9791 /* "View.MemoryView":541
9792 * try:
9793 * result = struct.unpack(self.view.format, bytesitem)
9794 * except struct.error: # <<<<<<<<<<<<<<
9795 * _err_ValueError("Unable to convert item to object")
9796 * else:
9797*/
9798 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5);
9799 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 541, __pyx_L5_except_error)
9800 __Pyx_GOTREF(__pyx_t_10);
9801 __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_10);
9802 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9803 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5);
9804 __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
9805 if (__pyx_t_11) {
9806 __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9807 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(1, 541, __pyx_L5_except_error)
9808 __Pyx_XGOTREF(__pyx_t_5);
9809 __Pyx_XGOTREF(__pyx_t_6);
9810 __Pyx_XGOTREF(__pyx_t_1);
9811
9812 /* "View.MemoryView":542
9813 * result = struct.unpack(self.view.format, bytesitem)
9814 * except struct.error:
9815 * _err_ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
9816 * else:
9817 * if len(self.view.format) == 1:
9818*/
9819 __pyx_t_11 = __pyx_memoryview_err_ValueError(__pyx_k_Unable_to_convert_item_to_object); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 542, __pyx_L5_except_error)
9820
9821 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9822 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9823 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9824 goto __pyx_L4_exception_handled;
9825 }
9826 goto __pyx_L5_except_error;
9827
9828 /* "View.MemoryView":539
9829 *
9830 * bytesitem = itemp[:self.view.itemsize]
9831 * try: # <<<<<<<<<<<<<<
9832 * result = struct.unpack(self.view.format, bytesitem)
9833 * except struct.error:
9834*/
9835 __pyx_L5_except_error:;
9836 __Pyx_XGIVEREF(__pyx_t_2);
9837 __Pyx_XGIVEREF(__pyx_t_3);
9838 __Pyx_XGIVEREF(__pyx_t_4);
9839 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9840 goto __pyx_L1_error;
9841 __pyx_L6_except_return:;
9842 __Pyx_XGIVEREF(__pyx_t_2);
9843 __Pyx_XGIVEREF(__pyx_t_3);
9844 __Pyx_XGIVEREF(__pyx_t_4);
9845 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9846 goto __pyx_L0;
9847 __pyx_L4_exception_handled:;
9848 __Pyx_XGIVEREF(__pyx_t_2);
9849 __Pyx_XGIVEREF(__pyx_t_3);
9850 __Pyx_XGIVEREF(__pyx_t_4);
9851 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9852 }
9853
9854 /* "View.MemoryView":532
9855 * self.assign_item_from_object(itemp, value)
9856 *
9857 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9858 * """Only used if instantiated manually by the user, or if Cython doesn't
9859 * know how to convert the type"""
9860*/
9861
9862 /* function exit code */
9863 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9864 goto __pyx_L0;
9865 __pyx_L1_error:;
9866 __Pyx_XDECREF(__pyx_t_1);
9867 __Pyx_XDECREF(__pyx_t_5);
9868 __Pyx_XDECREF(__pyx_t_6);
9869 __Pyx_XDECREF(__pyx_t_10);
9870 __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9871 __pyx_r = 0;
9872 __pyx_L0:;
9873 __Pyx_XDECREF(__pyx_v_struct);
9874 __Pyx_XDECREF(__pyx_v_bytesitem);
9875 __Pyx_XDECREF(__pyx_v_result);
9876 __Pyx_XGIVEREF(__pyx_r);
9877 __Pyx_RefNannyFinishContext();
9878 return __pyx_r;
9879}
9880
9881/* "View.MemoryView":548
9882 * return result
9883 *
9884 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9885 * """Only used if instantiated manually by the user, or if Cython doesn't
9886 * know how to convert the type"""
9887*/
9888
9889static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
9890 PyObject *__pyx_v_struct = NULL;
9891 char __pyx_v_c;
9892 PyObject *__pyx_v_bytesvalue = 0;
9893 Py_ssize_t __pyx_v_i;
9894 PyObject *__pyx_r = NULL;
9895 __Pyx_RefNannyDeclarations
9896 PyObject *__pyx_t_1 = NULL;
9897 PyObject *__pyx_t_2 = NULL;
9898 int __pyx_t_3;
9899 PyObject *__pyx_t_4 = NULL;
9900 PyObject *__pyx_t_5 = NULL;
9901 PyObject *__pyx_t_6 = NULL;
9902 size_t __pyx_t_7;
9903 Py_ssize_t __pyx_t_8;
9904 PyObject *__pyx_t_9 = NULL;
9905 char *__pyx_t_10;
9906 char *__pyx_t_11;
9907 Py_ssize_t __pyx_t_12;
9908 char *__pyx_t_13;
9909 char *__pyx_t_14;
9910 int __pyx_lineno = 0;
9911 const char *__pyx_filename = NULL;
9912 int __pyx_clineno = 0;
9913 __Pyx_RefNannySetupContext("assign_item_from_object", 0);
9914
9915 /* "View.MemoryView":551
9916 * """Only used if instantiated manually by the user, or if Cython doesn't
9917 * know how to convert the type"""
9918 * import struct # <<<<<<<<<<<<<<
9919 * cdef char c
9920 * cdef bytes bytesvalue
9921*/
9922 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
9923 __pyx_t_1 = __pyx_t_2;
9924 __Pyx_GOTREF(__pyx_t_1);
9925 __pyx_v_struct = __pyx_t_1;
9926 __pyx_t_1 = 0;
9927
9928 /* "View.MemoryView":556
9929 * cdef Py_ssize_t i
9930 *
9931 * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9932 * bytesvalue = struct.pack(self.view.format, *value)
9933 * else:
9934*/
9935 __pyx_t_3 = PyTuple_Check(__pyx_v_value);
9936 if (__pyx_t_3) {
9937
9938
9939 /* "View.MemoryView":557
9940 *
9941 * if isinstance(value, tuple):
9942 * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
9943 * else:
9944 * bytesvalue = struct.pack(self.view.format, value)
9945*/
9946 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 557, __pyx_L1_error)
9947 __Pyx_GOTREF(__pyx_t_1);
9948 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
9949 __Pyx_GOTREF(__pyx_t_4);
9950 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
9951 __Pyx_GOTREF(__pyx_t_5);
9952 __Pyx_GIVEREF(__pyx_t_4);
9953 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 557, __pyx_L1_error);
9954 __pyx_t_4 = 0;
9955 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
9956 __Pyx_GOTREF(__pyx_t_4);
9957 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 557, __pyx_L1_error)
9958 __Pyx_GOTREF(__pyx_t_6);
9959 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9960 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9961 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
9962 __Pyx_GOTREF(__pyx_t_4);
9963 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9964 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9965 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(1, 557, __pyx_L1_error)
9966 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
9967 __pyx_t_4 = 0;
9968
9969 /* "View.MemoryView":556
9970 * cdef Py_ssize_t i
9971 *
9972 * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9973 * bytesvalue = struct.pack(self.view.format, *value)
9974 * else:
9975*/
9976 goto __pyx_L3;
9977 }
9978
9979 /* "View.MemoryView":559
9980 * bytesvalue = struct.pack(self.view.format, *value)
9981 * else:
9982 * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
9983 *
9984 * for i, c in enumerate(bytesvalue):
9985*/
9986 /*else*/ {
9987 __pyx_t_6 = __pyx_v_struct;
9988 __Pyx_INCREF(__pyx_t_6);
9989 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
9990 __Pyx_GOTREF(__pyx_t_1);
9991 __pyx_t_7 = 0;
9992 {
9993 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_value};
9994 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_pack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
9995 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9997 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 559, __pyx_L1_error)
9998 __Pyx_GOTREF(__pyx_t_4);
9999 }
10000 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(1, 559, __pyx_L1_error)
10001 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10002 __pyx_t_4 = 0;
10003 }
10004 __pyx_L3:;
10005
10006 /* "View.MemoryView":561
10007 * bytesvalue = struct.pack(self.view.format, value)
10008 *
10009 * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10010 * itemp[i] = c
10011 *
10012*/
10013
10014 __pyx_t_8 = 0;
10015 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
10016 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 is not iterable");
10017 __PYX_ERR(1, 561, __pyx_L1_error)
10018 }
10019 __Pyx_INCREF(__pyx_v_bytesvalue);
10020 __pyx_t_9 = __pyx_v_bytesvalue;
10021 __pyx_t_11 = __Pyx_PyBytes_AsWritableString(__pyx_t_9); if (unlikely(__pyx_t_11 == ((char *)NULL))) __PYX_ERR(1, 561, __pyx_L1_error)
10022 __pyx_t_12 = __Pyx_PyBytes_GET_SIZE(__pyx_t_9); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(1, 561, __pyx_L1_error)
10023 __pyx_t_13 = (__pyx_t_11 + __pyx_t_12);
10024
10025 for (__pyx_t_14 = __pyx_t_11; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
10026 __pyx_t_10 = __pyx_t_14;
10027 __pyx_v_c = (__pyx_t_10[0]);
10028
10029 /* "View.MemoryView":562
10030 *
10031 * for i, c in enumerate(bytesvalue):
10032 * itemp[i] = c # <<<<<<<<<<<<<<
10033 *
10034 * @cname('getbuffer')
10035*/
10036 __pyx_v_i = __pyx_t_8;
10037
10038 /* "View.MemoryView":561
10039 * bytesvalue = struct.pack(self.view.format, value)
10040 *
10041 * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10042 * itemp[i] = c
10043 *
10044*/
10045 __pyx_t_8 = (__pyx_t_8 + 1);
10046
10047 /* "View.MemoryView":562
10048 *
10049 * for i, c in enumerate(bytesvalue):
10050 * itemp[i] = c # <<<<<<<<<<<<<<
10051 *
10052 * @cname('getbuffer')
10053*/
10054 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10055 }
10056
10057
10058
10059 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10060
10061 /* "View.MemoryView":548
10062 * return result
10063 *
10064 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
10065 * """Only used if instantiated manually by the user, or if Cython doesn't
10066 * know how to convert the type"""
10067*/
10068
10069 /* function exit code */
10070 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10071 goto __pyx_L0;
10072 __pyx_L1_error:;
10073 __Pyx_XDECREF(__pyx_t_1);
10074 __Pyx_XDECREF(__pyx_t_4);
10075 __Pyx_XDECREF(__pyx_t_5);
10076 __Pyx_XDECREF(__pyx_t_6);
10077 __Pyx_XDECREF(__pyx_t_9);
10078 __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10079 __pyx_r = 0;
10080 __pyx_L0:;
10081 __Pyx_XDECREF(__pyx_v_struct);
10082
10083 __Pyx_XDECREF(__pyx_v_bytesvalue);
10084
10085 __Pyx_XGIVEREF(__pyx_r);
10086 __Pyx_RefNannyFinishContext();
10087 return __pyx_r;
10088}
10089
10090/* "View.MemoryView":564
10091 * itemp[i] = c
10092 *
10093 * @cname('getbuffer') # <<<<<<<<<<<<<<
10094 * def __getbuffer__(self, Py_buffer *info, int flags):
10095 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
10096*/
10097
10098/* Python wrapper */
10099CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
10100CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10101 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10102 int __pyx_r;
10103 __Pyx_RefNannyDeclarations
10104 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
10105 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10106 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
10107
10108 /* function exit code */
10109
10110
10111 __Pyx_RefNannyFinishContext();
10112 return __pyx_r;
10113}
10114
10115static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10116 int __pyx_r;
10117 __Pyx_RefNannyDeclarations
10118 int __pyx_t_1;
10119 int __pyx_t_2;
10120 int __pyx_t_3;
10121 Py_ssize_t *__pyx_t_4;
10122 char *__pyx_t_5;
10123 void *__pyx_t_6;
10124 Py_ssize_t __pyx_t_7;
10125 int __pyx_lineno = 0;
10126 const char *__pyx_filename = NULL;
10127 int __pyx_clineno = 0;
10128 if (unlikely(__pyx_v_info == NULL)) {
10129 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
10130 return -1;
10131 }
10132 __Pyx_RefNannySetupContext("__getbuffer__", 0);
10133 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10134 __Pyx_GIVEREF(__pyx_v_info->obj);
10135
10136 /* "View.MemoryView":566
10137 * @cname('getbuffer')
10138 * def __getbuffer__(self, Py_buffer *info, int flags):
10139 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly): # <<<<<<<<<<<<<<
10140 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10141 *
10142*/
10143 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10144
10145 if (__pyx_t_2) {
10146
10147 } else {
10148
10149 __pyx_t_1 = __pyx_t_2;
10150
10151 goto __pyx_L4_bool_binop_done;
10152 }
10153
10154 __pyx_t_1 = __pyx_v_self->view.readonly;
10155 __pyx_L4_bool_binop_done:;
10156 if (unlikely(__pyx_t_1)) {
10157
10158
10159 /* "View.MemoryView":567
10160 * def __getbuffer__(self, Py_buffer *info, int flags):
10161 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
10162 * _err_ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
10163 *
10164 * if flags & PyBUF_ND:
10165*/
10166 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_Cannot_create_writable_memory_vi); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 567, __pyx_L1_error)
10167
10168
10169 /* "View.MemoryView":566
10170 * @cname('getbuffer')
10171 * def __getbuffer__(self, Py_buffer *info, int flags):
10172 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly): # <<<<<<<<<<<<<<
10173 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10174 *
10175*/
10176 }
10177
10178 /* "View.MemoryView":569
10179 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10180 *
10181 * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10182 * info.shape = self.view.shape
10183 * else:
10184*/
10185 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10186
10187 if (__pyx_t_1) {
10188
10189
10190 /* "View.MemoryView":570
10191 *
10192 * if flags & PyBUF_ND:
10193 * info.shape = self.view.shape # <<<<<<<<<<<<<<
10194 * else:
10195 * info.shape = NULL
10196*/
10197 __pyx_t_4 = __pyx_v_self->view.shape;
10198
10199 __pyx_v_info->shape = __pyx_t_4;
10200
10201 /* "View.MemoryView":569
10202 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10203 *
10204 * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10205 * info.shape = self.view.shape
10206 * else:
10207*/
10208 goto __pyx_L6;
10209 }
10210
10211 /* "View.MemoryView":572
10212 * info.shape = self.view.shape
10213 * else:
10214 * info.shape = NULL # <<<<<<<<<<<<<<
10215 *
10216 * if flags & PyBUF_STRIDES:
10217*/
10218 /*else*/ {
10219 __pyx_v_info->shape = NULL;
10220 }
10221 __pyx_L6:;
10222
10223 /* "View.MemoryView":574
10224 * info.shape = NULL
10225 *
10226 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10227 * info.strides = self.view.strides
10228 * else:
10229*/
10230 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10231
10232 if (__pyx_t_1) {
10233
10234
10235 /* "View.MemoryView":575
10236 *
10237 * if flags & PyBUF_STRIDES:
10238 * info.strides = self.view.strides # <<<<<<<<<<<<<<
10239 * else:
10240 * info.strides = NULL
10241*/
10242 __pyx_t_4 = __pyx_v_self->view.strides;
10243
10244 __pyx_v_info->strides = __pyx_t_4;
10245
10246 /* "View.MemoryView":574
10247 * info.shape = NULL
10248 *
10249 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10250 * info.strides = self.view.strides
10251 * else:
10252*/
10253 goto __pyx_L7;
10254 }
10255
10256 /* "View.MemoryView":577
10257 * info.strides = self.view.strides
10258 * else:
10259 * info.strides = NULL # <<<<<<<<<<<<<<
10260 *
10261 * if flags & PyBUF_INDIRECT:
10262*/
10263 /*else*/ {
10264 __pyx_v_info->strides = NULL;
10265 }
10266 __pyx_L7:;
10267
10268 /* "View.MemoryView":579
10269 * info.strides = NULL
10270 *
10271 * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10272 * info.suboffsets = self.view.suboffsets
10273 * else:
10274*/
10275 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10276
10277 if (__pyx_t_1) {
10278
10279
10280 /* "View.MemoryView":580
10281 *
10282 * if flags & PyBUF_INDIRECT:
10283 * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
10284 * else:
10285 * info.suboffsets = NULL
10286*/
10287 __pyx_t_4 = __pyx_v_self->view.suboffsets;
10288
10289 __pyx_v_info->suboffsets = __pyx_t_4;
10290
10291 /* "View.MemoryView":579
10292 * info.strides = NULL
10293 *
10294 * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10295 * info.suboffsets = self.view.suboffsets
10296 * else:
10297*/
10298 goto __pyx_L8;
10299 }
10300
10301 /* "View.MemoryView":582
10302 * info.suboffsets = self.view.suboffsets
10303 * else:
10304 * info.suboffsets = NULL # <<<<<<<<<<<<<<
10305 *
10306 * if flags & PyBUF_FORMAT:
10307*/
10308 /*else*/ {
10309 __pyx_v_info->suboffsets = NULL;
10310 }
10311 __pyx_L8:;
10312
10313 /* "View.MemoryView":584
10314 * info.suboffsets = NULL
10315 *
10316 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10317 * info.format = self.view.format
10318 * else:
10319*/
10320 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10321
10322 if (__pyx_t_1) {
10323
10324
10325 /* "View.MemoryView":585
10326 *
10327 * if flags & PyBUF_FORMAT:
10328 * info.format = self.view.format # <<<<<<<<<<<<<<
10329 * else:
10330 * info.format = NULL
10331*/
10332 __pyx_t_5 = __pyx_v_self->view.format;
10333
10334 __pyx_v_info->format = __pyx_t_5;
10335
10336 /* "View.MemoryView":584
10337 * info.suboffsets = NULL
10338 *
10339 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10340 * info.format = self.view.format
10341 * else:
10342*/
10343 goto __pyx_L9;
10344 }
10345
10346 /* "View.MemoryView":587
10347 * info.format = self.view.format
10348 * else:
10349 * info.format = NULL # <<<<<<<<<<<<<<
10350 *
10351 * info.buf = self.view.buf
10352*/
10353 /*else*/ {
10354 __pyx_v_info->format = NULL;
10355 }
10356 __pyx_L9:;
10357
10358 /* "View.MemoryView":589
10359 * info.format = NULL
10360 *
10361 * info.buf = self.view.buf # <<<<<<<<<<<<<<
10362 * info.ndim = self.view.ndim
10363 * info.itemsize = self.view.itemsize
10364*/
10365 __pyx_t_6 = __pyx_v_self->view.buf;
10366
10367 __pyx_v_info->buf = __pyx_t_6;
10368
10369 /* "View.MemoryView":590
10370 *
10371 * info.buf = self.view.buf
10372 * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
10373 * info.itemsize = self.view.itemsize
10374 * info.len = self.view.len
10375*/
10376 __pyx_t_3 = __pyx_v_self->view.ndim;
10377
10378 __pyx_v_info->ndim = __pyx_t_3;
10379
10380 /* "View.MemoryView":591
10381 * info.buf = self.view.buf
10382 * info.ndim = self.view.ndim
10383 * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
10384 * info.len = self.view.len
10385 * info.readonly = self.view.readonly
10386*/
10387 __pyx_t_7 = __pyx_v_self->view.itemsize;
10388
10389 __pyx_v_info->itemsize = __pyx_t_7;
10390
10391 /* "View.MemoryView":592
10392 * info.ndim = self.view.ndim
10393 * info.itemsize = self.view.itemsize
10394 * info.len = self.view.len # <<<<<<<<<<<<<<
10395 * info.readonly = self.view.readonly
10396 * info.obj = self
10397*/
10398 __pyx_t_7 = __pyx_v_self->view.len;
10399
10400 __pyx_v_info->len = __pyx_t_7;
10401
10402 /* "View.MemoryView":593
10403 * info.itemsize = self.view.itemsize
10404 * info.len = self.view.len
10405 * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
10406 * info.obj = self
10407 *
10408*/
10409 __pyx_t_1 = __pyx_v_self->view.readonly;
10410
10411 __pyx_v_info->readonly = __pyx_t_1;
10412
10413 /* "View.MemoryView":594
10414 * info.len = self.view.len
10415 * info.readonly = self.view.readonly
10416 * info.obj = self # <<<<<<<<<<<<<<
10417 *
10418 *
10419*/
10420 __Pyx_INCREF((PyObject *)__pyx_v_self);
10421 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10422 __Pyx_GOTREF(__pyx_v_info->obj);
10423 __Pyx_DECREF(__pyx_v_info->obj);
10424 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10425
10426 /* "View.MemoryView":564
10427 * itemp[i] = c
10428 *
10429 * @cname('getbuffer') # <<<<<<<<<<<<<<
10430 * def __getbuffer__(self, Py_buffer *info, int flags):
10431 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
10432*/
10433
10434 /* function exit code */
10435 __pyx_r = 0;
10436 goto __pyx_L0;
10437 __pyx_L1_error:;
10438 __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10439 __pyx_r = -1;
10440 if (__pyx_v_info->obj != NULL) {
10441 __Pyx_GOTREF(__pyx_v_info->obj);
10442 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10443 }
10444 goto __pyx_L2;
10445 __pyx_L0:;
10446 if (__pyx_v_info->obj == Py_None) {
10447 __Pyx_GOTREF(__pyx_v_info->obj);
10448 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10449 }
10450 __pyx_L2:;
10451
10452 __Pyx_RefNannyFinishContext();
10453 return __pyx_r;
10454}
10455
10456/* "View.MemoryView":597
10457 *
10458 *
10459 * @property # <<<<<<<<<<<<<<
10460 * def T(self):
10461 * cdef _memoryviewslice result = memoryview_copy(self)
10462*/
10463
10464/* Python wrapper */
10465static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
10466static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10467 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10468 PyObject *__pyx_r = 0;
10469 __Pyx_RefNannyDeclarations
10470 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10471 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10472 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10473
10474 /* function exit code */
10475 __Pyx_RefNannyFinishContext();
10476 return __pyx_r;
10477}
10478
10479static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10480 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10481 PyObject *__pyx_r = NULL;
10482 __Pyx_RefNannyDeclarations
10483 PyObject *__pyx_t_1 = NULL;
10484 int __pyx_t_2;
10485 int __pyx_lineno = 0;
10486 const char *__pyx_filename = NULL;
10487 int __pyx_clineno = 0;
10488 __Pyx_RefNannySetupContext("__get__", 0);
10489
10490 /* "View.MemoryView":599
10491 * @property
10492 * def T(self):
10493 * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
10494 * transpose_memslice(&result.from_slice)
10495 * return result
10496*/
10497 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 599, __pyx_L1_error)
10498 __Pyx_GOTREF(__pyx_t_1);
10499 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 599, __pyx_L1_error)
10500 __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10501 __pyx_t_1 = 0;
10502
10503 /* "View.MemoryView":600
10504 * def T(self):
10505 * cdef _memoryviewslice result = memoryview_copy(self)
10506 * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
10507 * return result
10508 *
10509*/
10510 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 600, __pyx_L1_error)
10511
10512
10513 /* "View.MemoryView":601
10514 * cdef _memoryviewslice result = memoryview_copy(self)
10515 * transpose_memslice(&result.from_slice)
10516 * return result # <<<<<<<<<<<<<<
10517 *
10518 * @property
10519*/
10520 {
10521 PyObject *__pyx_temp;
10522 {
10523 __pyx_temp = __pyx_r;
10524 __Pyx_INCREF((PyObject *)__pyx_v_result);
10525 __pyx_r = ((PyObject *)__pyx_v_result);
10526 }
10527 __Pyx_XDECREF(__pyx_temp);
10528 }
10529 goto __pyx_L0;
10530
10531 /* "View.MemoryView":597
10532 *
10533 *
10534 * @property # <<<<<<<<<<<<<<
10535 * def T(self):
10536 * cdef _memoryviewslice result = memoryview_copy(self)
10537*/
10538
10539 /* function exit code */
10540 __pyx_L1_error:;
10541 __Pyx_XDECREF(__pyx_t_1);
10542 __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10543 __pyx_r = NULL;
10544 __pyx_L0:;
10545 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10546 __Pyx_XGIVEREF(__pyx_r);
10547 __Pyx_RefNannyFinishContext();
10548 return __pyx_r;
10549}
10550
10551/* "View.MemoryView":603
10552 * return result
10553 *
10554 * @property # <<<<<<<<<<<<<<
10555 * def base(self):
10556 * return self._get_base()
10557*/
10558
10559/* Python wrapper */
10560static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
10561static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10562 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10563 PyObject *__pyx_r = 0;
10564 __Pyx_RefNannyDeclarations
10565 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10566 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10567 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10568
10569 /* function exit code */
10570 __Pyx_RefNannyFinishContext();
10571 return __pyx_r;
10572}
10573
10574static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10575 PyObject *__pyx_r = NULL;
10576 __Pyx_RefNannyDeclarations
10577 PyObject *__pyx_t_1 = NULL;
10578 int __pyx_lineno = 0;
10579 const char *__pyx_filename = NULL;
10580 int __pyx_clineno = 0;
10581 __Pyx_RefNannySetupContext("__get__", 0);
10582
10583 /* "View.MemoryView":605
10584 * @property
10585 * def base(self):
10586 * return self._get_base() # <<<<<<<<<<<<<<
10587 *
10588 * cdef _get_base(self):
10589*/
10590 __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 605, __pyx_L1_error)
10591 __Pyx_GOTREF(__pyx_t_1);
10592 {
10593 PyObject *__pyx_temp;
10594 {
10595 __pyx_temp = __pyx_r;
10596 __pyx_r = __pyx_t_1;
10597 }
10598 __Pyx_XDECREF(__pyx_temp);
10599 }
10600 __pyx_t_1 = 0;
10601 goto __pyx_L0;
10602
10603 /* "View.MemoryView":603
10604 * return result
10605 *
10606 * @property # <<<<<<<<<<<<<<
10607 * def base(self):
10608 * return self._get_base()
10609*/
10610
10611 /* function exit code */
10612 __pyx_L1_error:;
10613 __Pyx_XDECREF(__pyx_t_1);
10614 __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10615 __pyx_r = NULL;
10616 __pyx_L0:;
10617 __Pyx_XGIVEREF(__pyx_r);
10618 __Pyx_RefNannyFinishContext();
10619 return __pyx_r;
10620}
10621
10622/* "View.MemoryView":607
10623 * return self._get_base()
10624 *
10625 * cdef _get_base(self): # <<<<<<<<<<<<<<
10626 * return self.obj
10627 *
10628*/
10629
10630static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
10631 PyObject *__pyx_r = NULL;
10632 __Pyx_RefNannyDeclarations
10633 __Pyx_RefNannySetupContext("_get_base", 0);
10634
10635 /* "View.MemoryView":608
10636 *
10637 * cdef _get_base(self):
10638 * return self.obj # <<<<<<<<<<<<<<
10639 *
10640 * @property
10641*/
10642 {
10643 PyObject *__pyx_temp;
10644 {
10645 __pyx_temp = __pyx_r;
10646 __Pyx_INCREF(__pyx_v_self->obj);
10647 __pyx_r = __pyx_v_self->obj;
10648 }
10649 __Pyx_XDECREF(__pyx_temp);
10650 }
10651 goto __pyx_L0;
10652
10653 /* "View.MemoryView":607
10654 * return self._get_base()
10655 *
10656 * cdef _get_base(self): # <<<<<<<<<<<<<<
10657 * return self.obj
10658 *
10659*/
10660
10661 /* function exit code */
10662 __pyx_L0:;
10663 __Pyx_XGIVEREF(__pyx_r);
10664 __Pyx_RefNannyFinishContext();
10665 return __pyx_r;
10666}
10667
10668/* "View.MemoryView":610
10669 * return self.obj
10670 *
10671 * @property # <<<<<<<<<<<<<<
10672 * def shape(self):
10673 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10674*/
10675
10676/* Python wrapper */
10677static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
10678static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10679 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10680 PyObject *__pyx_r = 0;
10681 __Pyx_RefNannyDeclarations
10682 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10683 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10684 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10685
10686 /* function exit code */
10687 __Pyx_RefNannyFinishContext();
10688 return __pyx_r;
10689}
10690
10691static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10692 Py_ssize_t __pyx_7genexpr__pyx_v_length;
10693 PyObject *__pyx_r = NULL;
10694 __Pyx_RefNannyDeclarations
10695 PyObject *__pyx_t_1 = NULL;
10696 Py_ssize_t *__pyx_t_2;
10697 Py_ssize_t *__pyx_t_3;
10698 Py_ssize_t *__pyx_t_4;
10699 PyObject *__pyx_t_5 = NULL;
10700 int __pyx_lineno = 0;
10701 const char *__pyx_filename = NULL;
10702 int __pyx_clineno = 0;
10703 __Pyx_RefNannySetupContext("__get__", 0);
10704
10705 /* "View.MemoryView":612
10706 * @property
10707 * def shape(self):
10708 * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
10709 *
10710 * @property
10711*/
10712 { /* enter inner scope */
10713 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
10714 __Pyx_GOTREF(__pyx_t_1);
10715 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10716
10717 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10718 __pyx_t_2 = __pyx_t_4;
10719 __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
10720 __pyx_t_5 = PyLong_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10721 __Pyx_GOTREF(__pyx_t_5);
10722 __Pyx_GIVEREF(__pyx_t_5);
10723 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, __pyx_t_5))) __PYX_ERR(1, 612, __pyx_L1_error)
10724 __pyx_t_5 = 0;
10725 }
10726
10727 } /* exit inner scope */
10728 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10729 __Pyx_GOTREF(__pyx_t_5);
10730 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10731 {
10732 PyObject *__pyx_temp;
10733 {
10734 __pyx_temp = __pyx_r;
10735 __pyx_r = __pyx_t_5;
10736 }
10737 __Pyx_XDECREF(__pyx_temp);
10738 }
10739 __pyx_t_5 = 0;
10740 goto __pyx_L0;
10741
10742 /* "View.MemoryView":610
10743 * return self.obj
10744 *
10745 * @property # <<<<<<<<<<<<<<
10746 * def shape(self):
10747 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10748*/
10749
10750 /* function exit code */
10751 __pyx_L1_error:;
10752 __Pyx_XDECREF(__pyx_t_1);
10753 __Pyx_XDECREF(__pyx_t_5);
10754 __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10755 __pyx_r = NULL;
10756 __pyx_L0:;
10757
10758 __Pyx_XGIVEREF(__pyx_r);
10759 __Pyx_RefNannyFinishContext();
10760 return __pyx_r;
10761}
10762
10763/* "View.MemoryView":614
10764 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10765 *
10766 * @property # <<<<<<<<<<<<<<
10767 * def strides(self):
10768 * if cython.unlikely(self.view.strides == NULL):
10769*/
10770
10771/* Python wrapper */
10772static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
10773static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10774 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10775 PyObject *__pyx_r = 0;
10776 __Pyx_RefNannyDeclarations
10777 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10778 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10779 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10780
10781 /* function exit code */
10782 __Pyx_RefNannyFinishContext();
10783 return __pyx_r;
10784}
10785
10786static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10787 Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
10788 PyObject *__pyx_r = NULL;
10789 __Pyx_RefNannyDeclarations
10790 int __pyx_t_1;
10791 int __pyx_t_2;
10792 PyObject *__pyx_t_3 = NULL;
10793 Py_ssize_t *__pyx_t_4;
10794 Py_ssize_t *__pyx_t_5;
10795 Py_ssize_t *__pyx_t_6;
10796 PyObject *__pyx_t_7 = NULL;
10797 int __pyx_lineno = 0;
10798 const char *__pyx_filename = NULL;
10799 int __pyx_clineno = 0;
10800 __Pyx_RefNannySetupContext("__get__", 0);
10801
10802 /* "View.MemoryView":616
10803 * @property
10804 * def strides(self):
10805 * if cython.unlikely(self.view.strides == NULL): # <<<<<<<<<<<<<<
10806 *
10807 * _err_ValueError("Buffer view does not expose strides")
10808*/
10809 __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
10810
10811 if (unlikely(__pyx_t_1)) {
10812
10813
10814 /* "View.MemoryView":618
10815 * if cython.unlikely(self.view.strides == NULL):
10816 *
10817 * _err_ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
10818 *
10819 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10820*/
10821 __pyx_t_2 = __pyx_memoryview_err_ValueError(__pyx_k_Buffer_view_does_not_expose_stri); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 618, __pyx_L1_error)
10822
10823
10824 /* "View.MemoryView":616
10825 * @property
10826 * def strides(self):
10827 * if cython.unlikely(self.view.strides == NULL): # <<<<<<<<<<<<<<
10828 *
10829 * _err_ValueError("Buffer view does not expose strides")
10830*/
10831 }
10832
10833 /* "View.MemoryView":620
10834 * _err_ValueError("Buffer view does not expose strides")
10835 *
10836 * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
10837 *
10838 * @property
10839*/
10840 { /* enter inner scope */
10841 __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 620, __pyx_L1_error)
10842 __Pyx_GOTREF(__pyx_t_3);
10843 __pyx_t_5 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
10844
10845 for (__pyx_t_6 = __pyx_v_self->view.strides; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
10846 __pyx_t_4 = __pyx_t_6;
10847 __pyx_8genexpr1__pyx_v_stride = (__pyx_t_4[0]);
10848 __pyx_t_7 = PyLong_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10849 __Pyx_GOTREF(__pyx_t_7);
10850 __Pyx_GIVEREF(__pyx_t_7);
10851 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_3, __pyx_t_7))) __PYX_ERR(1, 620, __pyx_L1_error)
10852 __pyx_t_7 = 0;
10853 }
10854
10855 } /* exit inner scope */
10856 __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10857 __Pyx_GOTREF(__pyx_t_7);
10858 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10859 {
10860 PyObject *__pyx_temp;
10861 {
10862 __pyx_temp = __pyx_r;
10863 __pyx_r = __pyx_t_7;
10864 }
10865 __Pyx_XDECREF(__pyx_temp);
10866 }
10867 __pyx_t_7 = 0;
10868 goto __pyx_L0;
10869
10870 /* "View.MemoryView":614
10871 * return tuple([length for length in self.view.shape[:self.view.ndim]])
10872 *
10873 * @property # <<<<<<<<<<<<<<
10874 * def strides(self):
10875 * if cython.unlikely(self.view.strides == NULL):
10876*/
10877
10878 /* function exit code */
10879 __pyx_L1_error:;
10880 __Pyx_XDECREF(__pyx_t_3);
10881 __Pyx_XDECREF(__pyx_t_7);
10882 __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10883 __pyx_r = NULL;
10884 __pyx_L0:;
10885
10886 __Pyx_XGIVEREF(__pyx_r);
10887 __Pyx_RefNannyFinishContext();
10888 return __pyx_r;
10889}
10890
10891/* "View.MemoryView":622
10892 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10893 *
10894 * @property # <<<<<<<<<<<<<<
10895 * def suboffsets(self):
10896 * if self.view.suboffsets == NULL:
10897*/
10898
10899/* Python wrapper */
10900static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
10901static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
10902 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10903 PyObject *__pyx_r = 0;
10904 __Pyx_RefNannyDeclarations
10905 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10906 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10907 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10908
10909 /* function exit code */
10910 __Pyx_RefNannyFinishContext();
10911 return __pyx_r;
10912}
10913
10914static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10915 Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
10916 PyObject *__pyx_r = NULL;
10917 __Pyx_RefNannyDeclarations
10918 int __pyx_t_1;
10919 PyObject *__pyx_t_2 = NULL;
10920 Py_ssize_t *__pyx_t_3;
10921 Py_ssize_t *__pyx_t_4;
10922 Py_ssize_t *__pyx_t_5;
10923 PyObject *__pyx_t_6 = NULL;
10924 int __pyx_lineno = 0;
10925 const char *__pyx_filename = NULL;
10926 int __pyx_clineno = 0;
10927 __Pyx_RefNannySetupContext("__get__", 0);
10928
10929 /* "View.MemoryView":624
10930 * @property
10931 * def suboffsets(self):
10932 * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10933 * return (-1,) * self.view.ndim
10934 *
10935*/
10936 __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
10937
10938 if (__pyx_t_1) {
10939
10940
10941 /* "View.MemoryView":625
10942 * def suboffsets(self):
10943 * if self.view.suboffsets == NULL:
10944 * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
10945 *
10946 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10947*/
10948 __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[0], __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
10949 __Pyx_GOTREF(__pyx_t_2);
10950 {
10951 PyObject *__pyx_temp;
10952 {
10953 __pyx_temp = __pyx_r;
10954 __pyx_r = __pyx_t_2;
10955 }
10956 __Pyx_XDECREF(__pyx_temp);
10957 }
10958 __pyx_t_2 = 0;
10959 goto __pyx_L0;
10960
10961 /* "View.MemoryView":624
10962 * @property
10963 * def suboffsets(self):
10964 * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10965 * return (-1,) * self.view.ndim
10966 *
10967*/
10968 }
10969
10970 /* "View.MemoryView":627
10971 * return (-1,) * self.view.ndim
10972 *
10973 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
10974 *
10975 * @property
10976*/
10977 { /* enter inner scope */
10978 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error)
10979 __Pyx_GOTREF(__pyx_t_2);
10980 __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
10981
10982 for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10983 __pyx_t_3 = __pyx_t_5;
10984 __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
10985 __pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
10986 __Pyx_GOTREF(__pyx_t_6);
10987 __Pyx_GIVEREF(__pyx_t_6);
10988 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_2, __pyx_t_6))) __PYX_ERR(1, 627, __pyx_L1_error)
10989 __pyx_t_6 = 0;
10990 }
10991
10992 } /* exit inner scope */
10993 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
10994 __Pyx_GOTREF(__pyx_t_6);
10995 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10996 {
10997 PyObject *__pyx_temp;
10998 {
10999 __pyx_temp = __pyx_r;
11000 __pyx_r = __pyx_t_6;
11001 }
11002 __Pyx_XDECREF(__pyx_temp);
11003 }
11004 __pyx_t_6 = 0;
11005 goto __pyx_L0;
11006
11007 /* "View.MemoryView":622
11008 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11009 *
11010 * @property # <<<<<<<<<<<<<<
11011 * def suboffsets(self):
11012 * if self.view.suboffsets == NULL:
11013*/
11014
11015 /* function exit code */
11016 __pyx_L1_error:;
11017 __Pyx_XDECREF(__pyx_t_2);
11018 __Pyx_XDECREF(__pyx_t_6);
11019 __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11020 __pyx_r = NULL;
11021 __pyx_L0:;
11022
11023 __Pyx_XGIVEREF(__pyx_r);
11024 __Pyx_RefNannyFinishContext();
11025 return __pyx_r;
11026}
11027
11028/* "View.MemoryView":629
11029 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11030 *
11031 * @property # <<<<<<<<<<<<<<
11032 * def ndim(self):
11033 * return self.view.ndim
11034*/
11035
11036/* Python wrapper */
11037static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
11038static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11039 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11040 PyObject *__pyx_r = 0;
11041 __Pyx_RefNannyDeclarations
11042 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11043 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11044 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11045
11046 /* function exit code */
11047 __Pyx_RefNannyFinishContext();
11048 return __pyx_r;
11049}
11050
11051static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11052 PyObject *__pyx_r = NULL;
11053 __Pyx_RefNannyDeclarations
11054 PyObject *__pyx_t_1 = NULL;
11055 int __pyx_lineno = 0;
11056 const char *__pyx_filename = NULL;
11057 int __pyx_clineno = 0;
11058 __Pyx_RefNannySetupContext("__get__", 0);
11059
11060 /* "View.MemoryView":631
11061 * @property
11062 * def ndim(self):
11063 * return self.view.ndim # <<<<<<<<<<<<<<
11064 *
11065 * @property
11066*/
11067 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 631, __pyx_L1_error)
11068 __Pyx_GOTREF(__pyx_t_1);
11069 {
11070 PyObject *__pyx_temp;
11071 {
11072 __pyx_temp = __pyx_r;
11073 __pyx_r = __pyx_t_1;
11074 }
11075 __Pyx_XDECREF(__pyx_temp);
11076 }
11077 __pyx_t_1 = 0;
11078 goto __pyx_L0;
11079
11080 /* "View.MemoryView":629
11081 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11082 *
11083 * @property # <<<<<<<<<<<<<<
11084 * def ndim(self):
11085 * return self.view.ndim
11086*/
11087
11088 /* function exit code */
11089 __pyx_L1_error:;
11090 __Pyx_XDECREF(__pyx_t_1);
11091 __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11092 __pyx_r = NULL;
11093 __pyx_L0:;
11094 __Pyx_XGIVEREF(__pyx_r);
11095 __Pyx_RefNannyFinishContext();
11096 return __pyx_r;
11097}
11098
11099/* "View.MemoryView":633
11100 * return self.view.ndim
11101 *
11102 * @property # <<<<<<<<<<<<<<
11103 * def itemsize(self):
11104 * return self.view.itemsize
11105*/
11106
11107/* Python wrapper */
11108static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
11109static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
11110 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11111 PyObject *__pyx_r = 0;
11112 __Pyx_RefNannyDeclarations
11113 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11114 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11115 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11116
11117 /* function exit code */
11118 __Pyx_RefNannyFinishContext();
11119 return __pyx_r;
11120}
11121
11122static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11123 PyObject *__pyx_r = NULL;
11124 __Pyx_RefNannyDeclarations
11125 PyObject *__pyx_t_1 = NULL;
11126 int __pyx_lineno = 0;
11127 const char *__pyx_filename = NULL;
11128 int __pyx_clineno = 0;
11129 __Pyx_RefNannySetupContext("__get__", 0);
11130
11131 /* "View.MemoryView":635
11132 * @property
11133 * def itemsize(self):
11134 * return self.view.itemsize # <<<<<<<<<<<<<<
11135 *
11136 * @property
11137*/
11138 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 635, __pyx_L1_error)
11139 __Pyx_GOTREF(__pyx_t_1);
11140 {
11141 PyObject *__pyx_temp;
11142 {
11143 __pyx_temp = __pyx_r;
11144 __pyx_r = __pyx_t_1;
11145 }
11146 __Pyx_XDECREF(__pyx_temp);
11147 }
11148 __pyx_t_1 = 0;
11149 goto __pyx_L0;
11150
11151 /* "View.MemoryView":633
11152 * return self.view.ndim
11153 *
11154 * @property # <<<<<<<<<<<<<<
11155 * def itemsize(self):
11156 * return self.view.itemsize
11157*/
11158
11159 /* function exit code */
11160 __pyx_L1_error:;
11161 __Pyx_XDECREF(__pyx_t_1);
11162 __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11163 __pyx_r = NULL;
11164 __pyx_L0:;
11165 __Pyx_XGIVEREF(__pyx_r);
11166 __Pyx_RefNannyFinishContext();
11167 return __pyx_r;
11168}
11169
11170/* "View.MemoryView":637
11171 * return self.view.itemsize
11172 *
11173 * @property # <<<<<<<<<<<<<<
11174 * def nbytes(self):
11175 * return self.size * self.view.itemsize
11176*/
11177
11178/* Python wrapper */
11179static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
11180static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
11181 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11182 PyObject *__pyx_r = 0;
11183 __Pyx_RefNannyDeclarations
11184 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11185 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11186 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11187
11188 /* function exit code */
11189 __Pyx_RefNannyFinishContext();
11190 return __pyx_r;
11191}
11192
11193static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11194 PyObject *__pyx_r = NULL;
11195 __Pyx_RefNannyDeclarations
11196 PyObject *__pyx_t_1 = NULL;
11197 PyObject *__pyx_t_2 = NULL;
11198 PyObject *__pyx_t_3 = NULL;
11199 int __pyx_lineno = 0;
11200 const char *__pyx_filename = NULL;
11201 int __pyx_clineno = 0;
11202 __Pyx_RefNannySetupContext("__get__", 0);
11203
11204 /* "View.MemoryView":639
11205 * @property
11206 * def nbytes(self):
11207 * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
11208 *
11209 * @property
11210*/
11211 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 639, __pyx_L1_error)
11212 __Pyx_GOTREF(__pyx_t_1);
11213 __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
11214 __Pyx_GOTREF(__pyx_t_2);
11215 __pyx_t_3 = __Pyx_PyNumber_Multiply_object_int(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 639, __pyx_L1_error)
11216 __Pyx_GOTREF(__pyx_t_3);
11217 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11218 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11219 {
11220 PyObject *__pyx_temp;
11221 {
11222 __pyx_temp = __pyx_r;
11223 __pyx_r = __pyx_t_3;
11224 }
11225 __Pyx_XDECREF(__pyx_temp);
11226 }
11227 __pyx_t_3 = 0;
11228 goto __pyx_L0;
11229
11230 /* "View.MemoryView":637
11231 * return self.view.itemsize
11232 *
11233 * @property # <<<<<<<<<<<<<<
11234 * def nbytes(self):
11235 * return self.size * self.view.itemsize
11236*/
11237
11238 /* function exit code */
11239 __pyx_L1_error:;
11240 __Pyx_XDECREF(__pyx_t_1);
11241 __Pyx_XDECREF(__pyx_t_2);
11242 __Pyx_XDECREF(__pyx_t_3);
11243 __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11244 __pyx_r = NULL;
11245 __pyx_L0:;
11246 __Pyx_XGIVEREF(__pyx_r);
11247 __Pyx_RefNannyFinishContext();
11248 return __pyx_r;
11249}
11250
11251/* "View.MemoryView":641
11252 * return self.size * self.view.itemsize
11253 *
11254 * @property # <<<<<<<<<<<<<<
11255 * def size(self):
11256 * cdef size_t result
11257*/
11258
11259/* Python wrapper */
11260static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
11261static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11262 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11263 PyObject *__pyx_r = 0;
11264 __Pyx_RefNannyDeclarations
11265 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11266 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11267 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11268
11269 /* function exit code */
11270 __Pyx_RefNannyFinishContext();
11271 return __pyx_r;
11272}
11273
11274static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11275 size_t __pyx_v_result;
11276 Py_ssize_t __pyx_v_length;
11277 PyObject *__pyx_r = NULL;
11278 __Pyx_RefNannyDeclarations
11279 int __pyx_t_1;
11280 Py_ssize_t *__pyx_t_2;
11281 Py_ssize_t *__pyx_t_3;
11282 Py_ssize_t *__pyx_t_4;
11283 PyObject *__pyx_t_5 = NULL;
11284 int __pyx_lineno = 0;
11285 const char *__pyx_filename = NULL;
11286 int __pyx_clineno = 0;
11287 __Pyx_RefNannySetupContext("__get__", 0);
11288
11289 /* "View.MemoryView":644
11290 * def size(self):
11291 * cdef size_t result
11292 * if self._size is None: # <<<<<<<<<<<<<<
11293 * result = 1
11294 *
11295*/
11296 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11297 if (__pyx_t_1) {
11298
11299
11300 /* "View.MemoryView":645
11301 * cdef size_t result
11302 * if self._size is None:
11303 * result = 1 # <<<<<<<<<<<<<<
11304 *
11305 * for length in self.view.shape[:self.view.ndim]:
11306*/
11307 __pyx_v_result = 1;
11308
11309 /* "View.MemoryView":647
11310 * result = 1
11311 *
11312 * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
11313 * result *= <size_t> length
11314 *
11315*/
11316 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11317
11318 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11319 __pyx_t_2 = __pyx_t_4;
11320 __pyx_v_length = (__pyx_t_2[0]);
11321
11322 /* "View.MemoryView":648
11323 *
11324 * for length in self.view.shape[:self.view.ndim]:
11325 * result *= <size_t> length # <<<<<<<<<<<<<<
11326 *
11327 * self._size = result
11328*/
11329 __pyx_v_result = (__pyx_v_result * ((size_t)__pyx_v_length));
11330 }
11331
11332
11333 /* "View.MemoryView":650
11334 * result *= <size_t> length
11335 *
11336 * self._size = result # <<<<<<<<<<<<<<
11337 *
11338 * return self._size
11339*/
11340 __pyx_t_5 = __Pyx_PyLong_FromSize_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 650, __pyx_L1_error)
11341 __Pyx_GOTREF(__pyx_t_5);
11342 __Pyx_GIVEREF(__pyx_t_5);
11343 __Pyx_GOTREF(__pyx_v_self->_size);
11344 __Pyx_DECREF(__pyx_v_self->_size);
11345 __pyx_v_self->_size = __pyx_t_5;
11346 __pyx_t_5 = 0;
11347
11348 /* "View.MemoryView":644
11349 * def size(self):
11350 * cdef size_t result
11351 * if self._size is None: # <<<<<<<<<<<<<<
11352 * result = 1
11353 *
11354*/
11355 }
11356
11357 /* "View.MemoryView":652
11358 * self._size = result
11359 *
11360 * return self._size # <<<<<<<<<<<<<<
11361 *
11362 * def __len__(self):
11363*/
11364 {
11365 PyObject *__pyx_temp;
11366 {
11367 __pyx_temp = __pyx_r;
11368 __Pyx_INCREF(__pyx_v_self->_size);
11369 __pyx_r = __pyx_v_self->_size;
11370 }
11371 __Pyx_XDECREF(__pyx_temp);
11372 }
11373 goto __pyx_L0;
11374
11375 /* "View.MemoryView":641
11376 * return self.size * self.view.itemsize
11377 *
11378 * @property # <<<<<<<<<<<<<<
11379 * def size(self):
11380 * cdef size_t result
11381*/
11382
11383 /* function exit code */
11384 __pyx_L1_error:;
11385 __Pyx_XDECREF(__pyx_t_5);
11386 __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11387 __pyx_r = NULL;
11388 __pyx_L0:;
11389
11390
11391 __Pyx_XGIVEREF(__pyx_r);
11392 __Pyx_RefNannyFinishContext();
11393 return __pyx_r;
11394}
11395
11396/* "View.MemoryView":654
11397 * return self._size
11398 *
11399 * def __len__(self): # <<<<<<<<<<<<<<
11400 * if self.view.ndim >= 1:
11401 * return self.view.shape[0]
11402*/
11403
11404/* Python wrapper */
11405static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
11406static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11407 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11408 Py_ssize_t __pyx_r;
11409 __Pyx_RefNannyDeclarations
11410 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
11411 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11412 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11413
11414 /* function exit code */
11415 __Pyx_RefNannyFinishContext();
11416 return __pyx_r;
11417}
11418
11419static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
11420 Py_ssize_t __pyx_r;
11421 int __pyx_t_1;
11422
11423 /* "View.MemoryView":655
11424 *
11425 * def __len__(self):
11426 * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11427 * return self.view.shape[0]
11428 *
11429*/
11430 __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11431
11432 if (__pyx_t_1) {
11433
11434
11435 /* "View.MemoryView":656
11436 * def __len__(self):
11437 * if self.view.ndim >= 1:
11438 * return self.view.shape[0] # <<<<<<<<<<<<<<
11439 *
11440 * return 0
11441*/
11442 {
11443
11444 __pyx_r = (__pyx_v_self->view.shape[0]);
11445 }
11446 goto __pyx_L0;
11447
11448 /* "View.MemoryView":655
11449 *
11450 * def __len__(self):
11451 * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11452 * return self.view.shape[0]
11453 *
11454*/
11455 }
11456
11457 /* "View.MemoryView":658
11458 * return self.view.shape[0]
11459 *
11460 * return 0 # <<<<<<<<<<<<<<
11461 *
11462 * def __repr__(self):
11463*/
11464 {
11465
11466 __pyx_r = 0;
11467 }
11468 goto __pyx_L0;
11469
11470 /* "View.MemoryView":654
11471 * return self._size
11472 *
11473 * def __len__(self): # <<<<<<<<<<<<<<
11474 * if self.view.ndim >= 1:
11475 * return self.view.shape[0]
11476*/
11477
11478 /* function exit code */
11479 __pyx_L0:;
11480
11481 return __pyx_r;
11482}
11483
11484/* "View.MemoryView":660
11485 * return 0
11486 *
11487 * def __repr__(self): # <<<<<<<<<<<<<<
11488 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11489 * id(self))
11490*/
11491
11492/* Python wrapper */
11493static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
11494static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11495 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11496 PyObject *__pyx_r = 0;
11497 __Pyx_RefNannyDeclarations
11498 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11499 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11500 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11501
11502 /* function exit code */
11503 __Pyx_RefNannyFinishContext();
11504 return __pyx_r;
11505}
11506
11507static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
11508 PyObject *__pyx_r = NULL;
11509 __Pyx_RefNannyDeclarations
11510 PyObject *__pyx_t_1 = NULL;
11511 PyObject *__pyx_t_2 = NULL;
11512 PyObject *__pyx_t_3 = NULL;
11513 PyObject *__pyx_t_4[5];
11514 Py_ssize_t __pyx_t_5;
11515 int __pyx_t_6;
11516 int __pyx_lineno = 0;
11517 const char *__pyx_filename = NULL;
11518 int __pyx_clineno = 0;
11519 __Pyx_RefNannySetupContext("__repr__", 0);
11520
11521 /* "View.MemoryView":661
11522 *
11523 * def __repr__(self):
11524 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11525 * id(self))
11526 *
11527*/
11528 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11529 __Pyx_GOTREF(__pyx_t_1);
11530 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error)
11531 __Pyx_GOTREF(__pyx_t_2);
11532 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11533 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11534 __Pyx_GOTREF(__pyx_t_1);
11535 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11536 __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error)
11537 __Pyx_GOTREF(__pyx_t_2);
11538 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11539
11540 /* "View.MemoryView":662
11541 * def __repr__(self):
11542 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11543 * id(self)) # <<<<<<<<<<<<<<
11544 *
11545 * def __str__(self):
11546*/
11547 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 662, __pyx_L1_error)
11548 __Pyx_GOTREF(__pyx_t_1);
11549 __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error)
11550 __Pyx_GOTREF(__pyx_t_3);
11551 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11552 __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11553 __pyx_t_4[1] = __pyx_t_2;
11554 __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
11555 __pyx_t_4[3] = __pyx_t_3;
11556 __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__4;
11557
11558 /* "View.MemoryView":661
11559 *
11560 * def __repr__(self):
11561 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11562 * id(self))
11563 *
11564*/
11565 __pyx_t_5 = 22;
11566 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11567 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[3]);
11568 #endif
11569 __pyx_t_6 = 0;
11570 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11571 __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[3]);
11572 #endif
11573 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6);
11574 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11575 __Pyx_GOTREF(__pyx_t_1);
11576 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11577 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11578 {
11579 PyObject *__pyx_temp;
11580 {
11581 __pyx_temp = __pyx_r;
11582 __pyx_r = __pyx_t_1;
11583 }
11584 __Pyx_XDECREF(__pyx_temp);
11585 }
11586 __pyx_t_1 = 0;
11587 goto __pyx_L0;
11588
11589 /* "View.MemoryView":660
11590 * return 0
11591 *
11592 * def __repr__(self): # <<<<<<<<<<<<<<
11593 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11594 * id(self))
11595*/
11596
11597 /* function exit code */
11598 __pyx_L1_error:;
11599 __Pyx_XDECREF(__pyx_t_1);
11600 __Pyx_XDECREF(__pyx_t_2);
11601 __Pyx_XDECREF(__pyx_t_3);
11602 __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11603 __pyx_r = NULL;
11604 __pyx_L0:;
11605 __Pyx_XGIVEREF(__pyx_r);
11606 __Pyx_RefNannyFinishContext();
11607 return __pyx_r;
11608}
11609
11610/* "View.MemoryView":664
11611 * id(self))
11612 *
11613 * def __str__(self): # <<<<<<<<<<<<<<
11614 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11615 *
11616*/
11617
11618/* Python wrapper */
11619static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
11620static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11621 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11622 PyObject *__pyx_r = 0;
11623 __Pyx_RefNannyDeclarations
11624 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
11625 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11626 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11627
11628 /* function exit code */
11629 __Pyx_RefNannyFinishContext();
11630 return __pyx_r;
11631}
11632
11633static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
11634 PyObject *__pyx_r = NULL;
11635 __Pyx_RefNannyDeclarations
11636 PyObject *__pyx_t_1 = NULL;
11637 PyObject *__pyx_t_2 = NULL;
11638 PyObject *__pyx_t_3[3];
11639 Py_ssize_t __pyx_t_4;
11640 int __pyx_t_5;
11641 int __pyx_lineno = 0;
11642 const char *__pyx_filename = NULL;
11643 int __pyx_clineno = 0;
11644 __Pyx_RefNannySetupContext("__str__", 0);
11645
11646 /* "View.MemoryView":665
11647 *
11648 * def __str__(self):
11649 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
11650 *
11651 *
11652*/
11653 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11654 __Pyx_GOTREF(__pyx_t_1);
11655 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 665, __pyx_L1_error)
11656 __Pyx_GOTREF(__pyx_t_2);
11657 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11658 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11659 __Pyx_GOTREF(__pyx_t_1);
11660 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11661 __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 665, __pyx_L1_error)
11662 __Pyx_GOTREF(__pyx_t_2);
11663 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11664 __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11665 __pyx_t_3[1] = __pyx_t_2;
11666 __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object_2;
11667 __pyx_t_4 = 23;
11668 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11669 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]);
11670 #endif
11671 __pyx_t_5 = 0;
11672 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11673 __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]);
11674 #endif
11675 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5);
11676 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11677 __Pyx_GOTREF(__pyx_t_1);
11678 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11679 {
11680 PyObject *__pyx_temp;
11681 {
11682 __pyx_temp = __pyx_r;
11683 __pyx_r = __pyx_t_1;
11684 }
11685 __Pyx_XDECREF(__pyx_temp);
11686 }
11687 __pyx_t_1 = 0;
11688 goto __pyx_L0;
11689
11690 /* "View.MemoryView":664
11691 * id(self))
11692 *
11693 * def __str__(self): # <<<<<<<<<<<<<<
11694 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11695 *
11696*/
11697
11698 /* function exit code */
11699 __pyx_L1_error:;
11700 __Pyx_XDECREF(__pyx_t_1);
11701 __Pyx_XDECREF(__pyx_t_2);
11702 __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11703 __pyx_r = NULL;
11704 __pyx_L0:;
11705 __Pyx_XGIVEREF(__pyx_r);
11706 __Pyx_RefNannyFinishContext();
11707 return __pyx_r;
11708}
11709
11710/* "View.MemoryView":668
11711 *
11712 *
11713 * def is_c_contig(self): # <<<<<<<<<<<<<<
11714 * cdef __Pyx_memviewslice *mslice
11715 * cdef __Pyx_memviewslice tmp
11716*/
11717
11718/* Python wrapper */
11719static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11720#if CYTHON_VECTORCALL
11721PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11722#else
11723PyObject *__pyx_args, PyObject *__pyx_kwds
11724#endif
11725); /*proto*/
11726static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11727#if CYTHON_VECTORCALL
11728PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11729#else
11730PyObject *__pyx_args, PyObject *__pyx_kwds
11731#endif
11732) {
11733 #if !CYTHON_VECTORCALL
11734 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11735 #endif
11736 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11737 PyObject *__pyx_r = 0;
11738 __Pyx_RefNannyDeclarations
11739 __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
11740 #if !CYTHON_VECTORCALL
11741 #if CYTHON_ASSUME_SAFE_SIZE
11742 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11743 #else
11744 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11745 #endif
11746 #endif
11747 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11748 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL; }
11749 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11750 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11751 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_c_contig", __pyx_kwds); return NULL;}
11752 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11753
11754 /* function exit code */
11755 __Pyx_RefNannyFinishContext();
11756 return __pyx_r;
11757}
11758
11759static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11760 __Pyx_memviewslice *__pyx_v_mslice;
11761 __Pyx_memviewslice __pyx_v_tmp;
11762 PyObject *__pyx_r = NULL;
11763 __Pyx_RefNannyDeclarations
11764 __Pyx_memviewslice *__pyx_t_1;
11765 PyObject *__pyx_t_2 = NULL;
11766 int __pyx_lineno = 0;
11767 const char *__pyx_filename = NULL;
11768 int __pyx_clineno = 0;
11769 __Pyx_RefNannySetupContext("is_c_contig", 0);
11770
11771 /* "View.MemoryView":671
11772 * cdef __Pyx_memviewslice *mslice
11773 * cdef __Pyx_memviewslice tmp
11774 * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11775 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11776 *
11777*/
11778 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 671, __pyx_L1_error)
11779 __pyx_v_mslice = __pyx_t_1;
11780
11781 /* "View.MemoryView":672
11782 * cdef __Pyx_memviewslice tmp
11783 * mslice = get_slice_from_memview(self, &tmp)
11784 * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
11785 *
11786 * def is_f_contig(self):
11787*/
11788 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 672, __pyx_L1_error)
11789 __Pyx_GOTREF(__pyx_t_2);
11790 {
11791 PyObject *__pyx_temp;
11792 {
11793 __pyx_temp = __pyx_r;
11794 __pyx_r = __pyx_t_2;
11795 }
11796 __Pyx_XDECREF(__pyx_temp);
11797 }
11798 __pyx_t_2 = 0;
11799 goto __pyx_L0;
11800
11801 /* "View.MemoryView":668
11802 *
11803 *
11804 * def is_c_contig(self): # <<<<<<<<<<<<<<
11805 * cdef __Pyx_memviewslice *mslice
11806 * cdef __Pyx_memviewslice tmp
11807*/
11808
11809 /* function exit code */
11810 __pyx_L1_error:;
11811 __Pyx_XDECREF(__pyx_t_2);
11812 __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11813 __pyx_r = NULL;
11814 __pyx_L0:;
11815
11816
11817 __Pyx_XGIVEREF(__pyx_r);
11818 __Pyx_RefNannyFinishContext();
11819 return __pyx_r;
11820}
11821
11822/* "View.MemoryView":674
11823 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11824 *
11825 * def is_f_contig(self): # <<<<<<<<<<<<<<
11826 * cdef __Pyx_memviewslice *mslice
11827 * cdef __Pyx_memviewslice tmp
11828*/
11829
11830/* Python wrapper */
11831static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11832#if CYTHON_VECTORCALL
11833PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11834#else
11835PyObject *__pyx_args, PyObject *__pyx_kwds
11836#endif
11837); /*proto*/
11838static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11839#if CYTHON_VECTORCALL
11840PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11841#else
11842PyObject *__pyx_args, PyObject *__pyx_kwds
11843#endif
11844) {
11845 #if !CYTHON_VECTORCALL
11846 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11847 #endif
11848 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11849 PyObject *__pyx_r = 0;
11850 __Pyx_RefNannyDeclarations
11851 __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
11852 #if !CYTHON_VECTORCALL
11853 #if CYTHON_ASSUME_SAFE_SIZE
11854 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11855 #else
11856 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11857 #endif
11858 #endif
11859 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11860 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL; }
11861 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11862 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11863 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_f_contig", __pyx_kwds); return NULL;}
11864 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11865
11866 /* function exit code */
11867 __Pyx_RefNannyFinishContext();
11868 return __pyx_r;
11869}
11870
11871static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11872 __Pyx_memviewslice *__pyx_v_mslice;
11873 __Pyx_memviewslice __pyx_v_tmp;
11874 PyObject *__pyx_r = NULL;
11875 __Pyx_RefNannyDeclarations
11876 __Pyx_memviewslice *__pyx_t_1;
11877 PyObject *__pyx_t_2 = NULL;
11878 int __pyx_lineno = 0;
11879 const char *__pyx_filename = NULL;
11880 int __pyx_clineno = 0;
11881 __Pyx_RefNannySetupContext("is_f_contig", 0);
11882
11883 /* "View.MemoryView":677
11884 * cdef __Pyx_memviewslice *mslice
11885 * cdef __Pyx_memviewslice tmp
11886 * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11887 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11888 *
11889*/
11890 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 677, __pyx_L1_error)
11891 __pyx_v_mslice = __pyx_t_1;
11892
11893 /* "View.MemoryView":678
11894 * cdef __Pyx_memviewslice tmp
11895 * mslice = get_slice_from_memview(self, &tmp)
11896 * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
11897 *
11898 * def copy(self):
11899*/
11900 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 678, __pyx_L1_error)
11901 __Pyx_GOTREF(__pyx_t_2);
11902 {
11903 PyObject *__pyx_temp;
11904 {
11905 __pyx_temp = __pyx_r;
11906 __pyx_r = __pyx_t_2;
11907 }
11908 __Pyx_XDECREF(__pyx_temp);
11909 }
11910 __pyx_t_2 = 0;
11911 goto __pyx_L0;
11912
11913 /* "View.MemoryView":674
11914 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11915 *
11916 * def is_f_contig(self): # <<<<<<<<<<<<<<
11917 * cdef __Pyx_memviewslice *mslice
11918 * cdef __Pyx_memviewslice tmp
11919*/
11920
11921 /* function exit code */
11922 __pyx_L1_error:;
11923 __Pyx_XDECREF(__pyx_t_2);
11924 __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11925 __pyx_r = NULL;
11926 __pyx_L0:;
11927
11928
11929 __Pyx_XGIVEREF(__pyx_r);
11930 __Pyx_RefNannyFinishContext();
11931 return __pyx_r;
11932}
11933
11934/* "View.MemoryView":680
11935 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11936 *
11937 * def copy(self): # <<<<<<<<<<<<<<
11938 * cdef __Pyx_memviewslice mslice
11939 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11940*/
11941
11942/* Python wrapper */
11943static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11944#if CYTHON_VECTORCALL
11945PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11946#else
11947PyObject *__pyx_args, PyObject *__pyx_kwds
11948#endif
11949); /*proto*/
11950static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11951#if CYTHON_VECTORCALL
11952PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11953#else
11954PyObject *__pyx_args, PyObject *__pyx_kwds
11955#endif
11956) {
11957 #if !CYTHON_VECTORCALL
11958 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11959 #endif
11960 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11961 PyObject *__pyx_r = 0;
11962 __Pyx_RefNannyDeclarations
11963 __Pyx_RefNannySetupContext("copy (wrapper)", 0);
11964 #if !CYTHON_VECTORCALL
11965 #if CYTHON_ASSUME_SAFE_SIZE
11966 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11967 #else
11968 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11969 #endif
11970 #endif
11971 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11972 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
11973 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11974 if (unlikely(__pyx_kwds_len < 0)) return NULL;
11975 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
11976 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
11977
11978 /* function exit code */
11979 __Pyx_RefNannyFinishContext();
11980 return __pyx_r;
11981}
11982
11983static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
11984 __Pyx_memviewslice __pyx_v_mslice;
11985 int __pyx_v_flags;
11986 PyObject *__pyx_r = NULL;
11987 __Pyx_RefNannyDeclarations
11988 __Pyx_memviewslice __pyx_t_1;
11989 PyObject *__pyx_t_2 = NULL;
11990 int __pyx_lineno = 0;
11991 const char *__pyx_filename = NULL;
11992 int __pyx_clineno = 0;
11993 __Pyx_RefNannySetupContext("copy", 0);
11994
11995 /* "View.MemoryView":682
11996 * def copy(self):
11997 * cdef __Pyx_memviewslice mslice
11998 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
11999 *
12000 * slice_copy(self, &mslice)
12001*/
12002 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12003
12004 /* "View.MemoryView":684
12005 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12006 *
12007 * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
12008 * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
12009 * self.view.itemsize,
12010*/
12011 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12012
12013 /* "View.MemoryView":685
12014 *
12015 * slice_copy(self, &mslice)
12016 * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
12017 * self.view.itemsize,
12018 * flags|PyBUF_C_CONTIGUOUS,
12019*/
12020 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 685, __pyx_L1_error)
12021 __pyx_v_mslice = __pyx_t_1;
12022
12023 /* "View.MemoryView":690
12024 * self.dtype_is_object)
12025 *
12026 * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
12027 *
12028 * def copy_fortran(self):
12029*/
12030 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 690, __pyx_L1_error)
12031 __Pyx_GOTREF(__pyx_t_2);
12032 {
12033 PyObject *__pyx_temp;
12034 {
12035 __pyx_temp = __pyx_r;
12036 __pyx_r = __pyx_t_2;
12037 }
12038 __Pyx_XDECREF(__pyx_temp);
12039 }
12040 __pyx_t_2 = 0;
12041 goto __pyx_L0;
12042
12043 /* "View.MemoryView":680
12044 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12045 *
12046 * def copy(self): # <<<<<<<<<<<<<<
12047 * cdef __Pyx_memviewslice mslice
12048 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12049*/
12050
12051 /* function exit code */
12052 __pyx_L1_error:;
12053 __Pyx_XDECREF(__pyx_t_2);
12054 __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12055 __pyx_r = NULL;
12056 __pyx_L0:;
12057
12058
12059 __Pyx_XGIVEREF(__pyx_r);
12060 __Pyx_RefNannyFinishContext();
12061 return __pyx_r;
12062}
12063
12064/* "View.MemoryView":692
12065 * return memoryview_copy_from_slice(self, &mslice)
12066 *
12067 * def copy_fortran(self): # <<<<<<<<<<<<<<
12068 * cdef __Pyx_memviewslice src, dst
12069 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12070*/
12071
12072/* Python wrapper */
12073static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12074#if CYTHON_VECTORCALL
12075PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12076#else
12077PyObject *__pyx_args, PyObject *__pyx_kwds
12078#endif
12079); /*proto*/
12080static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12081#if CYTHON_VECTORCALL
12082PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12083#else
12084PyObject *__pyx_args, PyObject *__pyx_kwds
12085#endif
12086) {
12087 #if !CYTHON_VECTORCALL
12088 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12089 #endif
12090 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12091 PyObject *__pyx_r = 0;
12092 __Pyx_RefNannyDeclarations
12093 __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
12094 #if !CYTHON_VECTORCALL
12095 #if CYTHON_ASSUME_SAFE_SIZE
12096 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12097 #else
12098 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12099 #endif
12100 #endif
12101 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12102 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL; }
12103 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12104 if (unlikely(__pyx_kwds_len < 0)) return NULL;
12105 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy_fortran", __pyx_kwds); return NULL;}
12106 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
12107
12108 /* function exit code */
12109 __Pyx_RefNannyFinishContext();
12110 return __pyx_r;
12111}
12112
12113static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
12114 __Pyx_memviewslice __pyx_v_src;
12115 __Pyx_memviewslice __pyx_v_dst;
12116 int __pyx_v_flags;
12117 PyObject *__pyx_r = NULL;
12118 __Pyx_RefNannyDeclarations
12119 __Pyx_memviewslice __pyx_t_1;
12120 PyObject *__pyx_t_2 = NULL;
12121 int __pyx_lineno = 0;
12122 const char *__pyx_filename = NULL;
12123 int __pyx_clineno = 0;
12124 __Pyx_RefNannySetupContext("copy_fortran", 0);
12125
12126 /* "View.MemoryView":694
12127 * def copy_fortran(self):
12128 * cdef __Pyx_memviewslice src, dst
12129 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
12130 *
12131 * slice_copy(self, &src)
12132*/
12133 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12134
12135 /* "View.MemoryView":696
12136 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12137 *
12138 * slice_copy(self, &src) # <<<<<<<<<<<<<<
12139 * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
12140 * self.view.itemsize,
12141*/
12142 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12143
12144 /* "View.MemoryView":697
12145 *
12146 * slice_copy(self, &src)
12147 * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
12148 * self.view.itemsize,
12149 * flags|PyBUF_F_CONTIGUOUS,
12150*/
12151 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 697, __pyx_L1_error)
12152 __pyx_v_dst = __pyx_t_1;
12153
12154 /* "View.MemoryView":702
12155 * self.dtype_is_object)
12156 *
12157 * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
12158 *
12159 *
12160*/
12161 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 702, __pyx_L1_error)
12162 __Pyx_GOTREF(__pyx_t_2);
12163 {
12164 PyObject *__pyx_temp;
12165 {
12166 __pyx_temp = __pyx_r;
12167 __pyx_r = __pyx_t_2;
12168 }
12169 __Pyx_XDECREF(__pyx_temp);
12170 }
12171 __pyx_t_2 = 0;
12172 goto __pyx_L0;
12173
12174 /* "View.MemoryView":692
12175 * return memoryview_copy_from_slice(self, &mslice)
12176 *
12177 * def copy_fortran(self): # <<<<<<<<<<<<<<
12178 * cdef __Pyx_memviewslice src, dst
12179 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12180*/
12181
12182 /* function exit code */
12183 __pyx_L1_error:;
12184 __Pyx_XDECREF(__pyx_t_2);
12185 __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12186 __pyx_r = NULL;
12187 __pyx_L0:;
12188
12189
12190
12191 __Pyx_XGIVEREF(__pyx_r);
12192 __Pyx_RefNannyFinishContext();
12193 return __pyx_r;
12194}
12195
12196/* "(tree fragment)":1
12197 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12198 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12199 * def __setstate_cython__(self, __pyx_state):
12200*/
12201
12202/* Python wrapper */
12203static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12204#if CYTHON_VECTORCALL
12205PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12206#else
12207PyObject *__pyx_args, PyObject *__pyx_kwds
12208#endif
12209); /*proto*/
12210static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12211#if CYTHON_VECTORCALL
12212PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12213#else
12214PyObject *__pyx_args, PyObject *__pyx_kwds
12215#endif
12216) {
12217 #if !CYTHON_VECTORCALL
12218 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12219 #endif
12220 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12221 PyObject *__pyx_r = 0;
12222 __Pyx_RefNannyDeclarations
12223 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12224 #if !CYTHON_VECTORCALL
12225 #if CYTHON_ASSUME_SAFE_SIZE
12226 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12227 #else
12228 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12229 #endif
12230 #endif
12231 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12232 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
12233 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12234 if (unlikely(__pyx_kwds_len < 0)) return NULL;
12235 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
12236 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12237
12238 /* function exit code */
12239 __Pyx_RefNannyFinishContext();
12240 return __pyx_r;
12241}
12242
12243static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
12244 PyObject *__pyx_r = NULL;
12245 __Pyx_RefNannyDeclarations
12246 int __pyx_lineno = 0;
12247 const char *__pyx_filename = NULL;
12248 int __pyx_clineno = 0;
12249 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12250
12251 /* "(tree fragment)":2
12252 * def __reduce_cython__(self):
12253 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12254 * def __setstate_cython__(self, __pyx_state):
12255 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12256*/
12257 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12258 __PYX_ERR(1, 2, __pyx_L1_error)
12259
12260 /* "(tree fragment)":1
12261 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12262 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12263 * def __setstate_cython__(self, __pyx_state):
12264*/
12265
12266 /* function exit code */
12267 __pyx_L1_error:;
12268 __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12269 __pyx_r = NULL;
12270 __Pyx_XGIVEREF(__pyx_r);
12271 __Pyx_RefNannyFinishContext();
12272 return __pyx_r;
12273}
12274
12275/* "(tree fragment)":3
12276 * def __reduce_cython__(self):
12277 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12278 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12279 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12280*/
12281
12282/* Python wrapper */
12283static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12284#if CYTHON_VECTORCALL
12285PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12286#else
12287PyObject *__pyx_args, PyObject *__pyx_kwds
12288#endif
12289); /*proto*/
12290static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12291#if CYTHON_VECTORCALL
12292PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12293#else
12294PyObject *__pyx_args, PyObject *__pyx_kwds
12295#endif
12296) {
12297 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
12298 #if !CYTHON_VECTORCALL
12299 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12300 #endif
12301 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12302 PyObject* values[1] = {0};
12303 int __pyx_lineno = 0;
12304 const char *__pyx_filename = NULL;
12305 int __pyx_clineno = 0;
12306 PyObject *__pyx_r = 0;
12307 __Pyx_RefNannyDeclarations
12308 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12309 #if !CYTHON_VECTORCALL
12310 #if CYTHON_ASSUME_SAFE_SIZE
12311 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12312 #else
12313 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12314 #endif
12315 #endif
12316 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12317 {
12318 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
12319 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12320 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
12321 if (__pyx_kwds_len > 0) {
12322 switch (__pyx_nargs) {
12323 case 1:
12324 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12325 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12326 CYTHON_FALLTHROUGH;
12327 case 0: break;
12328 default: goto __pyx_L5_argtuple_error;
12329 }
12330 const Py_ssize_t kwd_pos_args = __pyx_nargs;
12331 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
12332 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
12333 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
12334 }
12335 } else if (unlikely(__pyx_nargs != 1)) {
12336 goto __pyx_L5_argtuple_error;
12337 } else {
12338 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12339 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12340 }
12341 __pyx_v___pyx_state = values[0];
12342 }
12343 goto __pyx_L6_skip;
12344 __pyx_L5_argtuple_error:;
12345 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
12346 __pyx_L6_skip:;
12347 goto __pyx_L4_argument_unpacking_done;
12348 __pyx_L3_error:;
12349 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12350 Py_XDECREF(values[__pyx_temp]);
12351 }
12352 __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12353 __Pyx_RefNannyFinishContext();
12354 return NULL;
12355 __pyx_L4_argument_unpacking_done:;
12356 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
12357
12358 /* function exit code */
12359 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12360 Py_XDECREF(values[__pyx_temp]);
12361 }
12362 __Pyx_RefNannyFinishContext();
12363 return __pyx_r;
12364}
12365
12366static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12367 PyObject *__pyx_r = NULL;
12368 __Pyx_RefNannyDeclarations
12369 int __pyx_lineno = 0;
12370 const char *__pyx_filename = NULL;
12371 int __pyx_clineno = 0;
12372 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12373
12374 /* "(tree fragment)":4
12375 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12376 * def __setstate_cython__(self, __pyx_state):
12377 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12378*/
12379 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12380 __PYX_ERR(1, 4, __pyx_L1_error)
12381
12382 /* "(tree fragment)":3
12383 * def __reduce_cython__(self):
12384 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12385 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12386 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12387*/
12388
12389 /* function exit code */
12390 __pyx_L1_error:;
12391 __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12392 __pyx_r = NULL;
12393 __Pyx_XGIVEREF(__pyx_r);
12394 __Pyx_RefNannyFinishContext();
12395 return __pyx_r;
12396}
12397
12398/* "View.MemoryView":705
12399 *
12400 *
12401 * @cname('__pyx_memoryview_new') # <<<<<<<<<<<<<<
12402 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12403 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12404*/
12405
12406static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo const *__pyx_v_typeinfo) {
12407 struct __pyx_memoryview_obj *__pyx_v_result = 0;
12408 PyObject *__pyx_r = NULL;
12409 __Pyx_RefNannyDeclarations
12410 PyObject *__pyx_t_1 = NULL;
12411 PyObject *__pyx_t_2 = NULL;
12412 PyObject *__pyx_t_3 = NULL;
12413 PyObject *__pyx_t_4 = NULL;
12414 size_t __pyx_t_5;
12415 int __pyx_lineno = 0;
12416 const char *__pyx_filename = NULL;
12417 int __pyx_clineno = 0;
12418 __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
12419
12420 /* "View.MemoryView":707
12421 * @cname('__pyx_memoryview_new')
12422 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12423 * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
12424 * result.typeinfo = typeinfo
12425 * return result
12426*/
12427 __pyx_t_2 = NULL;
12428 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 707, __pyx_L1_error)
12429 __Pyx_GOTREF(__pyx_t_3);
12430 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 707, __pyx_L1_error)
12431 __Pyx_GOTREF(__pyx_t_4);
12432 __pyx_t_5 = 1;
12433 {
12434 PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_o, __pyx_t_3, __pyx_t_4};
12435 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
12436 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12437 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12438 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12439 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 707, __pyx_L1_error)
12440 __Pyx_GOTREF((PyObject *)__pyx_t_1);
12441 }
12442 __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_1);
12443 __pyx_t_1 = 0;
12444
12445 /* "View.MemoryView":708
12446 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12447 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12448 * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
12449 * return result
12450 *
12451*/
12452 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12453
12454 /* "View.MemoryView":709
12455 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12456 * result.typeinfo = typeinfo
12457 * return result # <<<<<<<<<<<<<<
12458 *
12459 * @cname('__pyx_memoryview_check')
12460*/
12461 {
12462 PyObject *__pyx_temp;
12463 {
12464 __pyx_temp = __pyx_r;
12465 __Pyx_INCREF((PyObject *)__pyx_v_result);
12466 __pyx_r = ((PyObject *)__pyx_v_result);
12467 }
12468 __Pyx_XDECREF(__pyx_temp);
12469 }
12470 goto __pyx_L0;
12471
12472 /* "View.MemoryView":705
12473 *
12474 *
12475 * @cname('__pyx_memoryview_new') # <<<<<<<<<<<<<<
12476 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12477 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12478*/
12479
12480 /* function exit code */
12481 __pyx_L1_error:;
12482 __Pyx_XDECREF(__pyx_t_1);
12483 __Pyx_XDECREF(__pyx_t_2);
12484 __Pyx_XDECREF(__pyx_t_3);
12485 __Pyx_XDECREF(__pyx_t_4);
12486 __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12487 __pyx_r = 0;
12488 __pyx_L0:;
12489 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12490 __Pyx_XGIVEREF(__pyx_r);
12491 __Pyx_RefNannyFinishContext();
12492 return __pyx_r;
12493}
12494
12495/* "View.MemoryView":711
12496 * return result
12497 *
12498 * @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
12499 * cdef inline bint memoryview_check(object o) noexcept:
12500 * return isinstance(o, memoryview)
12501*/
12502
12503static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12504 int __pyx_r;
12505 int __pyx_t_1;
12506
12507 /* "View.MemoryView":713
12508 * @cname('__pyx_memoryview_check')
12509 * cdef inline bint memoryview_check(object o) noexcept:
12510 * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
12511 *
12512 *
12513*/
12514 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type);
12515 {
12516 __pyx_r = __pyx_t_1;
12517 }
12518 goto __pyx_L0;
12519
12520 /* "View.MemoryView":711
12521 * return result
12522 *
12523 * @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
12524 * cdef inline bint memoryview_check(object o) noexcept:
12525 * return isinstance(o, memoryview)
12526*/
12527
12528 /* function exit code */
12529 __pyx_L0:;
12530
12531 return __pyx_r;
12532}
12533
12534/* "View.MemoryView":716
12535 *
12536 *
12537 * @cname('__pyx_memoryview_err_invalid_index') # <<<<<<<<<<<<<<
12538 * cdef int _err_invalid_index(item) except -1:
12539 * type_name = str(type(item))
12540*/
12541
12542static int __pyx_memoryview_err_invalid_index(PyObject *__pyx_v_item) {
12543 PyObject *__pyx_v_type_name = NULL;
12544 int __pyx_r;
12545 __Pyx_RefNannyDeclarations
12546 PyObject *__pyx_t_1 = NULL;
12547 int __pyx_lineno = 0;
12548 const char *__pyx_filename = NULL;
12549 int __pyx_clineno = 0;
12550 __Pyx_RefNannySetupContext("_err_invalid_index", 0);
12551
12552 /* "View.MemoryView":718
12553 * @cname('__pyx_memoryview_err_invalid_index')
12554 * cdef int _err_invalid_index(item) except -1:
12555 * type_name = str(type(item)) # <<<<<<<<<<<<<<
12556 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name)
12557 * return -1
12558*/
12559 __pyx_t_1 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
12560 __Pyx_GOTREF(__pyx_t_1);
12561 __pyx_v_type_name = ((PyObject*)__pyx_t_1);
12562 __pyx_t_1 = 0;
12563
12564 /* "View.MemoryView":719
12565 * cdef int _err_invalid_index(item) except -1:
12566 * type_name = str(type(item))
12567 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name) # <<<<<<<<<<<<<<
12568 * return -1
12569 *
12570*/
12571 (void)(PyErr_Format(PyExc_TypeError, __pyx_k_Cannot_index_with_type_200U, ((PyObject *)__pyx_v_type_name)));
12572
12573 /* "View.MemoryView":720
12574 * type_name = str(type(item))
12575 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name)
12576 * return -1 # <<<<<<<<<<<<<<
12577 *
12578 *
12579*/
12580 {
12581
12582 __pyx_r = -1;
12583 }
12584 goto __pyx_L0;
12585
12586 /* "View.MemoryView":716
12587 *
12588 *
12589 * @cname('__pyx_memoryview_err_invalid_index') # <<<<<<<<<<<<<<
12590 * cdef int _err_invalid_index(item) except -1:
12591 * type_name = str(type(item))
12592*/
12593
12594 /* function exit code */
12595 __pyx_L1_error:;
12596 __Pyx_XDECREF(__pyx_t_1);
12597 __Pyx_AddTraceback("View.MemoryView._err_invalid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
12598 __pyx_r = -1;
12599 __pyx_L0:;
12600 __Pyx_XDECREF(__pyx_v_type_name);
12601
12602 __Pyx_RefNannyFinishContext();
12603 return __pyx_r;
12604}
12605
12606/* "View.MemoryView":723
12607 *
12608 *
12609 * cdef tuple[bint, tuple] _unellipsify_index_tuple(index_tuple: tuple, int ndim): # <<<<<<<<<<<<<<
12610 * """
12611 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12612*/
12613
12614static PyObject *_unellipsify_index_tuple(PyObject *__pyx_v_index_tuple, int __pyx_v_ndim) {
12615 Py_ssize_t __pyx_v_first_ellipsis_index;
12616 Py_ssize_t __pyx_v_idx;
12617 Py_ssize_t __pyx_v_ellipsis_end;
12618 Py_ssize_t __pyx_v_indices_from_ellipsis;
12619 int __pyx_v_have_slices;
12620 PyObject *__pyx_v_item = NULL;
12621 PyObject *__pyx_v_result = NULL;
12622 PyObject *__pyx_r = NULL;
12623 __Pyx_RefNannyDeclarations
12624 PyObject *__pyx_t_1 = NULL;
12625 Py_ssize_t __pyx_t_2;
12626 PyObject *__pyx_t_3 = NULL;
12627 int __pyx_t_4;
12628 int __pyx_t_5;
12629 Py_ssize_t __pyx_t_6;
12630 Py_ssize_t __pyx_t_7;
12631 Py_ssize_t __pyx_t_8;
12632 int __pyx_lineno = 0;
12633 const char *__pyx_filename = NULL;
12634 int __pyx_clineno = 0;
12635 __Pyx_RefNannySetupContext("_unellipsify_index_tuple", 0);
12636 __Pyx_INCREF(__pyx_v_index_tuple);
12637
12638 /* "View.MemoryView":727
12639 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12640 * """
12641 * cdef Py_ssize_t first_ellipsis_index = -1 # <<<<<<<<<<<<<<
12642 * cdef Py_ssize_t idx, ellipsis_end, indices_from_ellipsis
12643 *
12644*/
12645 __pyx_v_first_ellipsis_index = -1L;
12646
12647 /* "View.MemoryView":730
12648 * cdef Py_ssize_t idx, ellipsis_end, indices_from_ellipsis
12649 *
12650 * have_slices = False # <<<<<<<<<<<<<<
12651 *
12652 * idx = 0
12653*/
12654 __pyx_v_have_slices = 0;
12655
12656 /* "View.MemoryView":732
12657 * have_slices = False
12658 *
12659 * idx = 0 # <<<<<<<<<<<<<<
12660 * for item in index_tuple:
12661 * if item is Ellipsis:
12662*/
12663 __pyx_v_idx = 0;
12664
12665 /* "View.MemoryView":733
12666 *
12667 * idx = 0
12668 * for item in index_tuple: # <<<<<<<<<<<<<<
12669 * if item is Ellipsis:
12670 * have_slices = True
12671*/
12672 __pyx_t_1 = __pyx_v_index_tuple; __Pyx_INCREF(__pyx_t_1);
12673 __pyx_t_2 = 0;
12674 for (;;) {
12675 {
12676 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
12677 #if !CYTHON_ASSUME_SAFE_SIZE
12678 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 733, __pyx_L1_error)
12679 #endif
12680 if (__pyx_t_2 >= __pyx_temp) break;
12681 }
12682 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12683 __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
12684 #else
12685 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
12686 #endif
12687 ++__pyx_t_2;
12688 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 733, __pyx_L1_error)
12689 __Pyx_GOTREF(__pyx_t_3);
12690 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
12691 __pyx_t_3 = 0;
12692
12693 /* "View.MemoryView":734
12694 * idx = 0
12695 * for item in index_tuple:
12696 * if item is Ellipsis: # <<<<<<<<<<<<<<
12697 * have_slices = True
12698 * if first_ellipsis_index == -1:
12699*/
12700 __pyx_t_4 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12701 if (__pyx_t_4) {
12702
12703
12704 /* "View.MemoryView":735
12705 * for item in index_tuple:
12706 * if item is Ellipsis:
12707 * have_slices = True # <<<<<<<<<<<<<<
12708 * if first_ellipsis_index == -1:
12709 * first_ellipsis_index = idx
12710*/
12711 __pyx_v_have_slices = 1;
12712
12713 /* "View.MemoryView":736
12714 * if item is Ellipsis:
12715 * have_slices = True
12716 * if first_ellipsis_index == -1: # <<<<<<<<<<<<<<
12717 * first_ellipsis_index = idx
12718 * elif isinstance(item, slice):
12719*/
12720 __pyx_t_4 = (__pyx_v_first_ellipsis_index == -1L);
12721
12722 if (__pyx_t_4) {
12723
12724
12725 /* "View.MemoryView":737
12726 * have_slices = True
12727 * if first_ellipsis_index == -1:
12728 * first_ellipsis_index = idx # <<<<<<<<<<<<<<
12729 * elif isinstance(item, slice):
12730 * have_slices = True
12731*/
12732 __pyx_v_first_ellipsis_index = __pyx_v_idx;
12733
12734 /* "View.MemoryView":736
12735 * if item is Ellipsis:
12736 * have_slices = True
12737 * if first_ellipsis_index == -1: # <<<<<<<<<<<<<<
12738 * first_ellipsis_index = idx
12739 * elif isinstance(item, slice):
12740*/
12741 }
12742
12743 /* "View.MemoryView":734
12744 * idx = 0
12745 * for item in index_tuple:
12746 * if item is Ellipsis: # <<<<<<<<<<<<<<
12747 * have_slices = True
12748 * if first_ellipsis_index == -1:
12749*/
12750 goto __pyx_L5;
12751 }
12752
12753 /* "View.MemoryView":738
12754 * if first_ellipsis_index == -1:
12755 * first_ellipsis_index = idx
12756 * elif isinstance(item, slice): # <<<<<<<<<<<<<<
12757 * have_slices = True
12758 * elif cython.unlikely(not PyIndex_Check(item)):
12759*/
12760 __pyx_t_4 = PySlice_Check(__pyx_v_item);
12761 if (__pyx_t_4) {
12762
12763
12764 /* "View.MemoryView":739
12765 * first_ellipsis_index = idx
12766 * elif isinstance(item, slice):
12767 * have_slices = True # <<<<<<<<<<<<<<
12768 * elif cython.unlikely(not PyIndex_Check(item)):
12769 * _err_invalid_index(item)
12770*/
12771 __pyx_v_have_slices = 1;
12772
12773 /* "View.MemoryView":738
12774 * if first_ellipsis_index == -1:
12775 * first_ellipsis_index = idx
12776 * elif isinstance(item, slice): # <<<<<<<<<<<<<<
12777 * have_slices = True
12778 * elif cython.unlikely(not PyIndex_Check(item)):
12779*/
12780 goto __pyx_L5;
12781 }
12782
12783 /* "View.MemoryView":740
12784 * elif isinstance(item, slice):
12785 * have_slices = True
12786 * elif cython.unlikely(not PyIndex_Check(item)): # <<<<<<<<<<<<<<
12787 * _err_invalid_index(item)
12788 * idx += 1
12789*/
12790 __pyx_t_4 = (!(PyIndex_Check(__pyx_v_item) != 0));
12791
12792 if (unlikely(__pyx_t_4)) {
12793
12794
12795 /* "View.MemoryView":741
12796 * have_slices = True
12797 * elif cython.unlikely(not PyIndex_Check(item)):
12798 * _err_invalid_index(item) # <<<<<<<<<<<<<<
12799 * idx += 1
12800 *
12801*/
12802 __pyx_t_5 = __pyx_memoryview_err_invalid_index(__pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 741, __pyx_L1_error)
12803
12804
12805 /* "View.MemoryView":740
12806 * elif isinstance(item, slice):
12807 * have_slices = True
12808 * elif cython.unlikely(not PyIndex_Check(item)): # <<<<<<<<<<<<<<
12809 * _err_invalid_index(item)
12810 * idx += 1
12811*/
12812 }
12813 __pyx_L5:;
12814
12815 /* "View.MemoryView":742
12816 * elif cython.unlikely(not PyIndex_Check(item)):
12817 * _err_invalid_index(item)
12818 * idx += 1 # <<<<<<<<<<<<<<
12819 *
12820 * if first_ellipsis_index >= 0:
12821*/
12822 __pyx_v_idx = (__pyx_v_idx + 1);
12823
12824 /* "View.MemoryView":733
12825 *
12826 * idx = 0
12827 * for item in index_tuple: # <<<<<<<<<<<<<<
12828 * if item is Ellipsis:
12829 * have_slices = True
12830*/
12831 }
12832 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12833
12834 /* "View.MemoryView":744
12835 * idx += 1
12836 *
12837 * if first_ellipsis_index >= 0: # <<<<<<<<<<<<<<
12838 * result = [slice(None)] * ndim
12839 *
12840*/
12841 __pyx_t_4 = (__pyx_v_first_ellipsis_index >= 0);
12842
12843 if (__pyx_t_4) {
12844
12845
12846 /* "View.MemoryView":745
12847 *
12848 * if first_ellipsis_index >= 0:
12849 * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
12850 *
12851 * for idx in range(first_ellipsis_index):
12852*/
12853 __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
12854 __Pyx_GOTREF(__pyx_t_1);
12855 { Py_ssize_t __pyx_temp;
12856 for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
12857 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
12858 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
12859 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 745, __pyx_L1_error);
12860 }
12861 }
12862 __pyx_v_result = ((PyObject*)__pyx_t_1);
12863 __pyx_t_1 = 0;
12864
12865 /* "View.MemoryView":747
12866 * result = [slice(None)] * ndim
12867 *
12868 * for idx in range(first_ellipsis_index): # <<<<<<<<<<<<<<
12869 * result[idx] = index_tuple[idx]
12870 *
12871*/
12872
12873 __pyx_t_2 = __pyx_v_first_ellipsis_index;
12874 __pyx_t_6 = __pyx_t_2;
12875
12876 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12877 __pyx_v_idx = __pyx_t_7;
12878
12879 /* "View.MemoryView":748
12880 *
12881 * for idx in range(first_ellipsis_index):
12882 * result[idx] = index_tuple[idx] # <<<<<<<<<<<<<<
12883 *
12884 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index
12885*/
12886 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_index_tuple, __pyx_v_idx, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
12887 __Pyx_GOTREF(__pyx_t_1);
12888 if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_t_1, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(1, 748, __pyx_L1_error)
12889 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12890 }
12891
12892
12893 /* "View.MemoryView":750
12894 * result[idx] = index_tuple[idx]
12895 *
12896 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index # <<<<<<<<<<<<<<
12897 * ellipsis_end = ndim - indices_from_ellipsis
12898 *
12899*/
12900 __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_v_index_tuple); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
12901 __pyx_v_indices_from_ellipsis = (__pyx_t_2 - __pyx_v_first_ellipsis_index);
12902
12903
12904 /* "View.MemoryView":751
12905 *
12906 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index
12907 * ellipsis_end = ndim - indices_from_ellipsis # <<<<<<<<<<<<<<
12908 *
12909 * for idx in range(1, indices_from_ellipsis):
12910*/
12911 __pyx_v_ellipsis_end = (__pyx_v_ndim - __pyx_v_indices_from_ellipsis);
12912
12913 /* "View.MemoryView":753
12914 * ellipsis_end = ndim - indices_from_ellipsis
12915 *
12916 * for idx in range(1, indices_from_ellipsis): # <<<<<<<<<<<<<<
12917 * item = index_tuple[first_ellipsis_index + idx]
12918 * if item is not Ellipsis:
12919*/
12920
12921 __pyx_t_2 = __pyx_v_indices_from_ellipsis;
12922 __pyx_t_6 = __pyx_t_2;
12923
12924 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12925 __pyx_v_idx = __pyx_t_7;
12926
12927 /* "View.MemoryView":754
12928 *
12929 * for idx in range(1, indices_from_ellipsis):
12930 * item = index_tuple[first_ellipsis_index + idx] # <<<<<<<<<<<<<<
12931 * if item is not Ellipsis:
12932 * result[ellipsis_end + idx] = item
12933*/
12934 __pyx_t_8 = (__pyx_v_first_ellipsis_index + __pyx_v_idx);
12935
12936 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_index_tuple, __pyx_t_8, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 754, __pyx_L1_error)
12937 __Pyx_GOTREF(__pyx_t_1);
12938
12939 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
12940 __pyx_t_1 = 0;
12941
12942 /* "View.MemoryView":755
12943 * for idx in range(1, indices_from_ellipsis):
12944 * item = index_tuple[first_ellipsis_index + idx]
12945 * if item is not Ellipsis: # <<<<<<<<<<<<<<
12946 * result[ellipsis_end + idx] = item
12947 *
12948*/
12949 __pyx_t_4 = (__pyx_v_item != __pyx_builtin_Ellipsis);
12950 if (__pyx_t_4) {
12951
12952
12953 /* "View.MemoryView":756
12954 * item = index_tuple[first_ellipsis_index + idx]
12955 * if item is not Ellipsis:
12956 * result[ellipsis_end + idx] = item # <<<<<<<<<<<<<<
12957 *
12958 * index_tuple = tuple(result)
12959*/
12960 __pyx_t_8 = (__pyx_v_ellipsis_end + __pyx_v_idx);
12961
12962 if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_t_8, __pyx_v_item, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(1, 756, __pyx_L1_error)
12963
12964
12965 /* "View.MemoryView":755
12966 * for idx in range(1, indices_from_ellipsis):
12967 * item = index_tuple[first_ellipsis_index + idx]
12968 * if item is not Ellipsis: # <<<<<<<<<<<<<<
12969 * result[ellipsis_end + idx] = item
12970 *
12971*/
12972 }
12973 }
12974
12975
12976 /* "View.MemoryView":758
12977 * result[ellipsis_end + idx] = item
12978 *
12979 * index_tuple = tuple(result) # <<<<<<<<<<<<<<
12980 *
12981 * elif ndim > idx:
12982*/
12983 __pyx_t_1 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 758, __pyx_L1_error)
12984 __Pyx_GOTREF(__pyx_t_1);
12985 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_1));
12986 __pyx_t_1 = 0;
12987
12988 /* "View.MemoryView":744
12989 * idx += 1
12990 *
12991 * if first_ellipsis_index >= 0: # <<<<<<<<<<<<<<
12992 * result = [slice(None)] * ndim
12993 *
12994*/
12995 goto __pyx_L8;
12996 }
12997
12998 /* "View.MemoryView":760
12999 * index_tuple = tuple(result)
13000 *
13001 * elif ndim > idx: # <<<<<<<<<<<<<<
13002 *
13003 * have_slices = True
13004*/
13005 __pyx_t_4 = (__pyx_v_ndim > __pyx_v_idx);
13006
13007 if (__pyx_t_4) {
13008
13009
13010 /* "View.MemoryView":762
13011 * elif ndim > idx:
13012 *
13013 * have_slices = True # <<<<<<<<<<<<<<
13014 * index_tuple += (slice(None),) * (ndim - idx)
13015 *
13016*/
13017 __pyx_v_have_slices = 1;
13018
13019 /* "View.MemoryView":763
13020 *
13021 * have_slices = True
13022 * index_tuple += (slice(None),) * (ndim - idx) # <<<<<<<<<<<<<<
13023 *
13024 * return have_slices, index_tuple
13025*/
13026 __pyx_t_2 = (__pyx_v_ndim - __pyx_v_idx);
13027
13028 __pyx_t_1 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 763, __pyx_L1_error)
13029 __Pyx_GOTREF(__pyx_t_1);
13030
13031 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_index_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error)
13032 __Pyx_GOTREF(__pyx_t_3);
13033 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13034 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_3));
13035 __pyx_t_3 = 0;
13036
13037 /* "View.MemoryView":760
13038 * index_tuple = tuple(result)
13039 *
13040 * elif ndim > idx: # <<<<<<<<<<<<<<
13041 *
13042 * have_slices = True
13043*/
13044 }
13045 __pyx_L8:;
13046
13047 /* "View.MemoryView":765
13048 * index_tuple += (slice(None),) * (ndim - idx)
13049 *
13050 * return have_slices, index_tuple # <<<<<<<<<<<<<<
13051 *
13052 *
13053*/
13054 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 765, __pyx_L1_error)
13055 __Pyx_GOTREF(__pyx_t_3);
13056 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 765, __pyx_L1_error)
13057 __Pyx_GOTREF(__pyx_t_1);
13058 __Pyx_GIVEREF(__pyx_t_3);
13059 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
13060 __Pyx_INCREF(__pyx_v_index_tuple);
13061 __Pyx_GIVEREF(__pyx_v_index_tuple);
13062 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_index_tuple) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
13063 __pyx_t_3 = 0;
13064 {
13065 PyObject *__pyx_temp;
13066 {
13067 __pyx_temp = __pyx_r;
13068 __pyx_r = ((PyObject*)__pyx_t_1);
13069 }
13070 __Pyx_XDECREF(__pyx_temp);
13071 }
13072 __pyx_t_1 = 0;
13073 goto __pyx_L0;
13074
13075 /* "View.MemoryView":723
13076 *
13077 *
13078 * cdef tuple[bint, tuple] _unellipsify_index_tuple(index_tuple: tuple, int ndim): # <<<<<<<<<<<<<<
13079 * """
13080 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13081*/
13082
13083 /* function exit code */
13084 __pyx_L1_error:;
13085 __Pyx_XDECREF(__pyx_t_1);
13086 __Pyx_XDECREF(__pyx_t_3);
13087 __Pyx_AddTraceback("View.MemoryView._unellipsify_index_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
13088 __pyx_r = 0;
13089 __pyx_L0:;
13090
13091
13092
13093
13094
13095 __Pyx_XDECREF(__pyx_v_item);
13096 __Pyx_XDECREF(__pyx_v_result);
13097 __Pyx_XDECREF(__pyx_v_index_tuple);
13098 __Pyx_XGIVEREF(__pyx_r);
13099 __Pyx_RefNannyFinishContext();
13100 return __pyx_r;
13101}
13102
13103/* "View.MemoryView":768
13104 *
13105 *
13106 * cdef tuple[bint, tuple] _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13107 * """
13108 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13109*/
13110
13111static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
13112 PyObject *__pyx_v_result = 0;
13113 int __pyx_v_have_slices;
13114 PyObject *__pyx_r = NULL;
13115 __Pyx_RefNannyDeclarations
13116 int __pyx_t_1;
13117 PyObject *__pyx_t_2 = NULL;
13118 int __pyx_t_3;
13119 long __pyx_t_4;
13120 PyObject *__pyx_t_5 = NULL;
13121 PyObject *__pyx_t_6 = NULL;
13122 int __pyx_lineno = 0;
13123 const char *__pyx_filename = NULL;
13124 int __pyx_clineno = 0;
13125 __Pyx_RefNannySetupContext("_unellipsify", 0);
13126
13127 /* "View.MemoryView":773
13128 * """
13129 * result: tuple
13130 * have_slices = False # <<<<<<<<<<<<<<
13131 *
13132 * if index is Ellipsis:
13133*/
13134 __pyx_v_have_slices = 0;
13135
13136 /* "View.MemoryView":775
13137 * have_slices = False
13138 *
13139 * if index is Ellipsis: # <<<<<<<<<<<<<<
13140 * have_slices = True
13141 * result = (slice(None),) * ndim
13142*/
13143 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
13144 if (__pyx_t_1) {
13145
13146
13147 /* "View.MemoryView":776
13148 *
13149 * if index is Ellipsis:
13150 * have_slices = True # <<<<<<<<<<<<<<
13151 * result = (slice(None),) * ndim
13152 *
13153*/
13154 __pyx_v_have_slices = 1;
13155
13156 /* "View.MemoryView":777
13157 * if index is Ellipsis:
13158 * have_slices = True
13159 * result = (slice(None),) * ndim # <<<<<<<<<<<<<<
13160 *
13161 * elif isinstance(index, tuple):
13162*/
13163 __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 777, __pyx_L1_error)
13164 __Pyx_GOTREF(__pyx_t_2);
13165 __pyx_v_result = ((PyObject*)__pyx_t_2);
13166 __pyx_t_2 = 0;
13167
13168 /* "View.MemoryView":775
13169 * have_slices = False
13170 *
13171 * if index is Ellipsis: # <<<<<<<<<<<<<<
13172 * have_slices = True
13173 * result = (slice(None),) * ndim
13174*/
13175 goto __pyx_L3;
13176 }
13177
13178 /* "View.MemoryView":779
13179 * result = (slice(None),) * ndim
13180 *
13181 * elif isinstance(index, tuple): # <<<<<<<<<<<<<<
13182 * return _unellipsify_index_tuple(<tuple> index, ndim)
13183 *
13184*/
13185 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13186 if (__pyx_t_1) {
13187
13188
13189 /* "View.MemoryView":780
13190 *
13191 * elif isinstance(index, tuple):
13192 * return _unellipsify_index_tuple(<tuple> index, ndim) # <<<<<<<<<<<<<<
13193 *
13194 * else:
13195*/
13196 if (unlikely(__pyx_v_index == Py_None)) {
13197 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
13198 __PYX_ERR(1, 780, __pyx_L1_error)
13199 }
13200 __pyx_t_2 = _unellipsify_index_tuple(((PyObject*)__pyx_v_index), __pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 780, __pyx_L1_error)
13201 __Pyx_GOTREF(__pyx_t_2);
13202 {
13203 PyObject *__pyx_temp;
13204 {
13205 __pyx_temp = __pyx_r;
13206 __pyx_r = ((PyObject*)__pyx_t_2);
13207 }
13208 __Pyx_XDECREF(__pyx_temp);
13209 }
13210 __pyx_t_2 = 0;
13211 goto __pyx_L0;
13212
13213 /* "View.MemoryView":779
13214 * result = (slice(None),) * ndim
13215 *
13216 * elif isinstance(index, tuple): # <<<<<<<<<<<<<<
13217 * return _unellipsify_index_tuple(<tuple> index, ndim)
13218 *
13219*/
13220 }
13221
13222 /* "View.MemoryView":783
13223 *
13224 * else:
13225 * if isinstance(index, slice): # <<<<<<<<<<<<<<
13226 * have_slices = True
13227 * elif cython.unlikely(not PyIndex_Check(index)):
13228*/
13229 /*else*/ {
13230 __pyx_t_1 = PySlice_Check(__pyx_v_index);
13231 if (__pyx_t_1) {
13232
13233
13234 /* "View.MemoryView":784
13235 * else:
13236 * if isinstance(index, slice):
13237 * have_slices = True # <<<<<<<<<<<<<<
13238 * elif cython.unlikely(not PyIndex_Check(index)):
13239 * _err_invalid_index(index)
13240*/
13241 __pyx_v_have_slices = 1;
13242
13243 /* "View.MemoryView":783
13244 *
13245 * else:
13246 * if isinstance(index, slice): # <<<<<<<<<<<<<<
13247 * have_slices = True
13248 * elif cython.unlikely(not PyIndex_Check(index)):
13249*/
13250 goto __pyx_L4;
13251 }
13252
13253 /* "View.MemoryView":785
13254 * if isinstance(index, slice):
13255 * have_slices = True
13256 * elif cython.unlikely(not PyIndex_Check(index)): # <<<<<<<<<<<<<<
13257 * _err_invalid_index(index)
13258 *
13259*/
13260 __pyx_t_1 = (!(PyIndex_Check(__pyx_v_index) != 0));
13261
13262 if (unlikely(__pyx_t_1)) {
13263
13264
13265 /* "View.MemoryView":786
13266 * have_slices = True
13267 * elif cython.unlikely(not PyIndex_Check(index)):
13268 * _err_invalid_index(index) # <<<<<<<<<<<<<<
13269 *
13270 *
13271*/
13272 __pyx_t_3 = __pyx_memoryview_err_invalid_index(__pyx_v_index); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 786, __pyx_L1_error)
13273
13274
13275 /* "View.MemoryView":785
13276 * if isinstance(index, slice):
13277 * have_slices = True
13278 * elif cython.unlikely(not PyIndex_Check(index)): # <<<<<<<<<<<<<<
13279 * _err_invalid_index(index)
13280 *
13281*/
13282 }
13283 __pyx_L4:;
13284
13285 /* "View.MemoryView":789
13286 *
13287 *
13288 * if ndim == 1: # <<<<<<<<<<<<<<
13289 * result = (index,)
13290 * elif ndim == 2:
13291*/
13292 switch (__pyx_v_ndim) {
13293 case 1:
13294
13295 /* "View.MemoryView":790
13296 *
13297 * if ndim == 1:
13298 * result = (index,) # <<<<<<<<<<<<<<
13299 * elif ndim == 2:
13300 * have_slices = True
13301*/
13302 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
13303 __Pyx_GOTREF(__pyx_t_2);
13304 __Pyx_INCREF(__pyx_v_index);
13305 __Pyx_GIVEREF(__pyx_v_index);
13306 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 790, __pyx_L1_error);
13307 __pyx_v_result = ((PyObject*)__pyx_t_2);
13308 __pyx_t_2 = 0;
13309
13310 /* "View.MemoryView":789
13311 *
13312 *
13313 * if ndim == 1: # <<<<<<<<<<<<<<
13314 * result = (index,)
13315 * elif ndim == 2:
13316*/
13317 break;
13318 case 2:
13319
13320 /* "View.MemoryView":792
13321 * result = (index,)
13322 * elif ndim == 2:
13323 * have_slices = True # <<<<<<<<<<<<<<
13324 * result = (index, slice(None))
13325 * else:
13326*/
13327 __pyx_v_have_slices = 1;
13328
13329 /* "View.MemoryView":793
13330 * elif ndim == 2:
13331 * have_slices = True
13332 * result = (index, slice(None)) # <<<<<<<<<<<<<<
13333 * else:
13334 * have_slices = True
13335*/
13336 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __pyx_L1_error)
13337 __Pyx_GOTREF(__pyx_t_2);
13338 __Pyx_INCREF(__pyx_v_index);
13339 __Pyx_GIVEREF(__pyx_v_index);
13340 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13341 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
13342 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
13343 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13344 __pyx_v_result = ((PyObject*)__pyx_t_2);
13345 __pyx_t_2 = 0;
13346
13347 /* "View.MemoryView":791
13348 * if ndim == 1:
13349 * result = (index,)
13350 * elif ndim == 2: # <<<<<<<<<<<<<<
13351 * have_slices = True
13352 * result = (index, slice(None))
13353*/
13354 break;
13355 default:
13356
13357 /* "View.MemoryView":795
13358 * result = (index, slice(None))
13359 * else:
13360 * have_slices = True # <<<<<<<<<<<<<<
13361 * result = (index,) + (slice(None),) * (ndim - 1)
13362 *
13363*/
13364 __pyx_v_have_slices = 1;
13365
13366 /* "View.MemoryView":796
13367 * else:
13368 * have_slices = True
13369 * result = (index,) + (slice(None),) * (ndim - 1) # <<<<<<<<<<<<<<
13370 *
13371 * return have_slices, result
13372*/
13373 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 796, __pyx_L1_error)
13374 __Pyx_GOTREF(__pyx_t_2);
13375 __Pyx_INCREF(__pyx_v_index);
13376 __Pyx_GIVEREF(__pyx_v_index);
13377 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 796, __pyx_L1_error);
13378 __pyx_t_4 = (__pyx_v_ndim - 1);
13379
13380 __pyx_t_5 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 796, __pyx_L1_error)
13381 __Pyx_GOTREF(__pyx_t_5);
13382
13383 __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 796, __pyx_L1_error)
13384 __Pyx_GOTREF(__pyx_t_6);
13385 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13386 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13387 __pyx_v_result = ((PyObject*)__pyx_t_6);
13388 __pyx_t_6 = 0;
13389 break;
13390 }
13391 }
13392 __pyx_L3:;
13393
13394 /* "View.MemoryView":798
13395 * result = (index,) + (slice(None),) * (ndim - 1)
13396 *
13397 * return have_slices, result # <<<<<<<<<<<<<<
13398 *
13399 *
13400*/
13401 __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 798, __pyx_L1_error)
13402 __Pyx_GOTREF(__pyx_t_6);
13403 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 798, __pyx_L1_error)
13404 __Pyx_GOTREF(__pyx_t_5);
13405 __Pyx_GIVEREF(__pyx_t_6);
13406 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13407 __Pyx_INCREF(__pyx_v_result);
13408 __Pyx_GIVEREF(__pyx_v_result);
13409 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_result) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13410 __pyx_t_6 = 0;
13411 {
13412 PyObject *__pyx_temp;
13413 {
13414 __pyx_temp = __pyx_r;
13415 __pyx_r = ((PyObject*)__pyx_t_5);
13416 }
13417 __Pyx_XDECREF(__pyx_temp);
13418 }
13419 __pyx_t_5 = 0;
13420 goto __pyx_L0;
13421
13422 /* "View.MemoryView":768
13423 *
13424 *
13425 * cdef tuple[bint, tuple] _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13426 * """
13427 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13428*/
13429
13430 /* function exit code */
13431 __pyx_L1_error:;
13432 __Pyx_XDECREF(__pyx_t_2);
13433 __Pyx_XDECREF(__pyx_t_5);
13434 __Pyx_XDECREF(__pyx_t_6);
13435 __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13436 __pyx_r = 0;
13437 __pyx_L0:;
13438 __Pyx_XDECREF(__pyx_v_result);
13439
13440 __Pyx_XGIVEREF(__pyx_r);
13441 __Pyx_RefNannyFinishContext();
13442 return __pyx_r;
13443}
13444
13445/* "View.MemoryView":801
13446 *
13447 *
13448 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13449 * for suboffset in suboffsets[:ndim]:
13450 * if cython.unlikely(suboffset >= 0):
13451*/
13452
13453static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13454 Py_ssize_t __pyx_v_suboffset;
13455 int __pyx_r;
13456 Py_ssize_t *__pyx_t_1;
13457 Py_ssize_t *__pyx_t_2;
13458 Py_ssize_t *__pyx_t_3;
13459 int __pyx_t_4;
13460 int __pyx_t_5;
13461 int __pyx_lineno = 0;
13462 const char *__pyx_filename = NULL;
13463 int __pyx_clineno = 0;
13464
13465 /* "View.MemoryView":802
13466 *
13467 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13468 * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
13469 * if cython.unlikely(suboffset >= 0):
13470 * _err_ValueError("Indirect dimensions not supported")
13471*/
13472 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13473
13474 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13475 __pyx_t_1 = __pyx_t_3;
13476 __pyx_v_suboffset = (__pyx_t_1[0]);
13477
13478 /* "View.MemoryView":803
13479 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13480 * for suboffset in suboffsets[:ndim]:
13481 * if cython.unlikely(suboffset >= 0): # <<<<<<<<<<<<<<
13482 * _err_ValueError("Indirect dimensions not supported")
13483 * return 0 # return type just used as an error flag
13484*/
13485 __pyx_t_4 = (__pyx_v_suboffset >= 0);
13486
13487 if (unlikely(__pyx_t_4)) {
13488
13489
13490 /* "View.MemoryView":804
13491 * for suboffset in suboffsets[:ndim]:
13492 * if cython.unlikely(suboffset >= 0):
13493 * _err_ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
13494 * return 0 # return type just used as an error flag
13495 *
13496*/
13497 __pyx_t_5 = __pyx_memoryview_err_ValueError(__pyx_k_Indirect_dimensions_not_supporte); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 804, __pyx_L1_error)
13498
13499
13500 /* "View.MemoryView":803
13501 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13502 * for suboffset in suboffsets[:ndim]:
13503 * if cython.unlikely(suboffset >= 0): # <<<<<<<<<<<<<<
13504 * _err_ValueError("Indirect dimensions not supported")
13505 * return 0 # return type just used as an error flag
13506*/
13507 }
13508 }
13509
13510
13511 /* "View.MemoryView":805
13512 * if cython.unlikely(suboffset >= 0):
13513 * _err_ValueError("Indirect dimensions not supported")
13514 * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
13515 *
13516 *
13517*/
13518 {
13519
13520 __pyx_r = 0;
13521 }
13522 goto __pyx_L0;
13523
13524 /* "View.MemoryView":801
13525 *
13526 *
13527 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13528 * for suboffset in suboffsets[:ndim]:
13529 * if cython.unlikely(suboffset >= 0):
13530*/
13531
13532 /* function exit code */
13533 __pyx_L1_error:;
13534 __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13535 __pyx_r = -1;
13536 __pyx_L0:;
13537
13538
13539 return __pyx_r;
13540}
13541
13542/* "View.MemoryView":811
13543 *
13544 *
13545 * @cname('__pyx_memview_slice') # <<<<<<<<<<<<<<
13546 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13547 * cdef int new_ndim = 0, suboffset_dim = -1, dim
13548*/
13549
13550static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13551 int __pyx_v_new_ndim;
13552 int __pyx_v_suboffset_dim;
13553 int __pyx_v_dim;
13554 __Pyx_memviewslice __pyx_v_src;
13555 __Pyx_memviewslice __pyx_v_dst;
13556 __Pyx_memviewslice *__pyx_v_p_src;
13557 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13558 __Pyx_memviewslice *__pyx_v_p_dst;
13559 int *__pyx_v_p_suboffset_dim;
13560 Py_ssize_t __pyx_v_start;
13561 Py_ssize_t __pyx_v_stop;
13562 Py_ssize_t __pyx_v_step;
13563 Py_ssize_t __pyx_v_cindex;
13564 int __pyx_v_have_start;
13565 int __pyx_v_have_stop;
13566 int __pyx_v_have_step;
13567 PyObject *__pyx_v_index = NULL;
13568 struct __pyx_memoryview_obj *__pyx_r = NULL;
13569 __Pyx_RefNannyDeclarations
13570 int __pyx_t_1;
13571 PyObject *__pyx_t_2 = NULL;
13572 struct __pyx_memoryview_obj *__pyx_t_3;
13573 char *__pyx_t_4;
13574 int __pyx_t_5;
13575 Py_ssize_t __pyx_t_6;
13576 PyObject *__pyx_t_7 = NULL;
13577 Py_ssize_t __pyx_t_8;
13578 int __pyx_t_9;
13579 Py_ssize_t __pyx_t_10;
13580 int __pyx_lineno = 0;
13581 const char *__pyx_filename = NULL;
13582 int __pyx_clineno = 0;
13583 __Pyx_RefNannySetupContext("memview_slice", 0);
13584
13585 /* "View.MemoryView":813
13586 * @cname('__pyx_memview_slice')
13587 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13588 * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
13589 * cdef bint negative_step
13590 * cdef __Pyx_memviewslice src, dst
13591*/
13592 __pyx_v_new_ndim = 0;
13593 __pyx_v_suboffset_dim = -1;
13594
13595 /* "View.MemoryView":820
13596 *
13597 *
13598 * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
13599 *
13600 * cdef _memoryviewslice memviewsliceobj
13601*/
13602 (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
13603
13604 /* "View.MemoryView":824
13605 * cdef _memoryviewslice memviewsliceobj
13606 *
13607 * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
13608 *
13609 * if isinstance(memview, _memoryviewslice):
13610*/
13611 #ifndef CYTHON_WITHOUT_ASSERTIONS
13612 if (unlikely(__pyx_assertions_enabled())) {
13613 __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
13614
13615 if (unlikely(!__pyx_t_1)) {
13616 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
13617 __PYX_ERR(1, 824, __pyx_L1_error)
13618 }
13619
13620 }
13621 #else
13622 if ((1)); else __PYX_ERR(1, 824, __pyx_L1_error)
13623 #endif
13624
13625 /* "View.MemoryView":826
13626 * assert memview.view.ndim > 0
13627 *
13628 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13629 * memviewsliceobj = memview
13630 * p_src = &memviewsliceobj.from_slice
13631*/
13632 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
13633 if (__pyx_t_1) {
13634
13635
13636 /* "View.MemoryView":827
13637 *
13638 * if isinstance(memview, _memoryviewslice):
13639 * memviewsliceobj = memview # <<<<<<<<<<<<<<
13640 * p_src = &memviewsliceobj.from_slice
13641 * else:
13642*/
13643 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
13644 __Pyx_INCREF(__pyx_t_2);
13645 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 827, __pyx_L1_error)
13646 __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
13647 __pyx_t_2 = 0;
13648
13649 /* "View.MemoryView":828
13650 * if isinstance(memview, _memoryviewslice):
13651 * memviewsliceobj = memview
13652 * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
13653 * else:
13654 * slice_copy(memview, &src)
13655*/
13656 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13657
13658 /* "View.MemoryView":826
13659 * assert memview.view.ndim > 0
13660 *
13661 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13662 * memviewsliceobj = memview
13663 * p_src = &memviewsliceobj.from_slice
13664*/
13665 goto __pyx_L3;
13666 }
13667
13668 /* "View.MemoryView":830
13669 * p_src = &memviewsliceobj.from_slice
13670 * else:
13671 * slice_copy(memview, &src) # <<<<<<<<<<<<<<
13672 * p_src = &src
13673 *
13674*/
13675 /*else*/ {
13676 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13677
13678 /* "View.MemoryView":831
13679 * else:
13680 * slice_copy(memview, &src)
13681 * p_src = &src # <<<<<<<<<<<<<<
13682 *
13683 *
13684*/
13685 __pyx_v_p_src = (&__pyx_v_src);
13686 }
13687 __pyx_L3:;
13688
13689 /* "View.MemoryView":837
13690 *
13691 *
13692 * dst.memview = p_src.memview # <<<<<<<<<<<<<<
13693 * dst.data = p_src.data
13694 *
13695*/
13696 __pyx_t_3 = __pyx_v_p_src->memview;
13697
13698 __pyx_v_dst.memview = __pyx_t_3;
13699
13700 /* "View.MemoryView":838
13701 *
13702 * dst.memview = p_src.memview
13703 * dst.data = p_src.data # <<<<<<<<<<<<<<
13704 *
13705 *
13706*/
13707 __pyx_t_4 = __pyx_v_p_src->data;
13708
13709 __pyx_v_dst.data = __pyx_t_4;
13710
13711 /* "View.MemoryView":843
13712 *
13713 *
13714 * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
13715 * cdef int *p_suboffset_dim = &suboffset_dim
13716 * cdef Py_ssize_t start, stop, step, cindex
13717*/
13718 __pyx_v_p_dst = (&__pyx_v_dst);
13719
13720 /* "View.MemoryView":844
13721 *
13722 * cdef __Pyx_memviewslice *p_dst = &dst
13723 * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
13724 * cdef Py_ssize_t start, stop, step, cindex
13725 * cdef bint have_start, have_stop, have_step
13726*/
13727 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13728
13729 /* "View.MemoryView":848
13730 * cdef bint have_start, have_stop, have_step
13731 *
13732 * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13733 * if PyIndex_Check(index):
13734 * cindex = index
13735*/
13736
13737 __pyx_t_5 = 0;
13738 __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
13739 __pyx_t_6 = 0;
13740 for (;;) {
13741 {
13742 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
13743 #if !CYTHON_ASSUME_SAFE_SIZE
13744 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 848, __pyx_L1_error)
13745 #endif
13746 if (__pyx_t_6 >= __pyx_temp) break;
13747 }
13748 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13749 __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
13750 #else
13751 __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
13752 #endif
13753 ++__pyx_t_6;
13754 if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 848, __pyx_L1_error)
13755 __Pyx_GOTREF(__pyx_t_7);
13756 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_7);
13757 __pyx_t_7 = 0;
13758 __pyx_v_dim = __pyx_t_5;
13759 __pyx_t_5 = (__pyx_t_5 + 1);
13760
13761 /* "View.MemoryView":849
13762 *
13763 * for dim, index in enumerate(indices):
13764 * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13765 * cindex = index
13766 * slice_memviewslice(
13767*/
13768 __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
13769
13770 if (__pyx_t_1) {
13771
13772
13773 /* "View.MemoryView":850
13774 * for dim, index in enumerate(indices):
13775 * if PyIndex_Check(index):
13776 * cindex = index # <<<<<<<<<<<<<<
13777 * slice_memviewslice(
13778 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13779*/
13780 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 850, __pyx_L1_error)
13781 __pyx_v_cindex = __pyx_t_8;
13782
13783 /* "View.MemoryView":851
13784 * if PyIndex_Check(index):
13785 * cindex = index
13786 * slice_memviewslice( # <<<<<<<<<<<<<<
13787 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13788 * dim, new_ndim, p_suboffset_dim,
13789*/
13790 __pyx_t_9 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 851, __pyx_L1_error)
13791
13792
13793 /* "View.MemoryView":849
13794 *
13795 * for dim, index in enumerate(indices):
13796 * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13797 * cindex = index
13798 * slice_memviewslice(
13799*/
13800 goto __pyx_L6;
13801 }
13802
13803 /* "View.MemoryView":857
13804 * 0, 0, 0, # have_{start,stop,step}
13805 * False)
13806 * elif index is None: # <<<<<<<<<<<<<<
13807 * p_dst.shape[new_ndim] = 1
13808 * p_dst.strides[new_ndim] = 0
13809*/
13810 __pyx_t_1 = (__pyx_v_index == Py_None);
13811 if (__pyx_t_1) {
13812
13813
13814 /* "View.MemoryView":858
13815 * False)
13816 * elif index is None:
13817 * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
13818 * p_dst.strides[new_ndim] = 0
13819 * p_dst.suboffsets[new_ndim] = -1
13820*/
13821 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13822
13823 /* "View.MemoryView":859
13824 * elif index is None:
13825 * p_dst.shape[new_ndim] = 1
13826 * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
13827 * p_dst.suboffsets[new_ndim] = -1
13828 * new_ndim += 1
13829*/
13830 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13831
13832 /* "View.MemoryView":860
13833 * p_dst.shape[new_ndim] = 1
13834 * p_dst.strides[new_ndim] = 0
13835 * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
13836 * new_ndim += 1
13837 * else:
13838*/
13839 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13840
13841 /* "View.MemoryView":861
13842 * p_dst.strides[new_ndim] = 0
13843 * p_dst.suboffsets[new_ndim] = -1
13844 * new_ndim += 1 # <<<<<<<<<<<<<<
13845 * else:
13846 * start = index.start or 0
13847*/
13848 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13849
13850 /* "View.MemoryView":857
13851 * 0, 0, 0, # have_{start,stop,step}
13852 * False)
13853 * elif index is None: # <<<<<<<<<<<<<<
13854 * p_dst.shape[new_ndim] = 1
13855 * p_dst.strides[new_ndim] = 0
13856*/
13857 goto __pyx_L6;
13858 }
13859
13860 /* "View.MemoryView":863
13861 * new_ndim += 1
13862 * else:
13863 * start = index.start or 0 # <<<<<<<<<<<<<<
13864 * stop = index.stop or 0
13865 * step = index.step or 0
13866*/
13867 /*else*/ {
13868 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 863, __pyx_L1_error)
13869 __Pyx_GOTREF(__pyx_t_7);
13870 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 863, __pyx_L1_error)
13871 if (!__pyx_t_1) {
13872 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13873 } else {
13874 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 863, __pyx_L1_error)
13875 __pyx_t_8 = __pyx_t_10;
13876 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13877 goto __pyx_L7_bool_binop_done;
13878 }
13879
13880 __pyx_t_8 = 0;
13881 __pyx_L7_bool_binop_done:;
13882 __pyx_v_start = __pyx_t_8;
13883
13884 /* "View.MemoryView":864
13885 * else:
13886 * start = index.start or 0
13887 * stop = index.stop or 0 # <<<<<<<<<<<<<<
13888 * step = index.step or 0
13889 *
13890*/
13891 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 864, __pyx_L1_error)
13892 __Pyx_GOTREF(__pyx_t_7);
13893 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 864, __pyx_L1_error)
13894 if (!__pyx_t_1) {
13895 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13896 } else {
13897 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 864, __pyx_L1_error)
13898 __pyx_t_8 = __pyx_t_10;
13899 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13900 goto __pyx_L9_bool_binop_done;
13901 }
13902
13903 __pyx_t_8 = 0;
13904 __pyx_L9_bool_binop_done:;
13905 __pyx_v_stop = __pyx_t_8;
13906
13907 /* "View.MemoryView":865
13908 * start = index.start or 0
13909 * stop = index.stop or 0
13910 * step = index.step or 0 # <<<<<<<<<<<<<<
13911 *
13912 * have_start = index.start is not None
13913*/
13914 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 865, __pyx_L1_error)
13915 __Pyx_GOTREF(__pyx_t_7);
13916 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 865, __pyx_L1_error)
13917 if (!__pyx_t_1) {
13918 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13919 } else {
13920 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 865, __pyx_L1_error)
13921 __pyx_t_8 = __pyx_t_10;
13922 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13923 goto __pyx_L11_bool_binop_done;
13924 }
13925
13926 __pyx_t_8 = 0;
13927 __pyx_L11_bool_binop_done:;
13928 __pyx_v_step = __pyx_t_8;
13929
13930 /* "View.MemoryView":867
13931 * step = index.step or 0
13932 *
13933 * have_start = index.start is not None # <<<<<<<<<<<<<<
13934 * have_stop = index.stop is not None
13935 * have_step = index.step is not None
13936*/
13937 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 867, __pyx_L1_error)
13938 __Pyx_GOTREF(__pyx_t_7);
13939 __pyx_t_1 = (__pyx_t_7 != Py_None);
13940 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13941 __pyx_v_have_start = __pyx_t_1;
13942
13943 /* "View.MemoryView":868
13944 *
13945 * have_start = index.start is not None
13946 * have_stop = index.stop is not None # <<<<<<<<<<<<<<
13947 * have_step = index.step is not None
13948 *
13949*/
13950 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 868, __pyx_L1_error)
13951 __Pyx_GOTREF(__pyx_t_7);
13952 __pyx_t_1 = (__pyx_t_7 != Py_None);
13953 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13954 __pyx_v_have_stop = __pyx_t_1;
13955
13956 /* "View.MemoryView":869
13957 * have_start = index.start is not None
13958 * have_stop = index.stop is not None
13959 * have_step = index.step is not None # <<<<<<<<<<<<<<
13960 *
13961 * slice_memviewslice(
13962*/
13963 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 869, __pyx_L1_error)
13964 __Pyx_GOTREF(__pyx_t_7);
13965 __pyx_t_1 = (__pyx_t_7 != Py_None);
13966 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13967 __pyx_v_have_step = __pyx_t_1;
13968
13969 /* "View.MemoryView":871
13970 * have_step = index.step is not None
13971 *
13972 * slice_memviewslice( # <<<<<<<<<<<<<<
13973 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13974 * dim, new_ndim, p_suboffset_dim,
13975*/
13976 __pyx_t_9 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 871, __pyx_L1_error)
13977
13978
13979 /* "View.MemoryView":877
13980 * have_start, have_stop, have_step,
13981 * True)
13982 * new_ndim += 1 # <<<<<<<<<<<<<<
13983 *
13984 * if isinstance(memview, _memoryviewslice):
13985*/
13986 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13987 }
13988 __pyx_L6:;
13989
13990 /* "View.MemoryView":848
13991 * cdef bint have_start, have_stop, have_step
13992 *
13993 * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13994 * if PyIndex_Check(index):
13995 * cindex = index
13996*/
13997 }
13998 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13999
14000 /* "View.MemoryView":879
14001 * new_ndim += 1
14002 *
14003 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14004 * return memoryview_fromslice(dst, new_ndim,
14005 * memviewsliceobj.to_object_func,
14006*/
14007 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
14008 if (__pyx_t_1) {
14009
14010
14011 /* "View.MemoryView":881
14012 * if isinstance(memview, _memoryviewslice):
14013 * return memoryview_fromslice(dst, new_ndim,
14014 * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
14015 * memviewsliceobj.to_dtype_func,
14016 * memview.dtype_is_object)
14017*/
14018 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 881, __pyx_L1_error) }
14019
14020 /* "View.MemoryView":882
14021 * return memoryview_fromslice(dst, new_ndim,
14022 * memviewsliceobj.to_object_func,
14023 * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
14024 * memview.dtype_is_object)
14025 * else:
14026*/
14027 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 882, __pyx_L1_error) }
14028
14029 /* "View.MemoryView":880
14030 *
14031 * if isinstance(memview, _memoryviewslice):
14032 * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14033 * memviewsliceobj.to_object_func,
14034 * memviewsliceobj.to_dtype_func,
14035*/
14036 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 880, __pyx_L1_error)
14037 __Pyx_GOTREF(__pyx_t_2);
14038 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 880, __pyx_L1_error)
14039 {
14040 struct __pyx_memoryview_obj *__pyx_temp;
14041 {
14042 __pyx_temp = __pyx_r;
14043 __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14044 }
14045 __Pyx_XDECREF((PyObject *)__pyx_temp);
14046 }
14047 __pyx_t_2 = 0;
14048 goto __pyx_L0;
14049
14050 /* "View.MemoryView":879
14051 * new_ndim += 1
14052 *
14053 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14054 * return memoryview_fromslice(dst, new_ndim,
14055 * memviewsliceobj.to_object_func,
14056*/
14057 }
14058
14059 /* "View.MemoryView":885
14060 * memview.dtype_is_object)
14061 * else:
14062 * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14063 * memview.dtype_is_object)
14064 *
14065*/
14066 /*else*/ {
14067
14068 /* "View.MemoryView":886
14069 * else:
14070 * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
14071 * memview.dtype_is_object) # <<<<<<<<<<<<<<
14072 *
14073 *
14074*/
14075 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 885, __pyx_L1_error)
14076 __Pyx_GOTREF(__pyx_t_2);
14077
14078 /* "View.MemoryView":885
14079 * memview.dtype_is_object)
14080 * else:
14081 * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14082 * memview.dtype_is_object)
14083 *
14084*/
14085 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 885, __pyx_L1_error)
14086 {
14087 struct __pyx_memoryview_obj *__pyx_temp;
14088 {
14089 __pyx_temp = __pyx_r;
14090 __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14091 }
14092 __Pyx_XDECREF((PyObject *)__pyx_temp);
14093 }
14094 __pyx_t_2 = 0;
14095 goto __pyx_L0;
14096 }
14097
14098 /* "View.MemoryView":811
14099 *
14100 *
14101 * @cname('__pyx_memview_slice') # <<<<<<<<<<<<<<
14102 * cdef memoryview memview_slice(memoryview memview, tuple indices):
14103 * cdef int new_ndim = 0, suboffset_dim = -1, dim
14104*/
14105
14106 /* function exit code */
14107 __pyx_L1_error:;
14108 __Pyx_XDECREF(__pyx_t_2);
14109 __Pyx_XDECREF(__pyx_t_7);
14110 __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14111 __pyx_r = 0;
14112 __pyx_L0:;
14113
14114
14115
14116
14117
14118
14119 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129 __Pyx_XDECREF(__pyx_v_index);
14130 __Pyx_XGIVEREF((PyObject *)__pyx_r);
14131 __Pyx_RefNannyFinishContext();
14132 return __pyx_r;
14133}
14134
14135/* "View.MemoryView":892
14136 *
14137 *
14138 * @cname('__pyx_pybuffer_index') # <<<<<<<<<<<<<<
14139 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14140 * Py_ssize_t dim) except NULL:
14141*/
14142
14143static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
14144 Py_ssize_t __pyx_v_shape;
14145 Py_ssize_t __pyx_v_stride;
14146 Py_ssize_t __pyx_v_suboffset;
14147 Py_ssize_t __pyx_v_itemsize;
14148 char *__pyx_v_resultp;
14149 char *__pyx_r;
14150 Py_ssize_t __pyx_t_1;
14151 int __pyx_t_2;
14152 int __pyx_t_3;
14153 int __pyx_lineno = 0;
14154 const char *__pyx_filename = NULL;
14155 int __pyx_clineno = 0;
14156
14157
14158 /* "View.MemoryView":895
14159 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14160 * Py_ssize_t dim) except NULL:
14161 * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
14162 * cdef Py_ssize_t itemsize = view.itemsize
14163 * cdef char *resultp
14164*/
14165 __pyx_v_suboffset = -1L;
14166
14167 /* "View.MemoryView":896
14168 * Py_ssize_t dim) except NULL:
14169 * cdef Py_ssize_t shape, stride, suboffset = -1
14170 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
14171 * cdef char *resultp
14172 *
14173*/
14174 __pyx_t_1 = __pyx_v_view->itemsize;
14175
14176 __pyx_v_itemsize = __pyx_t_1;
14177
14178 /* "View.MemoryView":899
14179 * cdef char *resultp
14180 *
14181 * if view.ndim == 0: # <<<<<<<<<<<<<<
14182 * shape = view.len // itemsize
14183 * stride = itemsize
14184*/
14185 __pyx_t_2 = (__pyx_v_view->ndim == 0);
14186
14187 if (__pyx_t_2) {
14188
14189
14190 /* "View.MemoryView":900
14191 *
14192 * if view.ndim == 0:
14193 * shape = view.len // itemsize # <<<<<<<<<<<<<<
14194 * stride = itemsize
14195 * else:
14196*/
14197 if (unlikely(__pyx_v_itemsize == 0)) {
14198 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
14199 __PYX_ERR(1, 900, __pyx_L1_error)
14200 }
14201 else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
14202 PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
14203 __PYX_ERR(1, 900, __pyx_L1_error)
14204 }
14205 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);
14206
14207 /* "View.MemoryView":901
14208 * if view.ndim == 0:
14209 * shape = view.len // itemsize
14210 * stride = itemsize # <<<<<<<<<<<<<<
14211 * else:
14212 * shape = view.shape[dim]
14213*/
14214 __pyx_v_stride = __pyx_v_itemsize;
14215
14216 /* "View.MemoryView":899
14217 * cdef char *resultp
14218 *
14219 * if view.ndim == 0: # <<<<<<<<<<<<<<
14220 * shape = view.len // itemsize
14221 * stride = itemsize
14222*/
14223 goto __pyx_L3;
14224 }
14225
14226 /* "View.MemoryView":903
14227 * stride = itemsize
14228 * else:
14229 * shape = view.shape[dim] # <<<<<<<<<<<<<<
14230 * stride = view.strides[dim]
14231 * if view.suboffsets != NULL:
14232*/
14233 /*else*/ {
14234 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14235
14236 /* "View.MemoryView":904
14237 * else:
14238 * shape = view.shape[dim]
14239 * stride = view.strides[dim] # <<<<<<<<<<<<<<
14240 * if view.suboffsets != NULL:
14241 * suboffset = view.suboffsets[dim]
14242*/
14243 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14244
14245 /* "View.MemoryView":905
14246 * shape = view.shape[dim]
14247 * stride = view.strides[dim]
14248 * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14249 * suboffset = view.suboffsets[dim]
14250 *
14251*/
14252 __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14253
14254 if (__pyx_t_2) {
14255
14256
14257 /* "View.MemoryView":906
14258 * stride = view.strides[dim]
14259 * if view.suboffsets != NULL:
14260 * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
14261 *
14262 * if index < 0:
14263*/
14264 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14265
14266 /* "View.MemoryView":905
14267 * shape = view.shape[dim]
14268 * stride = view.strides[dim]
14269 * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14270 * suboffset = view.suboffsets[dim]
14271 *
14272*/
14273 }
14274 }
14275 __pyx_L3:;
14276
14277 /* "View.MemoryView":908
14278 * suboffset = view.suboffsets[dim]
14279 *
14280 * if index < 0: # <<<<<<<<<<<<<<
14281 * index += view.shape[dim]
14282 * if cython.unlikely(index < 0):
14283*/
14284 __pyx_t_2 = (__pyx_v_index < 0);
14285
14286 if (__pyx_t_2) {
14287
14288
14289 /* "View.MemoryView":909
14290 *
14291 * if index < 0:
14292 * index += view.shape[dim] # <<<<<<<<<<<<<<
14293 * if cython.unlikely(index < 0):
14294 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14295*/
14296 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14297
14298 /* "View.MemoryView":910
14299 * if index < 0:
14300 * index += view.shape[dim]
14301 * if cython.unlikely(index < 0): # <<<<<<<<<<<<<<
14302 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14303 *
14304*/
14305 __pyx_t_2 = (__pyx_v_index < 0);
14306
14307 if (unlikely(__pyx_t_2)) {
14308
14309
14310 /* "View.MemoryView":911
14311 * index += view.shape[dim]
14312 * if cython.unlikely(index < 0):
14313 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim) # <<<<<<<<<<<<<<
14314 *
14315 * if cython.unlikely(index >= shape):
14316*/
14317 __pyx_t_3 = __pyx_memoryview_err_IndexError(__pyx_k_Out_of_bounds_on_buffer_access_a, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 911, __pyx_L1_error)
14318
14319
14320 /* "View.MemoryView":910
14321 * if index < 0:
14322 * index += view.shape[dim]
14323 * if cython.unlikely(index < 0): # <<<<<<<<<<<<<<
14324 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14325 *
14326*/
14327 }
14328
14329 /* "View.MemoryView":908
14330 * suboffset = view.suboffsets[dim]
14331 *
14332 * if index < 0: # <<<<<<<<<<<<<<
14333 * index += view.shape[dim]
14334 * if cython.unlikely(index < 0):
14335*/
14336 }
14337
14338 /* "View.MemoryView":913
14339 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14340 *
14341 * if cython.unlikely(index >= shape): # <<<<<<<<<<<<<<
14342 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14343 *
14344*/
14345 __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14346
14347 if (unlikely(__pyx_t_2)) {
14348
14349
14350 /* "View.MemoryView":914
14351 *
14352 * if cython.unlikely(index >= shape):
14353 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim) # <<<<<<<<<<<<<<
14354 *
14355 * resultp = bufp + index * stride
14356*/
14357 __pyx_t_3 = __pyx_memoryview_err_IndexError(__pyx_k_Out_of_bounds_on_buffer_access_a, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 914, __pyx_L1_error)
14358
14359
14360 /* "View.MemoryView":913
14361 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14362 *
14363 * if cython.unlikely(index >= shape): # <<<<<<<<<<<<<<
14364 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14365 *
14366*/
14367 }
14368
14369 /* "View.MemoryView":916
14370 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14371 *
14372 * resultp = bufp + index * stride # <<<<<<<<<<<<<<
14373 * if suboffset >= 0:
14374 * resultp = (<char **> resultp)[0] + suboffset
14375*/
14376 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14377
14378 /* "View.MemoryView":917
14379 *
14380 * resultp = bufp + index * stride
14381 * if suboffset >= 0: # <<<<<<<<<<<<<<
14382 * resultp = (<char **> resultp)[0] + suboffset
14383 *
14384*/
14385 __pyx_t_2 = (__pyx_v_suboffset >= 0);
14386
14387 if (__pyx_t_2) {
14388
14389
14390 /* "View.MemoryView":918
14391 * resultp = bufp + index * stride
14392 * if suboffset >= 0:
14393 * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
14394 *
14395 * return resultp
14396*/
14397 __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14398
14399 /* "View.MemoryView":917
14400 *
14401 * resultp = bufp + index * stride
14402 * if suboffset >= 0: # <<<<<<<<<<<<<<
14403 * resultp = (<char **> resultp)[0] + suboffset
14404 *
14405*/
14406 }
14407
14408 /* "View.MemoryView":920
14409 * resultp = (<char **> resultp)[0] + suboffset
14410 *
14411 * return resultp # <<<<<<<<<<<<<<
14412 *
14413 *
14414*/
14415 {
14416
14417 __pyx_r = __pyx_v_resultp;
14418 }
14419 goto __pyx_L0;
14420
14421 /* "View.MemoryView":892
14422 *
14423 *
14424 * @cname('__pyx_pybuffer_index') # <<<<<<<<<<<<<<
14425 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14426 * Py_ssize_t dim) except NULL:
14427*/
14428
14429 /* function exit code */
14430 __pyx_L1_error:;
14431 __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14432 __pyx_r = NULL;
14433 __pyx_L0:;
14434
14435
14436
14437
14438
14439
14440
14441 return __pyx_r;
14442}
14443
14444/* "View.MemoryView":925
14445 *
14446 *
14447 * @cname('__pyx_memslice_transpose') # <<<<<<<<<<<<<<
14448 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14449 * cdef int ndim = memslice.memview.view.ndim
14450*/
14451
14452static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14453 int __pyx_v_ndim;
14454 Py_ssize_t *__pyx_v_shape;
14455 Py_ssize_t *__pyx_v_strides;
14456 int __pyx_v_i;
14457 int __pyx_v_j;
14458 int __pyx_r;
14459 int __pyx_t_1;
14460 Py_ssize_t *__pyx_t_2;
14461 long __pyx_t_3;
14462 long __pyx_t_4;
14463 Py_ssize_t __pyx_t_5;
14464 Py_ssize_t __pyx_t_6;
14465 int __pyx_t_7;
14466 int __pyx_t_8;
14467 int __pyx_t_9;
14468 int __pyx_lineno = 0;
14469 const char *__pyx_filename = NULL;
14470 int __pyx_clineno = 0;
14471 PyGILState_STATE __pyx_gilstate_save;
14472
14473 /* "View.MemoryView":927
14474 * @cname('__pyx_memslice_transpose')
14475 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14476 * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
14477 *
14478 * cdef Py_ssize_t *shape = memslice.shape
14479*/
14480 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14481
14482 __pyx_v_ndim = __pyx_t_1;
14483
14484 /* "View.MemoryView":929
14485 * cdef int ndim = memslice.memview.view.ndim
14486 *
14487 * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
14488 * cdef Py_ssize_t *strides = memslice.strides
14489 *
14490*/
14491 __pyx_t_2 = __pyx_v_memslice->shape;
14492
14493 __pyx_v_shape = __pyx_t_2;
14494
14495 /* "View.MemoryView":930
14496 *
14497 * cdef Py_ssize_t *shape = memslice.shape
14498 * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
14499 *
14500 *
14501*/
14502 __pyx_t_2 = __pyx_v_memslice->strides;
14503
14504 __pyx_v_strides = __pyx_t_2;
14505
14506 /* "View.MemoryView":934
14507 *
14508 * cdef int i, j
14509 * for i in range(ndim // 2): # <<<<<<<<<<<<<<
14510 * j = ndim - 1 - i
14511 * strides[i], strides[j] = strides[j], strides[i]
14512*/
14513
14514 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2, 1);
14515 __pyx_t_4 = __pyx_t_3;
14516
14517 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14518 __pyx_v_i = __pyx_t_1;
14519
14520 /* "View.MemoryView":935
14521 * cdef int i, j
14522 * for i in range(ndim // 2):
14523 * j = ndim - 1 - i # <<<<<<<<<<<<<<
14524 * strides[i], strides[j] = strides[j], strides[i]
14525 * shape[i], shape[j] = shape[j], shape[i]
14526*/
14527 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14528
14529 /* "View.MemoryView":936
14530 * for i in range(ndim // 2):
14531 * j = ndim - 1 - i
14532 * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
14533 * shape[i], shape[j] = shape[j], shape[i]
14534 *
14535*/
14536 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14537
14538 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14539
14540 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14541
14542 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14543
14544
14545 /* "View.MemoryView":937
14546 * j = ndim - 1 - i
14547 * strides[i], strides[j] = strides[j], strides[i]
14548 * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
14549 *
14550 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0):
14551*/
14552 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14553
14554 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14555
14556 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14557
14558 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14559
14560
14561 /* "View.MemoryView":939
14562 * shape[i], shape[j] = shape[j], shape[i]
14563 *
14564 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0): # <<<<<<<<<<<<<<
14565 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14566 *
14567*/
14568 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14569
14570 if (!__pyx_t_8) {
14571
14572 } else {
14573
14574 __pyx_t_7 = __pyx_t_8;
14575
14576 goto __pyx_L6_bool_binop_done;
14577 }
14578 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14579
14580
14581 __pyx_t_7 = __pyx_t_8;
14582
14583 __pyx_L6_bool_binop_done:;
14584 if (unlikely(__pyx_t_7)) {
14585
14586
14587 /* "View.MemoryView":940
14588 *
14589 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0):
14590 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
14591 *
14592 * return 0
14593*/
14594 __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 940, __pyx_L1_error)
14595
14596
14597 /* "View.MemoryView":939
14598 * shape[i], shape[j] = shape[j], shape[i]
14599 *
14600 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0): # <<<<<<<<<<<<<<
14601 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14602 *
14603*/
14604 }
14605 }
14606
14607
14608 /* "View.MemoryView":942
14609 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14610 *
14611 * return 0 # <<<<<<<<<<<<<<
14612 *
14613 *
14614*/
14615 {
14616
14617 __pyx_r = 0;
14618 }
14619 goto __pyx_L0;
14620
14621 /* "View.MemoryView":925
14622 *
14623 *
14624 * @cname('__pyx_memslice_transpose') # <<<<<<<<<<<<<<
14625 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14626 * cdef int ndim = memslice.memview.view.ndim
14627*/
14628
14629 /* function exit code */
14630 __pyx_L1_error:;
14631 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14632 __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14633 __pyx_r = -1;
14634 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14635 __pyx_L0:;
14636
14637
14638
14639
14640
14641 return __pyx_r;
14642}
14643
14644/* "View.MemoryView":960
14645 * cdef to_dtype_func_type to_dtype_func
14646 *
14647 * def __dealloc__(self): # <<<<<<<<<<<<<<
14648 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14649 *
14650*/
14651
14652/* Python wrapper */
14653static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
14654static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14655 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14656 __Pyx_RefNannyDeclarations
14657 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14658 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
14659 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14660
14661 /* function exit code */
14662 __Pyx_RefNannyFinishContext();
14663}
14664
14665static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14666
14667 /* "View.MemoryView":961
14668 *
14669 * def __dealloc__(self):
14670 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
14671 *
14672 * cdef convert_item_to_object(self, char *itemp):
14673*/
14674 __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
14675
14676 /* "View.MemoryView":960
14677 * cdef to_dtype_func_type to_dtype_func
14678 *
14679 * def __dealloc__(self): # <<<<<<<<<<<<<<
14680 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14681 *
14682*/
14683
14684 /* function exit code */
14685
14686}
14687
14688/* "View.MemoryView":963
14689 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14690 *
14691 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14692 * if self.to_object_func != NULL:
14693 * return self.to_object_func(itemp)
14694*/
14695
14696static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
14697 PyObject *__pyx_r = NULL;
14698 __Pyx_RefNannyDeclarations
14699 int __pyx_t_1;
14700 PyObject *__pyx_t_2 = NULL;
14701 int __pyx_lineno = 0;
14702 const char *__pyx_filename = NULL;
14703 int __pyx_clineno = 0;
14704 __Pyx_RefNannySetupContext("convert_item_to_object", 0);
14705
14706 /* "View.MemoryView":964
14707 *
14708 * cdef convert_item_to_object(self, char *itemp):
14709 * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14710 * return self.to_object_func(itemp)
14711 * else:
14712*/
14713 __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
14714
14715 if (__pyx_t_1) {
14716
14717
14718 /* "View.MemoryView":965
14719 * cdef convert_item_to_object(self, char *itemp):
14720 * if self.to_object_func != NULL:
14721 * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
14722 * else:
14723 * return memoryview.convert_item_to_object(self, itemp)
14724*/
14725 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 965, __pyx_L1_error)
14726 __Pyx_GOTREF(__pyx_t_2);
14727 {
14728 PyObject *__pyx_temp;
14729 {
14730 __pyx_temp = __pyx_r;
14731 __pyx_r = __pyx_t_2;
14732 }
14733 __Pyx_XDECREF(__pyx_temp);
14734 }
14735 __pyx_t_2 = 0;
14736 goto __pyx_L0;
14737
14738 /* "View.MemoryView":964
14739 *
14740 * cdef convert_item_to_object(self, char *itemp):
14741 * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14742 * return self.to_object_func(itemp)
14743 * else:
14744*/
14745 }
14746
14747 /* "View.MemoryView":967
14748 * return self.to_object_func(itemp)
14749 * else:
14750 * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
14751 *
14752 * cdef assign_item_from_object(self, char *itemp, object value):
14753*/
14754 /*else*/ {
14755 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error)
14756 __Pyx_GOTREF(__pyx_t_2);
14757 {
14758 PyObject *__pyx_temp;
14759 {
14760 __pyx_temp = __pyx_r;
14761 __pyx_r = __pyx_t_2;
14762 }
14763 __Pyx_XDECREF(__pyx_temp);
14764 }
14765 __pyx_t_2 = 0;
14766 goto __pyx_L0;
14767 }
14768
14769 /* "View.MemoryView":963
14770 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14771 *
14772 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14773 * if self.to_object_func != NULL:
14774 * return self.to_object_func(itemp)
14775*/
14776
14777 /* function exit code */
14778 __pyx_L1_error:;
14779 __Pyx_XDECREF(__pyx_t_2);
14780 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14781 __pyx_r = 0;
14782 __pyx_L0:;
14783 __Pyx_XGIVEREF(__pyx_r);
14784 __Pyx_RefNannyFinishContext();
14785 return __pyx_r;
14786}
14787
14788/* "View.MemoryView":969
14789 * return memoryview.convert_item_to_object(self, itemp)
14790 *
14791 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14792 * if self.to_dtype_func != NULL:
14793 * self.to_dtype_func(itemp, value)
14794*/
14795
14796static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14797 PyObject *__pyx_r = NULL;
14798 __Pyx_RefNannyDeclarations
14799 int __pyx_t_1;
14800 int __pyx_t_2;
14801 PyObject *__pyx_t_3 = NULL;
14802 int __pyx_lineno = 0;
14803 const char *__pyx_filename = NULL;
14804 int __pyx_clineno = 0;
14805 __Pyx_RefNannySetupContext("assign_item_from_object", 0);
14806
14807 /* "View.MemoryView":970
14808 *
14809 * cdef assign_item_from_object(self, char *itemp, object value):
14810 * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14811 * self.to_dtype_func(itemp, value)
14812 * else:
14813*/
14814 __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
14815
14816 if (__pyx_t_1) {
14817
14818
14819 /* "View.MemoryView":971
14820 * cdef assign_item_from_object(self, char *itemp, object value):
14821 * if self.to_dtype_func != NULL:
14822 * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
14823 * else:
14824 * memoryview.assign_item_from_object(self, itemp, value)
14825*/
14826 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 971, __pyx_L1_error)
14827
14828
14829 /* "View.MemoryView":970
14830 *
14831 * cdef assign_item_from_object(self, char *itemp, object value):
14832 * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14833 * self.to_dtype_func(itemp, value)
14834 * else:
14835*/
14836 goto __pyx_L3;
14837 }
14838
14839 /* "View.MemoryView":973
14840 * self.to_dtype_func(itemp, value)
14841 * else:
14842 * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
14843 *
14844 * cdef _get_base(self):
14845*/
14846 /*else*/ {
14847 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 973, __pyx_L1_error)
14848 __Pyx_GOTREF(__pyx_t_3);
14849 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14850 }
14851 __pyx_L3:;
14852
14853 /* "View.MemoryView":969
14854 * return memoryview.convert_item_to_object(self, itemp)
14855 *
14856 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14857 * if self.to_dtype_func != NULL:
14858 * self.to_dtype_func(itemp, value)
14859*/
14860
14861 /* function exit code */
14862 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14863 goto __pyx_L0;
14864 __pyx_L1_error:;
14865 __Pyx_XDECREF(__pyx_t_3);
14866 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14867 __pyx_r = 0;
14868 __pyx_L0:;
14869 __Pyx_XGIVEREF(__pyx_r);
14870 __Pyx_RefNannyFinishContext();
14871 return __pyx_r;
14872}
14873
14874/* "View.MemoryView":975
14875 * memoryview.assign_item_from_object(self, itemp, value)
14876 *
14877 * cdef _get_base(self): # <<<<<<<<<<<<<<
14878 * return self.from_object
14879 *
14880*/
14881
14882static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14883 PyObject *__pyx_r = NULL;
14884 __Pyx_RefNannyDeclarations
14885 __Pyx_RefNannySetupContext("_get_base", 0);
14886
14887 /* "View.MemoryView":976
14888 *
14889 * cdef _get_base(self):
14890 * return self.from_object # <<<<<<<<<<<<<<
14891 *
14892 *
14893*/
14894 {
14895 PyObject *__pyx_temp;
14896 {
14897 __pyx_temp = __pyx_r;
14898 __Pyx_INCREF(__pyx_v_self->from_object);
14899 __pyx_r = __pyx_v_self->from_object;
14900 }
14901 __Pyx_XDECREF(__pyx_temp);
14902 }
14903 goto __pyx_L0;
14904
14905 /* "View.MemoryView":975
14906 * memoryview.assign_item_from_object(self, itemp, value)
14907 *
14908 * cdef _get_base(self): # <<<<<<<<<<<<<<
14909 * return self.from_object
14910 *
14911*/
14912
14913 /* function exit code */
14914 __pyx_L0:;
14915 __Pyx_XGIVEREF(__pyx_r);
14916 __Pyx_RefNannyFinishContext();
14917 return __pyx_r;
14918}
14919
14920/* "(tree fragment)":1
14921 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14922 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14923 * def __setstate_cython__(self, __pyx_state):
14924*/
14925
14926/* Python wrapper */
14927static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14928#if CYTHON_VECTORCALL
14929PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14930#else
14931PyObject *__pyx_args, PyObject *__pyx_kwds
14932#endif
14933); /*proto*/
14934static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14935#if CYTHON_VECTORCALL
14936PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14937#else
14938PyObject *__pyx_args, PyObject *__pyx_kwds
14939#endif
14940) {
14941 #if !CYTHON_VECTORCALL
14942 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14943 #endif
14944 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14945 PyObject *__pyx_r = 0;
14946 __Pyx_RefNannyDeclarations
14947 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14948 #if !CYTHON_VECTORCALL
14949 #if CYTHON_ASSUME_SAFE_SIZE
14950 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14951 #else
14952 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14953 #endif
14954 #endif
14955 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14956 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
14957 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
14958 if (unlikely(__pyx_kwds_len < 0)) return NULL;
14959 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
14960 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14961
14962 /* function exit code */
14963 __Pyx_RefNannyFinishContext();
14964 return __pyx_r;
14965}
14966
14967static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14968 PyObject *__pyx_r = NULL;
14969 __Pyx_RefNannyDeclarations
14970 int __pyx_lineno = 0;
14971 const char *__pyx_filename = NULL;
14972 int __pyx_clineno = 0;
14973 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14974
14975 /* "(tree fragment)":2
14976 * def __reduce_cython__(self):
14977 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
14978 * def __setstate_cython__(self, __pyx_state):
14979 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14980*/
14981 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
14982 __PYX_ERR(1, 2, __pyx_L1_error)
14983
14984 /* "(tree fragment)":1
14985 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14986 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14987 * def __setstate_cython__(self, __pyx_state):
14988*/
14989
14990 /* function exit code */
14991 __pyx_L1_error:;
14992 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14993 __pyx_r = NULL;
14994 __Pyx_XGIVEREF(__pyx_r);
14995 __Pyx_RefNannyFinishContext();
14996 return __pyx_r;
14997}
14998
14999/* "(tree fragment)":3
15000 * def __reduce_cython__(self):
15001 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15002 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15003 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15004*/
15005
15006/* Python wrapper */
15007static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15008#if CYTHON_VECTORCALL
15009PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15010#else
15011PyObject *__pyx_args, PyObject *__pyx_kwds
15012#endif
15013); /*proto*/
15014static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15015#if CYTHON_VECTORCALL
15016PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15017#else
15018PyObject *__pyx_args, PyObject *__pyx_kwds
15019#endif
15020) {
15021 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
15022 #if !CYTHON_VECTORCALL
15023 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
15024 #endif
15025 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
15026 PyObject* values[1] = {0};
15027 int __pyx_lineno = 0;
15028 const char *__pyx_filename = NULL;
15029 int __pyx_clineno = 0;
15030 PyObject *__pyx_r = 0;
15031 __Pyx_RefNannyDeclarations
15032 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15033 #if !CYTHON_VECTORCALL
15034 #if CYTHON_ASSUME_SAFE_SIZE
15035 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
15036 #else
15037 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
15038 #endif
15039 #endif
15040 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
15041 {
15042 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
15043 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
15044 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
15045 if (__pyx_kwds_len > 0) {
15046 switch (__pyx_nargs) {
15047 case 1:
15048 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
15049 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
15050 CYTHON_FALLTHROUGH;
15051 case 0: break;
15052 default: goto __pyx_L5_argtuple_error;
15053 }
15054 const Py_ssize_t kwd_pos_args = __pyx_nargs;
15055 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
15056 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
15057 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
15058 }
15059 } else if (unlikely(__pyx_nargs != 1)) {
15060 goto __pyx_L5_argtuple_error;
15061 } else {
15062 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
15063 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
15064 }
15065 __pyx_v___pyx_state = values[0];
15066 }
15067 goto __pyx_L6_skip;
15068 __pyx_L5_argtuple_error:;
15069 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
15070 __pyx_L6_skip:;
15071 goto __pyx_L4_argument_unpacking_done;
15072 __pyx_L3_error:;
15073 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
15074 Py_XDECREF(values[__pyx_temp]);
15075 }
15076 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15077 __Pyx_RefNannyFinishContext();
15078 return NULL;
15079 __pyx_L4_argument_unpacking_done:;
15080 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
15081
15082 /* function exit code */
15083 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
15084 Py_XDECREF(values[__pyx_temp]);
15085 }
15086 __Pyx_RefNannyFinishContext();
15087 return __pyx_r;
15088}
15089
15090static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15091 PyObject *__pyx_r = NULL;
15092 __Pyx_RefNannyDeclarations
15093 int __pyx_lineno = 0;
15094 const char *__pyx_filename = NULL;
15095 int __pyx_clineno = 0;
15096 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15097
15098 /* "(tree fragment)":4
15099 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15100 * def __setstate_cython__(self, __pyx_state):
15101 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
15102*/
15103 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
15104 __PYX_ERR(1, 4, __pyx_L1_error)
15105
15106 /* "(tree fragment)":3
15107 * def __reduce_cython__(self):
15108 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15109 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15110 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15111*/
15112
15113 /* function exit code */
15114 __pyx_L1_error:;
15115 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15116 __pyx_r = NULL;
15117 __Pyx_XGIVEREF(__pyx_r);
15118 __Pyx_RefNannyFinishContext();
15119 return __pyx_r;
15120}
15121
15122/* "View.MemoryView":995
15123 * pass # ignore failure, it's a minor issue
15124 *
15125 * @cname('__pyx_memoryview_fromslice') # <<<<<<<<<<<<<<
15126 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
15127 * int ndim,
15128*/
15129
15130static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func, int __pyx_v_dtype_is_object) {
15131 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15132 Py_ssize_t __pyx_v_suboffset;
15133 Py_ssize_t __pyx_v_length;
15134 PyObject *__pyx_r = NULL;
15135 __Pyx_RefNannyDeclarations
15136 int __pyx_t_1;
15137 PyObject *__pyx_t_2 = NULL;
15138 PyObject *__pyx_t_3 = NULL;
15139 __Pyx_TypeInfo const *__pyx_t_4;
15140 Py_buffer __pyx_t_5;
15141 Py_ssize_t *__pyx_t_6;
15142 Py_ssize_t *__pyx_t_7;
15143 Py_ssize_t *__pyx_t_8;
15144 Py_ssize_t __pyx_t_9;
15145 int __pyx_lineno = 0;
15146 const char *__pyx_filename = NULL;
15147 int __pyx_clineno = 0;
15148 __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
15149
15150 /* "View.MemoryView":1004
15151 * cdef _memoryviewslice result
15152 *
15153 * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15154 * return None
15155 *
15156*/
15157 __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
15158
15159 if (__pyx_t_1) {
15160
15161
15162 /* "View.MemoryView":1005
15163 *
15164 * if <PyObject *> memviewslice.memview == Py_None:
15165 * return None # <<<<<<<<<<<<<<
15166 *
15167 *
15168*/
15169 {
15170 PyObject *__pyx_temp;
15171 {
15172 __pyx_temp = __pyx_r;
15173 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15174 }
15175 __Pyx_XDECREF(__pyx_temp);
15176 }
15177 goto __pyx_L0;
15178
15179 /* "View.MemoryView":1004
15180 * cdef _memoryviewslice result
15181 *
15182 * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15183 * return None
15184 *
15185*/
15186 }
15187
15188 /* "View.MemoryView":1010
15189 *
15190 *
15191 * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
15192 *
15193 * result.from_slice = memviewslice
15194*/
15195 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
15196 __Pyx_GOTREF(__pyx_t_2);
15197 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1010, __pyx_L1_error)
15198 __Pyx_GOTREF(__pyx_t_3);
15199 __Pyx_INCREF(Py_None);
15200 __Pyx_GIVEREF(Py_None);
15201 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15202 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
15203 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
15204 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15205 __Pyx_GIVEREF(__pyx_t_2);
15206 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15207 __pyx_t_2 = 0;
15208 __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_mstate_global->__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
15209 __Pyx_GOTREF(__pyx_t_2);
15210 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15211 __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15212 __pyx_t_2 = 0;
15213
15214 /* "View.MemoryView":1012
15215 * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
15216 *
15217 * result.from_slice = memviewslice # <<<<<<<<<<<<<<
15218 * __PYX_INC_MEMVIEW(&memviewslice, 1)
15219 *
15220*/
15221 __pyx_v_result->from_slice = __pyx_v_memviewslice;
15222
15223 /* "View.MemoryView":1013
15224 *
15225 * result.from_slice = memviewslice
15226 * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
15227 *
15228 * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15229*/
15230 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15231
15232 /* "View.MemoryView":1015
15233 * __PYX_INC_MEMVIEW(&memviewslice, 1)
15234 *
15235 * result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
15236 * result.typeinfo = memviewslice.memview.typeinfo
15237 *
15238*/
15239 __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
15240 __Pyx_GOTREF(__pyx_t_2);
15241 __Pyx_GIVEREF(__pyx_t_2);
15242 __Pyx_GOTREF(__pyx_v_result->from_object);
15243 __Pyx_DECREF(__pyx_v_result->from_object);
15244 __pyx_v_result->from_object = __pyx_t_2;
15245 __pyx_t_2 = 0;
15246
15247 /* "View.MemoryView":1016
15248 *
15249 * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15250 * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
15251 *
15252 * result.view = memviewslice.memview.view
15253*/
15254 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15255
15256 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15257
15258 /* "View.MemoryView":1018
15259 * result.typeinfo = memviewslice.memview.typeinfo
15260 *
15261 * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
15262 * result.view.buf = <void *> memviewslice.data
15263 * result.view.ndim = ndim
15264*/
15265 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15266
15267 __pyx_v_result->__pyx_base.view = __pyx_t_5;
15268
15269 /* "View.MemoryView":1019
15270 *
15271 * result.view = memviewslice.memview.view
15272 * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
15273 * result.view.ndim = ndim
15274 * (<__pyx_buffer *> &result.view).obj = Py_None
15275*/
15276 __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
15277
15278 /* "View.MemoryView":1020
15279 * result.view = memviewslice.memview.view
15280 * result.view.buf = <void *> memviewslice.data
15281 * result.view.ndim = ndim # <<<<<<<<<<<<<<
15282 * (<__pyx_buffer *> &result.view).obj = Py_None
15283 * Py_INCREF(Py_None)
15284*/
15285 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15286
15287 /* "View.MemoryView":1021
15288 * result.view.buf = <void *> memviewslice.data
15289 * result.view.ndim = ndim
15290 * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
15291 * Py_INCREF(Py_None)
15292 *
15293*/
15294 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15295
15296 /* "View.MemoryView":1022
15297 * result.view.ndim = ndim
15298 * (<__pyx_buffer *> &result.view).obj = Py_None
15299 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
15300 *
15301 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15302*/
15303 Py_INCREF(Py_None);
15304
15305 /* "View.MemoryView":1024
15306 * Py_INCREF(Py_None)
15307 *
15308 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15309 * result.flags = PyBUF_RECORDS
15310 * else:
15311*/
15312 __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15313
15314 if (__pyx_t_1) {
15315
15316
15317 /* "View.MemoryView":1025
15318 *
15319 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15320 * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
15321 * else:
15322 * result.flags = PyBUF_RECORDS_RO
15323*/
15324 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15325
15326 /* "View.MemoryView":1024
15327 * Py_INCREF(Py_None)
15328 *
15329 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15330 * result.flags = PyBUF_RECORDS
15331 * else:
15332*/
15333 goto __pyx_L4;
15334 }
15335
15336 /* "View.MemoryView":1027
15337 * result.flags = PyBUF_RECORDS
15338 * else:
15339 * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
15340 *
15341 * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15342*/
15343 /*else*/ {
15344 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15345 }
15346 __pyx_L4:;
15347
15348 /* "View.MemoryView":1029
15349 * result.flags = PyBUF_RECORDS_RO
15350 *
15351 * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
15352 * result.view.strides = <Py_ssize_t *> result.from_slice.strides
15353 *
15354*/
15355 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15356
15357 /* "View.MemoryView":1030
15358 *
15359 * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15360 * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
15361 *
15362 *
15363*/
15364 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15365
15366 /* "View.MemoryView":1033
15367 *
15368 *
15369 * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
15370 * for suboffset in result.from_slice.suboffsets[:ndim]:
15371 * if suboffset >= 0:
15372*/
15373 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15374
15375 /* "View.MemoryView":1034
15376 *
15377 * result.view.suboffsets = NULL
15378 * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
15379 * if suboffset >= 0:
15380 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15381*/
15382 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15383
15384 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15385 __pyx_t_6 = __pyx_t_8;
15386 __pyx_v_suboffset = (__pyx_t_6[0]);
15387
15388 /* "View.MemoryView":1035
15389 * result.view.suboffsets = NULL
15390 * for suboffset in result.from_slice.suboffsets[:ndim]:
15391 * if suboffset >= 0: # <<<<<<<<<<<<<<
15392 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15393 * break
15394*/
15395 __pyx_t_1 = (__pyx_v_suboffset >= 0);
15396
15397 if (__pyx_t_1) {
15398
15399
15400 /* "View.MemoryView":1036
15401 * for suboffset in result.from_slice.suboffsets[:ndim]:
15402 * if suboffset >= 0:
15403 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
15404 * break
15405 *
15406*/
15407 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15408
15409 /* "View.MemoryView":1037
15410 * if suboffset >= 0:
15411 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15412 * break # <<<<<<<<<<<<<<
15413 *
15414 * cdef Py_ssize_t length
15415*/
15416 goto __pyx_L6_break;
15417
15418 /* "View.MemoryView":1035
15419 * result.view.suboffsets = NULL
15420 * for suboffset in result.from_slice.suboffsets[:ndim]:
15421 * if suboffset >= 0: # <<<<<<<<<<<<<<
15422 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15423 * break
15424*/
15425 }
15426 }
15427 __pyx_L6_break:;
15428
15429
15430 /* "View.MemoryView":1040
15431 *
15432 * cdef Py_ssize_t length
15433 * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
15434 * for length in result.view.shape[:ndim]:
15435 * result.view.len *= length
15436*/
15437 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15438
15439 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15440
15441 /* "View.MemoryView":1041
15442 * cdef Py_ssize_t length
15443 * result.view.len = result.view.itemsize
15444 * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
15445 * result.view.len *= length
15446 *
15447*/
15448 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15449
15450 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15451 __pyx_t_6 = __pyx_t_8;
15452 __pyx_v_length = (__pyx_t_6[0]);
15453
15454 /* "View.MemoryView":1042
15455 * result.view.len = result.view.itemsize
15456 * for length in result.view.shape[:ndim]:
15457 * result.view.len *= length # <<<<<<<<<<<<<<
15458 *
15459 * result.to_object_func = to_object_func
15460*/
15461 __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * __pyx_v_length);
15462 }
15463
15464
15465 /* "View.MemoryView":1044
15466 * result.view.len *= length
15467 *
15468 * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
15469 * result.to_dtype_func = to_dtype_func
15470 *
15471*/
15472 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15473
15474 /* "View.MemoryView":1045
15475 *
15476 * result.to_object_func = to_object_func
15477 * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
15478 *
15479 * return result
15480*/
15481 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15482
15483 /* "View.MemoryView":1047
15484 * result.to_dtype_func = to_dtype_func
15485 *
15486 * return result # <<<<<<<<<<<<<<
15487 *
15488 * @cname('__pyx_memoryview_get_slice_from_memoryview')
15489*/
15490 {
15491 PyObject *__pyx_temp;
15492 {
15493 __pyx_temp = __pyx_r;
15494 __Pyx_INCREF((PyObject *)__pyx_v_result);
15495 __pyx_r = ((PyObject *)__pyx_v_result);
15496 }
15497 __Pyx_XDECREF(__pyx_temp);
15498 }
15499 goto __pyx_L0;
15500
15501 /* "View.MemoryView":995
15502 * pass # ignore failure, it's a minor issue
15503 *
15504 * @cname('__pyx_memoryview_fromslice') # <<<<<<<<<<<<<<
15505 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
15506 * int ndim,
15507*/
15508
15509 /* function exit code */
15510 __pyx_L1_error:;
15511 __Pyx_XDECREF(__pyx_t_2);
15512 __Pyx_XDECREF(__pyx_t_3);
15513 __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15514 __pyx_r = 0;
15515 __pyx_L0:;
15516 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15517
15518
15519 __Pyx_XGIVEREF(__pyx_r);
15520 __Pyx_RefNannyFinishContext();
15521 return __pyx_r;
15522}
15523
15524/* "View.MemoryView":1049
15525 * return result
15526 *
15527 * @cname('__pyx_memoryview_get_slice_from_memoryview') # <<<<<<<<<<<<<<
15528 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
15529 * __Pyx_memviewslice *mslice) except NULL:
15530*/
15531
15532static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15533 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15534 __Pyx_memviewslice *__pyx_r;
15535 __Pyx_RefNannyDeclarations
15536 int __pyx_t_1;
15537 PyObject *__pyx_t_2 = NULL;
15538 int __pyx_lineno = 0;
15539 const char *__pyx_filename = NULL;
15540 int __pyx_clineno = 0;
15541 __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
15542
15543 /* "View.MemoryView":1053
15544 * __Pyx_memviewslice *mslice) except NULL:
15545 * cdef _memoryviewslice obj
15546 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15547 * obj = memview
15548 * return &obj.from_slice
15549*/
15550 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15551 if (__pyx_t_1) {
15552
15553
15554 /* "View.MemoryView":1054
15555 * cdef _memoryviewslice obj
15556 * if isinstance(memview, _memoryviewslice):
15557 * obj = memview # <<<<<<<<<<<<<<
15558 * return &obj.from_slice
15559 * else:
15560*/
15561 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
15562 __Pyx_INCREF(__pyx_t_2);
15563 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 1054, __pyx_L1_error)
15564 __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15565 __pyx_t_2 = 0;
15566
15567 /* "View.MemoryView":1055
15568 * if isinstance(memview, _memoryviewslice):
15569 * obj = memview
15570 * return &obj.from_slice # <<<<<<<<<<<<<<
15571 * else:
15572 * slice_copy(memview, mslice)
15573*/
15574 {
15575
15576 __pyx_r = (&__pyx_v_obj->from_slice);
15577 }
15578 goto __pyx_L0;
15579
15580 /* "View.MemoryView":1053
15581 * __Pyx_memviewslice *mslice) except NULL:
15582 * cdef _memoryviewslice obj
15583 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15584 * obj = memview
15585 * return &obj.from_slice
15586*/
15587 }
15588
15589 /* "View.MemoryView":1057
15590 * return &obj.from_slice
15591 * else:
15592 * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
15593 * return mslice
15594 *
15595*/
15596 /*else*/ {
15597 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15598
15599 /* "View.MemoryView":1058
15600 * else:
15601 * slice_copy(memview, mslice)
15602 * return mslice # <<<<<<<<<<<<<<
15603 *
15604 * @cname('__pyx_memoryview_slice_copy')
15605*/
15606 {
15607
15608 __pyx_r = __pyx_v_mslice;
15609 }
15610 goto __pyx_L0;
15611 }
15612
15613 /* "View.MemoryView":1049
15614 * return result
15615 *
15616 * @cname('__pyx_memoryview_get_slice_from_memoryview') # <<<<<<<<<<<<<<
15617 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
15618 * __Pyx_memviewslice *mslice) except NULL:
15619*/
15620
15621 /* function exit code */
15622 __pyx_L1_error:;
15623 __Pyx_XDECREF(__pyx_t_2);
15624 __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15625 __pyx_r = NULL;
15626 __pyx_L0:;
15627 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15628
15629 __Pyx_RefNannyFinishContext();
15630 return __pyx_r;
15631}
15632
15633/* "View.MemoryView":1060
15634 * return mslice
15635 *
15636 * @cname('__pyx_memoryview_slice_copy') # <<<<<<<<<<<<<<
15637 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
15638 * cdef int dim
15639*/
15640
15641static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15642 int __pyx_v_dim;
15643 Py_ssize_t *__pyx_v_shape;
15644 Py_ssize_t *__pyx_v_strides;
15645 Py_ssize_t *__pyx_v_suboffsets;
15646 Py_ssize_t *__pyx_t_1;
15647 int __pyx_t_2;
15648 int __pyx_t_3;
15649 int __pyx_t_4;
15650 Py_ssize_t __pyx_t_5;
15651 int __pyx_t_6;
15652
15653 /* "View.MemoryView":1065
15654 * cdef (Py_ssize_t*) shape, strides, suboffsets
15655 *
15656 * shape = memview.view.shape # <<<<<<<<<<<<<<
15657 * strides = memview.view.strides
15658 * suboffsets = memview.view.suboffsets
15659*/
15660 __pyx_t_1 = __pyx_v_memview->view.shape;
15661
15662 __pyx_v_shape = __pyx_t_1;
15663
15664 /* "View.MemoryView":1066
15665 *
15666 * shape = memview.view.shape
15667 * strides = memview.view.strides # <<<<<<<<<<<<<<
15668 * suboffsets = memview.view.suboffsets
15669 *
15670*/
15671 __pyx_t_1 = __pyx_v_memview->view.strides;
15672
15673 __pyx_v_strides = __pyx_t_1;
15674
15675 /* "View.MemoryView":1067
15676 * shape = memview.view.shape
15677 * strides = memview.view.strides
15678 * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
15679 *
15680 * dst.memview = <__pyx_memoryview *> memview
15681*/
15682 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15683
15684 __pyx_v_suboffsets = __pyx_t_1;
15685
15686 /* "View.MemoryView":1069
15687 * suboffsets = memview.view.suboffsets
15688 *
15689 * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
15690 * dst.data = <char *> memview.view.buf
15691 *
15692*/
15693 __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
15694
15695 /* "View.MemoryView":1070
15696 *
15697 * dst.memview = <__pyx_memoryview *> memview
15698 * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
15699 *
15700 * for dim in range(memview.view.ndim):
15701*/
15702 __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
15703
15704 /* "View.MemoryView":1072
15705 * dst.data = <char *> memview.view.buf
15706 *
15707 * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
15708 * dst.shape[dim] = shape[dim]
15709 * dst.strides[dim] = strides[dim]
15710*/
15711
15712 __pyx_t_2 = __pyx_v_memview->view.ndim;
15713 __pyx_t_3 = __pyx_t_2;
15714
15715 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15716 __pyx_v_dim = __pyx_t_4;
15717
15718 /* "View.MemoryView":1073
15719 *
15720 * for dim in range(memview.view.ndim):
15721 * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
15722 * dst.strides[dim] = strides[dim]
15723 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15724*/
15725 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15726
15727 /* "View.MemoryView":1074
15728 * for dim in range(memview.view.ndim):
15729 * dst.shape[dim] = shape[dim]
15730 * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
15731 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15732 *
15733*/
15734 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15735
15736 /* "View.MemoryView":1075
15737 * dst.shape[dim] = shape[dim]
15738 * dst.strides[dim] = strides[dim]
15739 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
15740 *
15741 * @cname('__pyx_memoryview_copy_object')
15742*/
15743 __pyx_t_6 = (__pyx_v_suboffsets != 0);
15744
15745 if (__pyx_t_6) {
15746
15747 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15748 } else {
15749
15750 __pyx_t_5 = -1L;
15751 }
15752
15753 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15754
15755 }
15756
15757
15758 /* "View.MemoryView":1060
15759 * return mslice
15760 *
15761 * @cname('__pyx_memoryview_slice_copy') # <<<<<<<<<<<<<<
15762 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
15763 * cdef int dim
15764*/
15765
15766 /* function exit code */
15767
15768
15769
15770
15771
15772}
15773
15774/* "View.MemoryView":1077
15775 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15776 *
15777 * @cname('__pyx_memoryview_copy_object') # <<<<<<<<<<<<<<
15778 * cdef memoryview_copy(memoryview memview):
15779 * "Create a new memoryview object"
15780*/
15781
15782static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
15783 __Pyx_memviewslice __pyx_v_memviewslice;
15784 PyObject *__pyx_r = NULL;
15785 __Pyx_RefNannyDeclarations
15786 PyObject *__pyx_t_1 = NULL;
15787 int __pyx_lineno = 0;
15788 const char *__pyx_filename = NULL;
15789 int __pyx_clineno = 0;
15790 __Pyx_RefNannySetupContext("memoryview_copy", 0);
15791
15792 /* "View.MemoryView":1081
15793 * "Create a new memoryview object"
15794 * cdef __Pyx_memviewslice memviewslice
15795 * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
15796 * return memoryview_copy_from_slice(memview, &memviewslice)
15797 *
15798*/
15799 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15800
15801 /* "View.MemoryView":1082
15802 * cdef __Pyx_memviewslice memviewslice
15803 * slice_copy(memview, &memviewslice)
15804 * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
15805 *
15806 * @cname('__pyx_memoryview_copy_object_from_slice')
15807*/
15808 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1082, __pyx_L1_error)
15809 __Pyx_GOTREF(__pyx_t_1);
15810 {
15811 PyObject *__pyx_temp;
15812 {
15813 __pyx_temp = __pyx_r;
15814 __pyx_r = __pyx_t_1;
15815 }
15816 __Pyx_XDECREF(__pyx_temp);
15817 }
15818 __pyx_t_1 = 0;
15819 goto __pyx_L0;
15820
15821 /* "View.MemoryView":1077
15822 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15823 *
15824 * @cname('__pyx_memoryview_copy_object') # <<<<<<<<<<<<<<
15825 * cdef memoryview_copy(memoryview memview):
15826 * "Create a new memoryview object"
15827*/
15828
15829 /* function exit code */
15830 __pyx_L1_error:;
15831 __Pyx_XDECREF(__pyx_t_1);
15832 __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15833 __pyx_r = 0;
15834 __pyx_L0:;
15835
15836 __Pyx_XGIVEREF(__pyx_r);
15837 __Pyx_RefNannyFinishContext();
15838 return __pyx_r;
15839}
15840
15841/* "View.MemoryView":1084
15842 * return memoryview_copy_from_slice(memview, &memviewslice)
15843 *
15844 * @cname('__pyx_memoryview_copy_object_from_slice') # <<<<<<<<<<<<<<
15845 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
15846 * """
15847*/
15848
15849static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15850 PyObject *(*__pyx_v_to_object_func)(char *);
15851 __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func;
15852 PyObject *__pyx_r = NULL;
15853 __Pyx_RefNannyDeclarations
15854 int __pyx_t_1;
15855 PyObject *(*__pyx_t_2)(char *);
15856 __pyx_memoryview_to_dtype_func_type __pyx_t_3;
15857 PyObject *__pyx_t_4 = NULL;
15858 int __pyx_lineno = 0;
15859 const char *__pyx_filename = NULL;
15860 int __pyx_clineno = 0;
15861 __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
15862
15863 /* "View.MemoryView":1092
15864 * cdef to_dtype_func_type to_dtype_func
15865 *
15866 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15867 * to_object_func = (<_memoryviewslice> memview).to_object_func
15868 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15869*/
15870 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15871 if (__pyx_t_1) {
15872
15873
15874 /* "View.MemoryView":1093
15875 *
15876 * if isinstance(memview, _memoryviewslice):
15877 * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
15878 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15879 * else:
15880*/
15881 __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15882
15883 __pyx_v_to_object_func = __pyx_t_2;
15884
15885 /* "View.MemoryView":1094
15886 * if isinstance(memview, _memoryviewslice):
15887 * to_object_func = (<_memoryviewslice> memview).to_object_func
15888 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
15889 * else:
15890 * to_object_func = NULL
15891*/
15892 __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15893
15894 __pyx_v_to_dtype_func = __pyx_t_3;
15895
15896 /* "View.MemoryView":1092
15897 * cdef to_dtype_func_type to_dtype_func
15898 *
15899 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15900 * to_object_func = (<_memoryviewslice> memview).to_object_func
15901 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15902*/
15903 goto __pyx_L3;
15904 }
15905
15906 /* "View.MemoryView":1096
15907 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15908 * else:
15909 * to_object_func = NULL # <<<<<<<<<<<<<<
15910 * to_dtype_func = NULL
15911 *
15912*/
15913 /*else*/ {
15914 __pyx_v_to_object_func = NULL;
15915
15916 /* "View.MemoryView":1097
15917 * else:
15918 * to_object_func = NULL
15919 * to_dtype_func = NULL # <<<<<<<<<<<<<<
15920 *
15921 * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15922*/
15923 __pyx_v_to_dtype_func = NULL;
15924 }
15925 __pyx_L3:;
15926
15927 /* "View.MemoryView":1099
15928 * to_dtype_func = NULL
15929 *
15930 * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
15931 * to_object_func, to_dtype_func,
15932 * memview.dtype_is_object)
15933*/
15934 __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1099, __pyx_L1_error)
15935 __Pyx_GOTREF(__pyx_t_4);
15936 {
15937 PyObject *__pyx_temp;
15938 {
15939 __pyx_temp = __pyx_r;
15940 __pyx_r = __pyx_t_4;
15941 }
15942 __Pyx_XDECREF(__pyx_temp);
15943 }
15944 __pyx_t_4 = 0;
15945 goto __pyx_L0;
15946
15947 /* "View.MemoryView":1084
15948 * return memoryview_copy_from_slice(memview, &memviewslice)
15949 *
15950 * @cname('__pyx_memoryview_copy_object_from_slice') # <<<<<<<<<<<<<<
15951 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
15952 * """
15953*/
15954
15955 /* function exit code */
15956 __pyx_L1_error:;
15957 __Pyx_XDECREF(__pyx_t_4);
15958 __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15959 __pyx_r = 0;
15960 __pyx_L0:;
15961
15962
15963 __Pyx_XGIVEREF(__pyx_r);
15964 __Pyx_RefNannyFinishContext();
15965 return __pyx_r;
15966}
15967
15968/* "View.MemoryView":1107
15969 *
15970 *
15971 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15972 * return -arg if arg < 0 else arg
15973 *
15974*/
15975
15976static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
15977 Py_ssize_t __pyx_r;
15978 Py_ssize_t __pyx_t_1;
15979 int __pyx_t_2;
15980
15981 /* "View.MemoryView":1108
15982 *
15983 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
15984 * return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
15985 *
15986 * @cname('__pyx_get_best_slice_order')
15987*/
15988 __pyx_t_2 = (__pyx_v_arg < 0);
15989
15990 if (__pyx_t_2) {
15991
15992 __pyx_t_1 = (-__pyx_v_arg);
15993 } else {
15994
15995 __pyx_t_1 = __pyx_v_arg;
15996 }
15997
15998 {
15999 __pyx_r = __pyx_t_1;
16000 }
16001 goto __pyx_L0;
16002
16003 /* "View.MemoryView":1107
16004 *
16005 *
16006 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
16007 * return -arg if arg < 0 else arg
16008 *
16009*/
16010
16011 /* function exit code */
16012 __pyx_L0:;
16013 return __pyx_r;
16014}
16015
16016/* "View.MemoryView":1110
16017 * return -arg if arg < 0 else arg
16018 *
16019 * @cname('__pyx_get_best_slice_order') # <<<<<<<<<<<<<<
16020 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
16021 * """
16022*/
16023
16024static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
16025 int __pyx_v_i;
16026 Py_ssize_t __pyx_v_c_stride;
16027 Py_ssize_t __pyx_v_f_stride;
16028 char __pyx_r;
16029 int __pyx_t_1;
16030 int __pyx_t_2;
16031 int __pyx_t_3;
16032 int __pyx_t_4;
16033
16034 /* "View.MemoryView":1116
16035 * """
16036 * cdef int i
16037 * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
16038 * cdef Py_ssize_t f_stride = 0
16039 *
16040*/
16041 __pyx_v_c_stride = 0;
16042
16043 /* "View.MemoryView":1117
16044 * cdef int i
16045 * cdef Py_ssize_t c_stride = 0
16046 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
16047 *
16048 * for i in range(ndim - 1, -1, -1):
16049*/
16050 __pyx_v_f_stride = 0;
16051
16052 /* "View.MemoryView":1119
16053 * cdef Py_ssize_t f_stride = 0
16054 *
16055 * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16056 * if mslice.shape[i] > 1:
16057 * c_stride = mslice.strides[i]
16058*/
16059 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
16060 __pyx_v_i = __pyx_t_1;
16061
16062 /* "View.MemoryView":1120
16063 *
16064 * for i in range(ndim - 1, -1, -1):
16065 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16066 * c_stride = mslice.strides[i]
16067 * break
16068*/
16069 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16070
16071 if (__pyx_t_2) {
16072
16073
16074 /* "View.MemoryView":1121
16075 * for i in range(ndim - 1, -1, -1):
16076 * if mslice.shape[i] > 1:
16077 * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
16078 * break
16079 *
16080*/
16081 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16082
16083 /* "View.MemoryView":1122
16084 * if mslice.shape[i] > 1:
16085 * c_stride = mslice.strides[i]
16086 * break # <<<<<<<<<<<<<<
16087 *
16088 * for i in range(ndim):
16089*/
16090 goto __pyx_L4_break;
16091
16092 /* "View.MemoryView":1120
16093 *
16094 * for i in range(ndim - 1, -1, -1):
16095 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16096 * c_stride = mslice.strides[i]
16097 * break
16098*/
16099 }
16100 }
16101 __pyx_L4_break:;
16102
16103 /* "View.MemoryView":1124
16104 * break
16105 *
16106 * for i in range(ndim): # <<<<<<<<<<<<<<
16107 * if mslice.shape[i] > 1:
16108 * f_stride = mslice.strides[i]
16109*/
16110
16111 __pyx_t_1 = __pyx_v_ndim;
16112 __pyx_t_3 = __pyx_t_1;
16113
16114 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16115 __pyx_v_i = __pyx_t_4;
16116
16117 /* "View.MemoryView":1125
16118 *
16119 * for i in range(ndim):
16120 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16121 * f_stride = mslice.strides[i]
16122 * break
16123*/
16124 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16125
16126 if (__pyx_t_2) {
16127
16128
16129 /* "View.MemoryView":1126
16130 * for i in range(ndim):
16131 * if mslice.shape[i] > 1:
16132 * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
16133 * break
16134 *
16135*/
16136 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16137
16138 /* "View.MemoryView":1127
16139 * if mslice.shape[i] > 1:
16140 * f_stride = mslice.strides[i]
16141 * break # <<<<<<<<<<<<<<
16142 *
16143 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16144*/
16145 goto __pyx_L7_break;
16146
16147 /* "View.MemoryView":1125
16148 *
16149 * for i in range(ndim):
16150 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16151 * f_stride = mslice.strides[i]
16152 * break
16153*/
16154 }
16155 }
16156 __pyx_L7_break:;
16157
16158
16159 /* "View.MemoryView":1129
16160 * break
16161 *
16162 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16163 * return 'C'
16164 * else:
16165*/
16166 __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
16167
16168 if (__pyx_t_2) {
16169
16170
16171 /* "View.MemoryView":1130
16172 *
16173 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16174 * return 'C' # <<<<<<<<<<<<<<
16175 * else:
16176 * return 'F'
16177*/
16178 {
16179
16180 __pyx_r = 'C';
16181 }
16182 goto __pyx_L0;
16183
16184 /* "View.MemoryView":1129
16185 * break
16186 *
16187 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16188 * return 'C'
16189 * else:
16190*/
16191 }
16192
16193 /* "View.MemoryView":1132
16194 * return 'C'
16195 * else:
16196 * return 'F' # <<<<<<<<<<<<<<
16197 *
16198 * @cython.cdivision(True)
16199*/
16200 /*else*/ {
16201 {
16202
16203 __pyx_r = 'F';
16204 }
16205 goto __pyx_L0;
16206 }
16207
16208 /* "View.MemoryView":1110
16209 * return -arg if arg < 0 else arg
16210 *
16211 * @cname('__pyx_get_best_slice_order') # <<<<<<<<<<<<<<
16212 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
16213 * """
16214*/
16215
16216 /* function exit code */
16217 __pyx_L0:;
16218
16219
16220
16221 return __pyx_r;
16222}
16223
16224/* "View.MemoryView":1134
16225 * return 'F'
16226 *
16227 * @cython.cdivision(True) # <<<<<<<<<<<<<<
16228 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
16229 * char *dst_data, Py_ssize_t *dst_strides,
16230*/
16231
16232static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16233 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16234 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16235 Py_ssize_t __pyx_v_dst_extent;
16236 Py_ssize_t __pyx_v_src_stride;
16237 Py_ssize_t __pyx_v_dst_stride;
16238 int __pyx_t_1;
16239 int __pyx_t_2;
16240 Py_ssize_t __pyx_t_3;
16241 Py_ssize_t __pyx_t_4;
16242 Py_ssize_t __pyx_t_5;
16243
16244
16245
16246 /* "View.MemoryView":1142
16247 *
16248 * cdef Py_ssize_t i
16249 * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
16250 * cdef Py_ssize_t dst_extent = dst_shape[0]
16251 * cdef Py_ssize_t src_stride = src_strides[0]
16252*/
16253 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16254
16255 /* "View.MemoryView":1143
16256 * cdef Py_ssize_t i
16257 * cdef Py_ssize_t src_extent = src_shape[0]
16258 * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
16259 * cdef Py_ssize_t src_stride = src_strides[0]
16260 * cdef Py_ssize_t dst_stride = dst_strides[0]
16261*/
16262 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16263
16264 /* "View.MemoryView":1144
16265 * cdef Py_ssize_t src_extent = src_shape[0]
16266 * cdef Py_ssize_t dst_extent = dst_shape[0]
16267 * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
16268 * cdef Py_ssize_t dst_stride = dst_strides[0]
16269 *
16270*/
16271 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16272
16273 /* "View.MemoryView":1145
16274 * cdef Py_ssize_t dst_extent = dst_shape[0]
16275 * cdef Py_ssize_t src_stride = src_strides[0]
16276 * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
16277 *
16278 * if ndim == 1:
16279*/
16280 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16281
16282 /* "View.MemoryView":1147
16283 * cdef Py_ssize_t dst_stride = dst_strides[0]
16284 *
16285 * if ndim == 1: # <<<<<<<<<<<<<<
16286 * if (src_stride > 0 and dst_stride > 0 and
16287 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16288*/
16289 __pyx_t_1 = (__pyx_v_ndim == 1);
16290
16291 if (__pyx_t_1) {
16292
16293
16294 /* "View.MemoryView":1148
16295 *
16296 * if ndim == 1:
16297 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16298 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16299 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16300*/
16301 __pyx_t_2 = (__pyx_v_src_stride > 0);
16302
16303 if (__pyx_t_2) {
16304
16305 } else {
16306
16307 __pyx_t_1 = __pyx_t_2;
16308
16309 goto __pyx_L5_bool_binop_done;
16310 }
16311 __pyx_t_2 = (__pyx_v_dst_stride > 0);
16312
16313 if (__pyx_t_2) {
16314
16315 } else {
16316
16317 __pyx_t_1 = __pyx_t_2;
16318
16319 goto __pyx_L5_bool_binop_done;
16320 }
16321
16322 /* "View.MemoryView":1149
16323 * if ndim == 1:
16324 * if (src_stride > 0 and dst_stride > 0 and
16325 * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
16326 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16327 * else:
16328*/
16329 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16330 if (__pyx_t_2) {
16331 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16332 }
16333
16334 __pyx_t_1 = __pyx_t_2;
16335
16336 __pyx_L5_bool_binop_done:;
16337
16338 /* "View.MemoryView":1148
16339 *
16340 * if ndim == 1:
16341 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16342 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16343 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16344*/
16345 if (__pyx_t_1) {
16346
16347
16348 /* "View.MemoryView":1150
16349 * if (src_stride > 0 and dst_stride > 0 and
16350 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16351 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent) # <<<<<<<<<<<<<<
16352 * else:
16353 * for i in range(dst_extent):
16354*/
16355 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * ((size_t)__pyx_v_dst_extent))));
16356
16357 /* "View.MemoryView":1148
16358 *
16359 * if ndim == 1:
16360 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16361 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16362 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16363*/
16364 goto __pyx_L4;
16365 }
16366
16367 /* "View.MemoryView":1152
16368 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16369 * else:
16370 * for i in range(dst_extent): # <<<<<<<<<<<<<<
16371 * memcpy(dst_data, src_data, itemsize)
16372 * src_data += src_stride
16373*/
16374 /*else*/ {
16375
16376 __pyx_t_3 = __pyx_v_dst_extent;
16377 __pyx_t_4 = __pyx_t_3;
16378
16379 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16380 __pyx_v_i = __pyx_t_5;
16381
16382 /* "View.MemoryView":1153
16383 * else:
16384 * for i in range(dst_extent):
16385 * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
16386 * src_data += src_stride
16387 * dst_data += dst_stride
16388*/
16389 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16390
16391 /* "View.MemoryView":1154
16392 * for i in range(dst_extent):
16393 * memcpy(dst_data, src_data, itemsize)
16394 * src_data += src_stride # <<<<<<<<<<<<<<
16395 * dst_data += dst_stride
16396 * else:
16397*/
16398 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16399
16400 /* "View.MemoryView":1155
16401 * memcpy(dst_data, src_data, itemsize)
16402 * src_data += src_stride
16403 * dst_data += dst_stride # <<<<<<<<<<<<<<
16404 * else:
16405 * for i in range(dst_extent):
16406*/
16407 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16408 }
16409
16410 }
16411 __pyx_L4:;
16412
16413 /* "View.MemoryView":1147
16414 * cdef Py_ssize_t dst_stride = dst_strides[0]
16415 *
16416 * if ndim == 1: # <<<<<<<<<<<<<<
16417 * if (src_stride > 0 and dst_stride > 0 and
16418 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16419*/
16420 goto __pyx_L3;
16421 }
16422
16423 /* "View.MemoryView":1157
16424 * dst_data += dst_stride
16425 * else:
16426 * for i in range(dst_extent): # <<<<<<<<<<<<<<
16427 * _copy_strided_to_strided(src_data, src_strides + 1,
16428 * dst_data, dst_strides + 1,
16429*/
16430 /*else*/ {
16431
16432 __pyx_t_3 = __pyx_v_dst_extent;
16433 __pyx_t_4 = __pyx_t_3;
16434
16435 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16436 __pyx_v_i = __pyx_t_5;
16437
16438 /* "View.MemoryView":1158
16439 * else:
16440 * for i in range(dst_extent):
16441 * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
16442 * dst_data, dst_strides + 1,
16443 * src_shape + 1, dst_shape + 1,
16444*/
16445 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
16446
16447 /* "View.MemoryView":1162
16448 * src_shape + 1, dst_shape + 1,
16449 * ndim - 1, itemsize)
16450 * src_data += src_stride # <<<<<<<<<<<<<<
16451 * dst_data += dst_stride
16452 *
16453*/
16454 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16455
16456 /* "View.MemoryView":1163
16457 * ndim - 1, itemsize)
16458 * src_data += src_stride
16459 * dst_data += dst_stride # <<<<<<<<<<<<<<
16460 *
16461 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
16462*/
16463 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16464 }
16465
16466 }
16467 __pyx_L3:;
16468
16469 /* "View.MemoryView":1134
16470 * return 'F'
16471 *
16472 * @cython.cdivision(True) # <<<<<<<<<<<<<<
16473 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
16474 * char *dst_data, Py_ssize_t *dst_strides,
16475*/
16476
16477 /* function exit code */
16478
16479
16480
16481
16482
16483
16484
16485}
16486
16487/* "View.MemoryView":1165
16488 * dst_data += dst_stride
16489 *
16490 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16491 * __Pyx_memviewslice *dst,
16492 * int ndim, size_t itemsize) noexcept nogil:
16493*/
16494
16495static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16496
16497 /* "View.MemoryView":1168
16498 * __Pyx_memviewslice *dst,
16499 * int ndim, size_t itemsize) noexcept nogil:
16500 * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
16501 * src.shape, dst.shape, ndim, itemsize)
16502 *
16503*/
16504 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
16505
16506 /* "View.MemoryView":1165
16507 * dst_data += dst_stride
16508 *
16509 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16510 * __Pyx_memviewslice *dst,
16511 * int ndim, size_t itemsize) noexcept nogil:
16512*/
16513
16514 /* function exit code */
16515}
16516
16517/* "View.MemoryView":1171
16518 * src.shape, dst.shape, ndim, itemsize)
16519 *
16520 * @cname('__pyx_memoryview_slice_get_size') # <<<<<<<<<<<<<<
16521 * cdef size_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16522 * "Return the size of the memory occupied by the slice in number of bytes"
16523*/
16524
16525static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
16526 Py_ssize_t __pyx_v_shape;
16527 size_t __pyx_v_size;
16528 size_t __pyx_r;
16529 Py_ssize_t *__pyx_t_1;
16530 Py_ssize_t *__pyx_t_2;
16531 Py_ssize_t *__pyx_t_3;
16532
16533 /* "View.MemoryView":1175
16534 * "Return the size of the memory occupied by the slice in number of bytes"
16535 * cdef Py_ssize_t shape
16536 * cdef size_t size = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
16537 *
16538 * for shape in src.shape[:ndim]:
16539*/
16540 __pyx_v_size = ((size_t)__pyx_v_src->memview->view.itemsize);
16541
16542 /* "View.MemoryView":1177
16543 * cdef size_t size = <size_t> src.memview.view.itemsize
16544 *
16545 * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
16546 * size *= <size_t> shape
16547 *
16548*/
16549 __pyx_t_2 = (__pyx_v_src->shape + __pyx_v_ndim);
16550
16551 for (__pyx_t_3 = __pyx_v_src->shape; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16552 __pyx_t_1 = __pyx_t_3;
16553 __pyx_v_shape = (__pyx_t_1[0]);
16554
16555 /* "View.MemoryView":1178
16556 *
16557 * for shape in src.shape[:ndim]:
16558 * size *= <size_t> shape # <<<<<<<<<<<<<<
16559 *
16560 * return size
16561*/
16562 __pyx_v_size = (__pyx_v_size * ((size_t)__pyx_v_shape));
16563 }
16564
16565
16566 /* "View.MemoryView":1180
16567 * size *= <size_t> shape
16568 *
16569 * return size # <<<<<<<<<<<<<<
16570 *
16571 * @cname('__pyx_fill_contig_strides_array')
16572*/
16573 {
16574
16575 __pyx_r = __pyx_v_size;
16576 }
16577 goto __pyx_L0;
16578
16579 /* "View.MemoryView":1171
16580 * src.shape, dst.shape, ndim, itemsize)
16581 *
16582 * @cname('__pyx_memoryview_slice_get_size') # <<<<<<<<<<<<<<
16583 * cdef size_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16584 * "Return the size of the memory occupied by the slice in number of bytes"
16585*/
16586
16587 /* function exit code */
16588 __pyx_L0:;
16589
16590
16591 return __pyx_r;
16592}
16593
16594/* "View.MemoryView":1182
16595 * return size
16596 *
16597 * @cname('__pyx_fill_contig_strides_array') # <<<<<<<<<<<<<<
16598 * cdef Py_ssize_t fill_contig_strides_array(
16599 * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16600*/
16601
16602static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
16603 int __pyx_v_idx;
16604 Py_ssize_t __pyx_r;
16605 int __pyx_t_1;
16606 int __pyx_t_2;
16607 int __pyx_t_3;
16608 int __pyx_t_4;
16609
16610
16611 /* "View.MemoryView":1192
16612 * cdef int idx
16613 *
16614 * if order == 'F': # <<<<<<<<<<<<<<
16615 * for idx in range(ndim):
16616 * strides[idx] = stride
16617*/
16618 __pyx_t_1 = (__pyx_v_order == 'F');
16619
16620 if (__pyx_t_1) {
16621
16622
16623 /* "View.MemoryView":1193
16624 *
16625 * if order == 'F':
16626 * for idx in range(ndim): # <<<<<<<<<<<<<<
16627 * strides[idx] = stride
16628 * stride *= shape[idx]
16629*/
16630
16631 __pyx_t_2 = __pyx_v_ndim;
16632 __pyx_t_3 = __pyx_t_2;
16633
16634 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16635 __pyx_v_idx = __pyx_t_4;
16636
16637 /* "View.MemoryView":1194
16638 * if order == 'F':
16639 * for idx in range(ndim):
16640 * strides[idx] = stride # <<<<<<<<<<<<<<
16641 * stride *= shape[idx]
16642 * else:
16643*/
16644 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16645
16646 /* "View.MemoryView":1195
16647 * for idx in range(ndim):
16648 * strides[idx] = stride
16649 * stride *= shape[idx] # <<<<<<<<<<<<<<
16650 * else:
16651 * for idx in range(ndim - 1, -1, -1):
16652*/
16653 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16654 }
16655
16656
16657 /* "View.MemoryView":1192
16658 * cdef int idx
16659 *
16660 * if order == 'F': # <<<<<<<<<<<<<<
16661 * for idx in range(ndim):
16662 * strides[idx] = stride
16663*/
16664 goto __pyx_L3;
16665 }
16666
16667 /* "View.MemoryView":1197
16668 * stride *= shape[idx]
16669 * else:
16670 * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16671 * strides[idx] = stride
16672 * stride *= shape[idx]
16673*/
16674 /*else*/ {
16675 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16676 __pyx_v_idx = __pyx_t_2;
16677
16678 /* "View.MemoryView":1198
16679 * else:
16680 * for idx in range(ndim - 1, -1, -1):
16681 * strides[idx] = stride # <<<<<<<<<<<<<<
16682 * stride *= shape[idx]
16683 *
16684*/
16685 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16686
16687 /* "View.MemoryView":1199
16688 * for idx in range(ndim - 1, -1, -1):
16689 * strides[idx] = stride
16690 * stride *= shape[idx] # <<<<<<<<<<<<<<
16691 *
16692 * return stride
16693*/
16694 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16695 }
16696 }
16697 __pyx_L3:;
16698
16699 /* "View.MemoryView":1201
16700 * stride *= shape[idx]
16701 *
16702 * return stride # <<<<<<<<<<<<<<
16703 *
16704 * @cname('__pyx_memoryview_copy_data_to_temp')
16705*/
16706 {
16707
16708 __pyx_r = __pyx_v_stride;
16709 }
16710 goto __pyx_L0;
16711
16712 /* "View.MemoryView":1182
16713 * return size
16714 *
16715 * @cname('__pyx_fill_contig_strides_array') # <<<<<<<<<<<<<<
16716 * cdef Py_ssize_t fill_contig_strides_array(
16717 * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16718*/
16719
16720 /* function exit code */
16721 __pyx_L0:;
16722
16723
16724 return __pyx_r;
16725}
16726
16727/* "View.MemoryView":1203
16728 * return stride
16729 *
16730 * @cname('__pyx_memoryview_copy_data_to_temp') # <<<<<<<<<<<<<<
16731 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
16732 * __Pyx_memviewslice *tmpslice,
16733*/
16734
16735static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
16736 int __pyx_v_i;
16737 void *__pyx_v_result;
16738 size_t __pyx_v_itemsize;
16739 size_t __pyx_v_size;
16740 void *__pyx_r;
16741 int __pyx_t_1;
16742 int __pyx_t_2;
16743 struct __pyx_memoryview_obj *__pyx_t_3;
16744 int __pyx_t_4;
16745 int __pyx_t_5;
16746 int __pyx_lineno = 0;
16747 const char *__pyx_filename = NULL;
16748 int __pyx_clineno = 0;
16749 PyGILState_STATE __pyx_gilstate_save;
16750
16751 /* "View.MemoryView":1215
16752 * cdef void *result
16753 *
16754 * cdef size_t itemsize = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
16755 * cdef size_t size = slice_get_size(src, ndim)
16756 *
16757*/
16758 __pyx_v_itemsize = ((size_t)__pyx_v_src->memview->view.itemsize);
16759
16760 /* "View.MemoryView":1216
16761 *
16762 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
16763 * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
16764 *
16765 * result = malloc(size)
16766*/
16767 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16768
16769 /* "View.MemoryView":1218
16770 * cdef size_t size = slice_get_size(src, ndim)
16771 *
16772 * result = malloc(size) # <<<<<<<<<<<<<<
16773 * if cython.unlikely(not result):
16774 * _err_no_memory()
16775*/
16776 __pyx_v_result = malloc(__pyx_v_size);
16777
16778 /* "View.MemoryView":1219
16779 *
16780 * result = malloc(size)
16781 * if cython.unlikely(not result): # <<<<<<<<<<<<<<
16782 * _err_no_memory()
16783 *
16784*/
16785 __pyx_t_1 = (!(__pyx_v_result != 0));
16786
16787 if (unlikely(__pyx_t_1)) {
16788
16789
16790 /* "View.MemoryView":1220
16791 * result = malloc(size)
16792 * if cython.unlikely(not result):
16793 * _err_no_memory() # <<<<<<<<<<<<<<
16794 *
16795 *
16796*/
16797 __pyx_t_2 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
16798
16799
16800 /* "View.MemoryView":1219
16801 *
16802 * result = malloc(size)
16803 * if cython.unlikely(not result): # <<<<<<<<<<<<<<
16804 * _err_no_memory()
16805 *
16806*/
16807 }
16808
16809 /* "View.MemoryView":1223
16810 *
16811 *
16812 * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
16813 * tmpslice.memview = src.memview
16814 * for i in range(ndim):
16815*/
16816 __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
16817
16818 /* "View.MemoryView":1224
16819 *
16820 * tmpslice.data = <char *> result
16821 * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
16822 * for i in range(ndim):
16823 * tmpslice.shape[i] = src.shape[i]
16824*/
16825 __pyx_t_3 = __pyx_v_src->memview;
16826
16827 __pyx_v_tmpslice->memview = __pyx_t_3;
16828
16829 /* "View.MemoryView":1225
16830 * tmpslice.data = <char *> result
16831 * tmpslice.memview = src.memview
16832 * for i in range(ndim): # <<<<<<<<<<<<<<
16833 * tmpslice.shape[i] = src.shape[i]
16834 * tmpslice.suboffsets[i] = -1
16835*/
16836
16837 __pyx_t_2 = __pyx_v_ndim;
16838 __pyx_t_4 = __pyx_t_2;
16839
16840 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16841 __pyx_v_i = __pyx_t_5;
16842
16843 /* "View.MemoryView":1226
16844 * tmpslice.memview = src.memview
16845 * for i in range(ndim):
16846 * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
16847 * tmpslice.suboffsets[i] = -1
16848 *
16849*/
16850 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16851
16852 /* "View.MemoryView":1227
16853 * for i in range(ndim):
16854 * tmpslice.shape[i] = src.shape[i]
16855 * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
16856 *
16857 * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], <Py_ssize_t> itemsize, ndim, order)
16858*/
16859 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16860 }
16861
16862
16863 /* "View.MemoryView":1229
16864 * tmpslice.suboffsets[i] = -1
16865 *
16866 * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], <Py_ssize_t> itemsize, ndim, order) # <<<<<<<<<<<<<<
16867 *
16868 *
16869*/
16870 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), ((Py_ssize_t)__pyx_v_itemsize), __pyx_v_ndim, __pyx_v_order));
16871
16872 /* "View.MemoryView":1232
16873 *
16874 *
16875 * for i in range(ndim): # <<<<<<<<<<<<<<
16876 * if tmpslice.shape[i] == 1:
16877 * tmpslice.strides[i] = 0
16878*/
16879
16880 __pyx_t_2 = __pyx_v_ndim;
16881 __pyx_t_4 = __pyx_t_2;
16882
16883 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16884 __pyx_v_i = __pyx_t_5;
16885
16886 /* "View.MemoryView":1233
16887 *
16888 * for i in range(ndim):
16889 * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16890 * tmpslice.strides[i] = 0
16891 *
16892*/
16893 __pyx_t_1 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
16894
16895 if (__pyx_t_1) {
16896
16897
16898 /* "View.MemoryView":1234
16899 * for i in range(ndim):
16900 * if tmpslice.shape[i] == 1:
16901 * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
16902 *
16903 * if slice_is_contig(src[0], order, ndim):
16904*/
16905 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16906
16907 /* "View.MemoryView":1233
16908 *
16909 * for i in range(ndim):
16910 * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16911 * tmpslice.strides[i] = 0
16912 *
16913*/
16914 }
16915 }
16916
16917
16918 /* "View.MemoryView":1236
16919 * tmpslice.strides[i] = 0
16920 *
16921 * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16922 * memcpy(result, src.data, size)
16923 * else:
16924*/
16925 __pyx_t_1 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
16926
16927 if (__pyx_t_1) {
16928
16929
16930 /* "View.MemoryView":1237
16931 *
16932 * if slice_is_contig(src[0], order, ndim):
16933 * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
16934 * else:
16935 * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16936*/
16937 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16938
16939 /* "View.MemoryView":1236
16940 * tmpslice.strides[i] = 0
16941 *
16942 * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16943 * memcpy(result, src.data, size)
16944 * else:
16945*/
16946 goto __pyx_L9;
16947 }
16948
16949 /* "View.MemoryView":1239
16950 * memcpy(result, src.data, size)
16951 * else:
16952 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
16953 *
16954 * return result
16955*/
16956 /*else*/ {
16957 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
16958 }
16959 __pyx_L9:;
16960
16961 /* "View.MemoryView":1241
16962 * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16963 *
16964 * return result # <<<<<<<<<<<<<<
16965 *
16966 *
16967*/
16968 {
16969
16970 __pyx_r = __pyx_v_result;
16971 }
16972 goto __pyx_L0;
16973
16974 /* "View.MemoryView":1203
16975 * return stride
16976 *
16977 * @cname('__pyx_memoryview_copy_data_to_temp') # <<<<<<<<<<<<<<
16978 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
16979 * __Pyx_memviewslice *tmpslice,
16980*/
16981
16982 /* function exit code */
16983 __pyx_L1_error:;
16984 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16985 __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
16986 __pyx_r = NULL;
16987 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16988 __pyx_L0:;
16989
16990
16991
16992
16993 return __pyx_r;
16994}
16995
16996/* "View.MemoryView":1246
16997 *
16998 *
16999 * @cname('__pyx_memoryview_err_extents') # <<<<<<<<<<<<<<
17000 * cdef int _err_extents(int i, Py_ssize_t extent1,
17001 * Py_ssize_t extent2) except -1 with gil:
17002*/
17003
17004static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
17005 int __pyx_r;
17006 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17007
17008
17009
17010
17011 /* "View.MemoryView":1249
17012 * cdef int _err_extents(int i, Py_ssize_t extent1,
17013 * Py_ssize_t extent2) except -1 with gil:
17014 * PyErr_Format( # <<<<<<<<<<<<<<
17015 * PyExc_ValueError,
17016 * "got differing extents in dimension %d (got %zd and %zd)",
17017*/
17018 (void)(PyErr_Format(PyExc_ValueError, __pyx_k_got_differing_extents_in_dimensi, __pyx_v_i, __pyx_v_extent1, __pyx_v_extent2));
17019
17020 /* "View.MemoryView":1253
17021 * "got differing extents in dimension %d (got %zd and %zd)",
17022 * i, extent1, extent2)
17023 * return -1 # <<<<<<<<<<<<<<
17024 *
17025 * @cname('__pyx_memoryview_err_dim')
17026*/
17027 {
17028
17029 __pyx_r = -1;
17030 }
17031 goto __pyx_L0;
17032
17033 /* "View.MemoryView":1246
17034 *
17035 *
17036 * @cname('__pyx_memoryview_err_extents') # <<<<<<<<<<<<<<
17037 * cdef int _err_extents(int i, Py_ssize_t extent1,
17038 * Py_ssize_t extent2) except -1 with gil:
17039*/
17040
17041 /* function exit code */
17042 __pyx_L0:;
17043
17044
17045
17046
17047 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17048 return __pyx_r;
17049}
17050
17051/* "View.MemoryView":1255
17052 * return -1
17053 *
17054 * @cname('__pyx_memoryview_err_dim') # <<<<<<<<<<<<<<
17055 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
17056 * PyErr_Format(error, msg, dim)
17057*/
17058
17059static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char const *__pyx_v_msg, int __pyx_v_dim) {
17060 int __pyx_r;
17061 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17062
17063
17064
17065
17066 /* "View.MemoryView":1257
17067 * @cname('__pyx_memoryview_err_dim')
17068 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
17069 * PyErr_Format(error, msg, dim) # <<<<<<<<<<<<<<
17070 * return -1
17071 *
17072*/
17073 (void)(PyErr_Format(__pyx_v_error, __pyx_v_msg, __pyx_v_dim));
17074
17075 /* "View.MemoryView":1258
17076 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
17077 * PyErr_Format(error, msg, dim)
17078 * return -1 # <<<<<<<<<<<<<<
17079 *
17080 * @cname('__pyx_memoryview_err')
17081*/
17082 {
17083
17084 __pyx_r = -1;
17085 }
17086 goto __pyx_L0;
17087
17088 /* "View.MemoryView":1255
17089 * return -1
17090 *
17091 * @cname('__pyx_memoryview_err_dim') # <<<<<<<<<<<<<<
17092 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
17093 * PyErr_Format(error, msg, dim)
17094*/
17095
17096 /* function exit code */
17097 __pyx_L0:;
17098
17099
17100
17101
17102 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17103 return __pyx_r;
17104}
17105
17106/* "View.MemoryView":1260
17107 * return -1
17108 *
17109 * @cname('__pyx_memoryview_err') # <<<<<<<<<<<<<<
17110 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
17111 * PyErr_SetString(error, msg)
17112*/
17113
17114static int __pyx_memoryview_err(PyObject *__pyx_v_error, char const *__pyx_v_msg) {
17115 int __pyx_r;
17116 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17117
17118
17119
17120 /* "View.MemoryView":1262
17121 * @cname('__pyx_memoryview_err')
17122 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
17123 * PyErr_SetString(error, msg) # <<<<<<<<<<<<<<
17124 * return -1
17125 *
17126*/
17127 (void)(PyErr_SetString(__pyx_v_error, __pyx_v_msg));
17128
17129 /* "View.MemoryView":1263
17130 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
17131 * PyErr_SetString(error, msg)
17132 * return -1 # <<<<<<<<<<<<<<
17133 *
17134 * @cname('__pyx_memoryview_err_no_memory')
17135*/
17136 {
17137
17138 __pyx_r = -1;
17139 }
17140 goto __pyx_L0;
17141
17142 /* "View.MemoryView":1260
17143 * return -1
17144 *
17145 * @cname('__pyx_memoryview_err') # <<<<<<<<<<<<<<
17146 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
17147 * PyErr_SetString(error, msg)
17148*/
17149
17150 /* function exit code */
17151 __pyx_L0:;
17152
17153
17154
17155 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17156 return __pyx_r;
17157}
17158
17159/* "View.MemoryView":1265
17160 * return -1
17161 *
17162 * @cname('__pyx_memoryview_err_no_memory') # <<<<<<<<<<<<<<
17163 * cdef int _err_no_memory() except -1 with gil:
17164 * raise MemoryError
17165*/
17166
17167static int __pyx_memoryview_err_no_memory(void) {
17168 int __pyx_r;
17169 int __pyx_lineno = 0;
17170 const char *__pyx_filename = NULL;
17171 int __pyx_clineno = 0;
17172 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17173
17174 /* "View.MemoryView":1267
17175 * @cname('__pyx_memoryview_err_no_memory')
17176 * cdef int _err_no_memory() except -1 with gil:
17177 * raise MemoryError # <<<<<<<<<<<<<<
17178 *
17179 *
17180*/
17181 PyErr_NoMemory(); __PYX_ERR(1, 1267, __pyx_L1_error)
17182
17183 /* "View.MemoryView":1265
17184 * return -1
17185 *
17186 * @cname('__pyx_memoryview_err_no_memory') # <<<<<<<<<<<<<<
17187 * cdef int _err_no_memory() except -1 with gil:
17188 * raise MemoryError
17189*/
17190
17191 /* function exit code */
17192 __pyx_L1_error:;
17193 __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
17194 __pyx_r = -1;
17195
17196 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17197 return __pyx_r;
17198}
17199
17200/* "View.MemoryView":1271
17201 *
17202 *
17203 * @cname('__pyx_memoryview_err_ValueError') # <<<<<<<<<<<<<<
17204 * cdef int _err_ValueError(const char* msg) except -1:
17205 * PyErr_SetString(PyExc_ValueError, msg)
17206*/
17207
17208static int __pyx_memoryview_err_ValueError(char const *__pyx_v_msg) {
17209 int __pyx_r;
17210
17211 /* "View.MemoryView":1273
17212 * @cname('__pyx_memoryview_err_ValueError')
17213 * cdef int _err_ValueError(const char* msg) except -1:
17214 * PyErr_SetString(PyExc_ValueError, msg) # <<<<<<<<<<<<<<
17215 * return -1
17216 *
17217*/
17218 (void)(PyErr_SetString(PyExc_ValueError, __pyx_v_msg));
17219
17220 /* "View.MemoryView":1274
17221 * cdef int _err_ValueError(const char* msg) except -1:
17222 * PyErr_SetString(PyExc_ValueError, msg)
17223 * return -1 # <<<<<<<<<<<<<<
17224 *
17225 * @cname('__pyx_memoryview_err_IndexError')
17226*/
17227 {
17228
17229 __pyx_r = -1;
17230 }
17231 goto __pyx_L0;
17232
17233 /* "View.MemoryView":1271
17234 *
17235 *
17236 * @cname('__pyx_memoryview_err_ValueError') # <<<<<<<<<<<<<<
17237 * cdef int _err_ValueError(const char* msg) except -1:
17238 * PyErr_SetString(PyExc_ValueError, msg)
17239*/
17240
17241 /* function exit code */
17242 __pyx_L0:;
17243
17244 return __pyx_r;
17245}
17246
17247/* "View.MemoryView":1276
17248 * return -1
17249 *
17250 * @cname('__pyx_memoryview_err_IndexError') # <<<<<<<<<<<<<<
17251 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17252 * PyErr_Format(PyExc_IndexError, msg, index)
17253*/
17254
17255static int __pyx_memoryview_err_IndexError(char const *__pyx_v_msg, Py_ssize_t __pyx_v_index) {
17256 int __pyx_r;
17257
17258 /* "View.MemoryView":1278
17259 * @cname('__pyx_memoryview_err_IndexError')
17260 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17261 * PyErr_Format(PyExc_IndexError, msg, index) # <<<<<<<<<<<<<<
17262 * return -1
17263 *
17264*/
17265 (void)(PyErr_Format(PyExc_IndexError, __pyx_v_msg, __pyx_v_index));
17266
17267 /* "View.MemoryView":1279
17268 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17269 * PyErr_Format(PyExc_IndexError, msg, index)
17270 * return -1 # <<<<<<<<<<<<<<
17271 *
17272 *
17273*/
17274 {
17275
17276 __pyx_r = -1;
17277 }
17278 goto __pyx_L0;
17279
17280 /* "View.MemoryView":1276
17281 * return -1
17282 *
17283 * @cname('__pyx_memoryview_err_IndexError') # <<<<<<<<<<<<<<
17284 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17285 * PyErr_Format(PyExc_IndexError, msg, index)
17286*/
17287
17288 /* function exit code */
17289 __pyx_L0:;
17290
17291 return __pyx_r;
17292}
17293
17294/* "View.MemoryView":1282
17295 *
17296 *
17297 * @cname('__pyx_memoryview_copy_contents') # <<<<<<<<<<<<<<
17298 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
17299 * __Pyx_memviewslice dst,
17300*/
17301
17302static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
17303 void *__pyx_v_tmpdata;
17304 size_t __pyx_v_itemsize;
17305 int __pyx_v_i;
17306 char __pyx_v_order;
17307 int __pyx_v_broadcasting;
17308 int __pyx_v_direct_copy;
17309 __Pyx_memviewslice __pyx_v_tmp;
17310 int __pyx_v_ndim;
17311 int __pyx_r;
17312 int __pyx_t_1;
17313 int __pyx_t_2;
17314 int __pyx_t_3;
17315 int __pyx_t_4;
17316 int __pyx_t_5;
17317 void *__pyx_t_6;
17318 int __pyx_lineno = 0;
17319 const char *__pyx_filename = NULL;
17320 int __pyx_clineno = 0;
17321 PyGILState_STATE __pyx_gilstate_save;
17322
17323
17324 /* "View.MemoryView":1291
17325 * Check for overlapping memory and verify the shapes.
17326 * """
17327 * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
17328 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
17329 * cdef int i
17330*/
17331 __pyx_v_tmpdata = NULL;
17332
17333 /* "View.MemoryView":1292
17334 * """
17335 * cdef void *tmpdata = NULL
17336 * cdef size_t itemsize = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
17337 * cdef int i
17338 * cdef char order = get_best_order(&src, src_ndim)
17339*/
17340 __pyx_v_itemsize = ((size_t)__pyx_v_src.memview->view.itemsize);
17341
17342 /* "View.MemoryView":1294
17343 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
17344 * cdef int i
17345 * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
17346 * cdef bint broadcasting = False
17347 * cdef bint direct_copy = False
17348*/
17349 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17350
17351 /* "View.MemoryView":1295
17352 * cdef int i
17353 * cdef char order = get_best_order(&src, src_ndim)
17354 * cdef bint broadcasting = False # <<<<<<<<<<<<<<
17355 * cdef bint direct_copy = False
17356 * cdef __Pyx_memviewslice tmp
17357*/
17358 __pyx_v_broadcasting = 0;
17359
17360 /* "View.MemoryView":1296
17361 * cdef char order = get_best_order(&src, src_ndim)
17362 * cdef bint broadcasting = False
17363 * cdef bint direct_copy = False # <<<<<<<<<<<<<<
17364 * cdef __Pyx_memviewslice tmp
17365 *
17366*/
17367 __pyx_v_direct_copy = 0;
17368
17369 /* "View.MemoryView":1299
17370 * cdef __Pyx_memviewslice tmp
17371 *
17372 * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17373 * broadcast_leading(&src, src_ndim, dst_ndim)
17374 * elif dst_ndim < src_ndim:
17375*/
17376 __pyx_t_1 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17377
17378 if (__pyx_t_1) {
17379
17380
17381 /* "View.MemoryView":1300
17382 *
17383 * if src_ndim < dst_ndim:
17384 * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17385 * elif dst_ndim < src_ndim:
17386 * broadcast_leading(&dst, dst_ndim, src_ndim)
17387*/
17388 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17389
17390 /* "View.MemoryView":1299
17391 * cdef __Pyx_memviewslice tmp
17392 *
17393 * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17394 * broadcast_leading(&src, src_ndim, dst_ndim)
17395 * elif dst_ndim < src_ndim:
17396*/
17397 goto __pyx_L3;
17398 }
17399
17400 /* "View.MemoryView":1301
17401 * if src_ndim < dst_ndim:
17402 * broadcast_leading(&src, src_ndim, dst_ndim)
17403 * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17404 * broadcast_leading(&dst, dst_ndim, src_ndim)
17405 *
17406*/
17407 __pyx_t_1 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17408
17409 if (__pyx_t_1) {
17410
17411
17412 /* "View.MemoryView":1302
17413 * broadcast_leading(&src, src_ndim, dst_ndim)
17414 * elif dst_ndim < src_ndim:
17415 * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
17416 *
17417 * cdef int ndim = max(src_ndim, dst_ndim)
17418*/
17419 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17420
17421 /* "View.MemoryView":1301
17422 * if src_ndim < dst_ndim:
17423 * broadcast_leading(&src, src_ndim, dst_ndim)
17424 * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17425 * broadcast_leading(&dst, dst_ndim, src_ndim)
17426 *
17427*/
17428 }
17429 __pyx_L3:;
17430
17431 /* "View.MemoryView":1304
17432 * broadcast_leading(&dst, dst_ndim, src_ndim)
17433 *
17434 * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17435 *
17436 * for i in range(ndim):
17437*/
17438
17439 __pyx_t_2 = __pyx_v_dst_ndim;
17440
17441 __pyx_t_3 = __pyx_v_src_ndim;
17442 __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
17443
17444 if (__pyx_t_1) {
17445
17446 __pyx_t_4 = __pyx_t_2;
17447 } else {
17448
17449 __pyx_t_4 = __pyx_t_3;
17450 }
17451
17452 __pyx_v_ndim = __pyx_t_4;
17453
17454
17455 /* "View.MemoryView":1306
17456 * cdef int ndim = max(src_ndim, dst_ndim)
17457 *
17458 * for i in range(ndim): # <<<<<<<<<<<<<<
17459 * if src.shape[i] != dst.shape[i]:
17460 * if cython.likely(src.shape[i] == 1):
17461*/
17462
17463 __pyx_t_4 = __pyx_v_ndim;
17464 __pyx_t_2 = __pyx_t_4;
17465
17466 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17467 __pyx_v_i = __pyx_t_3;
17468
17469 /* "View.MemoryView":1307
17470 *
17471 * for i in range(ndim):
17472 * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17473 * if cython.likely(src.shape[i] == 1):
17474 * broadcasting = True
17475*/
17476 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17477
17478 if (__pyx_t_1) {
17479
17480
17481 /* "View.MemoryView":1308
17482 * for i in range(ndim):
17483 * if src.shape[i] != dst.shape[i]:
17484 * if cython.likely(src.shape[i] == 1): # <<<<<<<<<<<<<<
17485 * broadcasting = True
17486 * src.strides[i] = 0
17487*/
17488 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17489
17490 if (likely(__pyx_t_1)) {
17491
17492
17493 /* "View.MemoryView":1309
17494 * if src.shape[i] != dst.shape[i]:
17495 * if cython.likely(src.shape[i] == 1):
17496 * broadcasting = True # <<<<<<<<<<<<<<
17497 * src.strides[i] = 0
17498 * else:
17499*/
17500 __pyx_v_broadcasting = 1;
17501
17502 /* "View.MemoryView":1310
17503 * if cython.likely(src.shape[i] == 1):
17504 * broadcasting = True
17505 * src.strides[i] = 0 # <<<<<<<<<<<<<<
17506 * else:
17507 * _err_extents(i, dst.shape[i], src.shape[i])
17508*/
17509 (__pyx_v_src.strides[__pyx_v_i]) = 0;
17510
17511 /* "View.MemoryView":1308
17512 * for i in range(ndim):
17513 * if src.shape[i] != dst.shape[i]:
17514 * if cython.likely(src.shape[i] == 1): # <<<<<<<<<<<<<<
17515 * broadcasting = True
17516 * src.strides[i] = 0
17517*/
17518 goto __pyx_L7;
17519 }
17520
17521 /* "View.MemoryView":1312
17522 * src.strides[i] = 0
17523 * else:
17524 * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
17525 *
17526 * if cython.unlikely(src.suboffsets[i] >= 0):
17527*/
17528 /*else*/ {
17529 __pyx_t_5 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1312, __pyx_L1_error)
17530
17531 }
17532 __pyx_L7:;
17533
17534 /* "View.MemoryView":1307
17535 *
17536 * for i in range(ndim):
17537 * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17538 * if cython.likely(src.shape[i] == 1):
17539 * broadcasting = True
17540*/
17541 }
17542
17543 /* "View.MemoryView":1314
17544 * _err_extents(i, dst.shape[i], src.shape[i])
17545 *
17546 * if cython.unlikely(src.suboffsets[i] >= 0): # <<<<<<<<<<<<<<
17547 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17548 *
17549*/
17550 __pyx_t_1 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17551
17552 if (unlikely(__pyx_t_1)) {
17553
17554
17555 /* "View.MemoryView":1315
17556 *
17557 * if cython.unlikely(src.suboffsets[i] >= 0):
17558 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
17559 *
17560 * if slices_overlap(&src, &dst, ndim, itemsize):
17561*/
17562 __pyx_t_5 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1315, __pyx_L1_error)
17563
17564
17565 /* "View.MemoryView":1314
17566 * _err_extents(i, dst.shape[i], src.shape[i])
17567 *
17568 * if cython.unlikely(src.suboffsets[i] >= 0): # <<<<<<<<<<<<<<
17569 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17570 *
17571*/
17572 }
17573 }
17574
17575
17576 /* "View.MemoryView":1317
17577 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17578 *
17579 * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17580 *
17581 * if not slice_is_contig(src, order, ndim):
17582*/
17583 __pyx_t_1 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17584
17585 if (__pyx_t_1) {
17586
17587
17588 /* "View.MemoryView":1319
17589 * if slices_overlap(&src, &dst, ndim, itemsize):
17590 *
17591 * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17592 * order = get_best_order(&dst, ndim)
17593 *
17594*/
17595 __pyx_t_1 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17596
17597 if (__pyx_t_1) {
17598
17599
17600 /* "View.MemoryView":1320
17601 *
17602 * if not slice_is_contig(src, order, ndim):
17603 * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
17604 *
17605 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17606*/
17607 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17608
17609 /* "View.MemoryView":1319
17610 * if slices_overlap(&src, &dst, ndim, itemsize):
17611 *
17612 * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17613 * order = get_best_order(&dst, ndim)
17614 *
17615*/
17616 }
17617
17618 /* "View.MemoryView":1322
17619 * order = get_best_order(&dst, ndim)
17620 *
17621 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
17622 * src = tmp
17623 *
17624*/
17625 __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == ((void *)NULL))) __PYX_ERR(1, 1322, __pyx_L1_error)
17626 __pyx_v_tmpdata = __pyx_t_6;
17627
17628 /* "View.MemoryView":1323
17629 *
17630 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17631 * src = tmp # <<<<<<<<<<<<<<
17632 *
17633 * if not broadcasting:
17634*/
17635 __pyx_v_src = __pyx_v_tmp;
17636
17637 /* "View.MemoryView":1317
17638 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17639 *
17640 * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17641 *
17642 * if not slice_is_contig(src, order, ndim):
17643*/
17644 }
17645
17646 /* "View.MemoryView":1325
17647 * src = tmp
17648 *
17649 * if not broadcasting: # <<<<<<<<<<<<<<
17650 *
17651 *
17652*/
17653 __pyx_t_1 = (!__pyx_v_broadcasting);
17654
17655 if (__pyx_t_1) {
17656
17657
17658 /* "View.MemoryView":1328
17659 *
17660 *
17661 * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17662 * direct_copy = slice_is_contig(dst, 'C', ndim)
17663 * elif slice_is_contig(src, 'F', ndim):
17664*/
17665 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
17666
17667 if (__pyx_t_1) {
17668
17669
17670 /* "View.MemoryView":1329
17671 *
17672 * if slice_is_contig(src, 'C', ndim):
17673 * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
17674 * elif slice_is_contig(src, 'F', ndim):
17675 * direct_copy = slice_is_contig(dst, 'F', ndim)
17676*/
17677 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
17678
17679 /* "View.MemoryView":1328
17680 *
17681 *
17682 * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17683 * direct_copy = slice_is_contig(dst, 'C', ndim)
17684 * elif slice_is_contig(src, 'F', ndim):
17685*/
17686 goto __pyx_L12;
17687 }
17688
17689 /* "View.MemoryView":1330
17690 * if slice_is_contig(src, 'C', ndim):
17691 * direct_copy = slice_is_contig(dst, 'C', ndim)
17692 * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17693 * direct_copy = slice_is_contig(dst, 'F', ndim)
17694 *
17695*/
17696 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
17697
17698 if (__pyx_t_1) {
17699
17700
17701 /* "View.MemoryView":1331
17702 * direct_copy = slice_is_contig(dst, 'C', ndim)
17703 * elif slice_is_contig(src, 'F', ndim):
17704 * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
17705 *
17706 * if direct_copy:
17707*/
17708 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
17709
17710 /* "View.MemoryView":1330
17711 * if slice_is_contig(src, 'C', ndim):
17712 * direct_copy = slice_is_contig(dst, 'C', ndim)
17713 * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17714 * direct_copy = slice_is_contig(dst, 'F', ndim)
17715 *
17716*/
17717 }
17718 __pyx_L12:;
17719
17720 /* "View.MemoryView":1333
17721 * direct_copy = slice_is_contig(dst, 'F', ndim)
17722 *
17723 * if direct_copy: # <<<<<<<<<<<<<<
17724 *
17725 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17726*/
17727 if (__pyx_v_direct_copy) {
17728
17729 /* "View.MemoryView":1335
17730 * if direct_copy:
17731 *
17732 * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17733 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17734 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17735*/
17736 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17737
17738 /* "View.MemoryView":1336
17739 *
17740 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17741 * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
17742 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17743 * free(tmpdata)
17744*/
17745 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17746
17747 /* "View.MemoryView":1337
17748 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17749 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17750 * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17751 * free(tmpdata)
17752 * return 0
17753*/
17754 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17755
17756 /* "View.MemoryView":1338
17757 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17758 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17759 * free(tmpdata) # <<<<<<<<<<<<<<
17760 * return 0
17761 *
17762*/
17763 free(__pyx_v_tmpdata);
17764
17765 /* "View.MemoryView":1339
17766 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17767 * free(tmpdata)
17768 * return 0 # <<<<<<<<<<<<<<
17769 *
17770 * if order == 'F' == get_best_order(&dst, ndim):
17771*/
17772 {
17773
17774 __pyx_r = 0;
17775 }
17776 goto __pyx_L0;
17777
17778 /* "View.MemoryView":1333
17779 * direct_copy = slice_is_contig(dst, 'F', ndim)
17780 *
17781 * if direct_copy: # <<<<<<<<<<<<<<
17782 *
17783 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17784*/
17785 }
17786
17787 /* "View.MemoryView":1325
17788 * src = tmp
17789 *
17790 * if not broadcasting: # <<<<<<<<<<<<<<
17791 *
17792 *
17793*/
17794 }
17795
17796 /* "View.MemoryView":1341
17797 * return 0
17798 *
17799 * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17800 *
17801 *
17802*/
17803 __pyx_t_1 = (__pyx_v_order == 'F');
17804 if (__pyx_t_1) {
17805 __pyx_t_1 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17806 }
17807 if (__pyx_t_1) {
17808
17809
17810 /* "View.MemoryView":1344
17811 *
17812 *
17813 * transpose_memslice(&src) # <<<<<<<<<<<<<<
17814 * transpose_memslice(&dst)
17815 *
17816*/
17817 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1344, __pyx_L1_error)
17818
17819
17820 /* "View.MemoryView":1345
17821 *
17822 * transpose_memslice(&src)
17823 * transpose_memslice(&dst) # <<<<<<<<<<<<<<
17824 *
17825 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17826*/
17827 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1345, __pyx_L1_error)
17828
17829
17830 /* "View.MemoryView":1341
17831 * return 0
17832 *
17833 * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17834 *
17835 *
17836*/
17837 }
17838
17839 /* "View.MemoryView":1347
17840 * transpose_memslice(&dst)
17841 *
17842 * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17843 * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17844 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17845*/
17846 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17847
17848 /* "View.MemoryView":1348
17849 *
17850 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17851 * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
17852 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17853 *
17854*/
17855 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17856
17857 /* "View.MemoryView":1349
17858 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17859 * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17860 * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17861 *
17862 * free(tmpdata)
17863*/
17864 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17865
17866 /* "View.MemoryView":1351
17867 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17868 *
17869 * free(tmpdata) # <<<<<<<<<<<<<<
17870 * return 0
17871 *
17872*/
17873 free(__pyx_v_tmpdata);
17874
17875 /* "View.MemoryView":1352
17876 *
17877 * free(tmpdata)
17878 * return 0 # <<<<<<<<<<<<<<
17879 *
17880 * @cname('__pyx_memoryview_broadcast_leading')
17881*/
17882 {
17883
17884 __pyx_r = 0;
17885 }
17886 goto __pyx_L0;
17887
17888 /* "View.MemoryView":1282
17889 *
17890 *
17891 * @cname('__pyx_memoryview_copy_contents') # <<<<<<<<<<<<<<
17892 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
17893 * __Pyx_memviewslice dst,
17894*/
17895
17896 /* function exit code */
17897 __pyx_L1_error:;
17898 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17899 __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17900 __pyx_r = -1;
17901 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17902 __pyx_L0:;
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912 return __pyx_r;
17913}
17914
17915/* "View.MemoryView":1354
17916 * return 0
17917 *
17918 * @cname('__pyx_memoryview_broadcast_leading') # <<<<<<<<<<<<<<
17919 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
17920 * int ndim,
17921*/
17922
17923static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
17924 int __pyx_v_i;
17925 int __pyx_v_offset;
17926 int __pyx_t_1;
17927 int __pyx_t_2;
17928 int __pyx_t_3;
17929
17930 /* "View.MemoryView":1359
17931 * int ndim_other) noexcept nogil:
17932 * cdef int i
17933 * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
17934 *
17935 * for i in range(ndim - 1, -1, -1):
17936*/
17937 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17938
17939 /* "View.MemoryView":1361
17940 * cdef int offset = ndim_other - ndim
17941 *
17942 * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17943 * mslice.shape[i + offset] = mslice.shape[i]
17944 * mslice.strides[i + offset] = mslice.strides[i]
17945*/
17946 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17947 __pyx_v_i = __pyx_t_1;
17948
17949 /* "View.MemoryView":1362
17950 *
17951 * for i in range(ndim - 1, -1, -1):
17952 * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
17953 * mslice.strides[i + offset] = mslice.strides[i]
17954 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17955*/
17956 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
17957
17958 /* "View.MemoryView":1363
17959 * for i in range(ndim - 1, -1, -1):
17960 * mslice.shape[i + offset] = mslice.shape[i]
17961 * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
17962 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17963 *
17964*/
17965 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
17966
17967 /* "View.MemoryView":1364
17968 * mslice.shape[i + offset] = mslice.shape[i]
17969 * mslice.strides[i + offset] = mslice.strides[i]
17970 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
17971 *
17972 * for i in range(offset):
17973*/
17974 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
17975 }
17976
17977 /* "View.MemoryView":1366
17978 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17979 *
17980 * for i in range(offset): # <<<<<<<<<<<<<<
17981 * mslice.shape[i] = 1
17982 * mslice.strides[i] = mslice.strides[0]
17983*/
17984
17985 __pyx_t_1 = __pyx_v_offset;
17986 __pyx_t_2 = __pyx_t_1;
17987
17988 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17989 __pyx_v_i = __pyx_t_3;
17990
17991 /* "View.MemoryView":1367
17992 *
17993 * for i in range(offset):
17994 * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
17995 * mslice.strides[i] = mslice.strides[0]
17996 * mslice.suboffsets[i] = -1
17997*/
17998 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
17999
18000 /* "View.MemoryView":1368
18001 * for i in range(offset):
18002 * mslice.shape[i] = 1
18003 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
18004 * mslice.suboffsets[i] = -1
18005 *
18006*/
18007 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
18008
18009 /* "View.MemoryView":1369
18010 * mslice.shape[i] = 1
18011 * mslice.strides[i] = mslice.strides[0]
18012 * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18013 *
18014 *
18015*/
18016 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
18017 }
18018
18019
18020 /* "View.MemoryView":1354
18021 * return 0
18022 *
18023 * @cname('__pyx_memoryview_broadcast_leading') # <<<<<<<<<<<<<<
18024 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
18025 * int ndim,
18026*/
18027
18028 /* function exit code */
18029
18030
18031}
18032
18033/* "View.MemoryView":1376
18034 *
18035 *
18036 * @cname('__pyx_memoryview_refcount_copying') # <<<<<<<<<<<<<<
18037 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18038 *
18039*/
18040
18041static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
18042
18043 /* "View.MemoryView":1379
18044 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18045 *
18046 * if dtype_is_object: # <<<<<<<<<<<<<<
18047 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18048 *
18049*/
18050 if (__pyx_v_dtype_is_object) {
18051
18052 /* "View.MemoryView":1380
18053 *
18054 * if dtype_is_object:
18055 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
18056 *
18057 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18058*/
18059 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
18060
18061 /* "View.MemoryView":1379
18062 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18063 *
18064 * if dtype_is_object: # <<<<<<<<<<<<<<
18065 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18066 *
18067*/
18068 }
18069
18070 /* "View.MemoryView":1376
18071 *
18072 *
18073 * @cname('__pyx_memoryview_refcount_copying') # <<<<<<<<<<<<<<
18074 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18075 *
18076*/
18077
18078 /* function exit code */
18079}
18080
18081/* "View.MemoryView":1382
18082 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18083 *
18084 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') # <<<<<<<<<<<<<<
18085 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
18086 * Py_ssize_t *strides, int ndim,
18087*/
18088
18089static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
18090 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18091
18092
18093
18094
18095
18096
18097 /* "View.MemoryView":1386
18098 * Py_ssize_t *strides, int ndim,
18099 * bint inc) noexcept with gil:
18100 * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
18101 *
18102 * @cname('__pyx_memoryview_refcount_objects_in_slice')
18103*/
18104 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
18105
18106 /* "View.MemoryView":1382
18107 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18108 *
18109 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') # <<<<<<<<<<<<<<
18110 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
18111 * Py_ssize_t *strides, int ndim,
18112*/
18113
18114 /* function exit code */
18115
18116
18117
18118
18119
18120
18121 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18122}
18123
18124/* "View.MemoryView":1388
18125 * refcount_objects_in_slice(data, shape, strides, ndim, inc)
18126 *
18127 * @cname('__pyx_memoryview_refcount_objects_in_slice') # <<<<<<<<<<<<<<
18128 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
18129 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18130*/
18131
18132static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
18133 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18134 Py_ssize_t __pyx_v_stride;
18135 Py_ssize_t __pyx_t_1;
18136 Py_ssize_t __pyx_t_2;
18137 Py_ssize_t __pyx_t_3;
18138 int __pyx_t_4;
18139
18140
18141 /* "View.MemoryView":1392
18142 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18143 * cdef Py_ssize_t i
18144 * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18145 *
18146 * for i in range(shape[0]):
18147*/
18148 __pyx_v_stride = (__pyx_v_strides[0]);
18149
18150 /* "View.MemoryView":1394
18151 * cdef Py_ssize_t stride = strides[0]
18152 *
18153 * for i in range(shape[0]): # <<<<<<<<<<<<<<
18154 * if ndim == 1:
18155 * if inc:
18156*/
18157
18158 __pyx_t_1 = (__pyx_v_shape[0]);
18159 __pyx_t_2 = __pyx_t_1;
18160
18161 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18162 __pyx_v_i = __pyx_t_3;
18163
18164 /* "View.MemoryView":1395
18165 *
18166 * for i in range(shape[0]):
18167 * if ndim == 1: # <<<<<<<<<<<<<<
18168 * if inc:
18169 * Py_INCREF((<PyObject **> data)[0])
18170*/
18171 __pyx_t_4 = (__pyx_v_ndim == 1);
18172
18173 if (__pyx_t_4) {
18174
18175
18176 /* "View.MemoryView":1396
18177 * for i in range(shape[0]):
18178 * if ndim == 1:
18179 * if inc: # <<<<<<<<<<<<<<
18180 * Py_INCREF((<PyObject **> data)[0])
18181 * else:
18182*/
18183 if (__pyx_v_inc) {
18184
18185 /* "View.MemoryView":1397
18186 * if ndim == 1:
18187 * if inc:
18188 * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
18189 * else:
18190 * Py_DECREF((<PyObject **> data)[0])
18191*/
18192 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
18193
18194 /* "View.MemoryView":1396
18195 * for i in range(shape[0]):
18196 * if ndim == 1:
18197 * if inc: # <<<<<<<<<<<<<<
18198 * Py_INCREF((<PyObject **> data)[0])
18199 * else:
18200*/
18201 goto __pyx_L6;
18202 }
18203
18204 /* "View.MemoryView":1399
18205 * Py_INCREF((<PyObject **> data)[0])
18206 * else:
18207 * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
18208 * else:
18209 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
18210*/
18211 /*else*/ {
18212 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
18213 }
18214 __pyx_L6:;
18215
18216 /* "View.MemoryView":1395
18217 *
18218 * for i in range(shape[0]):
18219 * if ndim == 1: # <<<<<<<<<<<<<<
18220 * if inc:
18221 * Py_INCREF((<PyObject **> data)[0])
18222*/
18223 goto __pyx_L5;
18224 }
18225
18226 /* "View.MemoryView":1401
18227 * Py_DECREF((<PyObject **> data)[0])
18228 * else:
18229 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
18230 *
18231 * data += stride
18232*/
18233 /*else*/ {
18234 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18235 }
18236 __pyx_L5:;
18237
18238 /* "View.MemoryView":1403
18239 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
18240 *
18241 * data += stride # <<<<<<<<<<<<<<
18242 *
18243 *
18244*/
18245 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18246 }
18247
18248
18249 /* "View.MemoryView":1388
18250 * refcount_objects_in_slice(data, shape, strides, ndim, inc)
18251 *
18252 * @cname('__pyx_memoryview_refcount_objects_in_slice') # <<<<<<<<<<<<<<
18253 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
18254 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18255*/
18256
18257 /* function exit code */
18258
18259
18260
18261
18262}
18263
18264/* "View.MemoryView":1408
18265 *
18266 *
18267 * @cname('__pyx_memoryview_slice_assign_scalar') # <<<<<<<<<<<<<<
18268 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
18269 * size_t itemsize, void *item,
18270*/
18271
18272static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
18273
18274 /* "View.MemoryView":1412
18275 * size_t itemsize, void *item,
18276 * bint dtype_is_object) noexcept nogil:
18277 * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18278 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18279 * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18280*/
18281 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18282
18283 /* "View.MemoryView":1413
18284 * bint dtype_is_object) noexcept nogil:
18285 * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18286 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
18287 * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18288 *
18289*/
18290 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
18291
18292 /* "View.MemoryView":1414
18293 * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18294 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18295 * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18296 *
18297 *
18298*/
18299 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18300
18301 /* "View.MemoryView":1408
18302 *
18303 *
18304 * @cname('__pyx_memoryview_slice_assign_scalar') # <<<<<<<<<<<<<<
18305 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
18306 * size_t itemsize, void *item,
18307*/
18308
18309 /* function exit code */
18310}
18311
18312/* "View.MemoryView":1417
18313 *
18314 *
18315 * @cname('__pyx_memoryview__slice_assign_scalar') # <<<<<<<<<<<<<<
18316 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
18317 * Py_ssize_t *strides, int ndim,
18318*/
18319
18320static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
18321 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18322 Py_ssize_t __pyx_v_stride;
18323 Py_ssize_t __pyx_v_extent;
18324 int __pyx_t_1;
18325 Py_ssize_t __pyx_t_2;
18326 Py_ssize_t __pyx_t_3;
18327 Py_ssize_t __pyx_t_4;
18328
18329
18330 /* "View.MemoryView":1422
18331 * size_t itemsize, void *item) noexcept nogil:
18332 * cdef Py_ssize_t i
18333 * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18334 * cdef Py_ssize_t extent = shape[0]
18335 *
18336*/
18337 __pyx_v_stride = (__pyx_v_strides[0]);
18338
18339 /* "View.MemoryView":1423
18340 * cdef Py_ssize_t i
18341 * cdef Py_ssize_t stride = strides[0]
18342 * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
18343 *
18344 * if ndim == 1:
18345*/
18346 __pyx_v_extent = (__pyx_v_shape[0]);
18347
18348 /* "View.MemoryView":1425
18349 * cdef Py_ssize_t extent = shape[0]
18350 *
18351 * if ndim == 1: # <<<<<<<<<<<<<<
18352 * for i in range(extent):
18353 * memcpy(data, item, itemsize)
18354*/
18355 __pyx_t_1 = (__pyx_v_ndim == 1);
18356
18357 if (__pyx_t_1) {
18358
18359
18360 /* "View.MemoryView":1426
18361 *
18362 * if ndim == 1:
18363 * for i in range(extent): # <<<<<<<<<<<<<<
18364 * memcpy(data, item, itemsize)
18365 * data += stride
18366*/
18367
18368 __pyx_t_2 = __pyx_v_extent;
18369 __pyx_t_3 = __pyx_t_2;
18370
18371 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18372 __pyx_v_i = __pyx_t_4;
18373
18374 /* "View.MemoryView":1427
18375 * if ndim == 1:
18376 * for i in range(extent):
18377 * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
18378 * data += stride
18379 * else:
18380*/
18381 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18382
18383 /* "View.MemoryView":1428
18384 * for i in range(extent):
18385 * memcpy(data, item, itemsize)
18386 * data += stride # <<<<<<<<<<<<<<
18387 * else:
18388 * for i in range(extent):
18389*/
18390 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18391 }
18392
18393
18394 /* "View.MemoryView":1425
18395 * cdef Py_ssize_t extent = shape[0]
18396 *
18397 * if ndim == 1: # <<<<<<<<<<<<<<
18398 * for i in range(extent):
18399 * memcpy(data, item, itemsize)
18400*/
18401 goto __pyx_L3;
18402 }
18403
18404 /* "View.MemoryView":1430
18405 * data += stride
18406 * else:
18407 * for i in range(extent): # <<<<<<<<<<<<<<
18408 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18409 * data += stride
18410*/
18411 /*else*/ {
18412
18413 __pyx_t_2 = __pyx_v_extent;
18414 __pyx_t_3 = __pyx_t_2;
18415
18416 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18417 __pyx_v_i = __pyx_t_4;
18418
18419 /* "View.MemoryView":1431
18420 * else:
18421 * for i in range(extent):
18422 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
18423 * data += stride
18424 *
18425*/
18426 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
18427
18428 /* "View.MemoryView":1432
18429 * for i in range(extent):
18430 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18431 * data += stride # <<<<<<<<<<<<<<
18432 *
18433*/
18434 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18435 }
18436
18437 }
18438 __pyx_L3:;
18439
18440 /* "View.MemoryView":1417
18441 *
18442 *
18443 * @cname('__pyx_memoryview__slice_assign_scalar') # <<<<<<<<<<<<<<
18444 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
18445 * Py_ssize_t *strides, int ndim,
18446*/
18447
18448 /* function exit code */
18449
18450
18451
18452
18453}
18454
18455/* "(tree fragment)":4
18456 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
18457 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
18458 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
18459 * cdef object __pyx_result
18460 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18461*/
18462
18463/* Python wrapper */
18464static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18465#if CYTHON_VECTORCALL
18466PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18467#else
18468PyObject *__pyx_args, PyObject *__pyx_kwds
18469#endif
18470); /*proto*/
18471static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
18472static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18473#if CYTHON_VECTORCALL
18474PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18475#else
18476PyObject *__pyx_args, PyObject *__pyx_kwds
18477#endif
18478) {
18479 PyObject *__pyx_v___pyx_type = 0;
18480 long __pyx_v___pyx_checksum;
18481 PyObject *__pyx_v___pyx_state = 0;
18482 #if !CYTHON_VECTORCALL
18483 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18484 #endif
18485 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
18486 PyObject* values[3] = {0,0,0};
18487 int __pyx_lineno = 0;
18488 const char *__pyx_filename = NULL;
18489 int __pyx_clineno = 0;
18490 PyObject *__pyx_r = 0;
18491 __Pyx_RefNannyDeclarations
18492 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
18493 #if !CYTHON_VECTORCALL
18494 #if CYTHON_ASSUME_SAFE_SIZE
18495 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18496 #else
18497 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
18498 #endif
18499 #endif
18500 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18501 {
18502 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
18503 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
18504 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 4, __pyx_L3_error)
18505 if (__pyx_kwds_len > 0) {
18506 switch (__pyx_nargs) {
18507 case 3:
18508 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18509 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18510 CYTHON_FALLTHROUGH;
18511 case 2:
18512 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18513 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18514 CYTHON_FALLTHROUGH;
18515 case 1:
18516 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18517 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18518 CYTHON_FALLTHROUGH;
18519 case 0: break;
18520 default: goto __pyx_L5_argtuple_error;
18521 }
18522 const Py_ssize_t kwd_pos_args = __pyx_nargs;
18523 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_Enum", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
18524 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
18525 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
18526 }
18527 } else if (unlikely(__pyx_nargs != 3)) {
18528 goto __pyx_L5_argtuple_error;
18529 } else {
18530 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18531 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18532 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18533 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18534 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18535 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18536 }
18537 __pyx_v___pyx_type = values[0];
18538 __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
18539 __pyx_v___pyx_state = ((PyObject*)values[2]);
18540 }
18541 goto __pyx_L6_skip;
18542 __pyx_L5_argtuple_error:;
18543 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __pyx_L3_error)
18544 __pyx_L6_skip:;
18545 goto __pyx_L4_argument_unpacking_done;
18546 __pyx_L3_error:;
18547 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18548 Py_XDECREF(values[__pyx_temp]);
18549 }
18550 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18551 __Pyx_RefNannyFinishContext();
18552 return NULL;
18553 __pyx_L4_argument_unpacking_done:;
18554 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
18555 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18556
18557 /* function exit code */
18558 goto __pyx_L0;
18559 __pyx_L1_error:;
18560 __pyx_r = NULL;
18561 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18562 Py_XDECREF(values[__pyx_temp]);
18563 }
18564 goto __pyx_L7_cleaned_up;
18565 __pyx_L0:;
18566 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18567 Py_XDECREF(values[__pyx_temp]);
18568 }
18569 __pyx_L7_cleaned_up:;
18570
18571 __Pyx_RefNannyFinishContext();
18572 return __pyx_r;
18573}
18574
18575static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18576 PyObject *__pyx_v___pyx_result = 0;
18577 PyObject *__pyx_r = NULL;
18578 __Pyx_RefNannyDeclarations
18579 int __pyx_t_1;
18580 PyObject *__pyx_t_2 = NULL;
18581 PyObject *__pyx_t_3 = NULL;
18582 size_t __pyx_t_4;
18583 int __pyx_t_5;
18584 int __pyx_lineno = 0;
18585 const char *__pyx_filename = NULL;
18586 int __pyx_clineno = 0;
18587 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
18588
18589 /* "(tree fragment)":6
18590 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):
18591 * cdef object __pyx_result
18592 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name') # <<<<<<<<<<<<<<
18593 * __pyx_result = Enum.__new__(__pyx_type)
18594 * if __pyx_state is not None:
18595*/
18596 __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, __pyx_k_name); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)
18597
18598
18599 /* "(tree fragment)":7
18600 * cdef object __pyx_result
18601 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18602 * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
18603 * if __pyx_state is not None:
18604 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18605*/
18606 __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
18607 __Pyx_INCREF(__pyx_t_3);
18608 __pyx_t_4 = 0;
18609 {
18610 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
18611 __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
18612 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18613 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
18614 __Pyx_GOTREF(__pyx_t_2);
18615 }
18616 __pyx_v___pyx_result = __pyx_t_2;
18617 __pyx_t_2 = 0;
18618
18619 /* "(tree fragment)":8
18620 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18621 * __pyx_result = Enum.__new__(__pyx_type)
18622 * if __pyx_state is not None: # <<<<<<<<<<<<<<
18623 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18624 * return __pyx_result
18625*/
18626 __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
18627 if (__pyx_t_5) {
18628
18629
18630 /* "(tree fragment)":9
18631 * __pyx_result = Enum.__new__(__pyx_type)
18632 * if __pyx_state is not None:
18633 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
18634 * return __pyx_result
18635 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18636*/
18637 if (unlikely(__pyx_v___pyx_state == Py_None)) {
18638 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
18639 __PYX_ERR(1, 9, __pyx_L1_error)
18640 }
18641 __pyx_t_2 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
18642 __Pyx_GOTREF(__pyx_t_2);
18643 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18644
18645 /* "(tree fragment)":8
18646 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18647 * __pyx_result = Enum.__new__(__pyx_type)
18648 * if __pyx_state is not None: # <<<<<<<<<<<<<<
18649 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18650 * return __pyx_result
18651*/
18652 }
18653
18654 /* "(tree fragment)":10
18655 * if __pyx_state is not None:
18656 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18657 * return __pyx_result # <<<<<<<<<<<<<<
18658 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18659 * __pyx_result.name = __pyx_state[0]
18660*/
18661 {
18662 PyObject *__pyx_temp;
18663 {
18664 __pyx_temp = __pyx_r;
18665 __Pyx_INCREF(__pyx_v___pyx_result);
18666 __pyx_r = __pyx_v___pyx_result;
18667 }
18668 __Pyx_XDECREF(__pyx_temp);
18669 }
18670 goto __pyx_L0;
18671
18672 /* "(tree fragment)":4
18673 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
18674 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
18675 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
18676 * cdef object __pyx_result
18677 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18678*/
18679
18680 /* function exit code */
18681 __pyx_L1_error:;
18682 __Pyx_XDECREF(__pyx_t_2);
18683 __Pyx_XDECREF(__pyx_t_3);
18684 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18685 __pyx_r = NULL;
18686 __pyx_L0:;
18687 __Pyx_XDECREF(__pyx_v___pyx_result);
18688 __Pyx_XGIVEREF(__pyx_r);
18689 __Pyx_RefNannyFinishContext();
18690 return __pyx_r;
18691}
18692
18693/* "(tree fragment)":11
18694 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18695 * return __pyx_result
18696 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<<
18697 * __pyx_result.name = __pyx_state[0]
18698 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
18699*/
18700
18701static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18702 PyObject *__pyx_r = NULL;
18703 __Pyx_RefNannyDeclarations
18704 PyObject *__pyx_t_1 = NULL;
18705 int __pyx_t_2;
18706 int __pyx_lineno = 0;
18707 const char *__pyx_filename = NULL;
18708 int __pyx_clineno = 0;
18709 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
18710
18711 /* "(tree fragment)":12
18712 * return __pyx_result
18713 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18714 * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
18715 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
18716*/
18717 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18718 __Pyx_GOTREF(__pyx_t_1);
18719 __Pyx_GIVEREF(__pyx_t_1);
18720 __Pyx_GOTREF(__pyx_v___pyx_result->name);
18721 __Pyx_DECREF(__pyx_v___pyx_result->name);
18722 __pyx_v___pyx_result->name = __pyx_t_1;
18723 __pyx_t_1 = 0;
18724
18725 /* "(tree fragment)":13
18726 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18727 * __pyx_result.name = __pyx_state[0]
18728 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1) # <<<<<<<<<<<<<<
18729*/
18730 __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18731
18732
18733 /* "(tree fragment)":11
18734 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18735 * return __pyx_result
18736 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<<
18737 * __pyx_result.name = __pyx_state[0]
18738 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
18739*/
18740
18741 /* function exit code */
18742 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18743 goto __pyx_L0;
18744 __pyx_L1_error:;
18745 __Pyx_XDECREF(__pyx_t_1);
18746 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18747 __pyx_r = 0;
18748 __pyx_L0:;
18749 __Pyx_XGIVEREF(__pyx_r);
18750 __Pyx_RefNannyFinishContext();
18751 return __pyx_r;
18752}
18753
18754/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
18755 *
18756 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
18757 * @property # <<<<<<<<<<<<<<
18758 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
18759 * return PyDataType_TYPEOBJ(self)
18760*/
18761
18762static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
18763 PyTypeObject *__pyx_r;
18764
18765 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":232
18766 * @property
18767 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
18768 * return PyDataType_TYPEOBJ(self) # <<<<<<<<<<<<<<
18769 *
18770 * @property
18771*/
18772 {
18773
18774 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
18775 }
18776 goto __pyx_L0;
18777
18778 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
18779 *
18780 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
18781 * @property # <<<<<<<<<<<<<<
18782 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
18783 * return PyDataType_TYPEOBJ(self)
18784*/
18785
18786 /* function exit code */
18787 __pyx_L0:;
18788 return __pyx_r;
18789}
18790
18791/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
18792 * return PyDataType_TYPEOBJ(self)
18793 *
18794 * @property # <<<<<<<<<<<<<<
18795 * cdef inline char kind(self) noexcept nogil:
18796 * return PyDataType_KIND(self)
18797*/
18798
18799static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
18800 char __pyx_r;
18801
18802 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":236
18803 * @property
18804 * cdef inline char kind(self) noexcept nogil:
18805 * return PyDataType_KIND(self) # <<<<<<<<<<<<<<
18806 *
18807 * @property
18808*/
18809 {
18810
18811 __pyx_r = PyDataType_KIND(__pyx_v_self);
18812 }
18813 goto __pyx_L0;
18814
18815 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
18816 * return PyDataType_TYPEOBJ(self)
18817 *
18818 * @property # <<<<<<<<<<<<<<
18819 * cdef inline char kind(self) noexcept nogil:
18820 * return PyDataType_KIND(self)
18821*/
18822
18823 /* function exit code */
18824 __pyx_L0:;
18825 return __pyx_r;
18826}
18827
18828/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
18829 * return PyDataType_KIND(self)
18830 *
18831 * @property # <<<<<<<<<<<<<<
18832 * cdef inline char type(self) noexcept nogil:
18833 * return PyDataType_TYPE(self)
18834*/
18835
18836static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
18837 char __pyx_r;
18838
18839 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":240
18840 * @property
18841 * cdef inline char type(self) noexcept nogil:
18842 * return PyDataType_TYPE(self) # <<<<<<<<<<<<<<
18843 *
18844 * # Numpy sometimes mutates this without warning (e.g. it'll
18845*/
18846 {
18847
18848 __pyx_r = PyDataType_TYPE(__pyx_v_self);
18849 }
18850 goto __pyx_L0;
18851
18852 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
18853 * return PyDataType_KIND(self)
18854 *
18855 * @property # <<<<<<<<<<<<<<
18856 * cdef inline char type(self) noexcept nogil:
18857 * return PyDataType_TYPE(self)
18858*/
18859
18860 /* function exit code */
18861 __pyx_L0:;
18862 return __pyx_r;
18863}
18864
18865/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
18866 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
18867 * # directly accessing this field.
18868 * @property # <<<<<<<<<<<<<<
18869 * cdef inline char byteorder(self) noexcept nogil:
18870 * return PyDataType_BYTEORDER(self)
18871*/
18872
18873static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
18874 char __pyx_r;
18875
18876 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":249
18877 * @property
18878 * cdef inline char byteorder(self) noexcept nogil:
18879 * return PyDataType_BYTEORDER(self) # <<<<<<<<<<<<<<
18880 *
18881 * @property
18882*/
18883 {
18884
18885 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
18886 }
18887 goto __pyx_L0;
18888
18889 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
18890 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
18891 * # directly accessing this field.
18892 * @property # <<<<<<<<<<<<<<
18893 * cdef inline char byteorder(self) noexcept nogil:
18894 * return PyDataType_BYTEORDER(self)
18895*/
18896
18897 /* function exit code */
18898 __pyx_L0:;
18899 return __pyx_r;
18900}
18901
18902/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
18903 * return PyDataType_BYTEORDER(self)
18904 *
18905 * @property # <<<<<<<<<<<<<<
18906 * cdef inline int type_num(self) noexcept nogil:
18907 * return PyDataType_TYPENUM(self)
18908*/
18909
18910static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
18911 int __pyx_r;
18912
18913 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":253
18914 * @property
18915 * cdef inline int type_num(self) noexcept nogil:
18916 * return PyDataType_TYPENUM(self) # <<<<<<<<<<<<<<
18917 *
18918 * @property
18919*/
18920 {
18921
18922 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
18923 }
18924 goto __pyx_L0;
18925
18926 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
18927 * return PyDataType_BYTEORDER(self)
18928 *
18929 * @property # <<<<<<<<<<<<<<
18930 * cdef inline int type_num(self) noexcept nogil:
18931 * return PyDataType_TYPENUM(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":255
18940 * return PyDataType_TYPENUM(self)
18941 *
18942 * @property # <<<<<<<<<<<<<<
18943 * cdef inline npy_intp itemsize(self) noexcept nogil:
18944 * return PyDataType_ELSIZE(self)
18945*/
18946
18947static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
18948 npy_intp __pyx_r;
18949
18950 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":257
18951 * @property
18952 * cdef inline npy_intp itemsize(self) noexcept nogil:
18953 * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
18954 *
18955 * @property
18956*/
18957 {
18958
18959 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
18960 }
18961 goto __pyx_L0;
18962
18963 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
18964 * return PyDataType_TYPENUM(self)
18965 *
18966 * @property # <<<<<<<<<<<<<<
18967 * cdef inline npy_intp itemsize(self) noexcept nogil:
18968 * return PyDataType_ELSIZE(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":259
18977 * return PyDataType_ELSIZE(self)
18978 *
18979 * @property # <<<<<<<<<<<<<<
18980 * cdef inline npy_intp alignment(self) noexcept nogil:
18981 * return PyDataType_ALIGNMENT(self)
18982*/
18983
18984static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
18985 npy_intp __pyx_r;
18986
18987 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":261
18988 * @property
18989 * cdef inline npy_intp alignment(self) noexcept nogil:
18990 * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
18991 *
18992 * # Use fields/names with care as they may be NULL. You must check
18993*/
18994 {
18995
18996 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
18997 }
18998 goto __pyx_L0;
18999
19000 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
19001 * return PyDataType_ELSIZE(self)
19002 *
19003 * @property # <<<<<<<<<<<<<<
19004 * cdef inline npy_intp alignment(self) noexcept nogil:
19005 * return PyDataType_ALIGNMENT(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":265
19014 * # Use fields/names with care as they may be NULL. You must check
19015 * # for this using PyDataType_HASFIELDS.
19016 * @property # <<<<<<<<<<<<<<
19017 * cdef inline object fields(self):
19018 * return <object>PyDataType_FIELDS(self)
19019*/
19020
19021static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
19022 PyObject *__pyx_r = NULL;
19023 __Pyx_RefNannyDeclarations
19024 PyObject *__pyx_t_1;
19025 __Pyx_RefNannySetupContext("__get__", 0);
19026
19027 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":267
19028 * @property
19029 * cdef inline object fields(self):
19030 * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
19031 *
19032 * @property
19033*/
19034 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
19035
19036 {
19037 PyObject *__pyx_temp;
19038 {
19039 __pyx_temp = __pyx_r;
19040 __Pyx_INCREF(((PyObject *)__pyx_t_1));
19041 __pyx_r = ((PyObject *)__pyx_t_1);
19042 }
19043 __Pyx_XDECREF(__pyx_temp);
19044 }
19045
19046 goto __pyx_L0;
19047
19048 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
19049 * # Use fields/names with care as they may be NULL. You must check
19050 * # for this using PyDataType_HASFIELDS.
19051 * @property # <<<<<<<<<<<<<<
19052 * cdef inline object fields(self):
19053 * return <object>PyDataType_FIELDS(self)
19054*/
19055
19056 /* function exit code */
19057 __pyx_L0:;
19058 __Pyx_XGIVEREF(__pyx_r);
19059 __Pyx_RefNannyFinishContext();
19060 return __pyx_r;
19061}
19062
19063/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
19064 * return <object>PyDataType_FIELDS(self)
19065 *
19066 * @property # <<<<<<<<<<<<<<
19067 * cdef inline tuple names(self):
19068 * return <tuple>PyDataType_NAMES(self)
19069*/
19070
19071static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
19072 PyObject *__pyx_r = NULL;
19073 __Pyx_RefNannyDeclarations
19074 PyObject *__pyx_t_1;
19075 __Pyx_RefNannySetupContext("__get__", 0);
19076
19077 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":271
19078 * @property
19079 * cdef inline tuple names(self):
19080 * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
19081 *
19082 * # Use PyDataType_HASSUBARRAY to test whether this field is
19083*/
19084 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
19085
19086 {
19087 PyObject *__pyx_temp;
19088 {
19089 __pyx_temp = __pyx_r;
19090 __Pyx_INCREF(((PyObject*)__pyx_t_1));
19091 __pyx_r = ((PyObject*)__pyx_t_1);
19092 }
19093 __Pyx_XDECREF(__pyx_temp);
19094 }
19095
19096 goto __pyx_L0;
19097
19098 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
19099 * return <object>PyDataType_FIELDS(self)
19100 *
19101 * @property # <<<<<<<<<<<<<<
19102 * cdef inline tuple names(self):
19103 * return <tuple>PyDataType_NAMES(self)
19104*/
19105
19106 /* function exit code */
19107 __pyx_L0:;
19108 __Pyx_XGIVEREF(__pyx_r);
19109 __Pyx_RefNannyFinishContext();
19110 return __pyx_r;
19111}
19112
19113/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
19114 * # valid (the pointer can be NULL). Most users should access
19115 * # this field via the inline helper method PyDataType_SHAPE.
19116 * @property # <<<<<<<<<<<<<<
19117 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19118 * return PyDataType_SUBARRAY(self)
19119*/
19120
19121static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
19122 PyArray_ArrayDescr *__pyx_r;
19123
19124 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":278
19125 * @property
19126 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19127 * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
19128 *
19129 * @property
19130*/
19131 {
19132
19133 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
19134 }
19135 goto __pyx_L0;
19136
19137 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
19138 * # valid (the pointer can be NULL). Most users should access
19139 * # this field via the inline helper method PyDataType_SHAPE.
19140 * @property # <<<<<<<<<<<<<<
19141 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19142 * return PyDataType_SUBARRAY(self)
19143*/
19144
19145 /* function exit code */
19146 __pyx_L0:;
19147 return __pyx_r;
19148}
19149
19150/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
19151 * return PyDataType_SUBARRAY(self)
19152 *
19153 * @property # <<<<<<<<<<<<<<
19154 * cdef inline npy_uint64 flags(self) noexcept nogil:
19155 * """The data types flags."""
19156*/
19157
19158static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
19159 npy_uint64 __pyx_r;
19160
19161 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":283
19162 * cdef inline npy_uint64 flags(self) noexcept nogil:
19163 * """The data types flags."""
19164 * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
19165 *
19166 *
19167*/
19168 {
19169
19170 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
19171 }
19172 goto __pyx_L0;
19173
19174 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
19175 * return PyDataType_SUBARRAY(self)
19176 *
19177 * @property # <<<<<<<<<<<<<<
19178 * cdef inline npy_uint64 flags(self) noexcept nogil:
19179 * """The data types flags."""
19180*/
19181
19182 /* function exit code */
19183 __pyx_L0:;
19184 return __pyx_r;
19185}
19186
19187/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
19188 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
19189 *
19190 * @property # <<<<<<<<<<<<<<
19191 * cdef inline int numiter(self) noexcept nogil:
19192 * """The number of arrays that need to be broadcast to the same shape."""
19193*/
19194
19195static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
19196 int __pyx_r;
19197
19198 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":295
19199 * cdef inline int numiter(self) noexcept nogil:
19200 * """The number of arrays that need to be broadcast to the same shape."""
19201 * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
19202 *
19203 * @property
19204*/
19205 {
19206
19207 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
19208 }
19209 goto __pyx_L0;
19210
19211 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
19212 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
19213 *
19214 * @property # <<<<<<<<<<<<<<
19215 * cdef inline int numiter(self) noexcept nogil:
19216 * """The number of arrays that need to be broadcast to the same shape."""
19217*/
19218
19219 /* function exit code */
19220 __pyx_L0:;
19221 return __pyx_r;
19222}
19223
19224/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
19225 * return PyArray_MultiIter_NUMITER(self)
19226 *
19227 * @property # <<<<<<<<<<<<<<
19228 * cdef inline npy_intp size(self) noexcept nogil:
19229 * """The total broadcasted size."""
19230*/
19231
19232static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
19233 npy_intp __pyx_r;
19234
19235 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":300
19236 * cdef inline npy_intp size(self) noexcept nogil:
19237 * """The total broadcasted size."""
19238 * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
19239 *
19240 * @property
19241*/
19242 {
19243
19244 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
19245 }
19246 goto __pyx_L0;
19247
19248 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
19249 * return PyArray_MultiIter_NUMITER(self)
19250 *
19251 * @property # <<<<<<<<<<<<<<
19252 * cdef inline npy_intp size(self) noexcept nogil:
19253 * """The total broadcasted size."""
19254*/
19255
19256 /* function exit code */
19257 __pyx_L0:;
19258 return __pyx_r;
19259}
19260
19261/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
19262 * return PyArray_MultiIter_SIZE(self)
19263 *
19264 * @property # <<<<<<<<<<<<<<
19265 * cdef inline npy_intp index(self) noexcept nogil:
19266 * """The current (1-d) index into the broadcasted result."""
19267*/
19268
19269static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
19270 npy_intp __pyx_r;
19271
19272 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":305
19273 * cdef inline npy_intp index(self) noexcept nogil:
19274 * """The current (1-d) index into the broadcasted result."""
19275 * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
19276 *
19277 * @property
19278*/
19279 {
19280
19281 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
19282 }
19283 goto __pyx_L0;
19284
19285 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
19286 * return PyArray_MultiIter_SIZE(self)
19287 *
19288 * @property # <<<<<<<<<<<<<<
19289 * cdef inline npy_intp index(self) noexcept nogil:
19290 * """The current (1-d) index into the broadcasted result."""
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":307
19299 * return PyArray_MultiIter_INDEX(self)
19300 *
19301 * @property # <<<<<<<<<<<<<<
19302 * cdef inline int nd(self) noexcept nogil:
19303 * """The number of dimensions in the broadcasted result."""
19304*/
19305
19306static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
19307 int __pyx_r;
19308
19309 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":310
19310 * cdef inline int nd(self) noexcept nogil:
19311 * """The number of dimensions in the broadcasted result."""
19312 * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
19313 *
19314 * @property
19315*/
19316 {
19317
19318 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
19319 }
19320 goto __pyx_L0;
19321
19322 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
19323 * return PyArray_MultiIter_INDEX(self)
19324 *
19325 * @property # <<<<<<<<<<<<<<
19326 * cdef inline int nd(self) noexcept nogil:
19327 * """The number of dimensions in the broadcasted result."""
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":312
19336 * return PyArray_MultiIter_NDIM(self)
19337 *
19338 * @property # <<<<<<<<<<<<<<
19339 * cdef inline npy_intp* dimensions(self) noexcept nogil:
19340 * """The shape of the broadcasted result."""
19341*/
19342
19343static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
19344 npy_intp *__pyx_r;
19345
19346 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":315
19347 * cdef inline npy_intp* dimensions(self) noexcept nogil:
19348 * """The shape of the broadcasted result."""
19349 * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
19350 *
19351 * @property
19352*/
19353 {
19354
19355 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
19356 }
19357 goto __pyx_L0;
19358
19359 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
19360 * return PyArray_MultiIter_NDIM(self)
19361 *
19362 * @property # <<<<<<<<<<<<<<
19363 * cdef inline npy_intp* dimensions(self) noexcept nogil:
19364 * """The shape of the broadcasted result."""
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":317
19373 * return PyArray_MultiIter_DIMS(self)
19374 *
19375 * @property # <<<<<<<<<<<<<<
19376 * cdef inline void** iters(self) noexcept nogil:
19377 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19378*/
19379
19380static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
19381 void **__pyx_r;
19382
19383 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":321
19384 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19385 * On return, the iterators are adjusted for broadcasting."""
19386 * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
19387 *
19388 *
19389*/
19390 {
19391
19392 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
19393 }
19394 goto __pyx_L0;
19395
19396 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
19397 * return PyArray_MultiIter_DIMS(self)
19398 *
19399 * @property # <<<<<<<<<<<<<<
19400 * cdef inline void** iters(self) noexcept nogil:
19401 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
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":335
19410 * # Instead, we use properties that map to the corresponding C-API functions.
19411 *
19412 * @property # <<<<<<<<<<<<<<
19413 * cdef inline PyObject* base(self) noexcept nogil:
19414 * """Returns a borrowed reference to the object owning the data/memory.
19415*/
19416
19417static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
19418 PyObject *__pyx_r;
19419
19420 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":339
19421 * """Returns a borrowed reference to the object owning the data/memory.
19422 * """
19423 * return PyArray_BASE(self) # <<<<<<<<<<<<<<
19424 *
19425 * @property
19426*/
19427 {
19428
19429 __pyx_r = PyArray_BASE(__pyx_v_self);
19430 }
19431 goto __pyx_L0;
19432
19433 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
19434 * # Instead, we use properties that map to the corresponding C-API functions.
19435 *
19436 * @property # <<<<<<<<<<<<<<
19437 * cdef inline PyObject* base(self) noexcept nogil:
19438 * """Returns a borrowed reference to the object owning the data/memory.
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":341
19447 * return PyArray_BASE(self)
19448 *
19449 * @property # <<<<<<<<<<<<<<
19450 * cdef inline dtype descr(self):
19451 * """Returns an owned reference to the dtype of the array.
19452*/
19453
19454static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
19455 PyArray_Descr *__pyx_r = NULL;
19456 __Pyx_RefNannyDeclarations
19457 PyArray_Descr *__pyx_t_1;
19458 __Pyx_RefNannySetupContext("__get__", 0);
19459
19460 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":345
19461 * """Returns an owned reference to the dtype of the array.
19462 * """
19463 * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
19464 *
19465 * @property
19466*/
19467 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
19468
19469 {
19470 PyArray_Descr *__pyx_temp;
19471 {
19472 __pyx_temp = __pyx_r;
19473 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
19474 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19475 }
19476 __Pyx_XDECREF((PyObject *)__pyx_temp);
19477 }
19478
19479 goto __pyx_L0;
19480
19481 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
19482 * return PyArray_BASE(self)
19483 *
19484 * @property # <<<<<<<<<<<<<<
19485 * cdef inline dtype descr(self):
19486 * """Returns an owned reference to the dtype of the array.
19487*/
19488
19489 /* function exit code */
19490 __pyx_L0:;
19491 __Pyx_XGIVEREF((PyObject *)__pyx_r);
19492 __Pyx_RefNannyFinishContext();
19493 return __pyx_r;
19494}
19495
19496/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
19497 * return <dtype>PyArray_DESCR(self)
19498 *
19499 * @property # <<<<<<<<<<<<<<
19500 * cdef inline int ndim(self) noexcept nogil:
19501 * """Returns the number of dimensions in the array.
19502*/
19503
19504static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
19505 int __pyx_r;
19506
19507 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":351
19508 * """Returns the number of dimensions in the array.
19509 * """
19510 * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
19511 *
19512 * @property
19513*/
19514 {
19515
19516 __pyx_r = PyArray_NDIM(__pyx_v_self);
19517 }
19518 goto __pyx_L0;
19519
19520 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
19521 * return <dtype>PyArray_DESCR(self)
19522 *
19523 * @property # <<<<<<<<<<<<<<
19524 * cdef inline int ndim(self) noexcept nogil:
19525 * """Returns the number of dimensions in the array.
19526*/
19527
19528 /* function exit code */
19529 __pyx_L0:;
19530 return __pyx_r;
19531}
19532
19533/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
19534 * return PyArray_NDIM(self)
19535 *
19536 * @property # <<<<<<<<<<<<<<
19537 * cdef inline npy_intp *shape(self) noexcept nogil:
19538 * """Returns a pointer to the dimensions/shape of the array.
19539*/
19540
19541static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
19542 npy_intp *__pyx_r;
19543
19544 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":359
19545 * Can return NULL for 0-dimensional arrays.
19546 * """
19547 * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
19548 *
19549 * @property
19550*/
19551 {
19552
19553 __pyx_r = PyArray_DIMS(__pyx_v_self);
19554 }
19555 goto __pyx_L0;
19556
19557 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
19558 * return PyArray_NDIM(self)
19559 *
19560 * @property # <<<<<<<<<<<<<<
19561 * cdef inline npy_intp *shape(self) noexcept nogil:
19562 * """Returns a pointer to the dimensions/shape of the array.
19563*/
19564
19565 /* function exit code */
19566 __pyx_L0:;
19567 return __pyx_r;
19568}
19569
19570/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
19571 * return PyArray_DIMS(self)
19572 *
19573 * @property # <<<<<<<<<<<<<<
19574 * cdef inline npy_intp *strides(self) noexcept nogil:
19575 * """Returns a pointer to the strides of the array.
19576*/
19577
19578static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
19579 npy_intp *__pyx_r;
19580
19581 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":366
19582 * The number of elements matches the number of dimensions of the array (ndim).
19583 * """
19584 * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
19585 *
19586 * @property
19587*/
19588 {
19589
19590 __pyx_r = PyArray_STRIDES(__pyx_v_self);
19591 }
19592 goto __pyx_L0;
19593
19594 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
19595 * return PyArray_DIMS(self)
19596 *
19597 * @property # <<<<<<<<<<<<<<
19598 * cdef inline npy_intp *strides(self) noexcept nogil:
19599 * """Returns a pointer to the strides of the array.
19600*/
19601
19602 /* function exit code */
19603 __pyx_L0:;
19604 return __pyx_r;
19605}
19606
19607/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
19608 * return PyArray_STRIDES(self)
19609 *
19610 * @property # <<<<<<<<<<<<<<
19611 * cdef inline npy_intp size(self) noexcept nogil:
19612 * """Returns the total size (in number of elements) of the array.
19613*/
19614
19615static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
19616 npy_intp __pyx_r;
19617
19618 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":372
19619 * """Returns the total size (in number of elements) of the array.
19620 * """
19621 * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
19622 *
19623 * @property
19624*/
19625 {
19626
19627 __pyx_r = PyArray_SIZE(__pyx_v_self);
19628 }
19629 goto __pyx_L0;
19630
19631 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
19632 * return PyArray_STRIDES(self)
19633 *
19634 * @property # <<<<<<<<<<<<<<
19635 * cdef inline npy_intp size(self) noexcept nogil:
19636 * """Returns the total size (in number of elements) of the array.
19637*/
19638
19639 /* function exit code */
19640 __pyx_L0:;
19641 return __pyx_r;
19642}
19643
19644/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
19645 * return PyArray_SIZE(self)
19646 *
19647 * @property # <<<<<<<<<<<<<<
19648 * cdef inline char* data(self) noexcept nogil:
19649 * """The pointer to the data buffer as a char*.
19650*/
19651
19652static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
19653 char *__pyx_r;
19654
19655 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":381
19656 * of `PyArray_DATA()` instead, which returns a 'void*'.
19657 * """
19658 * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
19659 *
19660 *
19661*/
19662 {
19663
19664 __pyx_r = PyArray_BYTES(__pyx_v_self);
19665 }
19666 goto __pyx_L0;
19667
19668 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
19669 * return PyArray_SIZE(self)
19670 *
19671 * @property # <<<<<<<<<<<<<<
19672 * cdef inline char* data(self) noexcept nogil:
19673 * """The pointer to the data buffer as a char*.
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":794
19682 * ctypedef long double complex clongdouble_t
19683 *
19684 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19685 * return PyArray_MultiIterNew(1, <void*>a)
19686 *
19687*/
19688
19689static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19690 PyObject *__pyx_r = NULL;
19691 __Pyx_RefNannyDeclarations
19692 PyObject *__pyx_t_1 = NULL;
19693 int __pyx_lineno = 0;
19694 const char *__pyx_filename = NULL;
19695 int __pyx_clineno = 0;
19696 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
19697
19698 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":795
19699 *
19700 * cdef inline object PyArray_MultiIterNew1(a):
19701 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
19702 *
19703 * cdef inline object PyArray_MultiIterNew2(a, b):
19704*/
19705 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 795, __pyx_L1_error)
19706 __Pyx_GOTREF(__pyx_t_1);
19707 {
19708 PyObject *__pyx_temp;
19709 {
19710 __pyx_temp = __pyx_r;
19711 __pyx_r = __pyx_t_1;
19712 }
19713 __Pyx_XDECREF(__pyx_temp);
19714 }
19715 __pyx_t_1 = 0;
19716 goto __pyx_L0;
19717
19718 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
19719 * ctypedef long double complex clongdouble_t
19720 *
19721 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19722 * return PyArray_MultiIterNew(1, <void*>a)
19723 *
19724*/
19725
19726 /* function exit code */
19727 __pyx_L1_error:;
19728 __Pyx_XDECREF(__pyx_t_1);
19729 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19730 __pyx_r = 0;
19731 __pyx_L0:;
19732 __Pyx_XGIVEREF(__pyx_r);
19733 __Pyx_RefNannyFinishContext();
19734 return __pyx_r;
19735}
19736
19737/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
19738 * return PyArray_MultiIterNew(1, <void*>a)
19739 *
19740 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19741 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19742 *
19743*/
19744
19745static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19746 PyObject *__pyx_r = NULL;
19747 __Pyx_RefNannyDeclarations
19748 PyObject *__pyx_t_1 = NULL;
19749 int __pyx_lineno = 0;
19750 const char *__pyx_filename = NULL;
19751 int __pyx_clineno = 0;
19752 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
19753
19754 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":798
19755 *
19756 * cdef inline object PyArray_MultiIterNew2(a, b):
19757 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
19758 *
19759 * cdef inline object PyArray_MultiIterNew3(a, b, c):
19760*/
19761 __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 798, __pyx_L1_error)
19762 __Pyx_GOTREF(__pyx_t_1);
19763 {
19764 PyObject *__pyx_temp;
19765 {
19766 __pyx_temp = __pyx_r;
19767 __pyx_r = __pyx_t_1;
19768 }
19769 __Pyx_XDECREF(__pyx_temp);
19770 }
19771 __pyx_t_1 = 0;
19772 goto __pyx_L0;
19773
19774 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
19775 * return PyArray_MultiIterNew(1, <void*>a)
19776 *
19777 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19778 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19779 *
19780*/
19781
19782 /* function exit code */
19783 __pyx_L1_error:;
19784 __Pyx_XDECREF(__pyx_t_1);
19785 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19786 __pyx_r = 0;
19787 __pyx_L0:;
19788 __Pyx_XGIVEREF(__pyx_r);
19789 __Pyx_RefNannyFinishContext();
19790 return __pyx_r;
19791}
19792
19793/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
19794 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19795 *
19796 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19797 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19798 *
19799*/
19800
19801static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19802 PyObject *__pyx_r = NULL;
19803 __Pyx_RefNannyDeclarations
19804 PyObject *__pyx_t_1 = NULL;
19805 int __pyx_lineno = 0;
19806 const char *__pyx_filename = NULL;
19807 int __pyx_clineno = 0;
19808 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
19809
19810 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":801
19811 *
19812 * cdef inline object PyArray_MultiIterNew3(a, b, c):
19813 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
19814 *
19815 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19816*/
19817 __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 801, __pyx_L1_error)
19818 __Pyx_GOTREF(__pyx_t_1);
19819 {
19820 PyObject *__pyx_temp;
19821 {
19822 __pyx_temp = __pyx_r;
19823 __pyx_r = __pyx_t_1;
19824 }
19825 __Pyx_XDECREF(__pyx_temp);
19826 }
19827 __pyx_t_1 = 0;
19828 goto __pyx_L0;
19829
19830 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
19831 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19832 *
19833 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19834 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19835 *
19836*/
19837
19838 /* function exit code */
19839 __pyx_L1_error:;
19840 __Pyx_XDECREF(__pyx_t_1);
19841 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19842 __pyx_r = 0;
19843 __pyx_L0:;
19844 __Pyx_XGIVEREF(__pyx_r);
19845 __Pyx_RefNannyFinishContext();
19846 return __pyx_r;
19847}
19848
19849/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
19850 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19851 *
19852 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19853 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19854 *
19855*/
19856
19857static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
19858 PyObject *__pyx_r = NULL;
19859 __Pyx_RefNannyDeclarations
19860 PyObject *__pyx_t_1 = NULL;
19861 int __pyx_lineno = 0;
19862 const char *__pyx_filename = NULL;
19863 int __pyx_clineno = 0;
19864 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
19865
19866 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":804
19867 *
19868 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19869 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
19870 *
19871 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19872*/
19873 __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 804, __pyx_L1_error)
19874 __Pyx_GOTREF(__pyx_t_1);
19875 {
19876 PyObject *__pyx_temp;
19877 {
19878 __pyx_temp = __pyx_r;
19879 __pyx_r = __pyx_t_1;
19880 }
19881 __Pyx_XDECREF(__pyx_temp);
19882 }
19883 __pyx_t_1 = 0;
19884 goto __pyx_L0;
19885
19886 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
19887 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19888 *
19889 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19890 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19891 *
19892*/
19893
19894 /* function exit code */
19895 __pyx_L1_error:;
19896 __Pyx_XDECREF(__pyx_t_1);
19897 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19898 __pyx_r = 0;
19899 __pyx_L0:;
19900 __Pyx_XGIVEREF(__pyx_r);
19901 __Pyx_RefNannyFinishContext();
19902 return __pyx_r;
19903}
19904
19905/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
19906 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19907 *
19908 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19909 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19910 *
19911*/
19912
19913static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
19914 PyObject *__pyx_r = NULL;
19915 __Pyx_RefNannyDeclarations
19916 PyObject *__pyx_t_1 = NULL;
19917 int __pyx_lineno = 0;
19918 const char *__pyx_filename = NULL;
19919 int __pyx_clineno = 0;
19920 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
19921
19922 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":807
19923 *
19924 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19925 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
19926 *
19927 * cdef inline tuple PyDataType_SHAPE(dtype d):
19928*/
19929 __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 807, __pyx_L1_error)
19930 __Pyx_GOTREF(__pyx_t_1);
19931 {
19932 PyObject *__pyx_temp;
19933 {
19934 __pyx_temp = __pyx_r;
19935 __pyx_r = __pyx_t_1;
19936 }
19937 __Pyx_XDECREF(__pyx_temp);
19938 }
19939 __pyx_t_1 = 0;
19940 goto __pyx_L0;
19941
19942 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
19943 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19944 *
19945 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19946 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19947 *
19948*/
19949
19950 /* function exit code */
19951 __pyx_L1_error:;
19952 __Pyx_XDECREF(__pyx_t_1);
19953 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
19954 __pyx_r = 0;
19955 __pyx_L0:;
19956 __Pyx_XGIVEREF(__pyx_r);
19957 __Pyx_RefNannyFinishContext();
19958 return __pyx_r;
19959}
19960
19961/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
19962 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19963 *
19964 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
19965 * if PyDataType_HASSUBARRAY(d):
19966 * return <tuple>d.subarray.shape
19967*/
19968
19969static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
19970 PyObject *__pyx_r = NULL;
19971 __Pyx_RefNannyDeclarations
19972 int __pyx_t_1;
19973 PyObject *__pyx_t_2;
19974 __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
19975
19976 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
19977 *
19978 * cdef inline tuple PyDataType_SHAPE(dtype d):
19979 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
19980 * return <tuple>d.subarray.shape
19981 * else:
19982*/
19983 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
19984
19985 if (__pyx_t_1) {
19986
19987
19988 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":811
19989 * cdef inline tuple PyDataType_SHAPE(dtype d):
19990 * if PyDataType_HASSUBARRAY(d):
19991 * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
19992 * else:
19993 * return ()
19994*/
19995 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
19996
19997 {
19998 PyObject *__pyx_temp;
19999 {
20000 __pyx_temp = __pyx_r;
20001 __Pyx_INCREF(((PyObject*)__pyx_t_2));
20002 __pyx_r = ((PyObject*)__pyx_t_2);
20003 }
20004 __Pyx_XDECREF(__pyx_temp);
20005 }
20006
20007 goto __pyx_L0;
20008
20009 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
20010 *
20011 * cdef inline tuple PyDataType_SHAPE(dtype d):
20012 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20013 * return <tuple>d.subarray.shape
20014 * else:
20015*/
20016 }
20017
20018 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":813
20019 * return <tuple>d.subarray.shape
20020 * else:
20021 * return () # <<<<<<<<<<<<<<
20022 *
20023 *
20024*/
20025 /*else*/ {
20026 {
20027 PyObject *__pyx_temp;
20028 {
20029 __pyx_temp = __pyx_r;
20030 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
20031 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
20032 }
20033 __Pyx_XDECREF(__pyx_temp);
20034 }
20035 goto __pyx_L0;
20036 }
20037
20038 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
20039 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20040 *
20041 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20042 * if PyDataType_HASSUBARRAY(d):
20043 * return <tuple>d.subarray.shape
20044*/
20045
20046 /* function exit code */
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":947
20054 *
20055 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
20056 * @property # <<<<<<<<<<<<<<
20057 * cdef inline int nin(self) noexcept nogil:
20058 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20059*/
20060
20061static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
20062 int __pyx_r;
20063
20064 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":949
20065 * @property
20066 * cdef inline int nin(self) noexcept nogil:
20067 * return _PyUFuncObject_GET_ITEM_DATA(self).nin # <<<<<<<<<<<<<<
20068 *
20069 * @property
20070*/
20071 {
20072
20073 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
20074 }
20075 goto __pyx_L0;
20076
20077 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
20078 *
20079 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
20080 * @property # <<<<<<<<<<<<<<
20081 * cdef inline int nin(self) noexcept nogil:
20082 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20083*/
20084
20085 /* function exit code */
20086 __pyx_L0:;
20087 return __pyx_r;
20088}
20089
20090/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
20091 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20092 *
20093 * @property # <<<<<<<<<<<<<<
20094 * cdef inline int nout(self) noexcept nogil:
20095 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20096*/
20097
20098static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
20099 int __pyx_r;
20100
20101 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":953
20102 * @property
20103 * cdef inline int nout(self) noexcept nogil:
20104 * return _PyUFuncObject_GET_ITEM_DATA(self).nout # <<<<<<<<<<<<<<
20105 *
20106 * @property
20107*/
20108 {
20109
20110 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
20111 }
20112 goto __pyx_L0;
20113
20114 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
20115 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20116 *
20117 * @property # <<<<<<<<<<<<<<
20118 * cdef inline int nout(self) noexcept nogil:
20119 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20120*/
20121
20122 /* function exit code */
20123 __pyx_L0:;
20124 return __pyx_r;
20125}
20126
20127/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
20128 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20129 *
20130 * @property # <<<<<<<<<<<<<<
20131 * cdef inline int nargs(self) noexcept nogil:
20132 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20133*/
20134
20135static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
20136 int __pyx_r;
20137
20138 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":957
20139 * @property
20140 * cdef inline int nargs(self) noexcept nogil:
20141 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs # <<<<<<<<<<<<<<
20142 *
20143 * @property
20144*/
20145 {
20146
20147 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
20148 }
20149 goto __pyx_L0;
20150
20151 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
20152 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20153 *
20154 * @property # <<<<<<<<<<<<<<
20155 * cdef inline int nargs(self) noexcept nogil:
20156 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20157*/
20158
20159 /* function exit code */
20160 __pyx_L0:;
20161 return __pyx_r;
20162}
20163
20164/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
20165 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20166 *
20167 * @property # <<<<<<<<<<<<<<
20168 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20169 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20170*/
20171
20172static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
20173 PyUFuncGenericFunction *__pyx_r;
20174
20175 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":961
20176 * @property
20177 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20178 * return _PyUFuncObject_GET_ITEM_DATA(self).functions # <<<<<<<<<<<<<<
20179 *
20180 * @property
20181*/
20182 {
20183
20184 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
20185 }
20186 goto __pyx_L0;
20187
20188 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
20189 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20190 *
20191 * @property # <<<<<<<<<<<<<<
20192 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20193 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20194*/
20195
20196 /* function exit code */
20197 __pyx_L0:;
20198 return __pyx_r;
20199}
20200
20201/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
20202 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20203 *
20204 * @property # <<<<<<<<<<<<<<
20205 * cdef inline void ** data(self) noexcept nogil:
20206 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20207*/
20208
20209static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
20210 void **__pyx_r;
20211
20212 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":965
20213 * @property
20214 * cdef inline void ** data(self) noexcept nogil:
20215 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data # <<<<<<<<<<<<<<
20216 *
20217 * @property
20218*/
20219 {
20220
20221 __pyx_r = ((void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
20222 }
20223 goto __pyx_L0;
20224
20225 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
20226 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20227 *
20228 * @property # <<<<<<<<<<<<<<
20229 * cdef inline void ** data(self) noexcept nogil:
20230 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
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":967
20239 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20240 *
20241 * @property # <<<<<<<<<<<<<<
20242 * cdef inline int ntypes(self) noexcept nogil:
20243 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20244*/
20245
20246static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___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":969
20250 * @property
20251 * cdef inline int ntypes(self) noexcept nogil:
20252 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes # <<<<<<<<<<<<<<
20253 *
20254 * @property
20255*/
20256 {
20257
20258 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
20259 }
20260 goto __pyx_L0;
20261
20262 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
20263 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20264 *
20265 * @property # <<<<<<<<<<<<<<
20266 * cdef inline int ntypes(self) noexcept nogil:
20267 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
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":971
20276 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20277 *
20278 * @property # <<<<<<<<<<<<<<
20279 * cdef inline const char* name(self) noexcept nogil:
20280 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20281*/
20282
20283static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
20284 char const *__pyx_r;
20285
20286 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":973
20287 * @property
20288 * cdef inline const char* name(self) noexcept nogil:
20289 * return _PyUFuncObject_GET_ITEM_DATA(self).name # <<<<<<<<<<<<<<
20290 *
20291 * @property
20292*/
20293 {
20294
20295 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
20296 }
20297 goto __pyx_L0;
20298
20299 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
20300 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20301 *
20302 * @property # <<<<<<<<<<<<<<
20303 * cdef inline const char* name(self) noexcept nogil:
20304 * return _PyUFuncObject_GET_ITEM_DATA(self).name
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":975
20313 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20314 *
20315 * @property # <<<<<<<<<<<<<<
20316 * cdef inline const char* doc(self) noexcept nogil:
20317 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20318*/
20319
20320static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
20321 char const *__pyx_r;
20322
20323 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":977
20324 * @property
20325 * cdef inline const char* doc(self) noexcept nogil:
20326 * return _PyUFuncObject_GET_ITEM_DATA(self).doc # <<<<<<<<<<<<<<
20327 *
20328 * @property
20329*/
20330 {
20331
20332 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
20333 }
20334 goto __pyx_L0;
20335
20336 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
20337 * return _PyUFuncObject_GET_ITEM_DATA(self).name
20338 *
20339 * @property # <<<<<<<<<<<<<<
20340 * cdef inline const char* doc(self) noexcept nogil:
20341 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
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":979
20350 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20351 *
20352 * @property # <<<<<<<<<<<<<<
20353 * cdef inline void* ptr(self) noexcept nogil:
20354 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20355*/
20356
20357static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___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":981
20361 * @property
20362 * cdef inline void* ptr(self) noexcept nogil:
20363 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr # <<<<<<<<<<<<<<
20364 *
20365 * @property
20366*/
20367 {
20368
20369 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
20370 }
20371 goto __pyx_L0;
20372
20373 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
20374 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
20375 *
20376 * @property # <<<<<<<<<<<<<<
20377 * cdef inline void* ptr(self) noexcept nogil:
20378 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
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":983
20387 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20388 *
20389 * @property # <<<<<<<<<<<<<<
20390 * cdef inline PyObject* obj(self) noexcept nogil:
20391 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20392*/
20393
20394static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
20395 PyObject *__pyx_r;
20396
20397 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":985
20398 * @property
20399 * cdef inline PyObject* obj(self) noexcept nogil:
20400 * return _PyUFuncObject_GET_ITEM_DATA(self).obj # <<<<<<<<<<<<<<
20401 *
20402 * @property
20403*/
20404 {
20405
20406 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
20407 }
20408 goto __pyx_L0;
20409
20410 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
20411 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
20412 *
20413 * @property # <<<<<<<<<<<<<<
20414 * cdef inline PyObject* obj(self) noexcept nogil:
20415 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
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":987
20424 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20425 *
20426 * @property # <<<<<<<<<<<<<<
20427 * cdef inline PyObject* userloops(self) noexcept nogil:
20428 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
20429*/
20430
20431static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
20432 PyObject *__pyx_r;
20433
20434 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":989
20435 * @property
20436 * cdef inline PyObject* userloops(self) noexcept nogil:
20437 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops # <<<<<<<<<<<<<<
20438 *
20439 * PyUFuncObject_fields *_PyUFuncObject_GET_ITEM_DATA(ufunc) nogil
20440*/
20441 {
20442
20443 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
20444 }
20445 goto __pyx_L0;
20446
20447 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
20448 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
20449 *
20450 * @property # <<<<<<<<<<<<<<
20451 * cdef inline PyObject* userloops(self) noexcept nogil:
20452 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
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":1065
20461 * int _import_umath() except -1
20462 *
20463 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20464 * Py_INCREF(base) # important to do this before stealing the reference below!
20465 * PyArray_SetBaseObject(arr, base)
20466*/
20467
20468static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
20469 int __pyx_t_1;
20470 int __pyx_lineno = 0;
20471 const char *__pyx_filename = NULL;
20472 int __pyx_clineno = 0;
20473
20474 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1066
20475 *
20476 * cdef inline void set_array_base(ndarray arr, object base) except *:
20477 * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
20478 * PyArray_SetBaseObject(arr, base)
20479 *
20480*/
20481 Py_INCREF(__pyx_v_base);
20482
20483 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1067
20484 * cdef inline void set_array_base(ndarray arr, object base) except *:
20485 * Py_INCREF(base) # important to do this before stealing the reference below!
20486 * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
20487 *
20488 * cdef inline object get_array_base(ndarray arr):
20489*/
20490 __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1067, __pyx_L1_error)
20491
20492
20493 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
20494 * int _import_umath() except -1
20495 *
20496 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20497 * Py_INCREF(base) # important to do this before stealing the reference below!
20498 * PyArray_SetBaseObject(arr, base)
20499*/
20500
20501 /* function exit code */
20502 goto __pyx_L0;
20503 __pyx_L1_error:;
20504 __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
20505 __pyx_L0:;
20506
20507}
20508
20509/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
20510 * PyArray_SetBaseObject(arr, base)
20511 *
20512 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20513 * base = PyArray_BASE(arr)
20514 * if base is NULL:
20515*/
20516
20517static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
20518 PyObject *__pyx_v_base;
20519 PyObject *__pyx_r = NULL;
20520 __Pyx_RefNannyDeclarations
20521 int __pyx_t_1;
20522 __Pyx_RefNannySetupContext("get_array_base", 0);
20523
20524 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1070
20525 *
20526 * cdef inline object get_array_base(ndarray arr):
20527 * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
20528 * if base is NULL:
20529 * return None
20530*/
20531 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20532
20533 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
20534 * cdef inline object get_array_base(ndarray arr):
20535 * base = PyArray_BASE(arr)
20536 * if base is NULL: # <<<<<<<<<<<<<<
20537 * return None
20538 * return <object>base
20539*/
20540 __pyx_t_1 = (__pyx_v_base == NULL);
20541
20542 if (__pyx_t_1) {
20543
20544
20545 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1072
20546 * base = PyArray_BASE(arr)
20547 * if base is NULL:
20548 * return None # <<<<<<<<<<<<<<
20549 * return <object>base
20550 *
20551*/
20552 {
20553 PyObject *__pyx_temp;
20554 {
20555 __pyx_temp = __pyx_r;
20556 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20557 }
20558 __Pyx_XDECREF(__pyx_temp);
20559 }
20560 goto __pyx_L0;
20561
20562 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
20563 * cdef inline object get_array_base(ndarray arr):
20564 * base = PyArray_BASE(arr)
20565 * if base is NULL: # <<<<<<<<<<<<<<
20566 * return None
20567 * return <object>base
20568*/
20569 }
20570
20571 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1073
20572 * if base is NULL:
20573 * return None
20574 * return <object>base # <<<<<<<<<<<<<<
20575 *
20576 * # Versions of the import_* functions which are more suitable for
20577*/
20578 {
20579 PyObject *__pyx_temp;
20580 {
20581 __pyx_temp = __pyx_r;
20582 __Pyx_INCREF(((PyObject *)__pyx_v_base));
20583 __pyx_r = ((PyObject *)__pyx_v_base);
20584 }
20585 __Pyx_XDECREF(__pyx_temp);
20586 }
20587 goto __pyx_L0;
20588
20589 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
20590 * PyArray_SetBaseObject(arr, base)
20591 *
20592 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20593 * base = PyArray_BASE(arr)
20594 * if base is NULL:
20595*/
20596
20597 /* function exit code */
20598 __pyx_L0:;
20599
20600 __Pyx_XGIVEREF(__pyx_r);
20601 __Pyx_RefNannyFinishContext();
20602 return __pyx_r;
20603}
20604
20605/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
20606 * # Versions of the import_* functions which are more suitable for
20607 * # Cython code.
20608 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20609 * try:
20610 * __pyx_import_array()
20611*/
20612
20613static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20614 int __pyx_r;
20615 __Pyx_RefNannyDeclarations
20616 PyObject *__pyx_t_1 = NULL;
20617 PyObject *__pyx_t_2 = NULL;
20618 PyObject *__pyx_t_3 = NULL;
20619 int __pyx_t_4;
20620 PyObject *__pyx_t_5 = NULL;
20621 PyObject *__pyx_t_6 = NULL;
20622 PyObject *__pyx_t_7 = NULL;
20623 PyObject *__pyx_t_8 = NULL;
20624 PyObject *__pyx_t_9 = NULL;
20625 size_t __pyx_t_10;
20626 int __pyx_lineno = 0;
20627 const char *__pyx_filename = NULL;
20628 int __pyx_clineno = 0;
20629 __Pyx_RefNannySetupContext("import_array", 0);
20630
20631 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
20632 * # Cython code.
20633 * cdef inline int import_array() except -1:
20634 * try: # <<<<<<<<<<<<<<
20635 * __pyx_import_array()
20636 * except Exception:
20637*/
20638 {
20639 __Pyx_PyThreadState_declare
20640 __Pyx_PyThreadState_assign
20641 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20642 __Pyx_XGOTREF(__pyx_t_1);
20643 __Pyx_XGOTREF(__pyx_t_2);
20644 __Pyx_XGOTREF(__pyx_t_3);
20645 /*try:*/ {
20646
20647 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1079
20648 * cdef inline int import_array() except -1:
20649 * try:
20650 * __pyx_import_array() # <<<<<<<<<<<<<<
20651 * except Exception:
20652 * raise ImportError("numpy._core.multiarray failed to import")
20653*/
20654 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1079, __pyx_L3_error)
20655
20656
20657 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
20658 * # Cython code.
20659 * cdef inline int import_array() except -1:
20660 * try: # <<<<<<<<<<<<<<
20661 * __pyx_import_array()
20662 * except Exception:
20663*/
20664 }
20665 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20666 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20667 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20668 goto __pyx_L8_try_end;
20669 __pyx_L3_error:;
20670
20671 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1080
20672 * try:
20673 * __pyx_import_array()
20674 * except Exception: # <<<<<<<<<<<<<<
20675 * raise ImportError("numpy._core.multiarray failed to import")
20676 *
20677*/
20678 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20679 if (__pyx_t_4) {
20680 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20681 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1080, __pyx_L5_except_error)
20682 __Pyx_XGOTREF(__pyx_t_5);
20683 __Pyx_XGOTREF(__pyx_t_6);
20684 __Pyx_XGOTREF(__pyx_t_7);
20685
20686 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1081
20687 * __pyx_import_array()
20688 * except Exception:
20689 * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
20690 *
20691 * cdef inline int import_umath() except -1:
20692*/
20693 __pyx_t_9 = NULL;
20694 __pyx_t_10 = 1;
20695 {
20696 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
20697 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
20698 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20699 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1081, __pyx_L5_except_error)
20700 __Pyx_GOTREF(__pyx_t_8);
20701 }
20702 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20703 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20704 __PYX_ERR(2, 1081, __pyx_L5_except_error)
20705 }
20706 goto __pyx_L5_except_error;
20707
20708 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
20709 * # Cython code.
20710 * cdef inline int import_array() except -1:
20711 * try: # <<<<<<<<<<<<<<
20712 * __pyx_import_array()
20713 * except Exception:
20714*/
20715 __pyx_L5_except_error:;
20716 __Pyx_XGIVEREF(__pyx_t_1);
20717 __Pyx_XGIVEREF(__pyx_t_2);
20718 __Pyx_XGIVEREF(__pyx_t_3);
20719 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20720 goto __pyx_L1_error;
20721 __pyx_L8_try_end:;
20722 }
20723
20724 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
20725 * # Versions of the import_* functions which are more suitable for
20726 * # Cython code.
20727 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20728 * try:
20729 * __pyx_import_array()
20730*/
20731
20732 /* function exit code */
20733 __pyx_r = 0;
20734 goto __pyx_L0;
20735 __pyx_L1_error:;
20736 __Pyx_XDECREF(__pyx_t_5);
20737 __Pyx_XDECREF(__pyx_t_6);
20738 __Pyx_XDECREF(__pyx_t_7);
20739 __Pyx_XDECREF(__pyx_t_8);
20740 __Pyx_XDECREF(__pyx_t_9);
20741 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20742 __pyx_r = -1;
20743 __pyx_L0:;
20744
20745 __Pyx_RefNannyFinishContext();
20746 return __pyx_r;
20747}
20748
20749/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
20750 * raise ImportError("numpy._core.multiarray failed to import")
20751 *
20752 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
20753 * try:
20754 * _import_umath()
20755*/
20756
20757static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20758 int __pyx_r;
20759 __Pyx_RefNannyDeclarations
20760 PyObject *__pyx_t_1 = NULL;
20761 PyObject *__pyx_t_2 = NULL;
20762 PyObject *__pyx_t_3 = NULL;
20763 int __pyx_t_4;
20764 PyObject *__pyx_t_5 = NULL;
20765 PyObject *__pyx_t_6 = NULL;
20766 PyObject *__pyx_t_7 = NULL;
20767 PyObject *__pyx_t_8 = NULL;
20768 PyObject *__pyx_t_9 = NULL;
20769 size_t __pyx_t_10;
20770 int __pyx_lineno = 0;
20771 const char *__pyx_filename = NULL;
20772 int __pyx_clineno = 0;
20773 __Pyx_RefNannySetupContext("import_umath", 0);
20774
20775 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
20776 *
20777 * cdef inline int import_umath() except -1:
20778 * try: # <<<<<<<<<<<<<<
20779 * _import_umath()
20780 * except Exception:
20781*/
20782 {
20783 __Pyx_PyThreadState_declare
20784 __Pyx_PyThreadState_assign
20785 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20786 __Pyx_XGOTREF(__pyx_t_1);
20787 __Pyx_XGOTREF(__pyx_t_2);
20788 __Pyx_XGOTREF(__pyx_t_3);
20789 /*try:*/ {
20790
20791 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1085
20792 * cdef inline int import_umath() except -1:
20793 * try:
20794 * _import_umath() # <<<<<<<<<<<<<<
20795 * except Exception:
20796 * raise ImportError("numpy._core.umath failed to import")
20797*/
20798 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1085, __pyx_L3_error)
20799
20800
20801 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
20802 *
20803 * cdef inline int import_umath() except -1:
20804 * try: # <<<<<<<<<<<<<<
20805 * _import_umath()
20806 * except Exception:
20807*/
20808 }
20809 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20810 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20811 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20812 goto __pyx_L8_try_end;
20813 __pyx_L3_error:;
20814
20815 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1086
20816 * try:
20817 * _import_umath()
20818 * except Exception: # <<<<<<<<<<<<<<
20819 * raise ImportError("numpy._core.umath failed to import")
20820 *
20821*/
20822 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20823 if (__pyx_t_4) {
20824 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20825 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1086, __pyx_L5_except_error)
20826 __Pyx_XGOTREF(__pyx_t_5);
20827 __Pyx_XGOTREF(__pyx_t_6);
20828 __Pyx_XGOTREF(__pyx_t_7);
20829
20830 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1087
20831 * _import_umath()
20832 * except Exception:
20833 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
20834 *
20835 * cdef inline int import_ufunc() except -1:
20836*/
20837 __pyx_t_9 = NULL;
20838 __pyx_t_10 = 1;
20839 {
20840 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
20841 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
20842 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20843 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1087, __pyx_L5_except_error)
20844 __Pyx_GOTREF(__pyx_t_8);
20845 }
20846 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20847 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20848 __PYX_ERR(2, 1087, __pyx_L5_except_error)
20849 }
20850 goto __pyx_L5_except_error;
20851
20852 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
20853 *
20854 * cdef inline int import_umath() except -1:
20855 * try: # <<<<<<<<<<<<<<
20856 * _import_umath()
20857 * except Exception:
20858*/
20859 __pyx_L5_except_error:;
20860 __Pyx_XGIVEREF(__pyx_t_1);
20861 __Pyx_XGIVEREF(__pyx_t_2);
20862 __Pyx_XGIVEREF(__pyx_t_3);
20863 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20864 goto __pyx_L1_error;
20865 __pyx_L8_try_end:;
20866 }
20867
20868 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
20869 * raise ImportError("numpy._core.multiarray failed to import")
20870 *
20871 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
20872 * try:
20873 * _import_umath()
20874*/
20875
20876 /* function exit code */
20877 __pyx_r = 0;
20878 goto __pyx_L0;
20879 __pyx_L1_error:;
20880 __Pyx_XDECREF(__pyx_t_5);
20881 __Pyx_XDECREF(__pyx_t_6);
20882 __Pyx_XDECREF(__pyx_t_7);
20883 __Pyx_XDECREF(__pyx_t_8);
20884 __Pyx_XDECREF(__pyx_t_9);
20885 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20886 __pyx_r = -1;
20887 __pyx_L0:;
20888
20889 __Pyx_RefNannyFinishContext();
20890 return __pyx_r;
20891}
20892
20893/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
20894 * raise ImportError("numpy._core.umath failed to import")
20895 *
20896 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
20897 * try:
20898 * _import_umath()
20899*/
20900
20901static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20902 int __pyx_r;
20903 __Pyx_RefNannyDeclarations
20904 PyObject *__pyx_t_1 = NULL;
20905 PyObject *__pyx_t_2 = NULL;
20906 PyObject *__pyx_t_3 = NULL;
20907 int __pyx_t_4;
20908 PyObject *__pyx_t_5 = NULL;
20909 PyObject *__pyx_t_6 = NULL;
20910 PyObject *__pyx_t_7 = NULL;
20911 PyObject *__pyx_t_8 = NULL;
20912 PyObject *__pyx_t_9 = NULL;
20913 size_t __pyx_t_10;
20914 int __pyx_lineno = 0;
20915 const char *__pyx_filename = NULL;
20916 int __pyx_clineno = 0;
20917 __Pyx_RefNannySetupContext("import_ufunc", 0);
20918
20919 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
20920 *
20921 * cdef inline int import_ufunc() except -1:
20922 * try: # <<<<<<<<<<<<<<
20923 * _import_umath()
20924 * except Exception:
20925*/
20926 {
20927 __Pyx_PyThreadState_declare
20928 __Pyx_PyThreadState_assign
20929 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20930 __Pyx_XGOTREF(__pyx_t_1);
20931 __Pyx_XGOTREF(__pyx_t_2);
20932 __Pyx_XGOTREF(__pyx_t_3);
20933 /*try:*/ {
20934
20935 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1091
20936 * cdef inline int import_ufunc() except -1:
20937 * try:
20938 * _import_umath() # <<<<<<<<<<<<<<
20939 * except Exception:
20940 * raise ImportError("numpy._core.umath failed to import")
20941*/
20942 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1091, __pyx_L3_error)
20943
20944
20945 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
20946 *
20947 * cdef inline int import_ufunc() except -1:
20948 * try: # <<<<<<<<<<<<<<
20949 * _import_umath()
20950 * except Exception:
20951*/
20952 }
20953 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20954 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20955 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20956 goto __pyx_L8_try_end;
20957 __pyx_L3_error:;
20958
20959 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1092
20960 * try:
20961 * _import_umath()
20962 * except Exception: # <<<<<<<<<<<<<<
20963 * raise ImportError("numpy._core.umath failed to import")
20964 *
20965*/
20966 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20967 if (__pyx_t_4) {
20968 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20969 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1092, __pyx_L5_except_error)
20970 __Pyx_XGOTREF(__pyx_t_5);
20971 __Pyx_XGOTREF(__pyx_t_6);
20972 __Pyx_XGOTREF(__pyx_t_7);
20973
20974 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1093
20975 * _import_umath()
20976 * except Exception:
20977 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
20978 *
20979 *
20980*/
20981 __pyx_t_9 = NULL;
20982 __pyx_t_10 = 1;
20983 {
20984 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
20985 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
20986 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20987 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1093, __pyx_L5_except_error)
20988 __Pyx_GOTREF(__pyx_t_8);
20989 }
20990 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20991 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20992 __PYX_ERR(2, 1093, __pyx_L5_except_error)
20993 }
20994 goto __pyx_L5_except_error;
20995
20996 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
20997 *
20998 * cdef inline int import_ufunc() except -1:
20999 * try: # <<<<<<<<<<<<<<
21000 * _import_umath()
21001 * except Exception:
21002*/
21003 __pyx_L5_except_error:;
21004 __Pyx_XGIVEREF(__pyx_t_1);
21005 __Pyx_XGIVEREF(__pyx_t_2);
21006 __Pyx_XGIVEREF(__pyx_t_3);
21007 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21008 goto __pyx_L1_error;
21009 __pyx_L8_try_end:;
21010 }
21011
21012 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
21013 * raise ImportError("numpy._core.umath failed to import")
21014 *
21015 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
21016 * try:
21017 * _import_umath()
21018*/
21019
21020 /* function exit code */
21021 __pyx_r = 0;
21022 goto __pyx_L0;
21023 __pyx_L1_error:;
21024 __Pyx_XDECREF(__pyx_t_5);
21025 __Pyx_XDECREF(__pyx_t_6);
21026 __Pyx_XDECREF(__pyx_t_7);
21027 __Pyx_XDECREF(__pyx_t_8);
21028 __Pyx_XDECREF(__pyx_t_9);
21029 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21030 __pyx_r = -1;
21031 __pyx_L0:;
21032
21033 __Pyx_RefNannyFinishContext();
21034 return __pyx_r;
21035}
21036
21037/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
21038 *
21039 *
21040 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21041 * """
21042 * Cython equivalent of `isinstance(obj, np.timedelta64)`
21043*/
21044
21045static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
21046 int __pyx_r;
21047
21048 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1108
21049 * bool
21050 * """
21051 * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
21052 *
21053 *
21054*/
21055 {
21056
21057 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
21058 }
21059 goto __pyx_L0;
21060
21061 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
21062 *
21063 *
21064 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21065 * """
21066 * Cython equivalent of `isinstance(obj, np.timedelta64)`
21067*/
21068
21069 /* function exit code */
21070 __pyx_L0:;
21071
21072 return __pyx_r;
21073}
21074
21075/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
21076 *
21077 *
21078 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21079 * """
21080 * Cython equivalent of `isinstance(obj, np.datetime64)`
21081*/
21082
21083static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
21084 int __pyx_r;
21085
21086 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1123
21087 * bool
21088 * """
21089 * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
21090 *
21091 *
21092*/
21093 {
21094
21095 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
21096 }
21097 goto __pyx_L0;
21098
21099 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
21100 *
21101 *
21102 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21103 * """
21104 * Cython equivalent of `isinstance(obj, np.datetime64)`
21105*/
21106
21107 /* function exit code */
21108 __pyx_L0:;
21109
21110 return __pyx_r;
21111}
21112
21113/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
21114 *
21115 *
21116 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21117 * """
21118 * returns the int64 value underlying scalar numpy datetime64 object
21119*/
21120
21121static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
21122 npy_datetime __pyx_r;
21123
21124 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1133
21125 * also needed. That can be found using `get_datetime64_unit`.
21126 * """
21127 * return _PyDatetimeScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
21128 *
21129 *
21130*/
21131 {
21132
21133 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
21134 }
21135 goto __pyx_L0;
21136
21137 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
21138 *
21139 *
21140 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21141 * """
21142 * returns the int64 value underlying scalar numpy datetime64 object
21143*/
21144
21145 /* function exit code */
21146 __pyx_L0:;
21147 return __pyx_r;
21148}
21149
21150/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
21151 *
21152 *
21153 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21154 * """
21155 * returns the int64 value underlying scalar numpy timedelta64 object
21156*/
21157
21158static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
21159 npy_timedelta __pyx_r;
21160
21161 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1140
21162 * returns the int64 value underlying scalar numpy timedelta64 object
21163 * """
21164 * return _PyTimedeltaScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
21165 *
21166 *
21167*/
21168 {
21169
21170 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
21171 }
21172 goto __pyx_L0;
21173
21174 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
21175 *
21176 *
21177 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21178 * """
21179 * returns the int64 value underlying scalar numpy timedelta64 object
21180*/
21181
21182 /* function exit code */
21183 __pyx_L0:;
21184 return __pyx_r;
21185}
21186
21187/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
21188 *
21189 *
21190 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21191 * """
21192 * returns the unit part of the dtype for a numpy datetime64 object.
21193*/
21194
21195static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
21196 NPY_DATETIMEUNIT __pyx_r;
21197
21198 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1147
21199 * returns the unit part of the dtype for a numpy datetime64 object.
21200 * """
21201 * return _PyDatetimeScalarObject_GetMetadata(obj).base # <<<<<<<<<<<<<<
21202 *
21203 *
21204*/
21205 {
21206
21207 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
21208 }
21209 goto __pyx_L0;
21210
21211 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
21212 *
21213 *
21214 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21215 * """
21216 * returns the unit part of the dtype for a numpy datetime64 object.
21217*/
21218
21219 /* function exit code */
21220 __pyx_L0:;
21221 return __pyx_r;
21222}
21223
21224/* "csmoothers.pyx":8
21225 * class ASMFactor(object):
21226 *
21227 * def __init__(self, L): # <<<<<<<<<<<<<<
21228 * self.L = L
21229 * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
21230*/
21231
21232/* Python wrapper */
21233static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self,
21234#if CYTHON_VECTORCALL
21235PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21236#else
21237PyObject *__pyx_args, PyObject *__pyx_kwds
21238#endif
21239); /*proto*/
21240static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_9ASMFactor_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21241static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self,
21242#if CYTHON_VECTORCALL
21243PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21244#else
21245PyObject *__pyx_args, PyObject *__pyx_kwds
21246#endif
21247) {
21248 PyObject *__pyx_v_self = 0;
21249 PyObject *__pyx_v_L = 0;
21250 #if !CYTHON_VECTORCALL
21251 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21252 #endif
21253 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21254 PyObject* values[2] = {0,0};
21255 int __pyx_lineno = 0;
21256 const char *__pyx_filename = NULL;
21257 int __pyx_clineno = 0;
21258 PyObject *__pyx_r = 0;
21259 __Pyx_RefNannyDeclarations
21260 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
21261 #if !CYTHON_VECTORCALL
21262 #if CYTHON_ASSUME_SAFE_SIZE
21263 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21264 #else
21265 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21266 #endif
21267 #endif
21268 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21269 {
21270 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_L,0};
21271 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21272 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 8, __pyx_L3_error)
21273 if (__pyx_kwds_len > 0) {
21274 switch (__pyx_nargs) {
21275 case 2:
21276 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21277 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 8, __pyx_L3_error)
21278 CYTHON_FALLTHROUGH;
21279 case 1:
21280 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21281 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 8, __pyx_L3_error)
21282 CYTHON_FALLTHROUGH;
21283 case 0: break;
21284 default: goto __pyx_L5_argtuple_error;
21285 }
21286 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21287 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 8, __pyx_L3_error)
21288 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
21289 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 8, __pyx_L3_error) }
21290 }
21291 } else if (unlikely(__pyx_nargs != 2)) {
21292 goto __pyx_L5_argtuple_error;
21293 } else {
21294 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21295 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 8, __pyx_L3_error)
21296 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21297 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 8, __pyx_L3_error)
21298 }
21299 __pyx_v_self = values[0];
21300 __pyx_v_L = values[1];
21301 }
21302 goto __pyx_L6_skip;
21303 __pyx_L5_argtuple_error:;
21304 __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 8, __pyx_L3_error)
21305 __pyx_L6_skip:;
21306 goto __pyx_L4_argument_unpacking_done;
21307 __pyx_L3_error:;
21308 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21309 Py_XDECREF(values[__pyx_temp]);
21310 }
21311 __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21312 __Pyx_RefNannyFinishContext();
21313 return NULL;
21314 __pyx_L4_argument_unpacking_done:;
21315 __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
21316
21317 /* function exit code */
21318 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21319 Py_XDECREF(values[__pyx_temp]);
21320 }
21321 __Pyx_RefNannyFinishContext();
21322 return __pyx_r;
21323}
21324
21325static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
21326 PyObject *__pyx_r = NULL;
21327 __Pyx_RefNannyDeclarations
21328 PyObject *__pyx_t_1 = NULL;
21329 PyObject *__pyx_t_2 = NULL;
21330 PyObject *__pyx_t_3 = NULL;
21331 PyObject *__pyx_t_4 = NULL;
21332 size_t __pyx_t_5;
21333 int __pyx_lineno = 0;
21334 const char *__pyx_filename = NULL;
21335 int __pyx_clineno = 0;
21336 __Pyx_RefNannySetupContext("__init__", 0);
21337
21338 /* "csmoothers.pyx":9
21339 *
21340 * def __init__(self, L):
21341 * self.L = L # <<<<<<<<<<<<<<
21342 * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
21343 *
21344*/
21345 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_L, __pyx_v_L) < (0)) __PYX_ERR(0, 9, __pyx_L1_error)
21346
21347 /* "csmoothers.pyx":10
21348 * def __init__(self, L):
21349 * self.L = L
21350 * self._cASMFactor = cASMFactor(self.L._cSparseMatrix) # <<<<<<<<<<<<<<
21351 *
21352 * cdef class cASMFactor(object):
21353*/
21354 __pyx_t_2 = NULL;
21355 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error)
21356 __Pyx_GOTREF(__pyx_t_3);
21357 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error)
21358 __Pyx_GOTREF(__pyx_t_4);
21359 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21360 __pyx_t_5 = 1;
21361 {
21362 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
21363 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_10csmoothers_cASMFactor, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21364 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21365 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21366 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
21367 __Pyx_GOTREF((PyObject *)__pyx_t_1);
21368 }
21369 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_cASMFactor, ((PyObject *)__pyx_t_1)) < (0)) __PYX_ERR(0, 10, __pyx_L1_error)
21370 __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
21371
21372 /* "csmoothers.pyx":8
21373 * class ASMFactor(object):
21374 *
21375 * def __init__(self, L): # <<<<<<<<<<<<<<
21376 * self.L = L
21377 * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
21378*/
21379
21380 /* function exit code */
21381 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21382 goto __pyx_L0;
21383 __pyx_L1_error:;
21384 __Pyx_XDECREF(__pyx_t_1);
21385 __Pyx_XDECREF(__pyx_t_2);
21386 __Pyx_XDECREF(__pyx_t_3);
21387 __Pyx_XDECREF(__pyx_t_4);
21388 __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21389 __pyx_r = NULL;
21390 __pyx_L0:;
21391 __Pyx_XGIVEREF(__pyx_r);
21392 __Pyx_RefNannyFinishContext();
21393 return __pyx_r;
21394}
21395
21396/* "csmoothers.pyx":14
21397 * cdef class cASMFactor(object):
21398 *
21399 * def __cinit__(self, # <<<<<<<<<<<<<<
21400 * superluWrappers.cSparseMatrix L):
21401 * cdef int rval = 0
21402*/
21403
21404/* Python wrapper */
21405static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self,
21406#if CYTHON_VECTORCALL_TPNEW
21407PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21408#else
21409PyObject *__pyx_args, PyObject *__pyx_kwds
21410#endif
21411); /*proto*/
21412static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self,
21413#if CYTHON_VECTORCALL_TPNEW
21414PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21415#else
21416PyObject *__pyx_args, PyObject *__pyx_kwds
21417#endif
21418) {
21419 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
21420 #if !CYTHON_VECTORCALL_TPNEW
21421 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21422 #endif
21423 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21424 PyObject* values[1] = {0};
21425 int __pyx_lineno = 0;
21426 const char *__pyx_filename = NULL;
21427 int __pyx_clineno = 0;
21428 int __pyx_r;
21429 __Pyx_RefNannyDeclarations
21430 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
21431 #if !CYTHON_VECTORCALL_TPNEW
21432 #if CYTHON_ASSUME_SAFE_SIZE
21433 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21434 #else
21435 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
21436 #endif
21437 #endif
21438 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
21439 {
21440 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_L,0};
21441 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
21442 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 14, __pyx_L3_error)
21443 if (__pyx_kwds_len > 0) {
21444 switch (__pyx_nargs) {
21445 case 1:
21446 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
21447 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 14, __pyx_L3_error)
21448 CYTHON_FALLTHROUGH;
21449 case 0: break;
21450 default: goto __pyx_L5_argtuple_error;
21451 }
21452 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21453 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(0, 14, __pyx_L3_error)
21454 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
21455 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, i); __PYX_ERR(0, 14, __pyx_L3_error) }
21456 }
21457 } else if (unlikely(__pyx_nargs != 1)) {
21458 goto __pyx_L5_argtuple_error;
21459 } else {
21460 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
21461 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 14, __pyx_L3_error)
21462 }
21463 __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
21464 }
21465 goto __pyx_L6_skip;
21466 __pyx_L5_argtuple_error:;
21467 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 14, __pyx_L3_error)
21468 __pyx_L6_skip:;
21469 goto __pyx_L4_argument_unpacking_done;
21470 __pyx_L3_error:;
21471 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21472 Py_XDECREF(values[__pyx_temp]);
21473 }
21474 __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21475 __Pyx_RefNannyFinishContext();
21476 return -1;
21477 __pyx_L4_argument_unpacking_done:;
21478 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 15, __pyx_L1_error)
21479 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
21480
21481 /* function exit code */
21482 goto __pyx_L0;
21483 __pyx_L1_error:;
21484 __pyx_r = -1;
21485 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21486 Py_XDECREF(values[__pyx_temp]);
21487 }
21488 goto __pyx_L7_cleaned_up;
21489 __pyx_L0:;
21490 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21491 Py_XDECREF(values[__pyx_temp]);
21492 }
21493 __pyx_L7_cleaned_up:;
21494 __Pyx_RefNannyFinishContext();
21495 return __pyx_r;
21496}
21497
21498static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
21499 int __pyx_v_rval;
21500 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
21501 int __pyx_r;
21502 __Pyx_RefNannyDeclarations
21503 PyObject *__pyx_t_1 = NULL;
21504 int __pyx_t_2;
21505 int __pyx_t_3;
21506 int __pyx_lineno = 0;
21507 const char *__pyx_filename = NULL;
21508 int __pyx_clineno = 0;
21509 __Pyx_RefNannySetupContext("__cinit__", 0);
21510
21511 /* "csmoothers.pyx":16
21512 * def __cinit__(self,
21513 * superluWrappers.cSparseMatrix L):
21514 * cdef int rval = 0 # <<<<<<<<<<<<<<
21515 * cdef SuperMatrix AS
21516 * AS.Stype = superluWrappers._SLU_NR
21517*/
21518 __pyx_v_rval = 0;
21519
21520 /* "csmoothers.pyx":18
21521 * cdef int rval = 0
21522 * cdef SuperMatrix AS
21523 * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
21524 * AS.Dtype = superluWrappers._SLU_D
21525 * AS.Mtype = superluWrappers._SLU_GE
21526*/
21527 __pyx_v_AS.Stype = SLU_NR;
21528
21529 /* "csmoothers.pyx":19
21530 * cdef SuperMatrix AS
21531 * AS.Stype = superluWrappers._SLU_NR
21532 * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
21533 * AS.Mtype = superluWrappers._SLU_GE
21534 * AS.nrow = L.nr
21535*/
21536 __pyx_v_AS.Dtype = SLU_D;
21537
21538 /* "csmoothers.pyx":20
21539 * AS.Stype = superluWrappers._SLU_NR
21540 * AS.Dtype = superluWrappers._SLU_D
21541 * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
21542 * AS.nrow = L.nr
21543 * AS.ncol = L.nc
21544*/
21545 __pyx_v_AS.Mtype = SLU_GE;
21546
21547 /* "csmoothers.pyx":21
21548 * AS.Dtype = superluWrappers._SLU_D
21549 * AS.Mtype = superluWrappers._SLU_GE
21550 * AS.nrow = L.nr # <<<<<<<<<<<<<<
21551 * AS.ncol = L.nc
21552 * AS.Store = &L.A
21553*/
21554 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
21555 __Pyx_GOTREF(__pyx_t_1);
21556 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
21557 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21558 __pyx_v_AS.nrow = __pyx_t_2;
21559
21560 /* "csmoothers.pyx":22
21561 * AS.Mtype = superluWrappers._SLU_GE
21562 * AS.nrow = L.nr
21563 * AS.ncol = L.nc # <<<<<<<<<<<<<<
21564 * AS.Store = &L.A
21565 * rval = casm_NR_init(&AS,
21566*/
21567 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
21568 __Pyx_GOTREF(__pyx_t_1);
21569 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L1_error)
21570 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21571 __pyx_v_AS.ncol = __pyx_t_2;
21572
21573 /* "csmoothers.pyx":23
21574 * AS.nrow = L.nr
21575 * AS.ncol = L.nc
21576 * AS.Store = &L.A # <<<<<<<<<<<<<<
21577 * rval = casm_NR_init(&AS,
21578 * &self.subdomain_dim,
21579*/
21580 __pyx_v_AS.Store = (&__pyx_v_L->A);
21581
21582 /* "csmoothers.pyx":24
21583 * AS.ncol = L.nc
21584 * AS.Store = &L.A
21585 * rval = casm_NR_init(&AS, # <<<<<<<<<<<<<<
21586 * &self.subdomain_dim,
21587 * &self.l2g_L,
21588*/
21589 __pyx_v_rval = asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
21590
21591 /* "csmoothers.pyx":31
21592 * &self.subdomain_dX,
21593 * &self.subdomain_pivots)
21594 * assert rval == 0 # <<<<<<<<<<<<<<
21595 *
21596 * def __dealloc__(self):
21597*/
21598 #ifndef CYTHON_WITHOUT_ASSERTIONS
21599 if (unlikely(__pyx_assertions_enabled())) {
21600 __pyx_t_3 = (__pyx_v_rval == 0);
21601
21602 if (unlikely(!__pyx_t_3)) {
21603 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
21604 __PYX_ERR(0, 31, __pyx_L1_error)
21605 }
21606
21607 }
21608 #else
21609 if ((1)); else __PYX_ERR(0, 31, __pyx_L1_error)
21610 #endif
21611
21612 /* "csmoothers.pyx":14
21613 * cdef class cASMFactor(object):
21614 *
21615 * def __cinit__(self, # <<<<<<<<<<<<<<
21616 * superluWrappers.cSparseMatrix L):
21617 * cdef int rval = 0
21618*/
21619
21620 /* function exit code */
21621 __pyx_r = 0;
21622 goto __pyx_L0;
21623 __pyx_L1_error:;
21624 __Pyx_XDECREF(__pyx_t_1);
21625 __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21626 __pyx_r = -1;
21627 __pyx_L0:;
21628
21629
21630
21631 __Pyx_RefNannyFinishContext();
21632 return __pyx_r;
21633}
21634
21635/* "csmoothers.pyx":33
21636 * assert rval == 0
21637 *
21638 * def __dealloc__(self): # <<<<<<<<<<<<<<
21639 * casm_NR_free(self.N,
21640 * self.subdomain_dim,
21641*/
21642
21643/* Python wrapper */
21644static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
21645static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
21646 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21647 __Pyx_RefNannyDeclarations
21648 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
21649 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
21650 __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
21651
21652 /* function exit code */
21653 __Pyx_RefNannyFinishContext();
21654}
21655
21656static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
21657
21658 /* "csmoothers.pyx":34
21659 *
21660 * def __dealloc__(self):
21661 * casm_NR_free(self.N, # <<<<<<<<<<<<<<
21662 * self.subdomain_dim,
21663 * self.l2g_L,
21664*/
21665 asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
21666
21667 /* "csmoothers.pyx":33
21668 * assert rval == 0
21669 *
21670 * def __dealloc__(self): # <<<<<<<<<<<<<<
21671 * casm_NR_free(self.N,
21672 * self.subdomain_dim,
21673*/
21674
21675 /* function exit code */
21676
21677}
21678
21679/* "(tree fragment)":1
21680 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
21681 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
21682 * def __setstate_cython__(self, __pyx_state):
21683*/
21684
21685/* Python wrapper */
21686static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self,
21687#if CYTHON_VECTORCALL
21688PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21689#else
21690PyObject *__pyx_args, PyObject *__pyx_kwds
21691#endif
21692); /*proto*/
21693static PyMethodDef __pyx_mdef_10csmoothers_10cASMFactor_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21694static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self,
21695#if CYTHON_VECTORCALL
21696PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21697#else
21698PyObject *__pyx_args, PyObject *__pyx_kwds
21699#endif
21700) {
21701 #if !CYTHON_VECTORCALL
21702 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21703 #endif
21704 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21705 PyObject *__pyx_r = 0;
21706 __Pyx_RefNannyDeclarations
21707 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
21708 #if !CYTHON_VECTORCALL
21709 #if CYTHON_ASSUME_SAFE_SIZE
21710 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21711 #else
21712 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21713 #endif
21714 #endif
21715 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21716 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
21717 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21718 if (unlikely(__pyx_kwds_len < 0)) return NULL;
21719 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
21720 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
21721
21722 /* function exit code */
21723 __Pyx_RefNannyFinishContext();
21724 return __pyx_r;
21725}
21726
21727static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
21728 PyObject *__pyx_r = NULL;
21729 __Pyx_RefNannyDeclarations
21730 int __pyx_lineno = 0;
21731 const char *__pyx_filename = NULL;
21732 int __pyx_clineno = 0;
21733 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
21734
21735 /* "(tree fragment)":2
21736 * def __reduce_cython__(self):
21737 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
21738 * def __setstate_cython__(self, __pyx_state):
21739 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
21740*/
21741 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
21742 __PYX_ERR(1, 2, __pyx_L1_error)
21743
21744 /* "(tree fragment)":1
21745 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
21746 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
21747 * def __setstate_cython__(self, __pyx_state):
21748*/
21749
21750 /* function exit code */
21751 __pyx_L1_error:;
21752 __Pyx_AddTraceback("csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21753 __pyx_r = NULL;
21754 __Pyx_XGIVEREF(__pyx_r);
21755 __Pyx_RefNannyFinishContext();
21756 return __pyx_r;
21757}
21758
21759/* "(tree fragment)":3
21760 * def __reduce_cython__(self):
21761 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
21762 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
21763 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
21764*/
21765
21766/* Python wrapper */
21767static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self,
21768#if CYTHON_VECTORCALL
21769PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21770#else
21771PyObject *__pyx_args, PyObject *__pyx_kwds
21772#endif
21773); /*proto*/
21774static PyMethodDef __pyx_mdef_10csmoothers_10cASMFactor_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21775static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self,
21776#if CYTHON_VECTORCALL
21777PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21778#else
21779PyObject *__pyx_args, PyObject *__pyx_kwds
21780#endif
21781) {
21782 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
21783 #if !CYTHON_VECTORCALL
21784 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21785 #endif
21786 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21787 PyObject* values[1] = {0};
21788 int __pyx_lineno = 0;
21789 const char *__pyx_filename = NULL;
21790 int __pyx_clineno = 0;
21791 PyObject *__pyx_r = 0;
21792 __Pyx_RefNannyDeclarations
21793 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
21794 #if !CYTHON_VECTORCALL
21795 #if CYTHON_ASSUME_SAFE_SIZE
21796 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21797 #else
21798 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21799 #endif
21800 #endif
21801 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21802 {
21803 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
21804 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21805 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
21806 if (__pyx_kwds_len > 0) {
21807 switch (__pyx_nargs) {
21808 case 1:
21809 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21810 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
21811 CYTHON_FALLTHROUGH;
21812 case 0: break;
21813 default: goto __pyx_L5_argtuple_error;
21814 }
21815 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21816 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
21817 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
21818 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
21819 }
21820 } else if (unlikely(__pyx_nargs != 1)) {
21821 goto __pyx_L5_argtuple_error;
21822 } else {
21823 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21824 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
21825 }
21826 __pyx_v___pyx_state = values[0];
21827 }
21828 goto __pyx_L6_skip;
21829 __pyx_L5_argtuple_error:;
21830 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
21831 __pyx_L6_skip:;
21832 goto __pyx_L4_argument_unpacking_done;
21833 __pyx_L3_error:;
21834 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21835 Py_XDECREF(values[__pyx_temp]);
21836 }
21837 __Pyx_AddTraceback("csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21838 __Pyx_RefNannyFinishContext();
21839 return NULL;
21840 __pyx_L4_argument_unpacking_done:;
21841 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v___pyx_state);
21842
21843 /* function exit code */
21844 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21845 Py_XDECREF(values[__pyx_temp]);
21846 }
21847 __Pyx_RefNannyFinishContext();
21848 return __pyx_r;
21849}
21850
21851static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
21852 PyObject *__pyx_r = NULL;
21853 __Pyx_RefNannyDeclarations
21854 int __pyx_lineno = 0;
21855 const char *__pyx_filename = NULL;
21856 int __pyx_clineno = 0;
21857 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
21858
21859 /* "(tree fragment)":4
21860 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
21861 * def __setstate_cython__(self, __pyx_state):
21862 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
21863*/
21864 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
21865 __PYX_ERR(1, 4, __pyx_L1_error)
21866
21867 /* "(tree fragment)":3
21868 * def __reduce_cython__(self):
21869 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
21870 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
21871 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
21872*/
21873
21874 /* function exit code */
21875 __pyx_L1_error:;
21876 __Pyx_AddTraceback("csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21877 __pyx_r = NULL;
21878 __Pyx_XGIVEREF(__pyx_r);
21879 __Pyx_RefNannyFinishContext();
21880 return __pyx_r;
21881}
21882
21883/* "csmoothers.pyx":45
21884 * class BASMFactor(object):
21885 *
21886 * def __init__(self, L, bs): # <<<<<<<<<<<<<<
21887 * self.L = L
21888 * self.bs = bs
21889*/
21890
21891/* Python wrapper */
21892static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self,
21893#if CYTHON_VECTORCALL
21894PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21895#else
21896PyObject *__pyx_args, PyObject *__pyx_kwds
21897#endif
21898); /*proto*/
21899static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_10BASMFactor_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21900static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self,
21901#if CYTHON_VECTORCALL
21902PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21903#else
21904PyObject *__pyx_args, PyObject *__pyx_kwds
21905#endif
21906) {
21907 PyObject *__pyx_v_self = 0;
21908 PyObject *__pyx_v_L = 0;
21909 PyObject *__pyx_v_bs = 0;
21910 #if !CYTHON_VECTORCALL
21911 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21912 #endif
21913 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21914 PyObject* values[3] = {0,0,0};
21915 int __pyx_lineno = 0;
21916 const char *__pyx_filename = NULL;
21917 int __pyx_clineno = 0;
21918 PyObject *__pyx_r = 0;
21919 __Pyx_RefNannyDeclarations
21920 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
21921 #if !CYTHON_VECTORCALL
21922 #if CYTHON_ASSUME_SAFE_SIZE
21923 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21924 #else
21925 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21926 #endif
21927 #endif
21928 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21929 {
21930 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_L,&__pyx_mstate_global->__pyx_n_u_bs,0};
21931 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21932 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 45, __pyx_L3_error)
21933 if (__pyx_kwds_len > 0) {
21934 switch (__pyx_nargs) {
21935 case 3:
21936 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21937 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 45, __pyx_L3_error)
21938 CYTHON_FALLTHROUGH;
21939 case 2:
21940 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21941 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 45, __pyx_L3_error)
21942 CYTHON_FALLTHROUGH;
21943 case 1:
21944 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21945 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 45, __pyx_L3_error)
21946 CYTHON_FALLTHROUGH;
21947 case 0: break;
21948 default: goto __pyx_L5_argtuple_error;
21949 }
21950 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21951 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 45, __pyx_L3_error)
21952 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
21953 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 45, __pyx_L3_error) }
21954 }
21955 } else if (unlikely(__pyx_nargs != 3)) {
21956 goto __pyx_L5_argtuple_error;
21957 } else {
21958 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21959 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 45, __pyx_L3_error)
21960 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21961 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 45, __pyx_L3_error)
21962 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21963 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 45, __pyx_L3_error)
21964 }
21965 __pyx_v_self = values[0];
21966 __pyx_v_L = values[1];
21967 __pyx_v_bs = values[2];
21968 }
21969 goto __pyx_L6_skip;
21970 __pyx_L5_argtuple_error:;
21971 __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 45, __pyx_L3_error)
21972 __pyx_L6_skip:;
21973 goto __pyx_L4_argument_unpacking_done;
21974 __pyx_L3_error:;
21975 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21976 Py_XDECREF(values[__pyx_temp]);
21977 }
21978 __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21979 __Pyx_RefNannyFinishContext();
21980 return NULL;
21981 __pyx_L4_argument_unpacking_done:;
21982 __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
21983
21984 /* function exit code */
21985 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21986 Py_XDECREF(values[__pyx_temp]);
21987 }
21988 __Pyx_RefNannyFinishContext();
21989 return __pyx_r;
21990}
21991
21992static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
21993 PyObject *__pyx_r = NULL;
21994 __Pyx_RefNannyDeclarations
21995 PyObject *__pyx_t_1 = NULL;
21996 PyObject *__pyx_t_2 = NULL;
21997 PyObject *__pyx_t_3 = NULL;
21998 PyObject *__pyx_t_4 = NULL;
21999 size_t __pyx_t_5;
22000 int __pyx_lineno = 0;
22001 const char *__pyx_filename = NULL;
22002 int __pyx_clineno = 0;
22003 __Pyx_RefNannySetupContext("__init__", 0);
22004
22005 /* "csmoothers.pyx":46
22006 *
22007 * def __init__(self, L, bs):
22008 * self.L = L # <<<<<<<<<<<<<<
22009 * self.bs = bs
22010 * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
22011*/
22012 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_L, __pyx_v_L) < (0)) __PYX_ERR(0, 46, __pyx_L1_error)
22013
22014 /* "csmoothers.pyx":47
22015 * def __init__(self, L, bs):
22016 * self.L = L
22017 * self.bs = bs # <<<<<<<<<<<<<<
22018 * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
22019 * self.bs)
22020*/
22021 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_bs, __pyx_v_bs) < (0)) __PYX_ERR(0, 47, __pyx_L1_error)
22022
22023 /* "csmoothers.pyx":48
22024 * self.L = L
22025 * self.bs = bs
22026 * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
22027 * self.bs)
22028 *
22029*/
22030 __pyx_t_2 = NULL;
22031 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error)
22032 __Pyx_GOTREF(__pyx_t_3);
22033 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error)
22034 __Pyx_GOTREF(__pyx_t_4);
22035 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22036
22037 /* "csmoothers.pyx":49
22038 * self.bs = bs
22039 * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
22040 * self.bs) # <<<<<<<<<<<<<<
22041 *
22042 * cdef class cBASMFactor(object):
22043*/
22044 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_bs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
22045 __Pyx_GOTREF(__pyx_t_3);
22046 __pyx_t_5 = 1;
22047 {
22048 PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_3};
22049 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_10csmoothers_cBASMFactor, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22050 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22051 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22052 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22053 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
22054 __Pyx_GOTREF((PyObject *)__pyx_t_1);
22055 }
22056
22057 /* "csmoothers.pyx":48
22058 * self.L = L
22059 * self.bs = bs
22060 * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
22061 * self.bs)
22062 *
22063*/
22064 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_cBASMFactor, ((PyObject *)__pyx_t_1)) < (0)) __PYX_ERR(0, 48, __pyx_L1_error)
22065 __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
22066
22067 /* "csmoothers.pyx":45
22068 * class BASMFactor(object):
22069 *
22070 * def __init__(self, L, bs): # <<<<<<<<<<<<<<
22071 * self.L = L
22072 * self.bs = bs
22073*/
22074
22075 /* function exit code */
22076 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22077 goto __pyx_L0;
22078 __pyx_L1_error:;
22079 __Pyx_XDECREF(__pyx_t_1);
22080 __Pyx_XDECREF(__pyx_t_2);
22081 __Pyx_XDECREF(__pyx_t_3);
22082 __Pyx_XDECREF(__pyx_t_4);
22083 __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22084 __pyx_r = NULL;
22085 __pyx_L0:;
22086 __Pyx_XGIVEREF(__pyx_r);
22087 __Pyx_RefNannyFinishContext();
22088 return __pyx_r;
22089}
22090
22091/* "csmoothers.pyx":53
22092 * cdef class cBASMFactor(object):
22093 *
22094 * def __cinit__(self, # <<<<<<<<<<<<<<
22095 * superluWrappers.cSparseMatrix L,
22096 * int bs):
22097*/
22098
22099/* Python wrapper */
22100static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self,
22101#if CYTHON_VECTORCALL_TPNEW
22102PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22103#else
22104PyObject *__pyx_args, PyObject *__pyx_kwds
22105#endif
22106); /*proto*/
22107static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self,
22108#if CYTHON_VECTORCALL_TPNEW
22109PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22110#else
22111PyObject *__pyx_args, PyObject *__pyx_kwds
22112#endif
22113) {
22114 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
22115 int __pyx_v_bs;
22116 #if !CYTHON_VECTORCALL_TPNEW
22117 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22118 #endif
22119 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22120 PyObject* values[2] = {0,0};
22121 int __pyx_lineno = 0;
22122 const char *__pyx_filename = NULL;
22123 int __pyx_clineno = 0;
22124 int __pyx_r;
22125 __Pyx_RefNannyDeclarations
22126 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
22127 #if !CYTHON_VECTORCALL_TPNEW
22128 #if CYTHON_ASSUME_SAFE_SIZE
22129 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22130 #else
22131 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
22132 #endif
22133 #endif
22134 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
22135 {
22136 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_L,&__pyx_mstate_global->__pyx_n_u_bs,0};
22137 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
22138 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 53, __pyx_L3_error)
22139 if (__pyx_kwds_len > 0) {
22140 switch (__pyx_nargs) {
22141 case 2:
22142 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
22143 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 53, __pyx_L3_error)
22144 CYTHON_FALLTHROUGH;
22145 case 1:
22146 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
22147 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 53, __pyx_L3_error)
22148 CYTHON_FALLTHROUGH;
22149 case 0: break;
22150 default: goto __pyx_L5_argtuple_error;
22151 }
22152 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22153 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(0, 53, __pyx_L3_error)
22154 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
22155 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, i); __PYX_ERR(0, 53, __pyx_L3_error) }
22156 }
22157 } else if (unlikely(__pyx_nargs != 2)) {
22158 goto __pyx_L5_argtuple_error;
22159 } else {
22160 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
22161 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 53, __pyx_L3_error)
22162 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
22163 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 53, __pyx_L3_error)
22164 }
22165 __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
22166 __pyx_v_bs = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_bs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error)
22167 }
22168 goto __pyx_L6_skip;
22169 __pyx_L5_argtuple_error:;
22170 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 53, __pyx_L3_error)
22171 __pyx_L6_skip:;
22172 goto __pyx_L4_argument_unpacking_done;
22173 __pyx_L3_error:;
22174 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22175 Py_XDECREF(values[__pyx_temp]);
22176 }
22177 __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22178 __Pyx_RefNannyFinishContext();
22179 return -1;
22180 __pyx_L4_argument_unpacking_done:;
22181 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 54, __pyx_L1_error)
22182 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
22183
22184 /* function exit code */
22185 goto __pyx_L0;
22186 __pyx_L1_error:;
22187 __pyx_r = -1;
22188 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22189 Py_XDECREF(values[__pyx_temp]);
22190 }
22191 goto __pyx_L7_cleaned_up;
22192 __pyx_L0:;
22193 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22194 Py_XDECREF(values[__pyx_temp]);
22195 }
22196 __pyx_L7_cleaned_up:;
22197
22198 __Pyx_RefNannyFinishContext();
22199 return __pyx_r;
22200}
22201
22202static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs) {
22203 int __pyx_v_rval;
22204 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
22205 int __pyx_r;
22206 __Pyx_RefNannyDeclarations
22207 PyObject *__pyx_t_1 = NULL;
22208 int __pyx_t_2;
22209 int __pyx_t_3;
22210 int __pyx_lineno = 0;
22211 const char *__pyx_filename = NULL;
22212 int __pyx_clineno = 0;
22213 __Pyx_RefNannySetupContext("__cinit__", 0);
22214
22215 /* "csmoothers.pyx":56
22216 * superluWrappers.cSparseMatrix L,
22217 * int bs):
22218 * cdef int rval = 0 # <<<<<<<<<<<<<<
22219 * cdef SuperMatrix AS
22220 * AS.Stype = superluWrappers._SLU_NR
22221*/
22222 __pyx_v_rval = 0;
22223
22224 /* "csmoothers.pyx":58
22225 * cdef int rval = 0
22226 * cdef SuperMatrix AS
22227 * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
22228 * AS.Dtype = superluWrappers._SLU_D
22229 * AS.Mtype = superluWrappers._SLU_GE
22230*/
22231 __pyx_v_AS.Stype = SLU_NR;
22232
22233 /* "csmoothers.pyx":59
22234 * cdef SuperMatrix AS
22235 * AS.Stype = superluWrappers._SLU_NR
22236 * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
22237 * AS.Mtype = superluWrappers._SLU_GE
22238 * AS.nrow = L.nr
22239*/
22240 __pyx_v_AS.Dtype = SLU_D;
22241
22242 /* "csmoothers.pyx":60
22243 * AS.Stype = superluWrappers._SLU_NR
22244 * AS.Dtype = superluWrappers._SLU_D
22245 * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
22246 * AS.nrow = L.nr
22247 * AS.ncol = L.nc
22248*/
22249 __pyx_v_AS.Mtype = SLU_GE;
22250
22251 /* "csmoothers.pyx":61
22252 * AS.Dtype = superluWrappers._SLU_D
22253 * AS.Mtype = superluWrappers._SLU_GE
22254 * AS.nrow = L.nr # <<<<<<<<<<<<<<
22255 * AS.ncol = L.nc
22256 * AS.Store = &L.A
22257*/
22258 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
22259 __Pyx_GOTREF(__pyx_t_1);
22260 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
22261 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22262 __pyx_v_AS.nrow = __pyx_t_2;
22263
22264 /* "csmoothers.pyx":62
22265 * AS.Mtype = superluWrappers._SLU_GE
22266 * AS.nrow = L.nr
22267 * AS.ncol = L.nc # <<<<<<<<<<<<<<
22268 * AS.Store = &L.A
22269 * rval = cbasm_NR_init(bs,
22270*/
22271 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
22272 __Pyx_GOTREF(__pyx_t_1);
22273 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error)
22274 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22275 __pyx_v_AS.ncol = __pyx_t_2;
22276
22277 /* "csmoothers.pyx":63
22278 * AS.nrow = L.nr
22279 * AS.ncol = L.nc
22280 * AS.Store = &L.A # <<<<<<<<<<<<<<
22281 * rval = cbasm_NR_init(bs,
22282 * &AS,
22283*/
22284 __pyx_v_AS.Store = (&__pyx_v_L->A);
22285
22286 /* "csmoothers.pyx":64
22287 * AS.ncol = L.nc
22288 * AS.Store = &L.A
22289 * rval = cbasm_NR_init(bs, # <<<<<<<<<<<<<<
22290 * &AS,
22291 * &self.subdomain_dim,
22292*/
22293 __pyx_v_rval = basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
22294
22295 /* "csmoothers.pyx":73
22296 * &self.subdomain_pivots,
22297 * &self.subdomain_col_pivots)
22298 * assert rval == 0 # <<<<<<<<<<<<<<
22299 *
22300 * def __dealloc__(self):
22301*/
22302 #ifndef CYTHON_WITHOUT_ASSERTIONS
22303 if (unlikely(__pyx_assertions_enabled())) {
22304 __pyx_t_3 = (__pyx_v_rval == 0);
22305
22306 if (unlikely(!__pyx_t_3)) {
22307 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
22308 __PYX_ERR(0, 73, __pyx_L1_error)
22309 }
22310
22311 }
22312 #else
22313 if ((1)); else __PYX_ERR(0, 73, __pyx_L1_error)
22314 #endif
22315
22316 /* "csmoothers.pyx":53
22317 * cdef class cBASMFactor(object):
22318 *
22319 * def __cinit__(self, # <<<<<<<<<<<<<<
22320 * superluWrappers.cSparseMatrix L,
22321 * int bs):
22322*/
22323
22324 /* function exit code */
22325 __pyx_r = 0;
22326 goto __pyx_L0;
22327 __pyx_L1_error:;
22328 __Pyx_XDECREF(__pyx_t_1);
22329 __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22330 __pyx_r = -1;
22331 __pyx_L0:;
22332
22333
22334
22335 __Pyx_RefNannyFinishContext();
22336 return __pyx_r;
22337}
22338
22339/* "csmoothers.pyx":75
22340 * assert rval == 0
22341 *
22342 * def __dealloc__(self): # <<<<<<<<<<<<<<
22343 * cbasm_NR_free(self.N,
22344 * self.subdomain_dim,
22345*/
22346
22347/* Python wrapper */
22348static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
22349static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
22350 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22351 __Pyx_RefNannyDeclarations
22352 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
22353 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
22354 __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
22355
22356 /* function exit code */
22357 __Pyx_RefNannyFinishContext();
22358}
22359
22360static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
22361
22362 /* "csmoothers.pyx":76
22363 *
22364 * def __dealloc__(self):
22365 * cbasm_NR_free(self.N, # <<<<<<<<<<<<<<
22366 * self.subdomain_dim,
22367 * self.l2g_L,
22368*/
22369 basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
22370
22371 /* "csmoothers.pyx":75
22372 * assert rval == 0
22373 *
22374 * def __dealloc__(self): # <<<<<<<<<<<<<<
22375 * cbasm_NR_free(self.N,
22376 * self.subdomain_dim,
22377*/
22378
22379 /* function exit code */
22380
22381}
22382
22383/* "(tree fragment)":1
22384 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22385 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22386 * def __setstate_cython__(self, __pyx_state):
22387*/
22388
22389/* Python wrapper */
22390static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self,
22391#if CYTHON_VECTORCALL
22392PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22393#else
22394PyObject *__pyx_args, PyObject *__pyx_kwds
22395#endif
22396); /*proto*/
22397static PyMethodDef __pyx_mdef_10csmoothers_11cBASMFactor_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22398static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self,
22399#if CYTHON_VECTORCALL
22400PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22401#else
22402PyObject *__pyx_args, PyObject *__pyx_kwds
22403#endif
22404) {
22405 #if !CYTHON_VECTORCALL
22406 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22407 #endif
22408 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22409 PyObject *__pyx_r = 0;
22410 __Pyx_RefNannyDeclarations
22411 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
22412 #if !CYTHON_VECTORCALL
22413 #if CYTHON_ASSUME_SAFE_SIZE
22414 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22415 #else
22416 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22417 #endif
22418 #endif
22419 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22420 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
22421 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22422 if (unlikely(__pyx_kwds_len < 0)) return NULL;
22423 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
22424 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
22425
22426 /* function exit code */
22427 __Pyx_RefNannyFinishContext();
22428 return __pyx_r;
22429}
22430
22431static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
22432 PyObject *__pyx_r = NULL;
22433 __Pyx_RefNannyDeclarations
22434 int __pyx_lineno = 0;
22435 const char *__pyx_filename = NULL;
22436 int __pyx_clineno = 0;
22437 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
22438
22439 /* "(tree fragment)":2
22440 * def __reduce_cython__(self):
22441 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
22442 * def __setstate_cython__(self, __pyx_state):
22443 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22444*/
22445 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
22446 __PYX_ERR(1, 2, __pyx_L1_error)
22447
22448 /* "(tree fragment)":1
22449 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22450 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22451 * def __setstate_cython__(self, __pyx_state):
22452*/
22453
22454 /* function exit code */
22455 __pyx_L1_error:;
22456 __Pyx_AddTraceback("csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22457 __pyx_r = NULL;
22458 __Pyx_XGIVEREF(__pyx_r);
22459 __Pyx_RefNannyFinishContext();
22460 return __pyx_r;
22461}
22462
22463/* "(tree fragment)":3
22464 * def __reduce_cython__(self):
22465 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22466 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22467 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22468*/
22469
22470/* Python wrapper */
22471static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self,
22472#if CYTHON_VECTORCALL
22473PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22474#else
22475PyObject *__pyx_args, PyObject *__pyx_kwds
22476#endif
22477); /*proto*/
22478static PyMethodDef __pyx_mdef_10csmoothers_11cBASMFactor_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22479static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self,
22480#if CYTHON_VECTORCALL
22481PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22482#else
22483PyObject *__pyx_args, PyObject *__pyx_kwds
22484#endif
22485) {
22486 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
22487 #if !CYTHON_VECTORCALL
22488 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22489 #endif
22490 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22491 PyObject* values[1] = {0};
22492 int __pyx_lineno = 0;
22493 const char *__pyx_filename = NULL;
22494 int __pyx_clineno = 0;
22495 PyObject *__pyx_r = 0;
22496 __Pyx_RefNannyDeclarations
22497 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
22498 #if !CYTHON_VECTORCALL
22499 #if CYTHON_ASSUME_SAFE_SIZE
22500 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22501 #else
22502 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22503 #endif
22504 #endif
22505 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22506 {
22507 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
22508 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22509 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
22510 if (__pyx_kwds_len > 0) {
22511 switch (__pyx_nargs) {
22512 case 1:
22513 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22514 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
22515 CYTHON_FALLTHROUGH;
22516 case 0: break;
22517 default: goto __pyx_L5_argtuple_error;
22518 }
22519 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22520 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
22521 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
22522 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
22523 }
22524 } else if (unlikely(__pyx_nargs != 1)) {
22525 goto __pyx_L5_argtuple_error;
22526 } else {
22527 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22528 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
22529 }
22530 __pyx_v___pyx_state = values[0];
22531 }
22532 goto __pyx_L6_skip;
22533 __pyx_L5_argtuple_error:;
22534 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
22535 __pyx_L6_skip:;
22536 goto __pyx_L4_argument_unpacking_done;
22537 __pyx_L3_error:;
22538 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22539 Py_XDECREF(values[__pyx_temp]);
22540 }
22541 __Pyx_AddTraceback("csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22542 __Pyx_RefNannyFinishContext();
22543 return NULL;
22544 __pyx_L4_argument_unpacking_done:;
22545 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v___pyx_state);
22546
22547 /* function exit code */
22548 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22549 Py_XDECREF(values[__pyx_temp]);
22550 }
22551 __Pyx_RefNannyFinishContext();
22552 return __pyx_r;
22553}
22554
22555static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
22556 PyObject *__pyx_r = NULL;
22557 __Pyx_RefNannyDeclarations
22558 int __pyx_lineno = 0;
22559 const char *__pyx_filename = NULL;
22560 int __pyx_clineno = 0;
22561 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
22562
22563 /* "(tree fragment)":4
22564 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22565 * def __setstate_cython__(self, __pyx_state):
22566 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
22567*/
22568 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
22569 __PYX_ERR(1, 4, __pyx_L1_error)
22570
22571 /* "(tree fragment)":3
22572 * def __reduce_cython__(self):
22573 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22574 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22575 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
22576*/
22577
22578 /* function exit code */
22579 __pyx_L1_error:;
22580 __Pyx_AddTraceback("csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22581 __pyx_r = NULL;
22582 __Pyx_XGIVEREF(__pyx_r);
22583 __Pyx_RefNannyFinishContext();
22584 return __pyx_r;
22585}
22586
22587/* "csmoothers.pyx":85
22588 * self.subdomain_col_pivots)
22589 *
22590 * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
22591 * """
22592 *
22593*/
22594
22595/* Python wrapper */
22596static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self,
22597#if CYTHON_VECTORCALL
22598PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22599#else
22600PyObject *__pyx_args, PyObject *__pyx_kwds
22601#endif
22602); /*proto*/
22603PyDoc_STRVAR(__pyx_doc_10csmoothers_jacobi_NR_prepare, "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ");
22604static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {"jacobi_NR_prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_1jacobi_NR_prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
22605static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self,
22606#if CYTHON_VECTORCALL
22607PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22608#else
22609PyObject *__pyx_args, PyObject *__pyx_kwds
22610#endif
22611) {
22612 PyObject *__pyx_v_A = 0;
22613 PyObject *__pyx_v_w = 0;
22614 PyObject *__pyx_v_tol = 0;
22615 PyObject *__pyx_v_M = 0;
22616 #if !CYTHON_VECTORCALL
22617 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22618 #endif
22619 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22620 PyObject* values[4] = {0,0,0,0};
22621 int __pyx_lineno = 0;
22622 const char *__pyx_filename = NULL;
22623 int __pyx_clineno = 0;
22624 PyObject *__pyx_r = 0;
22625 __Pyx_RefNannyDeclarations
22626 __Pyx_RefNannySetupContext("jacobi_NR_prepare (wrapper)", 0);
22627 #if !CYTHON_VECTORCALL
22628 #if CYTHON_ASSUME_SAFE_SIZE
22629 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22630 #else
22631 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22632 #endif
22633 #endif
22634 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22635 {
22636 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_M,0};
22637 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22638 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
22639 if (__pyx_kwds_len > 0) {
22640 switch (__pyx_nargs) {
22641 case 4:
22642 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22643 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 85, __pyx_L3_error)
22644 CYTHON_FALLTHROUGH;
22645 case 3:
22646 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22647 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 85, __pyx_L3_error)
22648 CYTHON_FALLTHROUGH;
22649 case 2:
22650 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22651 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 85, __pyx_L3_error)
22652 CYTHON_FALLTHROUGH;
22653 case 1:
22654 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22655 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 85, __pyx_L3_error)
22656 CYTHON_FALLTHROUGH;
22657 case 0: break;
22658 default: goto __pyx_L5_argtuple_error;
22659 }
22660 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22661 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "jacobi_NR_prepare", 0) < (0)) __PYX_ERR(0, 85, __pyx_L3_error)
22662 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
22663 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, i); __PYX_ERR(0, 85, __pyx_L3_error) }
22664 }
22665 } else if (unlikely(__pyx_nargs != 4)) {
22666 goto __pyx_L5_argtuple_error;
22667 } else {
22668 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22669 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 85, __pyx_L3_error)
22670 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22671 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 85, __pyx_L3_error)
22672 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22673 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 85, __pyx_L3_error)
22674 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22675 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 85, __pyx_L3_error)
22676 }
22677 __pyx_v_A = values[0];
22678 __pyx_v_w = values[1];
22679 __pyx_v_tol = values[2];
22680 __pyx_v_M = values[3];
22681 }
22682 goto __pyx_L6_skip;
22683 __pyx_L5_argtuple_error:;
22684 __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 85, __pyx_L3_error)
22685 __pyx_L6_skip:;
22686 goto __pyx_L4_argument_unpacking_done;
22687 __pyx_L3_error:;
22688 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22689 Py_XDECREF(values[__pyx_temp]);
22690 }
22691 __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
22692 __Pyx_RefNannyFinishContext();
22693 return NULL;
22694 __pyx_L4_argument_unpacking_done:;
22695 __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
22696
22697 /* function exit code */
22698 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22699 Py_XDECREF(values[__pyx_temp]);
22700 }
22701 __Pyx_RefNannyFinishContext();
22702 return __pyx_r;
22703}
22704
22705static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
22706 PyObject *__pyx_r = NULL;
22707 __Pyx_RefNannyDeclarations
22708 PyObject *__pyx_t_1 = NULL;
22709 double __pyx_t_2;
22710 double __pyx_t_3;
22711 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
22712 int __pyx_lineno = 0;
22713 const char *__pyx_filename = NULL;
22714 int __pyx_clineno = 0;
22715 __Pyx_RefNannySetupContext("jacobi_NR_prepare", 0);
22716
22717 /* "csmoothers.pyx":95
22718 * M : np.array
22719 * """
22720 * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
22721 *
22722 * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm,
22723*/
22724 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
22725 __Pyx_GOTREF(__pyx_t_1);
22726 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 95, __pyx_L1_error)
22727 __pyx_t_2 = __Pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error)
22728 __pyx_t_3 = __Pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error)
22729 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 95, __pyx_L1_error)
22730 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error)
22731 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22732
22733
22734 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;
22735
22736 /* "csmoothers.pyx":85
22737 * self.subdomain_col_pivots)
22738 *
22739 * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
22740 * """
22741 *
22742*/
22743
22744 /* function exit code */
22745 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22746 goto __pyx_L0;
22747 __pyx_L1_error:;
22748 __Pyx_XDECREF(__pyx_t_1);
22749 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
22750 __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
22751 __pyx_r = NULL;
22752 __pyx_L0:;
22753 __Pyx_XGIVEREF(__pyx_r);
22754 __Pyx_RefNannyFinishContext();
22755 return __pyx_r;
22756}
22757
22758/* "csmoothers.pyx":97
22759 * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
22760 *
22761 * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
22762 * double w,
22763 * double tol,
22764*/
22765
22766static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
22767 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
22768 __Pyx_RefNannyDeclarations
22769 PyObject *__pyx_t_1 = NULL;
22770 int __pyx_t_2;
22771 Py_ssize_t __pyx_t_3;
22772 int __pyx_lineno = 0;
22773 const char *__pyx_filename = NULL;
22774 int __pyx_clineno = 0;
22775 __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_prepare", 0);
22776
22777 /* "csmoothers.pyx":102
22778 * DDATA M):
22779 * cdef SuperMatrix AS
22780 * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
22781 * AS.Dtype = superluWrappers._SLU_D
22782 * AS.Mtype = superluWrappers._SLU_GE
22783*/
22784 __pyx_v_AS.Stype = SLU_NR;
22785
22786 /* "csmoothers.pyx":103
22787 * cdef SuperMatrix AS
22788 * AS.Stype = superluWrappers._SLU_NR
22789 * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
22790 * AS.Mtype = superluWrappers._SLU_GE
22791 * AS.nrow = sm.nr
22792*/
22793 __pyx_v_AS.Dtype = SLU_D;
22794
22795 /* "csmoothers.pyx":104
22796 * AS.Stype = superluWrappers._SLU_NR
22797 * AS.Dtype = superluWrappers._SLU_D
22798 * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
22799 * AS.nrow = sm.nr
22800 * AS.ncol = sm.nc
22801*/
22802 __pyx_v_AS.Mtype = SLU_GE;
22803
22804 /* "csmoothers.pyx":105
22805 * AS.Dtype = superluWrappers._SLU_D
22806 * AS.Mtype = superluWrappers._SLU_GE
22807 * AS.nrow = sm.nr # <<<<<<<<<<<<<<
22808 * AS.ncol = sm.nc
22809 * AS.Store = &sm.A
22810*/
22811 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
22812 __Pyx_GOTREF(__pyx_t_1);
22813 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
22814 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22815 __pyx_v_AS.nrow = __pyx_t_2;
22816
22817 /* "csmoothers.pyx":106
22818 * AS.Mtype = superluWrappers._SLU_GE
22819 * AS.nrow = sm.nr
22820 * AS.ncol = sm.nc # <<<<<<<<<<<<<<
22821 * AS.Store = &sm.A
22822 * cjacobi_NR_prepare(&AS, w, tol, &M[0])
22823*/
22824 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
22825 __Pyx_GOTREF(__pyx_t_1);
22826 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L1_error)
22827 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22828 __pyx_v_AS.ncol = __pyx_t_2;
22829
22830 /* "csmoothers.pyx":107
22831 * AS.nrow = sm.nr
22832 * AS.ncol = sm.nc
22833 * AS.Store = &sm.A # <<<<<<<<<<<<<<
22834 * cjacobi_NR_prepare(&AS, w, tol, &M[0])
22835 *
22836*/
22837 __pyx_v_AS.Store = (&__pyx_v_sm->A);
22838
22839 /* "csmoothers.pyx":108
22840 * AS.ncol = sm.nc
22841 * AS.Store = &sm.A
22842 * cjacobi_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
22843 *
22844 * def jacobi_NR_solve(A, M, R, node_order, dX):
22845*/
22846 __pyx_t_3 = 0;
22847 __pyx_t_2 = -1;
22848 if (__pyx_t_3 < 0) {
22849 __pyx_t_3 += __pyx_v_M.shape[0];
22850 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
22851 } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
22852 if (unlikely(__pyx_t_2 != -1)) {
22853 __Pyx_RaiseBufferIndexError(__pyx_t_2);
22854 __PYX_ERR(0, 108, __pyx_L1_error)
22855 }
22856 jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
22857
22858 /* "csmoothers.pyx":97
22859 * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
22860 *
22861 * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
22862 * double w,
22863 * double tol,
22864*/
22865
22866 /* function exit code */
22867 goto __pyx_L0;
22868 __pyx_L1_error:;
22869 __Pyx_XDECREF(__pyx_t_1);
22870 __Pyx_AddTraceback("csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
22871 __pyx_L0:;
22872
22873
22874 __Pyx_RefNannyFinishContext();
22875}
22876
22877/* "csmoothers.pyx":110
22878 * cjacobi_NR_prepare(&AS, w, tol, &M[0])
22879 *
22880 * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
22881 * """
22882 *
22883*/
22884
22885/* Python wrapper */
22886static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self,
22887#if CYTHON_VECTORCALL
22888PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22889#else
22890PyObject *__pyx_args, PyObject *__pyx_kwds
22891#endif
22892); /*proto*/
22893PyDoc_STRVAR(__pyx_doc_10csmoothers_2jacobi_NR_solve, "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ");
22894static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {"jacobi_NR_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_3jacobi_NR_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
22895static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self,
22896#if CYTHON_VECTORCALL
22897PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22898#else
22899PyObject *__pyx_args, PyObject *__pyx_kwds
22900#endif
22901) {
22902 PyObject *__pyx_v_A = 0;
22903 PyObject *__pyx_v_M = 0;
22904 PyObject *__pyx_v_R = 0;
22905 PyObject *__pyx_v_node_order = 0;
22906 PyObject *__pyx_v_dX = 0;
22907 #if !CYTHON_VECTORCALL
22908 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22909 #endif
22910 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22911 PyObject* values[5] = {0,0,0,0,0};
22912 int __pyx_lineno = 0;
22913 const char *__pyx_filename = NULL;
22914 int __pyx_clineno = 0;
22915 PyObject *__pyx_r = 0;
22916 __Pyx_RefNannyDeclarations
22917 __Pyx_RefNannySetupContext("jacobi_NR_solve (wrapper)", 0);
22918 #if !CYTHON_VECTORCALL
22919 #if CYTHON_ASSUME_SAFE_SIZE
22920 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22921 #else
22922 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22923 #endif
22924 #endif
22925 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22926 {
22927 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_M,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_node_order,&__pyx_mstate_global->__pyx_n_u_dX,0};
22928 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22929 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 110, __pyx_L3_error)
22930 if (__pyx_kwds_len > 0) {
22931 switch (__pyx_nargs) {
22932 case 5:
22933 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
22934 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 110, __pyx_L3_error)
22935 CYTHON_FALLTHROUGH;
22936 case 4:
22937 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22938 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 110, __pyx_L3_error)
22939 CYTHON_FALLTHROUGH;
22940 case 3:
22941 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22942 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 110, __pyx_L3_error)
22943 CYTHON_FALLTHROUGH;
22944 case 2:
22945 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22946 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 110, __pyx_L3_error)
22947 CYTHON_FALLTHROUGH;
22948 case 1:
22949 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22950 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 110, __pyx_L3_error)
22951 CYTHON_FALLTHROUGH;
22952 case 0: break;
22953 default: goto __pyx_L5_argtuple_error;
22954 }
22955 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22956 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "jacobi_NR_solve", 0) < (0)) __PYX_ERR(0, 110, __pyx_L3_error)
22957 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
22958 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, i); __PYX_ERR(0, 110, __pyx_L3_error) }
22959 }
22960 } else if (unlikely(__pyx_nargs != 5)) {
22961 goto __pyx_L5_argtuple_error;
22962 } else {
22963 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22964 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 110, __pyx_L3_error)
22965 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22966 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 110, __pyx_L3_error)
22967 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22968 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 110, __pyx_L3_error)
22969 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22970 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 110, __pyx_L3_error)
22971 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
22972 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 110, __pyx_L3_error)
22973 }
22974 __pyx_v_A = values[0];
22975 __pyx_v_M = values[1];
22976 __pyx_v_R = values[2];
22977 __pyx_v_node_order = values[3];
22978 __pyx_v_dX = values[4];
22979 }
22980 goto __pyx_L6_skip;
22981 __pyx_L5_argtuple_error:;
22982 __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 110, __pyx_L3_error)
22983 __pyx_L6_skip:;
22984 goto __pyx_L4_argument_unpacking_done;
22985 __pyx_L3_error:;
22986 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22987 Py_XDECREF(values[__pyx_temp]);
22988 }
22989 __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
22990 __Pyx_RefNannyFinishContext();
22991 return NULL;
22992 __pyx_L4_argument_unpacking_done:;
22993 __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
22994
22995 /* function exit code */
22996 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22997 Py_XDECREF(values[__pyx_temp]);
22998 }
22999 __Pyx_RefNannyFinishContext();
23000 return __pyx_r;
23001}
23002
23003static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
23004 PyObject *__pyx_r = NULL;
23005 __Pyx_RefNannyDeclarations
23006 PyObject *__pyx_t_1 = NULL;
23007 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
23008 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
23009 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
23010 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
23011 int __pyx_lineno = 0;
23012 const char *__pyx_filename = NULL;
23013 int __pyx_clineno = 0;
23014 __Pyx_RefNannySetupContext("jacobi_NR_solve", 0);
23015
23016 /* "csmoothers.pyx":121
23017 * dX : np.array double
23018 * """
23019 * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
23020 *
23021 * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm,
23022*/
23023 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
23024 __Pyx_GOTREF(__pyx_t_1);
23025 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 121, __pyx_L1_error)
23026 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 121, __pyx_L1_error)
23027 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 121, __pyx_L1_error)
23028 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 121, __pyx_L1_error)
23029 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 121, __pyx_L1_error)
23030 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error)
23031 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23032 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);; __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
23033 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL;
23034 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;
23035 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
23036
23037 /* "csmoothers.pyx":110
23038 * cjacobi_NR_prepare(&AS, w, tol, &M[0])
23039 *
23040 * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23041 * """
23042 *
23043*/
23044
23045 /* function exit code */
23046 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23047 goto __pyx_L0;
23048 __pyx_L1_error:;
23049 __Pyx_XDECREF(__pyx_t_1);
23050 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
23051 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
23052 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
23053 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
23054 __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
23055 __pyx_r = NULL;
23056 __pyx_L0:;
23057 __Pyx_XGIVEREF(__pyx_r);
23058 __Pyx_RefNannyFinishContext();
23059 return __pyx_r;
23060}
23061
23062/* "csmoothers.pyx":123
23063 * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
23064 *
23065 * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
23066 * DDATA M,
23067 * DDATA R,
23068*/
23069
23070static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
23071 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
23072 __Pyx_RefNannyDeclarations
23073 PyObject *__pyx_t_1 = NULL;
23074 int __pyx_t_2;
23075 Py_ssize_t __pyx_t_3;
23076 Py_ssize_t __pyx_t_4;
23077 Py_ssize_t __pyx_t_5;
23078 Py_ssize_t __pyx_t_6;
23079 int __pyx_lineno = 0;
23080 const char *__pyx_filename = NULL;
23081 int __pyx_clineno = 0;
23082 __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_solve", 0);
23083
23084 /* "csmoothers.pyx":129
23085 * DDATA dX):
23086 * cdef SuperMatrix AS
23087 * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
23088 * AS.Dtype = superluWrappers._SLU_D
23089 * AS.Mtype = superluWrappers._SLU_GE
23090*/
23091 __pyx_v_AS.Stype = SLU_NR;
23092
23093 /* "csmoothers.pyx":130
23094 * cdef SuperMatrix AS
23095 * AS.Stype = superluWrappers._SLU_NR
23096 * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
23097 * AS.Mtype = superluWrappers._SLU_GE
23098 * AS.nrow = sm.nr
23099*/
23100 __pyx_v_AS.Dtype = SLU_D;
23101
23102 /* "csmoothers.pyx":131
23103 * AS.Stype = superluWrappers._SLU_NR
23104 * AS.Dtype = superluWrappers._SLU_D
23105 * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
23106 * AS.nrow = sm.nr
23107 * AS.ncol = sm.nc
23108*/
23109 __pyx_v_AS.Mtype = SLU_GE;
23110
23111 /* "csmoothers.pyx":132
23112 * AS.Dtype = superluWrappers._SLU_D
23113 * AS.Mtype = superluWrappers._SLU_GE
23114 * AS.nrow = sm.nr # <<<<<<<<<<<<<<
23115 * AS.ncol = sm.nc
23116 * AS.Store = &sm.A
23117*/
23118 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
23119 __Pyx_GOTREF(__pyx_t_1);
23120 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
23121 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23122 __pyx_v_AS.nrow = __pyx_t_2;
23123
23124 /* "csmoothers.pyx":133
23125 * AS.Mtype = superluWrappers._SLU_GE
23126 * AS.nrow = sm.nr
23127 * AS.ncol = sm.nc # <<<<<<<<<<<<<<
23128 * AS.Store = &sm.A
23129 * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23130*/
23131 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
23132 __Pyx_GOTREF(__pyx_t_1);
23133 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L1_error)
23134 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23135 __pyx_v_AS.ncol = __pyx_t_2;
23136
23137 /* "csmoothers.pyx":134
23138 * AS.nrow = sm.nr
23139 * AS.ncol = sm.nc
23140 * AS.Store = &sm.A # <<<<<<<<<<<<<<
23141 * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23142 *
23143*/
23144 __pyx_v_AS.Store = (&__pyx_v_sm->A);
23145
23146 /* "csmoothers.pyx":135
23147 * AS.ncol = sm.nc
23148 * AS.Store = &sm.A
23149 * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
23150 *
23151 * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX):
23152*/
23153 __pyx_t_3 = 0;
23154 __pyx_t_2 = -1;
23155 if (__pyx_t_3 < 0) {
23156 __pyx_t_3 += __pyx_v_M.shape[0];
23157 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
23158 } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
23159 if (unlikely(__pyx_t_2 != -1)) {
23160 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23161 __PYX_ERR(0, 135, __pyx_L1_error)
23162 }
23163 __pyx_t_4 = 0;
23164 __pyx_t_2 = -1;
23165 if (__pyx_t_4 < 0) {
23166 __pyx_t_4 += __pyx_v_R.shape[0];
23167 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
23168 } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
23169 if (unlikely(__pyx_t_2 != -1)) {
23170 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23171 __PYX_ERR(0, 135, __pyx_L1_error)
23172 }
23173 __pyx_t_5 = 0;
23174 __pyx_t_2 = -1;
23175 if (__pyx_t_5 < 0) {
23176 __pyx_t_5 += __pyx_v_node_order.shape[0];
23177 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
23178 } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
23179 if (unlikely(__pyx_t_2 != -1)) {
23180 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23181 __PYX_ERR(0, 135, __pyx_L1_error)
23182 }
23183 __pyx_t_6 = 0;
23184 __pyx_t_2 = -1;
23185 if (__pyx_t_6 < 0) {
23186 __pyx_t_6 += __pyx_v_dX.shape[0];
23187 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
23188 } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
23189 if (unlikely(__pyx_t_2 != -1)) {
23190 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23191 __PYX_ERR(0, 135, __pyx_L1_error)
23192 }
23193 jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
23194
23195 /* "csmoothers.pyx":123
23196 * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
23197 *
23198 * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
23199 * DDATA M,
23200 * DDATA R,
23201*/
23202
23203 /* function exit code */
23204 goto __pyx_L0;
23205 __pyx_L1_error:;
23206 __Pyx_XDECREF(__pyx_t_1);
23207 __Pyx_AddTraceback("csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
23208 __pyx_L0:;
23209
23210
23211 __Pyx_RefNannyFinishContext();
23212}
23213
23214/* "csmoothers.pyx":137
23215 * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23216 *
23217 * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23218 * """
23219 *
23220*/
23221
23222/* Python wrapper */
23223static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self,
23224#if CYTHON_VECTORCALL
23225PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23226#else
23227PyObject *__pyx_args, PyObject *__pyx_kwds
23228#endif
23229); /*proto*/
23230PyDoc_STRVAR(__pyx_doc_10csmoothers_4nl_jacobi_NR_solve, "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ");
23231static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {"nl_jacobi_NR_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
23232static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self,
23233#if CYTHON_VECTORCALL
23234PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23235#else
23236PyObject *__pyx_args, PyObject *__pyx_kwds
23237#endif
23238) {
23239 PyObject *__pyx_v_A = 0;
23240 PyObject *__pyx_v_R = 0;
23241 PyObject *__pyx_v_node_order = 0;
23242 PyObject *__pyx_v_w = 0;
23243 PyObject *__pyx_v_tol = 0;
23244 PyObject *__pyx_v_dX = 0;
23245 #if !CYTHON_VECTORCALL
23246 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23247 #endif
23248 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23249 PyObject* values[6] = {0,0,0,0,0,0};
23250 int __pyx_lineno = 0;
23251 const char *__pyx_filename = NULL;
23252 int __pyx_clineno = 0;
23253 PyObject *__pyx_r = 0;
23254 __Pyx_RefNannyDeclarations
23255 __Pyx_RefNannySetupContext("nl_jacobi_NR_solve (wrapper)", 0);
23256 #if !CYTHON_VECTORCALL
23257 #if CYTHON_ASSUME_SAFE_SIZE
23258 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23259 #else
23260 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23261 #endif
23262 #endif
23263 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23264 {
23265 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_node_order,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_dX,0};
23266 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
23267 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 137, __pyx_L3_error)
23268 if (__pyx_kwds_len > 0) {
23269 switch (__pyx_nargs) {
23270 case 6:
23271 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
23272 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 137, __pyx_L3_error)
23273 CYTHON_FALLTHROUGH;
23274 case 5:
23275 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
23276 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 137, __pyx_L3_error)
23277 CYTHON_FALLTHROUGH;
23278 case 4:
23279 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23280 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 137, __pyx_L3_error)
23281 CYTHON_FALLTHROUGH;
23282 case 3:
23283 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23284 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 137, __pyx_L3_error)
23285 CYTHON_FALLTHROUGH;
23286 case 2:
23287 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23288 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 137, __pyx_L3_error)
23289 CYTHON_FALLTHROUGH;
23290 case 1:
23291 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23292 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 137, __pyx_L3_error)
23293 CYTHON_FALLTHROUGH;
23294 case 0: break;
23295 default: goto __pyx_L5_argtuple_error;
23296 }
23297 const Py_ssize_t kwd_pos_args = __pyx_nargs;
23298 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "nl_jacobi_NR_solve", 0) < (0)) __PYX_ERR(0, 137, __pyx_L3_error)
23299 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
23300 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, i); __PYX_ERR(0, 137, __pyx_L3_error) }
23301 }
23302 } else if (unlikely(__pyx_nargs != 6)) {
23303 goto __pyx_L5_argtuple_error;
23304 } else {
23305 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23306 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 137, __pyx_L3_error)
23307 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23308 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 137, __pyx_L3_error)
23309 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23310 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 137, __pyx_L3_error)
23311 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23312 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 137, __pyx_L3_error)
23313 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
23314 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 137, __pyx_L3_error)
23315 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
23316 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 137, __pyx_L3_error)
23317 }
23318 __pyx_v_A = values[0];
23319 __pyx_v_R = values[1];
23320 __pyx_v_node_order = values[2];
23321 __pyx_v_w = values[3];
23322 __pyx_v_tol = values[4];
23323 __pyx_v_dX = values[5];
23324 }
23325 goto __pyx_L6_skip;
23326 __pyx_L5_argtuple_error:;
23327 __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 137, __pyx_L3_error)
23328 __pyx_L6_skip:;
23329 goto __pyx_L4_argument_unpacking_done;
23330 __pyx_L3_error:;
23331 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23332 Py_XDECREF(values[__pyx_temp]);
23333 }
23334 __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
23335 __Pyx_RefNannyFinishContext();
23336 return NULL;
23337 __pyx_L4_argument_unpacking_done:;
23338 __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
23339
23340 /* function exit code */
23341 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23342 Py_XDECREF(values[__pyx_temp]);
23343 }
23344 __Pyx_RefNannyFinishContext();
23345 return __pyx_r;
23346}
23347
23348static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
23349 PyObject *__pyx_r = NULL;
23350 __Pyx_RefNannyDeclarations
23351 PyObject *__pyx_t_1 = NULL;
23352 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
23353 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
23354 double __pyx_t_4;
23355 double __pyx_t_5;
23356 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
23357 int __pyx_lineno = 0;
23358 const char *__pyx_filename = NULL;
23359 int __pyx_clineno = 0;
23360 __Pyx_RefNannySetupContext("nl_jacobi_NR_solve", 0);
23361
23362 /* "csmoothers.pyx":149
23363 * dX : np.array double
23364 * """
23365 * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX) # <<<<<<<<<<<<<<
23366 *
23367 * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm,
23368*/
23369 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
23370 __Pyx_GOTREF(__pyx_t_1);
23371 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 149, __pyx_L1_error)
23372 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 149, __pyx_L1_error)
23373 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 149, __pyx_L1_error)
23374 __pyx_t_4 = __Pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error)
23375 __pyx_t_5 = __Pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error)
23376 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 149, __pyx_L1_error)
23377 __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error)
23378 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23379 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);; __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
23380 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL;
23381
23382
23383 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL;
23384
23385 /* "csmoothers.pyx":137
23386 * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23387 *
23388 * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23389 * """
23390 *
23391*/
23392
23393 /* function exit code */
23394 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23395 goto __pyx_L0;
23396 __pyx_L1_error:;
23397 __Pyx_XDECREF(__pyx_t_1);
23398 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
23399 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
23400 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
23401 __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
23402 __pyx_r = NULL;
23403 __pyx_L0:;
23404 __Pyx_XGIVEREF(__pyx_r);
23405 __Pyx_RefNannyFinishContext();
23406 return __pyx_r;
23407}
23408
23409/* "csmoothers.pyx":151
23410 * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
23411 *
23412 * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
23413 * DDATA R,
23414 * IDATA node_order,
23415*/
23416
23417static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
23418 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
23419 __Pyx_RefNannyDeclarations
23420 PyObject *__pyx_t_1 = NULL;
23421 int __pyx_t_2;
23422 Py_ssize_t __pyx_t_3;
23423 Py_ssize_t __pyx_t_4;
23424 Py_ssize_t __pyx_t_5;
23425 int __pyx_lineno = 0;
23426 const char *__pyx_filename = NULL;
23427 int __pyx_clineno = 0;
23428 __Pyx_RefNannySetupContext("smootherWrappersnl_jacobi_NR_solve", 0);
23429
23430 /* "csmoothers.pyx":158
23431 * DDATA dX):
23432 * cdef SuperMatrix AS
23433 * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
23434 * AS.Dtype = superluWrappers._SLU_D
23435 * AS.Mtype = superluWrappers._SLU_GE
23436*/
23437 __pyx_v_AS.Stype = SLU_NR;
23438
23439 /* "csmoothers.pyx":159
23440 * cdef SuperMatrix AS
23441 * AS.Stype = superluWrappers._SLU_NR
23442 * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
23443 * AS.Mtype = superluWrappers._SLU_GE
23444 * AS.nrow = sm.nr
23445*/
23446 __pyx_v_AS.Dtype = SLU_D;
23447
23448 /* "csmoothers.pyx":160
23449 * AS.Stype = superluWrappers._SLU_NR
23450 * AS.Dtype = superluWrappers._SLU_D
23451 * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
23452 * AS.nrow = sm.nr
23453 * AS.ncol = sm.nc
23454*/
23455 __pyx_v_AS.Mtype = SLU_GE;
23456
23457 /* "csmoothers.pyx":161
23458 * AS.Dtype = superluWrappers._SLU_D
23459 * AS.Mtype = superluWrappers._SLU_GE
23460 * AS.nrow = sm.nr # <<<<<<<<<<<<<<
23461 * AS.ncol = sm.nc
23462 * AS.Store = &sm.A
23463*/
23464 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
23465 __Pyx_GOTREF(__pyx_t_1);
23466 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
23467 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23468 __pyx_v_AS.nrow = __pyx_t_2;
23469
23470 /* "csmoothers.pyx":162
23471 * AS.Mtype = superluWrappers._SLU_GE
23472 * AS.nrow = sm.nr
23473 * AS.ncol = sm.nc # <<<<<<<<<<<<<<
23474 * AS.Store = &sm.A
23475 * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23476*/
23477 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
23478 __Pyx_GOTREF(__pyx_t_1);
23479 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
23480 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23481 __pyx_v_AS.ncol = __pyx_t_2;
23482
23483 /* "csmoothers.pyx":163
23484 * AS.nrow = sm.nr
23485 * AS.ncol = sm.nc
23486 * AS.Store = &sm.A # <<<<<<<<<<<<<<
23487 * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23488 *
23489*/
23490 __pyx_v_AS.Store = (&__pyx_v_sm->A);
23491
23492 /* "csmoothers.pyx":164
23493 * AS.ncol = sm.nc
23494 * AS.Store = &sm.A
23495 * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
23496 *
23497 * def gauss_seidel_NR_preare(A, w, tol, M):
23498*/
23499 __pyx_t_3 = 0;
23500 __pyx_t_2 = -1;
23501 if (__pyx_t_3 < 0) {
23502 __pyx_t_3 += __pyx_v_R.shape[0];
23503 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
23504 } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
23505 if (unlikely(__pyx_t_2 != -1)) {
23506 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23507 __PYX_ERR(0, 164, __pyx_L1_error)
23508 }
23509 __pyx_t_4 = 0;
23510 __pyx_t_2 = -1;
23511 if (__pyx_t_4 < 0) {
23512 __pyx_t_4 += __pyx_v_node_order.shape[0];
23513 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
23514 } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
23515 if (unlikely(__pyx_t_2 != -1)) {
23516 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23517 __PYX_ERR(0, 164, __pyx_L1_error)
23518 }
23519 __pyx_t_5 = 0;
23520 __pyx_t_2 = -1;
23521 if (__pyx_t_5 < 0) {
23522 __pyx_t_5 += __pyx_v_dX.shape[0];
23523 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
23524 } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
23525 if (unlikely(__pyx_t_2 != -1)) {
23526 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23527 __PYX_ERR(0, 164, __pyx_L1_error)
23528 }
23529 nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
23530
23531 /* "csmoothers.pyx":151
23532 * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
23533 *
23534 * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
23535 * DDATA R,
23536 * IDATA node_order,
23537*/
23538
23539 /* function exit code */
23540 goto __pyx_L0;
23541 __pyx_L1_error:;
23542 __Pyx_XDECREF(__pyx_t_1);
23543 __Pyx_AddTraceback("csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
23544 __pyx_L0:;
23545
23546
23547 __Pyx_RefNannyFinishContext();
23548}
23549
23550/* "csmoothers.pyx":166
23551 * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23552 *
23553 * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
23554 * """
23555 *
23556*/
23557
23558/* Python wrapper */
23559static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self,
23560#if CYTHON_VECTORCALL
23561PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23562#else
23563PyObject *__pyx_args, PyObject *__pyx_kwds
23564#endif
23565); /*proto*/
23566PyDoc_STRVAR(__pyx_doc_10csmoothers_6gauss_seidel_NR_preare, "\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ");
23567static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {"gauss_seidel_NR_preare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
23568static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self,
23569#if CYTHON_VECTORCALL
23570PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23571#else
23572PyObject *__pyx_args, PyObject *__pyx_kwds
23573#endif
23574) {
23575 PyObject *__pyx_v_A = 0;
23576 PyObject *__pyx_v_w = 0;
23577 PyObject *__pyx_v_tol = 0;
23578 PyObject *__pyx_v_M = 0;
23579 #if !CYTHON_VECTORCALL
23580 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23581 #endif
23582 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23583 PyObject* values[4] = {0,0,0,0};
23584 int __pyx_lineno = 0;
23585 const char *__pyx_filename = NULL;
23586 int __pyx_clineno = 0;
23587 PyObject *__pyx_r = 0;
23588 __Pyx_RefNannyDeclarations
23589 __Pyx_RefNannySetupContext("gauss_seidel_NR_preare (wrapper)", 0);
23590 #if !CYTHON_VECTORCALL
23591 #if CYTHON_ASSUME_SAFE_SIZE
23592 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23593 #else
23594 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23595 #endif
23596 #endif
23597 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23598 {
23599 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_M,0};
23600 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
23601 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 166, __pyx_L3_error)
23602 if (__pyx_kwds_len > 0) {
23603 switch (__pyx_nargs) {
23604 case 4:
23605 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23606 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 166, __pyx_L3_error)
23607 CYTHON_FALLTHROUGH;
23608 case 3:
23609 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23610 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 166, __pyx_L3_error)
23611 CYTHON_FALLTHROUGH;
23612 case 2:
23613 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23614 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 166, __pyx_L3_error)
23615 CYTHON_FALLTHROUGH;
23616 case 1:
23617 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23618 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 166, __pyx_L3_error)
23619 CYTHON_FALLTHROUGH;
23620 case 0: break;
23621 default: goto __pyx_L5_argtuple_error;
23622 }
23623 const Py_ssize_t kwd_pos_args = __pyx_nargs;
23624 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "gauss_seidel_NR_preare", 0) < (0)) __PYX_ERR(0, 166, __pyx_L3_error)
23625 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
23626 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, i); __PYX_ERR(0, 166, __pyx_L3_error) }
23627 }
23628 } else if (unlikely(__pyx_nargs != 4)) {
23629 goto __pyx_L5_argtuple_error;
23630 } else {
23631 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23632 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 166, __pyx_L3_error)
23633 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23634 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 166, __pyx_L3_error)
23635 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23636 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 166, __pyx_L3_error)
23637 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23638 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 166, __pyx_L3_error)
23639 }
23640 __pyx_v_A = values[0];
23641 __pyx_v_w = values[1];
23642 __pyx_v_tol = values[2];
23643 __pyx_v_M = values[3];
23644 }
23645 goto __pyx_L6_skip;
23646 __pyx_L5_argtuple_error:;
23647 __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 166, __pyx_L3_error)
23648 __pyx_L6_skip:;
23649 goto __pyx_L4_argument_unpacking_done;
23650 __pyx_L3_error:;
23651 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23652 Py_XDECREF(values[__pyx_temp]);
23653 }
23654 __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
23655 __Pyx_RefNannyFinishContext();
23656 return NULL;
23657 __pyx_L4_argument_unpacking_done:;
23658 __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
23659
23660 /* function exit code */
23661 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23662 Py_XDECREF(values[__pyx_temp]);
23663 }
23664 __Pyx_RefNannyFinishContext();
23665 return __pyx_r;
23666}
23667
23668static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
23669 PyObject *__pyx_r = NULL;
23670 __Pyx_RefNannyDeclarations
23671 PyObject *__pyx_t_1 = NULL;
23672 double __pyx_t_2;
23673 double __pyx_t_3;
23674 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
23675 int __pyx_lineno = 0;
23676 const char *__pyx_filename = NULL;
23677 int __pyx_clineno = 0;
23678 __Pyx_RefNannySetupContext("gauss_seidel_NR_preare", 0);
23679
23680 /* "csmoothers.pyx":176
23681 * M :
23682 * """
23683 * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
23684 *
23685 * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm,
23686*/
23687 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
23688 __Pyx_GOTREF(__pyx_t_1);
23689 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 176, __pyx_L1_error)
23690 __pyx_t_2 = __Pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L1_error)
23691 __pyx_t_3 = __Pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L1_error)
23692 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 176, __pyx_L1_error)
23693 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L1_error)
23694 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23695
23696
23697 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;
23698
23699 /* "csmoothers.pyx":166
23700 * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23701 *
23702 * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
23703 * """
23704 *
23705*/
23706
23707 /* function exit code */
23708 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23709 goto __pyx_L0;
23710 __pyx_L1_error:;
23711 __Pyx_XDECREF(__pyx_t_1);
23712 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
23713 __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
23714 __pyx_r = NULL;
23715 __pyx_L0:;
23716 __Pyx_XGIVEREF(__pyx_r);
23717 __Pyx_RefNannyFinishContext();
23718 return __pyx_r;
23719}
23720
23721/* "csmoothers.pyx":178
23722 * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
23723 *
23724 * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
23725 * double w,
23726 * double tol,
23727*/
23728
23729static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
23730 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
23731 __Pyx_RefNannyDeclarations
23732 PyObject *__pyx_t_1 = NULL;
23733 int __pyx_t_2;
23734 Py_ssize_t __pyx_t_3;
23735 int __pyx_lineno = 0;
23736 const char *__pyx_filename = NULL;
23737 int __pyx_clineno = 0;
23738 __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_prepare", 0);
23739
23740 /* "csmoothers.pyx":183
23741 * DDATA M):
23742 * cdef SuperMatrix AS
23743 * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
23744 * AS.Dtype = superluWrappers._SLU_D
23745 * AS.Mtype = superluWrappers._SLU_GE
23746*/
23747 __pyx_v_AS.Stype = SLU_NR;
23748
23749 /* "csmoothers.pyx":184
23750 * cdef SuperMatrix AS
23751 * AS.Stype = superluWrappers._SLU_NR
23752 * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
23753 * AS.Mtype = superluWrappers._SLU_GE
23754 * AS.nrow = sm.nr
23755*/
23756 __pyx_v_AS.Dtype = SLU_D;
23757
23758 /* "csmoothers.pyx":185
23759 * AS.Stype = superluWrappers._SLU_NR
23760 * AS.Dtype = superluWrappers._SLU_D
23761 * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
23762 * AS.nrow = sm.nr
23763 * AS.ncol = sm.nc
23764*/
23765 __pyx_v_AS.Mtype = SLU_GE;
23766
23767 /* "csmoothers.pyx":186
23768 * AS.Dtype = superluWrappers._SLU_D
23769 * AS.Mtype = superluWrappers._SLU_GE
23770 * AS.nrow = sm.nr # <<<<<<<<<<<<<<
23771 * AS.ncol = sm.nc
23772 * AS.Store = &sm.A
23773*/
23774 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
23775 __Pyx_GOTREF(__pyx_t_1);
23776 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
23777 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23778 __pyx_v_AS.nrow = __pyx_t_2;
23779
23780 /* "csmoothers.pyx":187
23781 * AS.Mtype = superluWrappers._SLU_GE
23782 * AS.nrow = sm.nr
23783 * AS.ncol = sm.nc # <<<<<<<<<<<<<<
23784 * AS.Store = &sm.A
23785 * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
23786*/
23787 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
23788 __Pyx_GOTREF(__pyx_t_1);
23789 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L1_error)
23790 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23791 __pyx_v_AS.ncol = __pyx_t_2;
23792
23793 /* "csmoothers.pyx":188
23794 * AS.nrow = sm.nr
23795 * AS.ncol = sm.nc
23796 * AS.Store = &sm.A # <<<<<<<<<<<<<<
23797 * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
23798 *
23799*/
23800 __pyx_v_AS.Store = (&__pyx_v_sm->A);
23801
23802 /* "csmoothers.pyx":189
23803 * AS.ncol = sm.nc
23804 * AS.Store = &sm.A
23805 * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
23806 *
23807 * def gauss_seidel_NR_solve(A, M, R, node_order, dX):
23808*/
23809 __pyx_t_3 = 0;
23810 __pyx_t_2 = -1;
23811 if (__pyx_t_3 < 0) {
23812 __pyx_t_3 += __pyx_v_M.shape[0];
23813 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
23814 } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
23815 if (unlikely(__pyx_t_2 != -1)) {
23816 __Pyx_RaiseBufferIndexError(__pyx_t_2);
23817 __PYX_ERR(0, 189, __pyx_L1_error)
23818 }
23819 gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
23820
23821 /* "csmoothers.pyx":178
23822 * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
23823 *
23824 * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
23825 * double w,
23826 * double tol,
23827*/
23828
23829 /* function exit code */
23830 goto __pyx_L0;
23831 __pyx_L1_error:;
23832 __Pyx_XDECREF(__pyx_t_1);
23833 __Pyx_AddTraceback("csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
23834 __pyx_L0:;
23835
23836
23837 __Pyx_RefNannyFinishContext();
23838}
23839
23840/* "csmoothers.pyx":191
23841 * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
23842 *
23843 * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23844 * """
23845 *
23846*/
23847
23848/* Python wrapper */
23849static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self,
23850#if CYTHON_VECTORCALL
23851PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23852#else
23853PyObject *__pyx_args, PyObject *__pyx_kwds
23854#endif
23855); /*proto*/
23856PyDoc_STRVAR(__pyx_doc_10csmoothers_8gauss_seidel_NR_solve, "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ");
23857static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {"gauss_seidel_NR_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
23858static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self,
23859#if CYTHON_VECTORCALL
23860PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23861#else
23862PyObject *__pyx_args, PyObject *__pyx_kwds
23863#endif
23864) {
23865 PyObject *__pyx_v_A = 0;
23866 PyObject *__pyx_v_M = 0;
23867 PyObject *__pyx_v_R = 0;
23868 PyObject *__pyx_v_node_order = 0;
23869 PyObject *__pyx_v_dX = 0;
23870 #if !CYTHON_VECTORCALL
23871 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23872 #endif
23873 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23874 PyObject* values[5] = {0,0,0,0,0};
23875 int __pyx_lineno = 0;
23876 const char *__pyx_filename = NULL;
23877 int __pyx_clineno = 0;
23878 PyObject *__pyx_r = 0;
23879 __Pyx_RefNannyDeclarations
23880 __Pyx_RefNannySetupContext("gauss_seidel_NR_solve (wrapper)", 0);
23881 #if !CYTHON_VECTORCALL
23882 #if CYTHON_ASSUME_SAFE_SIZE
23883 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23884 #else
23885 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23886 #endif
23887 #endif
23888 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23889 {
23890 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_M,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_node_order,&__pyx_mstate_global->__pyx_n_u_dX,0};
23891 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
23892 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 191, __pyx_L3_error)
23893 if (__pyx_kwds_len > 0) {
23894 switch (__pyx_nargs) {
23895 case 5:
23896 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
23897 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 191, __pyx_L3_error)
23898 CYTHON_FALLTHROUGH;
23899 case 4:
23900 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23901 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 191, __pyx_L3_error)
23902 CYTHON_FALLTHROUGH;
23903 case 3:
23904 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23905 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 191, __pyx_L3_error)
23906 CYTHON_FALLTHROUGH;
23907 case 2:
23908 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23909 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 191, __pyx_L3_error)
23910 CYTHON_FALLTHROUGH;
23911 case 1:
23912 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23913 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 191, __pyx_L3_error)
23914 CYTHON_FALLTHROUGH;
23915 case 0: break;
23916 default: goto __pyx_L5_argtuple_error;
23917 }
23918 const Py_ssize_t kwd_pos_args = __pyx_nargs;
23919 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "gauss_seidel_NR_solve", 0) < (0)) __PYX_ERR(0, 191, __pyx_L3_error)
23920 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
23921 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, i); __PYX_ERR(0, 191, __pyx_L3_error) }
23922 }
23923 } else if (unlikely(__pyx_nargs != 5)) {
23924 goto __pyx_L5_argtuple_error;
23925 } else {
23926 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23927 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 191, __pyx_L3_error)
23928 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23929 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 191, __pyx_L3_error)
23930 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23931 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 191, __pyx_L3_error)
23932 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
23933 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 191, __pyx_L3_error)
23934 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
23935 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 191, __pyx_L3_error)
23936 }
23937 __pyx_v_A = values[0];
23938 __pyx_v_M = values[1];
23939 __pyx_v_R = values[2];
23940 __pyx_v_node_order = values[3];
23941 __pyx_v_dX = values[4];
23942 }
23943 goto __pyx_L6_skip;
23944 __pyx_L5_argtuple_error:;
23945 __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 191, __pyx_L3_error)
23946 __pyx_L6_skip:;
23947 goto __pyx_L4_argument_unpacking_done;
23948 __pyx_L3_error:;
23949 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23950 Py_XDECREF(values[__pyx_temp]);
23951 }
23952 __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
23953 __Pyx_RefNannyFinishContext();
23954 return NULL;
23955 __pyx_L4_argument_unpacking_done:;
23956 __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
23957
23958 /* function exit code */
23959 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23960 Py_XDECREF(values[__pyx_temp]);
23961 }
23962 __Pyx_RefNannyFinishContext();
23963 return __pyx_r;
23964}
23965
23966static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
23967 PyObject *__pyx_r = NULL;
23968 __Pyx_RefNannyDeclarations
23969 PyObject *__pyx_t_1 = NULL;
23970 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
23971 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
23972 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
23973 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
23974 int __pyx_lineno = 0;
23975 const char *__pyx_filename = NULL;
23976 int __pyx_clineno = 0;
23977 __Pyx_RefNannySetupContext("gauss_seidel_NR_solve", 0);
23978
23979 /* "csmoothers.pyx":202
23980 * dX : np.array double
23981 * """
23982 * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
23983 *
23984 * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
23985*/
23986 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
23987 __Pyx_GOTREF(__pyx_t_1);
23988 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 202, __pyx_L1_error)
23989 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 202, __pyx_L1_error)
23990 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 202, __pyx_L1_error)
23991 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 202, __pyx_L1_error)
23992 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 202, __pyx_L1_error)
23993 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error)
23994 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23995 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);; __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
23996 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL;
23997 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;
23998 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
23999
24000 /* "csmoothers.pyx":191
24001 * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
24002 *
24003 * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
24004 * """
24005 *
24006*/
24007
24008 /* function exit code */
24009 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24010 goto __pyx_L0;
24011 __pyx_L1_error:;
24012 __Pyx_XDECREF(__pyx_t_1);
24013 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
24014 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
24015 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
24016 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
24017 __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24018 __pyx_r = NULL;
24019 __pyx_L0:;
24020 __Pyx_XGIVEREF(__pyx_r);
24021 __Pyx_RefNannyFinishContext();
24022 return __pyx_r;
24023}
24024
24025/* "csmoothers.pyx":204
24026 * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
24027 *
24028 * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
24029 * DDATA M,
24030 * DDATA R,
24031*/
24032
24033static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
24034 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
24035 __Pyx_RefNannyDeclarations
24036 PyObject *__pyx_t_1 = NULL;
24037 int __pyx_t_2;
24038 Py_ssize_t __pyx_t_3;
24039 Py_ssize_t __pyx_t_4;
24040 Py_ssize_t __pyx_t_5;
24041 Py_ssize_t __pyx_t_6;
24042 int __pyx_lineno = 0;
24043 const char *__pyx_filename = NULL;
24044 int __pyx_clineno = 0;
24045 __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_solve", 0);
24046
24047 /* "csmoothers.pyx":210
24048 * DDATA dX):
24049 * cdef SuperMatrix AS
24050 * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
24051 * AS.Dtype = superluWrappers._SLU_D
24052 * AS.Mtype = superluWrappers._SLU_GE
24053*/
24054 __pyx_v_AS.Stype = SLU_NR;
24055
24056 /* "csmoothers.pyx":211
24057 * cdef SuperMatrix AS
24058 * AS.Stype = superluWrappers._SLU_NR
24059 * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
24060 * AS.Mtype = superluWrappers._SLU_GE
24061 * AS.nrow = sm.nr
24062*/
24063 __pyx_v_AS.Dtype = SLU_D;
24064
24065 /* "csmoothers.pyx":212
24066 * AS.Stype = superluWrappers._SLU_NR
24067 * AS.Dtype = superluWrappers._SLU_D
24068 * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
24069 * AS.nrow = sm.nr
24070 * AS.ncol = sm.nc
24071*/
24072 __pyx_v_AS.Mtype = SLU_GE;
24073
24074 /* "csmoothers.pyx":213
24075 * AS.Dtype = superluWrappers._SLU_D
24076 * AS.Mtype = superluWrappers._SLU_GE
24077 * AS.nrow = sm.nr # <<<<<<<<<<<<<<
24078 * AS.ncol = sm.nc
24079 * AS.Store = &sm.A
24080*/
24081 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
24082 __Pyx_GOTREF(__pyx_t_1);
24083 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
24084 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24085 __pyx_v_AS.nrow = __pyx_t_2;
24086
24087 /* "csmoothers.pyx":214
24088 * AS.Mtype = superluWrappers._SLU_GE
24089 * AS.nrow = sm.nr
24090 * AS.ncol = sm.nc # <<<<<<<<<<<<<<
24091 * AS.Store = &sm.A
24092 * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
24093*/
24094 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
24095 __Pyx_GOTREF(__pyx_t_1);
24096 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L1_error)
24097 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24098 __pyx_v_AS.ncol = __pyx_t_2;
24099
24100 /* "csmoothers.pyx":215
24101 * AS.nrow = sm.nr
24102 * AS.ncol = sm.nc
24103 * AS.Store = &sm.A # <<<<<<<<<<<<<<
24104 * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
24105 *
24106*/
24107 __pyx_v_AS.Store = (&__pyx_v_sm->A);
24108
24109 /* "csmoothers.pyx":216
24110 * AS.ncol = sm.nc
24111 * AS.Store = &sm.A
24112 * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
24113 *
24114 * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX):
24115*/
24116 __pyx_t_3 = 0;
24117 __pyx_t_2 = -1;
24118 if (__pyx_t_3 < 0) {
24119 __pyx_t_3 += __pyx_v_M.shape[0];
24120 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
24121 } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
24122 if (unlikely(__pyx_t_2 != -1)) {
24123 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24124 __PYX_ERR(0, 216, __pyx_L1_error)
24125 }
24126 __pyx_t_4 = 0;
24127 __pyx_t_2 = -1;
24128 if (__pyx_t_4 < 0) {
24129 __pyx_t_4 += __pyx_v_R.shape[0];
24130 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
24131 } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
24132 if (unlikely(__pyx_t_2 != -1)) {
24133 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24134 __PYX_ERR(0, 216, __pyx_L1_error)
24135 }
24136 __pyx_t_5 = 0;
24137 __pyx_t_2 = -1;
24138 if (__pyx_t_5 < 0) {
24139 __pyx_t_5 += __pyx_v_node_order.shape[0];
24140 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
24141 } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
24142 if (unlikely(__pyx_t_2 != -1)) {
24143 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24144 __PYX_ERR(0, 216, __pyx_L1_error)
24145 }
24146 __pyx_t_6 = 0;
24147 __pyx_t_2 = -1;
24148 if (__pyx_t_6 < 0) {
24149 __pyx_t_6 += __pyx_v_dX.shape[0];
24150 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
24151 } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
24152 if (unlikely(__pyx_t_2 != -1)) {
24153 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24154 __PYX_ERR(0, 216, __pyx_L1_error)
24155 }
24156 gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
24157
24158 /* "csmoothers.pyx":204
24159 * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
24160 *
24161 * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
24162 * DDATA M,
24163 * DDATA R,
24164*/
24165
24166 /* function exit code */
24167 goto __pyx_L0;
24168 __pyx_L1_error:;
24169 __Pyx_XDECREF(__pyx_t_1);
24170 __Pyx_AddTraceback("csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24171 __pyx_L0:;
24172
24173
24174 __Pyx_RefNannyFinishContext();
24175}
24176
24177/* "csmoothers.pyx":218
24178 * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
24179 *
24180 * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
24181 * """
24182 *
24183*/
24184
24185/* Python wrapper */
24186static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self,
24187#if CYTHON_VECTORCALL
24188PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24189#else
24190PyObject *__pyx_args, PyObject *__pyx_kwds
24191#endif
24192); /*proto*/
24193PyDoc_STRVAR(__pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve, "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ");
24194static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {"nl_gauss_seidel_NR_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
24195static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self,
24196#if CYTHON_VECTORCALL
24197PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24198#else
24199PyObject *__pyx_args, PyObject *__pyx_kwds
24200#endif
24201) {
24202 PyObject *__pyx_v_A = 0;
24203 PyObject *__pyx_v_R = 0;
24204 PyObject *__pyx_v_node_order = 0;
24205 PyObject *__pyx_v_w = 0;
24206 PyObject *__pyx_v_tol = 0;
24207 PyObject *__pyx_v_dX = 0;
24208 #if !CYTHON_VECTORCALL
24209 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24210 #endif
24211 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24212 PyObject* values[6] = {0,0,0,0,0,0};
24213 int __pyx_lineno = 0;
24214 const char *__pyx_filename = NULL;
24215 int __pyx_clineno = 0;
24216 PyObject *__pyx_r = 0;
24217 __Pyx_RefNannyDeclarations
24218 __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve (wrapper)", 0);
24219 #if !CYTHON_VECTORCALL
24220 #if CYTHON_ASSUME_SAFE_SIZE
24221 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24222 #else
24223 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24224 #endif
24225 #endif
24226 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24227 {
24228 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_node_order,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_dX,0};
24229 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24230 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 218, __pyx_L3_error)
24231 if (__pyx_kwds_len > 0) {
24232 switch (__pyx_nargs) {
24233 case 6:
24234 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24235 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 218, __pyx_L3_error)
24236 CYTHON_FALLTHROUGH;
24237 case 5:
24238 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24239 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 218, __pyx_L3_error)
24240 CYTHON_FALLTHROUGH;
24241 case 4:
24242 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24243 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 218, __pyx_L3_error)
24244 CYTHON_FALLTHROUGH;
24245 case 3:
24246 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24247 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 218, __pyx_L3_error)
24248 CYTHON_FALLTHROUGH;
24249 case 2:
24250 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24251 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 218, __pyx_L3_error)
24252 CYTHON_FALLTHROUGH;
24253 case 1:
24254 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24255 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 218, __pyx_L3_error)
24256 CYTHON_FALLTHROUGH;
24257 case 0: break;
24258 default: goto __pyx_L5_argtuple_error;
24259 }
24260 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24261 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "nl_gauss_seidel_NR_solve", 0) < (0)) __PYX_ERR(0, 218, __pyx_L3_error)
24262 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
24263 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, i); __PYX_ERR(0, 218, __pyx_L3_error) }
24264 }
24265 } else if (unlikely(__pyx_nargs != 6)) {
24266 goto __pyx_L5_argtuple_error;
24267 } else {
24268 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24269 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 218, __pyx_L3_error)
24270 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24271 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 218, __pyx_L3_error)
24272 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24273 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 218, __pyx_L3_error)
24274 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24275 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 218, __pyx_L3_error)
24276 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24277 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 218, __pyx_L3_error)
24278 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24279 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 218, __pyx_L3_error)
24280 }
24281 __pyx_v_A = values[0];
24282 __pyx_v_R = values[1];
24283 __pyx_v_node_order = values[2];
24284 __pyx_v_w = values[3];
24285 __pyx_v_tol = values[4];
24286 __pyx_v_dX = values[5];
24287 }
24288 goto __pyx_L6_skip;
24289 __pyx_L5_argtuple_error:;
24290 __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 218, __pyx_L3_error)
24291 __pyx_L6_skip:;
24292 goto __pyx_L4_argument_unpacking_done;
24293 __pyx_L3_error:;
24294 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24295 Py_XDECREF(values[__pyx_temp]);
24296 }
24297 __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24298 __Pyx_RefNannyFinishContext();
24299 return NULL;
24300 __pyx_L4_argument_unpacking_done:;
24301 __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
24302
24303 /* function exit code */
24304 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24305 Py_XDECREF(values[__pyx_temp]);
24306 }
24307 __Pyx_RefNannyFinishContext();
24308 return __pyx_r;
24309}
24310
24311static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
24312 PyObject *__pyx_r = NULL;
24313 __Pyx_RefNannyDeclarations
24314 PyObject *__pyx_t_1 = NULL;
24315 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
24316 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
24317 double __pyx_t_4;
24318 double __pyx_t_5;
24319 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
24320 PyObject *__pyx_t_7 = NULL;
24321 int __pyx_lineno = 0;
24322 const char *__pyx_filename = NULL;
24323 int __pyx_clineno = 0;
24324 __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve", 0);
24325
24326 /* "csmoothers.pyx":230
24327 * dX : np.array double
24328 * """
24329 * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
24330 * R,
24331 * node_order,
24332*/
24333 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
24334 __Pyx_GOTREF(__pyx_t_1);
24335 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 230, __pyx_L1_error)
24336
24337 /* "csmoothers.pyx":231
24338 * """
24339 * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
24340 * R, # <<<<<<<<<<<<<<
24341 * node_order,
24342 * w,
24343*/
24344 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
24345
24346 /* "csmoothers.pyx":232
24347 * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
24348 * R,
24349 * node_order, # <<<<<<<<<<<<<<
24350 * w,
24351 * tol,
24352*/
24353 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 232, __pyx_L1_error)
24354
24355 /* "csmoothers.pyx":233
24356 * R,
24357 * node_order,
24358 * w, # <<<<<<<<<<<<<<
24359 * tol,
24360 * dX)
24361*/
24362 __pyx_t_4 = __Pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
24363
24364 /* "csmoothers.pyx":234
24365 * node_order,
24366 * w,
24367 * tol, # <<<<<<<<<<<<<<
24368 * dX)
24369 *
24370*/
24371 __pyx_t_5 = __Pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L1_error)
24372
24373 /* "csmoothers.pyx":235
24374 * w,
24375 * tol,
24376 * dX) # <<<<<<<<<<<<<<
24377 *
24378 * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
24379*/
24380 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 235, __pyx_L1_error)
24381
24382 /* "csmoothers.pyx":230
24383 * dX : np.array double
24384 * """
24385 * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
24386 * R,
24387 * node_order,
24388*/
24389 __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 230, __pyx_L1_error)
24390 __Pyx_GOTREF(__pyx_t_7);
24391 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24392 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);; __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
24393 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL;
24394
24395
24396 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL;
24397 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24398
24399 /* "csmoothers.pyx":218
24400 * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
24401 *
24402 * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
24403 * """
24404 *
24405*/
24406
24407 /* function exit code */
24408 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24409 goto __pyx_L0;
24410 __pyx_L1_error:;
24411 __Pyx_XDECREF(__pyx_t_1);
24412 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
24413 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
24414 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
24415 __Pyx_XDECREF(__pyx_t_7);
24416 __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24417 __pyx_r = NULL;
24418 __pyx_L0:;
24419 __Pyx_XGIVEREF(__pyx_r);
24420 __Pyx_RefNannyFinishContext();
24421 return __pyx_r;
24422}
24423
24424/* "csmoothers.pyx":237
24425 * dX)
24426 *
24427 * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
24428 * DDATA R,
24429 * IDATA node_order,
24430*/
24431
24432static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
24433 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
24434 PyObject *__pyx_r = NULL;
24435 __Pyx_RefNannyDeclarations
24436 PyObject *__pyx_t_1 = NULL;
24437 int __pyx_t_2;
24438 Py_ssize_t __pyx_t_3;
24439 Py_ssize_t __pyx_t_4;
24440 Py_ssize_t __pyx_t_5;
24441 int __pyx_lineno = 0;
24442 const char *__pyx_filename = NULL;
24443 int __pyx_clineno = 0;
24444 __Pyx_RefNannySetupContext("smootherWrappers_nl_gauss_seidel_NR_solve", 0);
24445
24446 /* "csmoothers.pyx":244
24447 * DDATA dX):
24448 * cdef SuperMatrix AS
24449 * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
24450 * AS.Dtype = superluWrappers._SLU_D
24451 * AS.Mtype = superluWrappers._SLU_GE
24452*/
24453 __pyx_v_AS.Stype = SLU_NR;
24454
24455 /* "csmoothers.pyx":245
24456 * cdef SuperMatrix AS
24457 * AS.Stype = superluWrappers._SLU_NR
24458 * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
24459 * AS.Mtype = superluWrappers._SLU_GE
24460 * AS.nrow = sm.nr
24461*/
24462 __pyx_v_AS.Dtype = SLU_D;
24463
24464 /* "csmoothers.pyx":246
24465 * AS.Stype = superluWrappers._SLU_NR
24466 * AS.Dtype = superluWrappers._SLU_D
24467 * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
24468 * AS.nrow = sm.nr
24469 * AS.ncol = sm.nc
24470*/
24471 __pyx_v_AS.Mtype = SLU_GE;
24472
24473 /* "csmoothers.pyx":247
24474 * AS.Dtype = superluWrappers._SLU_D
24475 * AS.Mtype = superluWrappers._SLU_GE
24476 * AS.nrow = sm.nr # <<<<<<<<<<<<<<
24477 * AS.ncol = sm.nc
24478 * AS.Store = &sm.A
24479*/
24480 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
24481 __Pyx_GOTREF(__pyx_t_1);
24482 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
24483 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24484 __pyx_v_AS.nrow = __pyx_t_2;
24485
24486 /* "csmoothers.pyx":248
24487 * AS.Mtype = superluWrappers._SLU_GE
24488 * AS.nrow = sm.nr
24489 * AS.ncol = sm.nc # <<<<<<<<<<<<<<
24490 * AS.Store = &sm.A
24491 * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
24492*/
24493 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
24494 __Pyx_GOTREF(__pyx_t_1);
24495 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L1_error)
24496 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24497 __pyx_v_AS.ncol = __pyx_t_2;
24498
24499 /* "csmoothers.pyx":249
24500 * AS.nrow = sm.nr
24501 * AS.ncol = sm.nc
24502 * AS.Store = &sm.A # <<<<<<<<<<<<<<
24503 * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
24504 *
24505*/
24506 __pyx_v_AS.Store = (&__pyx_v_sm->A);
24507
24508 /* "csmoothers.pyx":250
24509 * AS.ncol = sm.nc
24510 * AS.Store = &sm.A
24511 * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
24512 *
24513 * def asm_NR_prepare(A, asmFactor):
24514*/
24515 __pyx_t_3 = 0;
24516 __pyx_t_2 = -1;
24517 if (__pyx_t_3 < 0) {
24518 __pyx_t_3 += __pyx_v_R.shape[0];
24519 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
24520 } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
24521 if (unlikely(__pyx_t_2 != -1)) {
24522 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24523 __PYX_ERR(0, 250, __pyx_L1_error)
24524 }
24525 __pyx_t_4 = 0;
24526 __pyx_t_2 = -1;
24527 if (__pyx_t_4 < 0) {
24528 __pyx_t_4 += __pyx_v_node_order.shape[0];
24529 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
24530 } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
24531 if (unlikely(__pyx_t_2 != -1)) {
24532 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24533 __PYX_ERR(0, 250, __pyx_L1_error)
24534 }
24535 __pyx_t_5 = 0;
24536 __pyx_t_2 = -1;
24537 if (__pyx_t_5 < 0) {
24538 __pyx_t_5 += __pyx_v_dX.shape[0];
24539 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
24540 } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
24541 if (unlikely(__pyx_t_2 != -1)) {
24542 __Pyx_RaiseBufferIndexError(__pyx_t_2);
24543 __PYX_ERR(0, 250, __pyx_L1_error)
24544 }
24545 nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
24546
24547 /* "csmoothers.pyx":237
24548 * dX)
24549 *
24550 * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
24551 * DDATA R,
24552 * IDATA node_order,
24553*/
24554
24555 /* function exit code */
24556 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24557 goto __pyx_L0;
24558 __pyx_L1_error:;
24559 __Pyx_XDECREF(__pyx_t_1);
24560 __Pyx_AddTraceback("csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24561 __pyx_r = 0;
24562 __pyx_L0:;
24563
24564 __Pyx_XGIVEREF(__pyx_r);
24565 __Pyx_RefNannyFinishContext();
24566 return __pyx_r;
24567}
24568
24569/* "csmoothers.pyx":252
24570 * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
24571 *
24572 * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
24573 * """
24574 *
24575*/
24576
24577/* Python wrapper */
24578static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self,
24579#if CYTHON_VECTORCALL
24580PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24581#else
24582PyObject *__pyx_args, PyObject *__pyx_kwds
24583#endif
24584); /*proto*/
24585PyDoc_STRVAR(__pyx_doc_10csmoothers_12asm_NR_prepare, "\n\n Arguments\n ---------\n A :\n asmFactor :\n ");
24586static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {"asm_NR_prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_13asm_NR_prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
24587static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self,
24588#if CYTHON_VECTORCALL
24589PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24590#else
24591PyObject *__pyx_args, PyObject *__pyx_kwds
24592#endif
24593) {
24594 PyObject *__pyx_v_A = 0;
24595 PyObject *__pyx_v_asmFactor = 0;
24596 #if !CYTHON_VECTORCALL
24597 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24598 #endif
24599 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24600 PyObject* values[2] = {0,0};
24601 int __pyx_lineno = 0;
24602 const char *__pyx_filename = NULL;
24603 int __pyx_clineno = 0;
24604 PyObject *__pyx_r = 0;
24605 __Pyx_RefNannyDeclarations
24606 __Pyx_RefNannySetupContext("asm_NR_prepare (wrapper)", 0);
24607 #if !CYTHON_VECTORCALL
24608 #if CYTHON_ASSUME_SAFE_SIZE
24609 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24610 #else
24611 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24612 #endif
24613 #endif
24614 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24615 {
24616 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_asmFactor,0};
24617 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24618 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 252, __pyx_L3_error)
24619 if (__pyx_kwds_len > 0) {
24620 switch (__pyx_nargs) {
24621 case 2:
24622 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24623 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 252, __pyx_L3_error)
24624 CYTHON_FALLTHROUGH;
24625 case 1:
24626 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24627 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 252, __pyx_L3_error)
24628 CYTHON_FALLTHROUGH;
24629 case 0: break;
24630 default: goto __pyx_L5_argtuple_error;
24631 }
24632 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24633 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "asm_NR_prepare", 0) < (0)) __PYX_ERR(0, 252, __pyx_L3_error)
24634 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
24635 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, i); __PYX_ERR(0, 252, __pyx_L3_error) }
24636 }
24637 } else if (unlikely(__pyx_nargs != 2)) {
24638 goto __pyx_L5_argtuple_error;
24639 } else {
24640 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24641 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 252, __pyx_L3_error)
24642 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24643 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 252, __pyx_L3_error)
24644 }
24645 __pyx_v_A = values[0];
24646 __pyx_v_asmFactor = values[1];
24647 }
24648 goto __pyx_L6_skip;
24649 __pyx_L5_argtuple_error:;
24650 __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 252, __pyx_L3_error)
24651 __pyx_L6_skip:;
24652 goto __pyx_L4_argument_unpacking_done;
24653 __pyx_L3_error:;
24654 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24655 Py_XDECREF(values[__pyx_temp]);
24656 }
24657 __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
24658 __Pyx_RefNannyFinishContext();
24659 return NULL;
24660 __pyx_L4_argument_unpacking_done:;
24661 __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
24662
24663 /* function exit code */
24664 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24665 Py_XDECREF(values[__pyx_temp]);
24666 }
24667 __Pyx_RefNannyFinishContext();
24668 return __pyx_r;
24669}
24670
24671static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
24672 PyObject *__pyx_r = NULL;
24673 __Pyx_RefNannyDeclarations
24674 PyObject *__pyx_t_1 = NULL;
24675 PyObject *__pyx_t_2 = NULL;
24676 int __pyx_lineno = 0;
24677 const char *__pyx_filename = NULL;
24678 int __pyx_clineno = 0;
24679 __Pyx_RefNannySetupContext("asm_NR_prepare", 0);
24680
24681 /* "csmoothers.pyx":260
24682 * asmFactor :
24683 * """
24684 * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
24685 * asmFactor._cASMFactor)
24686 *
24687*/
24688 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
24689 __Pyx_GOTREF(__pyx_t_1);
24690 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 260, __pyx_L1_error)
24691
24692 /* "csmoothers.pyx":261
24693 * """
24694 * smootherWrappers_asm_NR_prepare(A._cSparseMatrix,
24695 * asmFactor._cASMFactor) # <<<<<<<<<<<<<<
24696 *
24697 * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm,
24698*/
24699 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_mstate_global->__pyx_n_u_cASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
24700 __Pyx_GOTREF(__pyx_t_2);
24701 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 261, __pyx_L1_error)
24702
24703 /* "csmoothers.pyx":260
24704 * asmFactor :
24705 * """
24706 * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
24707 * asmFactor._cASMFactor)
24708 *
24709*/
24710 __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 260, __pyx_L1_error)
24711 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24712 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24713
24714 /* "csmoothers.pyx":252
24715 * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
24716 *
24717 * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
24718 * """
24719 *
24720*/
24721
24722 /* function exit code */
24723 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24724 goto __pyx_L0;
24725 __pyx_L1_error:;
24726 __Pyx_XDECREF(__pyx_t_1);
24727 __Pyx_XDECREF(__pyx_t_2);
24728 __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
24729 __pyx_r = NULL;
24730 __pyx_L0:;
24731 __Pyx_XGIVEREF(__pyx_r);
24732 __Pyx_RefNannyFinishContext();
24733 return __pyx_r;
24734}
24735
24736/* "csmoothers.pyx":263
24737 * asmFactor._cASMFactor)
24738 *
24739 * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
24740 * cASMFactor asmFactor):
24741 * cdef SuperMatrix AS
24742*/
24743
24744static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
24745 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
24746 __Pyx_RefNannyDeclarations
24747 PyObject *__pyx_t_1 = NULL;
24748 int __pyx_t_2;
24749 int __pyx_lineno = 0;
24750 const char *__pyx_filename = NULL;
24751 int __pyx_clineno = 0;
24752 __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_prepare", 0);
24753
24754 /* "csmoothers.pyx":266
24755 * cASMFactor asmFactor):
24756 * cdef SuperMatrix AS
24757 * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
24758 * AS.Dtype = superluWrappers._SLU_D
24759 * AS.Mtype = superluWrappers._SLU_GE
24760*/
24761 __pyx_v_AS.Stype = SLU_NR;
24762
24763 /* "csmoothers.pyx":267
24764 * cdef SuperMatrix AS
24765 * AS.Stype = superluWrappers._SLU_NR
24766 * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
24767 * AS.Mtype = superluWrappers._SLU_GE
24768 * AS.nrow = sm.nr
24769*/
24770 __pyx_v_AS.Dtype = SLU_D;
24771
24772 /* "csmoothers.pyx":268
24773 * AS.Stype = superluWrappers._SLU_NR
24774 * AS.Dtype = superluWrappers._SLU_D
24775 * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
24776 * AS.nrow = sm.nr
24777 * AS.ncol = sm.nc
24778*/
24779 __pyx_v_AS.Mtype = SLU_GE;
24780
24781 /* "csmoothers.pyx":269
24782 * AS.Dtype = superluWrappers._SLU_D
24783 * AS.Mtype = superluWrappers._SLU_GE
24784 * AS.nrow = sm.nr # <<<<<<<<<<<<<<
24785 * AS.ncol = sm.nc
24786 * AS.Store = &sm.A
24787*/
24788 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
24789 __Pyx_GOTREF(__pyx_t_1);
24790 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
24791 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24792 __pyx_v_AS.nrow = __pyx_t_2;
24793
24794 /* "csmoothers.pyx":270
24795 * AS.Mtype = superluWrappers._SLU_GE
24796 * AS.nrow = sm.nr
24797 * AS.ncol = sm.nc # <<<<<<<<<<<<<<
24798 * AS.Store = &sm.A
24799 * casm_NR_prepare(&AS,
24800*/
24801 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
24802 __Pyx_GOTREF(__pyx_t_1);
24803 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
24804 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24805 __pyx_v_AS.ncol = __pyx_t_2;
24806
24807 /* "csmoothers.pyx":271
24808 * AS.nrow = sm.nr
24809 * AS.ncol = sm.nc
24810 * AS.Store = &sm.A # <<<<<<<<<<<<<<
24811 * casm_NR_prepare(&AS,
24812 * asmFactor.subdomain_dim,
24813*/
24814 __pyx_v_AS.Store = (&__pyx_v_sm->A);
24815
24816 /* "csmoothers.pyx":272
24817 * AS.ncol = sm.nc
24818 * AS.Store = &sm.A
24819 * casm_NR_prepare(&AS, # <<<<<<<<<<<<<<
24820 * asmFactor.subdomain_dim,
24821 * asmFactor.l2g_L,
24822*/
24823 asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
24824
24825 /* "csmoothers.pyx":263
24826 * asmFactor._cASMFactor)
24827 *
24828 * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
24829 * cASMFactor asmFactor):
24830 * cdef SuperMatrix AS
24831*/
24832
24833 /* function exit code */
24834 goto __pyx_L0;
24835 __pyx_L1_error:;
24836 __Pyx_XDECREF(__pyx_t_1);
24837 __Pyx_AddTraceback("csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
24838 __pyx_L0:;
24839
24840
24841 __Pyx_RefNannyFinishContext();
24842}
24843
24844/* "csmoothers.pyx":278
24845 * asmFactor.subdomain_pivots)
24846 *
24847 * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
24848 * """
24849 *
24850*/
24851
24852/* Python wrapper */
24853static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self,
24854#if CYTHON_VECTORCALL
24855PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24856#else
24857PyObject *__pyx_args, PyObject *__pyx_kwds
24858#endif
24859); /*proto*/
24860PyDoc_STRVAR(__pyx_doc_10csmoothers_14asm_NR_solve, "\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ");
24861static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {"asm_NR_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_15asm_NR_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
24862static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self,
24863#if CYTHON_VECTORCALL
24864PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24865#else
24866PyObject *__pyx_args, PyObject *__pyx_kwds
24867#endif
24868) {
24869 PyObject *__pyx_v_A = 0;
24870 PyObject *__pyx_v_w = 0;
24871 PyObject *__pyx_v_asmFactor = 0;
24872 PyObject *__pyx_v_node_order = 0;
24873 PyObject *__pyx_v_R = 0;
24874 PyObject *__pyx_v_dX = 0;
24875 #if !CYTHON_VECTORCALL
24876 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24877 #endif
24878 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24879 PyObject* values[6] = {0,0,0,0,0,0};
24880 int __pyx_lineno = 0;
24881 const char *__pyx_filename = NULL;
24882 int __pyx_clineno = 0;
24883 PyObject *__pyx_r = 0;
24884 __Pyx_RefNannyDeclarations
24885 __Pyx_RefNannySetupContext("asm_NR_solve (wrapper)", 0);
24886 #if !CYTHON_VECTORCALL
24887 #if CYTHON_ASSUME_SAFE_SIZE
24888 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24889 #else
24890 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24891 #endif
24892 #endif
24893 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24894 {
24895 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_asmFactor,&__pyx_mstate_global->__pyx_n_u_node_order,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_dX,0};
24896 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24897 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 278, __pyx_L3_error)
24898 if (__pyx_kwds_len > 0) {
24899 switch (__pyx_nargs) {
24900 case 6:
24901 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24902 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 278, __pyx_L3_error)
24903 CYTHON_FALLTHROUGH;
24904 case 5:
24905 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24906 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 278, __pyx_L3_error)
24907 CYTHON_FALLTHROUGH;
24908 case 4:
24909 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24910 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 278, __pyx_L3_error)
24911 CYTHON_FALLTHROUGH;
24912 case 3:
24913 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24914 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 278, __pyx_L3_error)
24915 CYTHON_FALLTHROUGH;
24916 case 2:
24917 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24918 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 278, __pyx_L3_error)
24919 CYTHON_FALLTHROUGH;
24920 case 1:
24921 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24922 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 278, __pyx_L3_error)
24923 CYTHON_FALLTHROUGH;
24924 case 0: break;
24925 default: goto __pyx_L5_argtuple_error;
24926 }
24927 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24928 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "asm_NR_solve", 0) < (0)) __PYX_ERR(0, 278, __pyx_L3_error)
24929 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
24930 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, i); __PYX_ERR(0, 278, __pyx_L3_error) }
24931 }
24932 } else if (unlikely(__pyx_nargs != 6)) {
24933 goto __pyx_L5_argtuple_error;
24934 } else {
24935 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24936 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 278, __pyx_L3_error)
24937 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24938 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 278, __pyx_L3_error)
24939 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24940 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 278, __pyx_L3_error)
24941 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24942 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 278, __pyx_L3_error)
24943 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24944 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 278, __pyx_L3_error)
24945 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24946 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 278, __pyx_L3_error)
24947 }
24948 __pyx_v_A = values[0];
24949 __pyx_v_w = values[1];
24950 __pyx_v_asmFactor = values[2];
24951 __pyx_v_node_order = values[3];
24952 __pyx_v_R = values[4];
24953 __pyx_v_dX = values[5];
24954 }
24955 goto __pyx_L6_skip;
24956 __pyx_L5_argtuple_error:;
24957 __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 278, __pyx_L3_error)
24958 __pyx_L6_skip:;
24959 goto __pyx_L4_argument_unpacking_done;
24960 __pyx_L3_error:;
24961 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24962 Py_XDECREF(values[__pyx_temp]);
24963 }
24964 __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24965 __Pyx_RefNannyFinishContext();
24966 return NULL;
24967 __pyx_L4_argument_unpacking_done:;
24968 __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
24969
24970 /* function exit code */
24971 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24972 Py_XDECREF(values[__pyx_temp]);
24973 }
24974 __Pyx_RefNannyFinishContext();
24975 return __pyx_r;
24976}
24977
24978static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
24979 PyObject *__pyx_r = NULL;
24980 __Pyx_RefNannyDeclarations
24981 PyObject *__pyx_t_1 = NULL;
24982 double __pyx_t_2;
24983 PyObject *__pyx_t_3 = NULL;
24984 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
24985 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
24986 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
24987 int __pyx_lineno = 0;
24988 const char *__pyx_filename = NULL;
24989 int __pyx_clineno = 0;
24990 __Pyx_RefNannySetupContext("asm_NR_solve", 0);
24991
24992 /* "csmoothers.pyx":290
24993 * dX : np.array double
24994 * """
24995 * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
24996 * w,
24997 * asmFactor._cASMFactor,
24998*/
24999 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
25000 __Pyx_GOTREF(__pyx_t_1);
25001 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 290, __pyx_L1_error)
25002
25003 /* "csmoothers.pyx":291
25004 * """
25005 * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
25006 * w, # <<<<<<<<<<<<<<
25007 * asmFactor._cASMFactor,
25008 * node_order,
25009*/
25010 __pyx_t_2 = __Pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 291, __pyx_L1_error)
25011
25012 /* "csmoothers.pyx":292
25013 * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
25014 * w,
25015 * asmFactor._cASMFactor, # <<<<<<<<<<<<<<
25016 * node_order,
25017 * R,
25018*/
25019 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_mstate_global->__pyx_n_u_cASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
25020 __Pyx_GOTREF(__pyx_t_3);
25021 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 292, __pyx_L1_error)
25022
25023 /* "csmoothers.pyx":293
25024 * w,
25025 * asmFactor._cASMFactor,
25026 * node_order, # <<<<<<<<<<<<<<
25027 * R,
25028 * dX)
25029*/
25030 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
25031
25032 /* "csmoothers.pyx":294
25033 * asmFactor._cASMFactor,
25034 * node_order,
25035 * R, # <<<<<<<<<<<<<<
25036 * dX)
25037 *
25038*/
25039 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
25040
25041 /* "csmoothers.pyx":295
25042 * node_order,
25043 * R,
25044 * dX) # <<<<<<<<<<<<<<
25045 *
25046 * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm,
25047*/
25048 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 295, __pyx_L1_error)
25049
25050 /* "csmoothers.pyx":290
25051 * dX : np.array double
25052 * """
25053 * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
25054 * w,
25055 * asmFactor._cASMFactor,
25056*/
25057 __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
25058 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25059
25060 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25061 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;
25062 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
25063 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL;
25064
25065 /* "csmoothers.pyx":278
25066 * asmFactor.subdomain_pivots)
25067 *
25068 * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
25069 * """
25070 *
25071*/
25072
25073 /* function exit code */
25074 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25075 goto __pyx_L0;
25076 __pyx_L1_error:;
25077 __Pyx_XDECREF(__pyx_t_1);
25078 __Pyx_XDECREF(__pyx_t_3);
25079 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
25080 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
25081 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
25082 __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
25083 __pyx_r = NULL;
25084 __pyx_L0:;
25085 __Pyx_XGIVEREF(__pyx_r);
25086 __Pyx_RefNannyFinishContext();
25087 return __pyx_r;
25088}
25089
25090/* "csmoothers.pyx":297
25091 * dX)
25092 *
25093 * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
25094 * double w,
25095 * cASMFactor asmFactor,
25096*/
25097
25098static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
25099 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
25100 __Pyx_RefNannyDeclarations
25101 PyObject *__pyx_t_1 = NULL;
25102 int __pyx_t_2;
25103 Py_ssize_t __pyx_t_3;
25104 Py_ssize_t __pyx_t_4;
25105 Py_ssize_t __pyx_t_5;
25106 int __pyx_lineno = 0;
25107 const char *__pyx_filename = NULL;
25108 int __pyx_clineno = 0;
25109 __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_solve", 0);
25110
25111 /* "csmoothers.pyx":304
25112 * DDATA dX):
25113 * cdef SuperMatrix AS
25114 * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
25115 * AS.Dtype = superluWrappers._SLU_D
25116 * AS.Mtype = superluWrappers._SLU_GE
25117*/
25118 __pyx_v_AS.Stype = SLU_NR;
25119
25120 /* "csmoothers.pyx":305
25121 * cdef SuperMatrix AS
25122 * AS.Stype = superluWrappers._SLU_NR
25123 * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
25124 * AS.Mtype = superluWrappers._SLU_GE
25125 * AS.nrow = sm.nr
25126*/
25127 __pyx_v_AS.Dtype = SLU_D;
25128
25129 /* "csmoothers.pyx":306
25130 * AS.Stype = superluWrappers._SLU_NR
25131 * AS.Dtype = superluWrappers._SLU_D
25132 * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
25133 * AS.nrow = sm.nr
25134 * AS.ncol = sm.nc
25135*/
25136 __pyx_v_AS.Mtype = SLU_GE;
25137
25138 /* "csmoothers.pyx":307
25139 * AS.Dtype = superluWrappers._SLU_D
25140 * AS.Mtype = superluWrappers._SLU_GE
25141 * AS.nrow = sm.nr # <<<<<<<<<<<<<<
25142 * AS.ncol = sm.nc
25143 * AS.Store = &sm.A
25144*/
25145 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
25146 __Pyx_GOTREF(__pyx_t_1);
25147 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
25148 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25149 __pyx_v_AS.nrow = __pyx_t_2;
25150
25151 /* "csmoothers.pyx":308
25152 * AS.Mtype = superluWrappers._SLU_GE
25153 * AS.nrow = sm.nr
25154 * AS.ncol = sm.nc # <<<<<<<<<<<<<<
25155 * AS.Store = &sm.A
25156 * casm_NR_solve(&AS,
25157*/
25158 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
25159 __Pyx_GOTREF(__pyx_t_1);
25160 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L1_error)
25161 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25162 __pyx_v_AS.ncol = __pyx_t_2;
25163
25164 /* "csmoothers.pyx":309
25165 * AS.nrow = sm.nr
25166 * AS.ncol = sm.nc
25167 * AS.Store = &sm.A # <<<<<<<<<<<<<<
25168 * casm_NR_solve(&AS,
25169 * w,
25170*/
25171 __pyx_v_AS.Store = (&__pyx_v_sm->A);
25172
25173 /* "csmoothers.pyx":315
25174 * asmFactor.subdomain_dim,
25175 * asmFactor.l2g_L,
25176 * &R[0], # <<<<<<<<<<<<<<
25177 * asmFactor.subdomain_R,
25178 * &node_order[0],
25179*/
25180 __pyx_t_3 = 0;
25181 __pyx_t_2 = -1;
25182 if (__pyx_t_3 < 0) {
25183 __pyx_t_3 += __pyx_v_R.shape[0];
25184 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
25185 } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
25186 if (unlikely(__pyx_t_2 != -1)) {
25187 __Pyx_RaiseBufferIndexError(__pyx_t_2);
25188 __PYX_ERR(0, 315, __pyx_L1_error)
25189 }
25190
25191 /* "csmoothers.pyx":317
25192 * &R[0],
25193 * asmFactor.subdomain_R,
25194 * &node_order[0], # <<<<<<<<<<<<<<
25195 * asmFactor.subdomain_dX,
25196 * &dX[0],
25197*/
25198 __pyx_t_4 = 0;
25199 __pyx_t_2 = -1;
25200 if (__pyx_t_4 < 0) {
25201 __pyx_t_4 += __pyx_v_node_order.shape[0];
25202 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
25203 } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
25204 if (unlikely(__pyx_t_2 != -1)) {
25205 __Pyx_RaiseBufferIndexError(__pyx_t_2);
25206 __PYX_ERR(0, 317, __pyx_L1_error)
25207 }
25208
25209 /* "csmoothers.pyx":319
25210 * &node_order[0],
25211 * asmFactor.subdomain_dX,
25212 * &dX[0], # <<<<<<<<<<<<<<
25213 * asmFactor.subdomain_pivots)
25214 *
25215*/
25216 __pyx_t_5 = 0;
25217 __pyx_t_2 = -1;
25218 if (__pyx_t_5 < 0) {
25219 __pyx_t_5 += __pyx_v_dX.shape[0];
25220 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
25221 } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
25222 if (unlikely(__pyx_t_2 != -1)) {
25223 __Pyx_RaiseBufferIndexError(__pyx_t_2);
25224 __PYX_ERR(0, 319, __pyx_L1_error)
25225 }
25226
25227 /* "csmoothers.pyx":310
25228 * AS.ncol = sm.nc
25229 * AS.Store = &sm.A
25230 * casm_NR_solve(&AS, # <<<<<<<<<<<<<<
25231 * w,
25232 * asmFactor.subdomain_L,
25233*/
25234 asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
25235
25236 /* "csmoothers.pyx":297
25237 * dX)
25238 *
25239 * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
25240 * double w,
25241 * cASMFactor asmFactor,
25242*/
25243
25244 /* function exit code */
25245 goto __pyx_L0;
25246 __pyx_L1_error:;
25247 __Pyx_XDECREF(__pyx_t_1);
25248 __Pyx_AddTraceback("csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
25249 __pyx_L0:;
25250
25251
25252 __Pyx_RefNannyFinishContext();
25253}
25254
25255/* "csmoothers.pyx":322
25256 * asmFactor.subdomain_pivots)
25257 *
25258 * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
25259 * """
25260 *
25261*/
25262
25263/* Python wrapper */
25264static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self,
25265#if CYTHON_VECTORCALL
25266PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25267#else
25268PyObject *__pyx_args, PyObject *__pyx_kwds
25269#endif
25270); /*proto*/
25271PyDoc_STRVAR(__pyx_doc_10csmoothers_16basm_NR_prepare, "\n\n Arguments\n ---------\n A :\n basmFactor :\n ");
25272static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {"basm_NR_prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_17basm_NR_prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
25273static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self,
25274#if CYTHON_VECTORCALL
25275PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25276#else
25277PyObject *__pyx_args, PyObject *__pyx_kwds
25278#endif
25279) {
25280 PyObject *__pyx_v_A = 0;
25281 PyObject *__pyx_v_basmFactor = 0;
25282 #if !CYTHON_VECTORCALL
25283 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
25284 #endif
25285 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
25286 PyObject* values[2] = {0,0};
25287 int __pyx_lineno = 0;
25288 const char *__pyx_filename = NULL;
25289 int __pyx_clineno = 0;
25290 PyObject *__pyx_r = 0;
25291 __Pyx_RefNannyDeclarations
25292 __Pyx_RefNannySetupContext("basm_NR_prepare (wrapper)", 0);
25293 #if !CYTHON_VECTORCALL
25294 #if CYTHON_ASSUME_SAFE_SIZE
25295 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
25296 #else
25297 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
25298 #endif
25299 #endif
25300 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
25301 {
25302 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_basmFactor,0};
25303 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
25304 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 322, __pyx_L3_error)
25305 if (__pyx_kwds_len > 0) {
25306 switch (__pyx_nargs) {
25307 case 2:
25308 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25309 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 322, __pyx_L3_error)
25310 CYTHON_FALLTHROUGH;
25311 case 1:
25312 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25313 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 322, __pyx_L3_error)
25314 CYTHON_FALLTHROUGH;
25315 case 0: break;
25316 default: goto __pyx_L5_argtuple_error;
25317 }
25318 const Py_ssize_t kwd_pos_args = __pyx_nargs;
25319 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "basm_NR_prepare", 0) < (0)) __PYX_ERR(0, 322, __pyx_L3_error)
25320 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
25321 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, i); __PYX_ERR(0, 322, __pyx_L3_error) }
25322 }
25323 } else if (unlikely(__pyx_nargs != 2)) {
25324 goto __pyx_L5_argtuple_error;
25325 } else {
25326 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25327 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 322, __pyx_L3_error)
25328 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25329 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 322, __pyx_L3_error)
25330 }
25331 __pyx_v_A = values[0];
25332 __pyx_v_basmFactor = values[1];
25333 }
25334 goto __pyx_L6_skip;
25335 __pyx_L5_argtuple_error:;
25336 __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 322, __pyx_L3_error)
25337 __pyx_L6_skip:;
25338 goto __pyx_L4_argument_unpacking_done;
25339 __pyx_L3_error:;
25340 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25341 Py_XDECREF(values[__pyx_temp]);
25342 }
25343 __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
25344 __Pyx_RefNannyFinishContext();
25345 return NULL;
25346 __pyx_L4_argument_unpacking_done:;
25347 __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
25348
25349 /* function exit code */
25350 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25351 Py_XDECREF(values[__pyx_temp]);
25352 }
25353 __Pyx_RefNannyFinishContext();
25354 return __pyx_r;
25355}
25356
25357static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
25358 PyObject *__pyx_r = NULL;
25359 __Pyx_RefNannyDeclarations
25360 PyObject *__pyx_t_1 = NULL;
25361 PyObject *__pyx_t_2 = NULL;
25362 int __pyx_lineno = 0;
25363 const char *__pyx_filename = NULL;
25364 int __pyx_clineno = 0;
25365 __Pyx_RefNannySetupContext("basm_NR_prepare", 0);
25366
25367 /* "csmoothers.pyx":330
25368 * basmFactor :
25369 * """
25370 * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
25371 * basmFactor._cBASMFactor)
25372 *
25373*/
25374 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
25375 __Pyx_GOTREF(__pyx_t_1);
25376 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 330, __pyx_L1_error)
25377
25378 /* "csmoothers.pyx":331
25379 * """
25380 * smootherWrappers_basm_NR_prepare(A._cSparseMatrix,
25381 * basmFactor._cBASMFactor) # <<<<<<<<<<<<<<
25382 *
25383 * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm,
25384*/
25385 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_mstate_global->__pyx_n_u_cBASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
25386 __Pyx_GOTREF(__pyx_t_2);
25387 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 331, __pyx_L1_error)
25388
25389 /* "csmoothers.pyx":330
25390 * basmFactor :
25391 * """
25392 * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
25393 * basmFactor._cBASMFactor)
25394 *
25395*/
25396 __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L1_error)
25397 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25398 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25399
25400 /* "csmoothers.pyx":322
25401 * asmFactor.subdomain_pivots)
25402 *
25403 * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
25404 * """
25405 *
25406*/
25407
25408 /* function exit code */
25409 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25410 goto __pyx_L0;
25411 __pyx_L1_error:;
25412 __Pyx_XDECREF(__pyx_t_1);
25413 __Pyx_XDECREF(__pyx_t_2);
25414 __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
25415 __pyx_r = NULL;
25416 __pyx_L0:;
25417 __Pyx_XGIVEREF(__pyx_r);
25418 __Pyx_RefNannyFinishContext();
25419 return __pyx_r;
25420}
25421
25422/* "csmoothers.pyx":333
25423 * basmFactor._cBASMFactor)
25424 *
25425 * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
25426 * cBASMFactor basmFactor):
25427 * cdef SuperMatrix AS
25428*/
25429
25430static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor) {
25431 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
25432 __Pyx_RefNannyDeclarations
25433 PyObject *__pyx_t_1 = NULL;
25434 int __pyx_t_2;
25435 int __pyx_lineno = 0;
25436 const char *__pyx_filename = NULL;
25437 int __pyx_clineno = 0;
25438 __Pyx_RefNannySetupContext("smootherWrappers_basm_NR_prepare", 0);
25439
25440 /* "csmoothers.pyx":336
25441 * cBASMFactor basmFactor):
25442 * cdef SuperMatrix AS
25443 * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
25444 * AS.Mtype = superluWrappers._SLU_GE
25445 * AS.nrow = sm.nr
25446*/
25447 __pyx_v_AS.Dtype = SLU_D;
25448
25449 /* "csmoothers.pyx":337
25450 * cdef SuperMatrix AS
25451 * AS.Dtype = superluWrappers._SLU_D
25452 * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
25453 * AS.nrow = sm.nr
25454 * AS.ncol = sm.nc
25455*/
25456 __pyx_v_AS.Mtype = SLU_GE;
25457
25458 /* "csmoothers.pyx":338
25459 * AS.Dtype = superluWrappers._SLU_D
25460 * AS.Mtype = superluWrappers._SLU_GE
25461 * AS.nrow = sm.nr # <<<<<<<<<<<<<<
25462 * AS.ncol = sm.nc
25463 * AS.Store = &sm.A
25464*/
25465 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
25466 __Pyx_GOTREF(__pyx_t_1);
25467 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
25468 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25469 __pyx_v_AS.nrow = __pyx_t_2;
25470
25471 /* "csmoothers.pyx":339
25472 * AS.Mtype = superluWrappers._SLU_GE
25473 * AS.nrow = sm.nr
25474 * AS.ncol = sm.nc # <<<<<<<<<<<<<<
25475 * AS.Store = &sm.A
25476 * cbasm_NR_prepare(basmFactor.bs,
25477*/
25478 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
25479 __Pyx_GOTREF(__pyx_t_1);
25480 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L1_error)
25481 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25482 __pyx_v_AS.ncol = __pyx_t_2;
25483
25484 /* "csmoothers.pyx":340
25485 * AS.nrow = sm.nr
25486 * AS.ncol = sm.nc
25487 * AS.Store = &sm.A # <<<<<<<<<<<<<<
25488 * cbasm_NR_prepare(basmFactor.bs,
25489 * basmFactor.N,
25490*/
25491 __pyx_v_AS.Store = (&__pyx_v_sm->A);
25492
25493 /* "csmoothers.pyx":341
25494 * AS.ncol = sm.nc
25495 * AS.Store = &sm.A
25496 * cbasm_NR_prepare(basmFactor.bs, # <<<<<<<<<<<<<<
25497 * basmFactor.N,
25498 * &AS,
25499*/
25500 basm_NR_prepare(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
25501
25502 /* "csmoothers.pyx":333
25503 * basmFactor._cBASMFactor)
25504 *
25505 * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
25506 * cBASMFactor basmFactor):
25507 * cdef SuperMatrix AS
25508*/
25509
25510 /* function exit code */
25511 goto __pyx_L0;
25512 __pyx_L1_error:;
25513 __Pyx_XDECREF(__pyx_t_1);
25514 __Pyx_AddTraceback("csmoothers.smootherWrappers_basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
25515 __pyx_L0:;
25516
25517
25518 __Pyx_RefNannyFinishContext();
25519}
25520
25521/* "csmoothers.pyx":351
25522 *
25523 *
25524 * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
25525 * """
25526 *
25527*/
25528
25529/* Python wrapper */
25530static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self,
25531#if CYTHON_VECTORCALL
25532PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25533#else
25534PyObject *__pyx_args, PyObject *__pyx_kwds
25535#endif
25536); /*proto*/
25537PyDoc_STRVAR(__pyx_doc_10csmoothers_18basm_NR_solve, "\n \n Arguments\n ---------\n A :\n w :\n basmFactor :\n node_order :\n R :\n dX :\n ");
25538static PyMethodDef __pyx_mdef_10csmoothers_19basm_NR_solve = {"basm_NR_solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_19basm_NR_solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10csmoothers_18basm_NR_solve};
25539static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self,
25540#if CYTHON_VECTORCALL
25541PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25542#else
25543PyObject *__pyx_args, PyObject *__pyx_kwds
25544#endif
25545) {
25546 PyObject *__pyx_v_A = 0;
25547 PyObject *__pyx_v_w = 0;
25548 PyObject *__pyx_v_basmFactor = 0;
25549 PyObject *__pyx_v_node_order = 0;
25550 PyObject *__pyx_v_R = 0;
25551 PyObject *__pyx_v_dX = 0;
25552 #if !CYTHON_VECTORCALL
25553 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
25554 #endif
25555 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
25556 PyObject* values[6] = {0,0,0,0,0,0};
25557 int __pyx_lineno = 0;
25558 const char *__pyx_filename = NULL;
25559 int __pyx_clineno = 0;
25560 PyObject *__pyx_r = 0;
25561 __Pyx_RefNannyDeclarations
25562 __Pyx_RefNannySetupContext("basm_NR_solve (wrapper)", 0);
25563 #if !CYTHON_VECTORCALL
25564 #if CYTHON_ASSUME_SAFE_SIZE
25565 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
25566 #else
25567 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
25568 #endif
25569 #endif
25570 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
25571 {
25572 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_basmFactor,&__pyx_mstate_global->__pyx_n_u_node_order,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_dX,0};
25573 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
25574 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 351, __pyx_L3_error)
25575 if (__pyx_kwds_len > 0) {
25576 switch (__pyx_nargs) {
25577 case 6:
25578 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
25579 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 351, __pyx_L3_error)
25580 CYTHON_FALLTHROUGH;
25581 case 5:
25582 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
25583 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 351, __pyx_L3_error)
25584 CYTHON_FALLTHROUGH;
25585 case 4:
25586 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
25587 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 351, __pyx_L3_error)
25588 CYTHON_FALLTHROUGH;
25589 case 3:
25590 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25591 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 351, __pyx_L3_error)
25592 CYTHON_FALLTHROUGH;
25593 case 2:
25594 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25595 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 351, __pyx_L3_error)
25596 CYTHON_FALLTHROUGH;
25597 case 1:
25598 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25599 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 351, __pyx_L3_error)
25600 CYTHON_FALLTHROUGH;
25601 case 0: break;
25602 default: goto __pyx_L5_argtuple_error;
25603 }
25604 const Py_ssize_t kwd_pos_args = __pyx_nargs;
25605 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "basm_NR_solve", 0) < (0)) __PYX_ERR(0, 351, __pyx_L3_error)
25606 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
25607 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, i); __PYX_ERR(0, 351, __pyx_L3_error) }
25608 }
25609 } else if (unlikely(__pyx_nargs != 6)) {
25610 goto __pyx_L5_argtuple_error;
25611 } else {
25612 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25613 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 351, __pyx_L3_error)
25614 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25615 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 351, __pyx_L3_error)
25616 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25617 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 351, __pyx_L3_error)
25618 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
25619 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 351, __pyx_L3_error)
25620 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
25621 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 351, __pyx_L3_error)
25622 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
25623 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 351, __pyx_L3_error)
25624 }
25625 __pyx_v_A = values[0];
25626 __pyx_v_w = values[1];
25627 __pyx_v_basmFactor = values[2];
25628 __pyx_v_node_order = values[3];
25629 __pyx_v_R = values[4];
25630 __pyx_v_dX = values[5];
25631 }
25632 goto __pyx_L6_skip;
25633 __pyx_L5_argtuple_error:;
25634 __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 351, __pyx_L3_error)
25635 __pyx_L6_skip:;
25636 goto __pyx_L4_argument_unpacking_done;
25637 __pyx_L3_error:;
25638 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25639 Py_XDECREF(values[__pyx_temp]);
25640 }
25641 __Pyx_AddTraceback("csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
25642 __Pyx_RefNannyFinishContext();
25643 return NULL;
25644 __pyx_L4_argument_unpacking_done:;
25645 __pyx_r = __pyx_pf_10csmoothers_18basm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_basmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
25646
25647 /* function exit code */
25648 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25649 Py_XDECREF(values[__pyx_temp]);
25650 }
25651 __Pyx_RefNannyFinishContext();
25652 return __pyx_r;
25653}
25654
25655static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
25656 PyObject *__pyx_r = NULL;
25657 __Pyx_RefNannyDeclarations
25658 PyObject *__pyx_t_1 = NULL;
25659 double __pyx_t_2;
25660 PyObject *__pyx_t_3 = NULL;
25661 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
25662 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
25663 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
25664 int __pyx_lineno = 0;
25665 const char *__pyx_filename = NULL;
25666 int __pyx_clineno = 0;
25667 __Pyx_RefNannySetupContext("basm_NR_solve", 0);
25668
25669 /* "csmoothers.pyx":363
25670 * dX :
25671 * """
25672 * smootherWrappers_basm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
25673 * w,
25674 * basmFactor._cBASMFactor,
25675*/
25676 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_mstate_global->__pyx_n_u_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
25677 __Pyx_GOTREF(__pyx_t_1);
25678 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 363, __pyx_L1_error)
25679
25680 /* "csmoothers.pyx":364
25681 * """
25682 * smootherWrappers_basm_NR_solve(A._cSparseMatrix,
25683 * w, # <<<<<<<<<<<<<<
25684 * basmFactor._cBASMFactor,
25685 * node_order,
25686*/
25687 __pyx_t_2 = __Pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error)
25688
25689 /* "csmoothers.pyx":365
25690 * smootherWrappers_basm_NR_solve(A._cSparseMatrix,
25691 * w,
25692 * basmFactor._cBASMFactor, # <<<<<<<<<<<<<<
25693 * node_order,
25694 * R,
25695*/
25696 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_mstate_global->__pyx_n_u_cBASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
25697 __Pyx_GOTREF(__pyx_t_3);
25698 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 365, __pyx_L1_error)
25699
25700 /* "csmoothers.pyx":366
25701 * w,
25702 * basmFactor._cBASMFactor,
25703 * node_order, # <<<<<<<<<<<<<<
25704 * R,
25705 * dX)
25706*/
25707 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 366, __pyx_L1_error)
25708
25709 /* "csmoothers.pyx":367
25710 * basmFactor._cBASMFactor,
25711 * node_order,
25712 * R, # <<<<<<<<<<<<<<
25713 * dX)
25714 *
25715*/
25716 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 367, __pyx_L1_error)
25717
25718 /* "csmoothers.pyx":368
25719 * node_order,
25720 * R,
25721 * dX) # <<<<<<<<<<<<<<
25722 *
25723 * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm,
25724*/
25725 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 368, __pyx_L1_error)
25726
25727 /* "csmoothers.pyx":363
25728 * dX :
25729 * """
25730 * smootherWrappers_basm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
25731 * w,
25732 * basmFactor._cBASMFactor,
25733*/
25734 __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
25735 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25736
25737 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25738 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;
25739 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
25740 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL;
25741
25742 /* "csmoothers.pyx":351
25743 *
25744 *
25745 * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
25746 * """
25747 *
25748*/
25749
25750 /* function exit code */
25751 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25752 goto __pyx_L0;
25753 __pyx_L1_error:;
25754 __Pyx_XDECREF(__pyx_t_1);
25755 __Pyx_XDECREF(__pyx_t_3);
25756 __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
25757 __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
25758 __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
25759 __Pyx_AddTraceback("csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
25760 __pyx_r = NULL;
25761 __pyx_L0:;
25762 __Pyx_XGIVEREF(__pyx_r);
25763 __Pyx_RefNannyFinishContext();
25764 return __pyx_r;
25765}
25766
25767/* "csmoothers.pyx":370
25768 * dX)
25769 *
25770 * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
25771 * double w,
25772 * cBASMFactor basmFactor,
25773*/
25774
25775static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
25776 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
25777 __Pyx_RefNannyDeclarations
25778 PyObject *__pyx_t_1 = NULL;
25779 int __pyx_t_2;
25780 Py_ssize_t __pyx_t_3;
25781 Py_ssize_t __pyx_t_4;
25782 Py_ssize_t __pyx_t_5;
25783 int __pyx_lineno = 0;
25784 const char *__pyx_filename = NULL;
25785 int __pyx_clineno = 0;
25786 __Pyx_RefNannySetupContext("smootherWrappers_basm_NR_solve", 0);
25787
25788 /* "csmoothers.pyx":377
25789 * DDATA dX):
25790 * cdef SuperMatrix AS
25791 * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
25792 * AS.Dtype = superluWrappers._SLU_D
25793 * AS.Mtype = superluWrappers._SLU_GE
25794*/
25795 __pyx_v_AS.Stype = SLU_NR;
25796
25797 /* "csmoothers.pyx":378
25798 * cdef SuperMatrix AS
25799 * AS.Stype = superluWrappers._SLU_NR
25800 * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
25801 * AS.Mtype = superluWrappers._SLU_GE
25802 * AS.nrow = sm.nr
25803*/
25804 __pyx_v_AS.Dtype = SLU_D;
25805
25806 /* "csmoothers.pyx":379
25807 * AS.Stype = superluWrappers._SLU_NR
25808 * AS.Dtype = superluWrappers._SLU_D
25809 * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
25810 * AS.nrow = sm.nr
25811 * AS.ncol = sm.nc
25812*/
25813 __pyx_v_AS.Mtype = SLU_GE;
25814
25815 /* "csmoothers.pyx":380
25816 * AS.Dtype = superluWrappers._SLU_D
25817 * AS.Mtype = superluWrappers._SLU_GE
25818 * AS.nrow = sm.nr # <<<<<<<<<<<<<<
25819 * AS.ncol = sm.nc
25820 * AS.Store = &sm.A
25821*/
25822 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
25823 __Pyx_GOTREF(__pyx_t_1);
25824 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
25825 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25826 __pyx_v_AS.nrow = __pyx_t_2;
25827
25828 /* "csmoothers.pyx":381
25829 * AS.Mtype = superluWrappers._SLU_GE
25830 * AS.nrow = sm.nr
25831 * AS.ncol = sm.nc # <<<<<<<<<<<<<<
25832 * AS.Store = &sm.A
25833 * cbasm_NR_solve(basmFactor.bs,
25834*/
25835 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_mstate_global->__pyx_n_u_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
25836 __Pyx_GOTREF(__pyx_t_1);
25837 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L1_error)
25838 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25839 __pyx_v_AS.ncol = __pyx_t_2;
25840
25841 /* "csmoothers.pyx":382
25842 * AS.nrow = sm.nr
25843 * AS.ncol = sm.nc
25844 * AS.Store = &sm.A # <<<<<<<<<<<<<<
25845 * cbasm_NR_solve(basmFactor.bs,
25846 * basmFactor.N,
25847*/
25848 __pyx_v_AS.Store = (&__pyx_v_sm->A);
25849
25850 /* "csmoothers.pyx":390
25851 * basmFactor.subdomain_dim,
25852 * basmFactor.l2g_L,
25853 * &R[0], # <<<<<<<<<<<<<<
25854 * basmFactor.subdomain_R,
25855 * &node_order[0],
25856*/
25857 __pyx_t_3 = 0;
25858 __pyx_t_2 = -1;
25859 if (__pyx_t_3 < 0) {
25860 __pyx_t_3 += __pyx_v_R.shape[0];
25861 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
25862 } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
25863 if (unlikely(__pyx_t_2 != -1)) {
25864 __Pyx_RaiseBufferIndexError(__pyx_t_2);
25865 __PYX_ERR(0, 390, __pyx_L1_error)
25866 }
25867
25868 /* "csmoothers.pyx":392
25869 * &R[0],
25870 * basmFactor.subdomain_R,
25871 * &node_order[0], # <<<<<<<<<<<<<<
25872 * basmFactor.subdomain_dX,
25873 * &dX[0],
25874*/
25875 __pyx_t_4 = 0;
25876 __pyx_t_2 = -1;
25877 if (__pyx_t_4 < 0) {
25878 __pyx_t_4 += __pyx_v_node_order.shape[0];
25879 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
25880 } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
25881 if (unlikely(__pyx_t_2 != -1)) {
25882 __Pyx_RaiseBufferIndexError(__pyx_t_2);
25883 __PYX_ERR(0, 392, __pyx_L1_error)
25884 }
25885
25886 /* "csmoothers.pyx":394
25887 * &node_order[0],
25888 * basmFactor.subdomain_dX,
25889 * &dX[0], # <<<<<<<<<<<<<<
25890 * basmFactor.subdomain_pivots,
25891 * basmFactor.subdomain_col_pivots)
25892*/
25893 __pyx_t_5 = 0;
25894 __pyx_t_2 = -1;
25895 if (__pyx_t_5 < 0) {
25896 __pyx_t_5 += __pyx_v_dX.shape[0];
25897 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
25898 } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
25899 if (unlikely(__pyx_t_2 != -1)) {
25900 __Pyx_RaiseBufferIndexError(__pyx_t_2);
25901 __PYX_ERR(0, 394, __pyx_L1_error)
25902 }
25903
25904 /* "csmoothers.pyx":383
25905 * AS.ncol = sm.nc
25906 * AS.Store = &sm.A
25907 * cbasm_NR_solve(basmFactor.bs, # <<<<<<<<<<<<<<
25908 * basmFactor.N,
25909 * &AS,
25910*/
25911 basm_NR_solve(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_w, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_basmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_basmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
25912
25913 /* "csmoothers.pyx":370
25914 * dX)
25915 *
25916 * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
25917 * double w,
25918 * cBASMFactor basmFactor,
25919*/
25920
25921 /* function exit code */
25922 goto __pyx_L0;
25923 __pyx_L1_error:;
25924 __Pyx_XDECREF(__pyx_t_1);
25925 __Pyx_AddTraceback("csmoothers.smootherWrappers_basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
25926 __pyx_L0:;
25927
25928
25929 __Pyx_RefNannyFinishContext();
25930}
25931/* #### Code section: module_exttypes ### */
25932
25933static PyObject *__pyx_tp_new__initialisation_10csmoothers_cASMFactor(PyObject *o,
25934#if CYTHON_VECTORCALL_TPNEW
25935 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25936#else
25937 PyObject *a, PyObject *k
25938#endif
25939) {
25940 {
25941 int cinit_result = __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(o,
25942#if CYTHON_VECTORCALL_TPNEW
25943 args, nargs, kwnames
25944#else
25945 a, k
25946#endif
25947);
25948 if (unlikely(cinit_result)) goto bad;
25949 }
25950 return o;
25951 bad:
25952 Py_DECREF(o); o = 0;
25953 return NULL;
25954}
25955
25956static PyObject *__pyx_tp_new_vectorcall_10csmoothers_cASMFactor(PyTypeObject *t,
25957#if CYTHON_VECTORCALL_TPNEW
25958 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
25959#else
25960 PyObject *a, PyObject *k
25961#endif
25962) {
25963 PyObject *o;
25964 o = __Pyx_AllocateExtensionType(t, 0);
25965 if (unlikely(!o)) return 0;
25966 return __pyx_tp_new__initialisation_10csmoothers_cASMFactor(o,
25967#if CYTHON_VECTORCALL_TPNEW
25968 args, nargs, kwnames
25969#else
25970 a, k
25971#endif
25972);
25973}
25974
25975#if CYTHON_VECTORCALL_TPNEW
25976static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
25977 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_10csmoothers_cASMFactor, t, a, k);
25978}
25979#endif
25980
25981#if CYTHON_VECTORCALL_TPNEW
25982static PyObject *__pyx_tp_vectorcall_10csmoothers_cASMFactor(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
25983 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_10csmoothers_cASMFactor || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25984 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25985 }
25986 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25987 PyObject *o = __pyx_tp_new_vectorcall_10csmoothers_cASMFactor((PyTypeObject*)t, args, nargs, kwnames);
25988 return o;
25989}
25990#endif
25991
25992static void __pyx_tp_dealloc_10csmoothers_cASMFactor(PyObject *o) {
25993 #if CYTHON_USE_TP_FINALIZE
25994 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25995 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10csmoothers_cASMFactor) {
25996 if (PyObject_CallFinalizerFromDealloc(o)) return;
25997 }
25998 }
25999 #endif
26000 {
26001 PyObject *etype, *eval, *etb;
26002 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26003 __Pyx_DeallocKeepAliveBegin(o);
26004 __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(o);
26005 __Pyx_DeallocKeepAliveEnd(o);
26006 __Pyx_PyErr_RestoreException(etype, eval, etb);
26007 }
26008 PyTypeObject *tp = Py_TYPE(o);
26009 #if CYTHON_USE_TYPE_SLOTS
26010 (*tp->tp_free)(o);
26011 #else
26012 {
26013 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26014 if (tp_free) tp_free(o);
26015 }
26016 #endif
26017 #if CYTHON_USE_TYPE_SPECS
26018 Py_DECREF(tp);
26019 #endif
26020}
26021
26022static PyMethodDef __pyx_methods_10csmoothers_cASMFactor[] = {
26023 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26024 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26025 {0, 0, 0, 0}
26026};
26027#if CYTHON_USE_TYPE_SPECS
26028static PyType_Slot __pyx_type_10csmoothers_cASMFactor_slots[] = {
26029 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10csmoothers_cASMFactor},
26030 {Py_tp_methods, (void *)__pyx_methods_10csmoothers_cASMFactor},
26031 {Py_tp_new, (void *)__pyx_tp_new_10csmoothers_cASMFactor},
26032 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26033 #if CYTHON_VECTORCALL_TPNEW
26034 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_10csmoothers_cASMFactor},
26035 #endif
26036 #endif
26037 {0, 0},
26038};
26039static PyType_Spec __pyx_type_10csmoothers_cASMFactor_spec = {
26040 "csmoothers.cASMFactor",
26041 sizeof(struct __pyx_obj_10csmoothers_cASMFactor),
26042 0,
26043 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
26044 __pyx_type_10csmoothers_cASMFactor_slots,
26045};
26046#else
26047
26048static PyTypeObject __pyx_type_10csmoothers_cASMFactor = {
26049 PyVarObject_HEAD_INIT(0, 0)
26050 "csmoothers.""cASMFactor", /*tp_name*/
26051 sizeof(struct __pyx_obj_10csmoothers_cASMFactor), /*tp_basicsize*/
26052 0, /*tp_itemsize*/
26053 __pyx_tp_dealloc_10csmoothers_cASMFactor, /*tp_dealloc*/
26054 0, /*tp_vectorcall_offset*/
26055 0, /*tp_getattr*/
26056 0, /*tp_setattr*/
26057 0, /*tp_as_async*/
26058 0, /*tp_repr*/
26059 0, /*tp_as_number*/
26060 0, /*tp_as_sequence*/
26061 0, /*tp_as_mapping*/
26062 0, /*tp_hash*/
26063 0, /*tp_call*/
26064 0, /*tp_str*/
26065 0, /*tp_getattro*/
26066 0, /*tp_setattro*/
26067 0, /*tp_as_buffer*/
26068 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
26069 0, /*tp_doc*/
26070 0, /*tp_traverse*/
26071 0, /*tp_clear*/
26072 0, /*tp_richcompare*/
26073 0, /*tp_weaklistoffset*/
26074 0, /*tp_iter*/
26075 0, /*tp_iternext*/
26076 __pyx_methods_10csmoothers_cASMFactor, /*tp_methods*/
26077 0, /*tp_members*/
26078 0, /*tp_getset*/
26079 0, /*tp_base*/
26080 0, /*tp_dict*/
26081 0, /*tp_descr_get*/
26082 0, /*tp_descr_set*/
26083 #if !CYTHON_USE_TYPE_SPECS
26084 0, /*tp_dictoffset*/
26085 #endif
26086 0, /*tp_init*/
26087 0, /*tp_alloc*/
26088 __pyx_tp_new_10csmoothers_cASMFactor, /*tp_new*/
26089 0, /*tp_free*/
26090 0, /*tp_is_gc*/
26091 0, /*tp_bases*/
26092 0, /*tp_mro*/
26093 0, /*tp_cache*/
26094 0, /*tp_subclasses*/
26095 0, /*tp_weaklist*/
26096 0, /*tp_del*/
26097 0, /*tp_version_tag*/
26098 #if CYTHON_USE_TP_FINALIZE
26099 0, /*tp_finalize*/
26100 #else
26101 NULL, /*tp_finalize*/
26102 #endif
26103 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26104 #if CYTHON_VECTORCALL_TPNEW
26105 __pyx_tp_vectorcall_10csmoothers_cASMFactor, /*tp_vectorcall*/
26106 #else
26107 NULL, /*tp_vectorcall*/
26108 #endif
26109 #endif
26110 #if __PYX_NEED_TP_PRINT_SLOT == 1
26111 0, /*tp_print*/
26112 #endif
26113 #if PY_VERSION_HEX >= 0x030C0000
26114 0, /*tp_watched*/
26115 #endif
26116 #if PY_VERSION_HEX >= 0x030d00A4
26117 0, /*tp_versions_used*/
26118 #endif
26119 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26120 0, /*tp_pypy_flags*/
26121 #endif
26122};
26123#endif
26124
26125static PyObject *__pyx_tp_new__initialisation_10csmoothers_cBASMFactor(PyObject *o,
26126#if CYTHON_VECTORCALL_TPNEW
26127 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26128#else
26129 PyObject *a, PyObject *k
26130#endif
26131) {
26132 {
26133 int cinit_result = __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(o,
26134#if CYTHON_VECTORCALL_TPNEW
26135 args, nargs, kwnames
26136#else
26137 a, k
26138#endif
26139);
26140 if (unlikely(cinit_result)) goto bad;
26141 }
26142 return o;
26143 bad:
26144 Py_DECREF(o); o = 0;
26145 return NULL;
26146}
26147
26148static PyObject *__pyx_tp_new_vectorcall_10csmoothers_cBASMFactor(PyTypeObject *t,
26149#if CYTHON_VECTORCALL_TPNEW
26150 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26151#else
26152 PyObject *a, PyObject *k
26153#endif
26154) {
26155 PyObject *o;
26156 o = __Pyx_AllocateExtensionType(t, 0);
26157 if (unlikely(!o)) return 0;
26158 return __pyx_tp_new__initialisation_10csmoothers_cBASMFactor(o,
26159#if CYTHON_VECTORCALL_TPNEW
26160 args, nargs, kwnames
26161#else
26162 a, k
26163#endif
26164);
26165}
26166
26167#if CYTHON_VECTORCALL_TPNEW
26168static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
26169 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_10csmoothers_cBASMFactor, t, a, k);
26170}
26171#endif
26172
26173#if CYTHON_VECTORCALL_TPNEW
26174static PyObject *__pyx_tp_vectorcall_10csmoothers_cBASMFactor(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
26175 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_10csmoothers_cBASMFactor || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26176 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26177 }
26178 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26179 PyObject *o = __pyx_tp_new_vectorcall_10csmoothers_cBASMFactor((PyTypeObject*)t, args, nargs, kwnames);
26180 return o;
26181}
26182#endif
26183
26184static void __pyx_tp_dealloc_10csmoothers_cBASMFactor(PyObject *o) {
26185 #if CYTHON_USE_TP_FINALIZE
26186 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
26187 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10csmoothers_cBASMFactor) {
26188 if (PyObject_CallFinalizerFromDealloc(o)) return;
26189 }
26190 }
26191 #endif
26192 {
26193 PyObject *etype, *eval, *etb;
26194 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26195 __Pyx_DeallocKeepAliveBegin(o);
26196 __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(o);
26197 __Pyx_DeallocKeepAliveEnd(o);
26198 __Pyx_PyErr_RestoreException(etype, eval, etb);
26199 }
26200 PyTypeObject *tp = Py_TYPE(o);
26201 #if CYTHON_USE_TYPE_SLOTS
26202 (*tp->tp_free)(o);
26203 #else
26204 {
26205 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26206 if (tp_free) tp_free(o);
26207 }
26208 #endif
26209 #if CYTHON_USE_TYPE_SPECS
26210 Py_DECREF(tp);
26211 #endif
26212}
26213
26214static PyMethodDef __pyx_methods_10csmoothers_cBASMFactor[] = {
26215 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26216 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26217 {0, 0, 0, 0}
26218};
26219#if CYTHON_USE_TYPE_SPECS
26220static PyType_Slot __pyx_type_10csmoothers_cBASMFactor_slots[] = {
26221 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10csmoothers_cBASMFactor},
26222 {Py_tp_methods, (void *)__pyx_methods_10csmoothers_cBASMFactor},
26223 {Py_tp_new, (void *)__pyx_tp_new_10csmoothers_cBASMFactor},
26224 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26225 #if CYTHON_VECTORCALL_TPNEW
26226 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_10csmoothers_cBASMFactor},
26227 #endif
26228 #endif
26229 {0, 0},
26230};
26231static PyType_Spec __pyx_type_10csmoothers_cBASMFactor_spec = {
26232 "csmoothers.cBASMFactor",
26233 sizeof(struct __pyx_obj_10csmoothers_cBASMFactor),
26234 0,
26235 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
26236 __pyx_type_10csmoothers_cBASMFactor_slots,
26237};
26238#else
26239
26240static PyTypeObject __pyx_type_10csmoothers_cBASMFactor = {
26241 PyVarObject_HEAD_INIT(0, 0)
26242 "csmoothers.""cBASMFactor", /*tp_name*/
26243 sizeof(struct __pyx_obj_10csmoothers_cBASMFactor), /*tp_basicsize*/
26244 0, /*tp_itemsize*/
26245 __pyx_tp_dealloc_10csmoothers_cBASMFactor, /*tp_dealloc*/
26246 0, /*tp_vectorcall_offset*/
26247 0, /*tp_getattr*/
26248 0, /*tp_setattr*/
26249 0, /*tp_as_async*/
26250 0, /*tp_repr*/
26251 0, /*tp_as_number*/
26252 0, /*tp_as_sequence*/
26253 0, /*tp_as_mapping*/
26254 0, /*tp_hash*/
26255 0, /*tp_call*/
26256 0, /*tp_str*/
26257 0, /*tp_getattro*/
26258 0, /*tp_setattro*/
26259 0, /*tp_as_buffer*/
26260 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE, /*tp_flags*/
26261 0, /*tp_doc*/
26262 0, /*tp_traverse*/
26263 0, /*tp_clear*/
26264 0, /*tp_richcompare*/
26265 0, /*tp_weaklistoffset*/
26266 0, /*tp_iter*/
26267 0, /*tp_iternext*/
26268 __pyx_methods_10csmoothers_cBASMFactor, /*tp_methods*/
26269 0, /*tp_members*/
26270 0, /*tp_getset*/
26271 0, /*tp_base*/
26272 0, /*tp_dict*/
26273 0, /*tp_descr_get*/
26274 0, /*tp_descr_set*/
26275 #if !CYTHON_USE_TYPE_SPECS
26276 0, /*tp_dictoffset*/
26277 #endif
26278 0, /*tp_init*/
26279 0, /*tp_alloc*/
26280 __pyx_tp_new_10csmoothers_cBASMFactor, /*tp_new*/
26281 0, /*tp_free*/
26282 0, /*tp_is_gc*/
26283 0, /*tp_bases*/
26284 0, /*tp_mro*/
26285 0, /*tp_cache*/
26286 0, /*tp_subclasses*/
26287 0, /*tp_weaklist*/
26288 0, /*tp_del*/
26289 0, /*tp_version_tag*/
26290 #if CYTHON_USE_TP_FINALIZE
26291 0, /*tp_finalize*/
26292 #else
26293 NULL, /*tp_finalize*/
26294 #endif
26295 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26296 #if CYTHON_VECTORCALL_TPNEW
26297 __pyx_tp_vectorcall_10csmoothers_cBASMFactor, /*tp_vectorcall*/
26298 #else
26299 NULL, /*tp_vectorcall*/
26300 #endif
26301 #endif
26302 #if __PYX_NEED_TP_PRINT_SLOT == 1
26303 0, /*tp_print*/
26304 #endif
26305 #if PY_VERSION_HEX >= 0x030C0000
26306 0, /*tp_watched*/
26307 #endif
26308 #if PY_VERSION_HEX >= 0x030d00A4
26309 0, /*tp_versions_used*/
26310 #endif
26311 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26312 0, /*tp_pypy_flags*/
26313 #endif
26314};
26315#endif
26316static struct __pyx_vtabstruct_array __pyx_vtable_array;
26317
26318static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
26319#if CYTHON_VECTORCALL_TPNEW
26320 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26321#else
26322 PyObject *a, PyObject *k
26323#endif
26324) {
26325 struct __pyx_array_obj *p = ((struct __pyx_array_obj *)o);
26326 p->__pyx_vtab = __pyx_vtabptr_array;
26327 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
26328 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
26329 {
26330 int cinit_result = __pyx_array___cinit__(o,
26331#if CYTHON_VECTORCALL_TPNEW
26332 args, nargs, kwnames
26333#else
26334 a, k
26335#endif
26336);
26337 if (unlikely(cinit_result)) goto bad;
26338 }
26339 return o;
26340 bad:
26341 Py_DECREF(o); o = 0;
26342 return NULL;
26343}
26344
26345static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
26346#if CYTHON_VECTORCALL_TPNEW
26347 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26348#else
26349 PyObject *a, PyObject *k
26350#endif
26351) {
26352 PyObject *o;
26353 o = __Pyx_AllocateExtensionType(t, 0);
26354 if (unlikely(!o)) return 0;
26355 return __pyx_tp_new__initialisation_array(o,
26356#if CYTHON_VECTORCALL_TPNEW
26357 args, nargs, kwnames
26358#else
26359 a, k
26360#endif
26361);
26362}
26363
26364#if CYTHON_VECTORCALL_TPNEW
26365static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
26366 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_array, t, a, k);
26367}
26368#endif
26369
26370#if CYTHON_VECTORCALL_TPNEW
26371static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
26372 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_array_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26373 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26374 }
26375 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26376 PyObject *o = __pyx_tp_new_vectorcall_array((PyTypeObject*)t, args, nargs, kwnames);
26377 return o;
26378}
26379#endif
26380
26381static void __pyx_tp_dealloc_array(PyObject *o) {
26382 struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
26383 #if CYTHON_USE_TP_FINALIZE
26384 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
26385 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
26386 if (PyObject_CallFinalizerFromDealloc(o)) return;
26387 }
26388 }
26389 #endif
26390 {
26391 PyObject *etype, *eval, *etb;
26392 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26393 __Pyx_DeallocKeepAliveBegin(o);
26394 __pyx_array___dealloc__(o);
26395 __Pyx_DeallocKeepAliveEnd(o);
26396 __Pyx_PyErr_RestoreException(etype, eval, etb);
26397 }
26398 Py_CLEAR(p->mode);
26399 Py_CLEAR(p->_format);
26400 PyTypeObject *tp = Py_TYPE(o);
26401 #if CYTHON_USE_TYPE_SLOTS
26402 (*tp->tp_free)(o);
26403 #else
26404 {
26405 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26406 if (tp_free) tp_free(o);
26407 }
26408 #endif
26409 #if CYTHON_USE_TYPE_SPECS
26410 Py_DECREF(tp);
26411 #endif
26412}
26413
26414static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
26415 PyObject *r;
26416 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return NULL;
26417 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
26418 binaryfunc f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
26419 #else
26420 binaryfunc f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
26421 #endif
26422 r = f(o, x);
26423 Py_DECREF(x);
26424 return r;
26425}
26426
26427static PyObject *__pyx_mp_subscript_array(PyObject *o, PyObject *i) {
26428 return __pyx_array___getitem__(o, i);
26429}
26430
26431static int __pyx_sq_ass_item_array(PyObject *o, Py_ssize_t i, PyObject *v) {
26432 if (likely(v)) {
26433 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return -1;
26434 int r = __pyx_array___setitem__(o, x, v);
26435 Py_DECREF(x);
26436 return r;
26437 } else {
26438 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
26439 return -1;
26440 }
26441}
26442
26443static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
26444 if (likely(v)) {
26445 return __pyx_array___setitem__(o, i, v);
26446 } else {
26447 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
26448 return -1;
26449 }
26450}
26451
26452static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
26453 PyObject *v = PyObject_GenericGetAttr(o, n);
26454 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
26455 PyErr_Clear();
26456 v = __pyx_array___getattr__(o, n);
26457 }
26458 return v;
26459}
26460
26461static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
26462 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
26463}
26464
26465static PyMethodDef __pyx_methods_array[] = {
26466 {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
26467 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26468 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26469 {0, 0, 0, 0}
26470};
26471
26472static struct PyGetSetDef __pyx_getsets_array[] = {
26473 {"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
26474 {0, 0, 0, 0, 0}
26475};
26476#if CYTHON_USE_TYPE_SPECS
26477#if !CYTHON_COMPILING_IN_LIMITED_API
26478
26479static PyBufferProcs __pyx_tp_as_buffer_array = {
26480 __pyx_array_getbuffer, /*bf_getbuffer*/
26481 0, /*bf_releasebuffer*/
26482};
26483#endif
26484static PyType_Slot __pyx_type___pyx_array_slots[] = {
26485 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
26486 {Py_sq_length, (void *)__pyx_array___len__},
26487 {Py_sq_item, (void *)__pyx_sq_item_array},
26488 {Py_sq_ass_item, (void *)__pyx_sq_ass_item_array},
26489 {Py_mp_length, (void *)__pyx_array___len__},
26490 {Py_mp_subscript, (void *)__pyx_mp_subscript_array},
26491 {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
26492 {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
26493 #if defined(Py_bf_getbuffer)
26494 {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
26495 #endif
26496 {Py_tp_methods, (void *)__pyx_methods_array},
26497 {Py_tp_getset, (void *)__pyx_getsets_array},
26498 {Py_tp_new, (void *)__pyx_tp_new_array},
26499 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26500 #if CYTHON_VECTORCALL_TPNEW
26501 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_array},
26502 #endif
26503 #endif
26504 {0, 0},
26505};
26506static PyType_Spec __pyx_type___pyx_array_spec = {
26507 "csmoothers.array",
26508 sizeof(struct __pyx_array_obj),
26509 0,
26510 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
26511 __pyx_type___pyx_array_slots,
26512};
26513#else
26514
26515static PySequenceMethods __pyx_tp_as_sequence_array = {
26516 __pyx_array___len__, /*sq_length*/
26517 0, /*sq_concat*/
26518 0, /*sq_repeat*/
26519 __pyx_sq_item_array, /*sq_item*/
26520 0, /*sq_slice*/
26521 __pyx_sq_ass_item_array, /*sq_ass_item*/
26522 0, /*sq_ass_slice*/
26523 0, /*sq_contains*/
26524 0, /*sq_inplace_concat*/
26525 0, /*sq_inplace_repeat*/
26526};
26527
26528static PyMappingMethods __pyx_tp_as_mapping_array = {
26529 __pyx_array___len__, /*mp_length*/
26530 __pyx_mp_subscript_array, /*mp_subscript*/
26531 __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
26532};
26533
26534static PyBufferProcs __pyx_tp_as_buffer_array = {
26535 __pyx_array_getbuffer, /*bf_getbuffer*/
26536 0, /*bf_releasebuffer*/
26537};
26538
26539static PyTypeObject __pyx_type___pyx_array = {
26540 PyVarObject_HEAD_INIT(0, 0)
26541 "csmoothers.""array", /*tp_name*/
26542 sizeof(struct __pyx_array_obj), /*tp_basicsize*/
26543 0, /*tp_itemsize*/
26544 __pyx_tp_dealloc_array, /*tp_dealloc*/
26545 0, /*tp_vectorcall_offset*/
26546 0, /*tp_getattr*/
26547 0, /*tp_setattr*/
26548 0, /*tp_as_async*/
26549 0, /*tp_repr*/
26550 0, /*tp_as_number*/
26551 &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
26552 &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
26553 0, /*tp_hash*/
26554 0, /*tp_call*/
26555 0, /*tp_str*/
26556 __pyx_tp_getattro_array, /*tp_getattro*/
26557 0, /*tp_setattro*/
26558 &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
26559 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
26560 0, /*tp_doc*/
26561 0, /*tp_traverse*/
26562 0, /*tp_clear*/
26563 0, /*tp_richcompare*/
26564 0, /*tp_weaklistoffset*/
26565 0, /*tp_iter*/
26566 0, /*tp_iternext*/
26567 __pyx_methods_array, /*tp_methods*/
26568 0, /*tp_members*/
26569 __pyx_getsets_array, /*tp_getset*/
26570 0, /*tp_base*/
26571 0, /*tp_dict*/
26572 0, /*tp_descr_get*/
26573 0, /*tp_descr_set*/
26574 #if !CYTHON_USE_TYPE_SPECS
26575 0, /*tp_dictoffset*/
26576 #endif
26577 0, /*tp_init*/
26578 0, /*tp_alloc*/
26579 __pyx_tp_new_array, /*tp_new*/
26580 0, /*tp_free*/
26581 0, /*tp_is_gc*/
26582 0, /*tp_bases*/
26583 0, /*tp_mro*/
26584 0, /*tp_cache*/
26585 0, /*tp_subclasses*/
26586 0, /*tp_weaklist*/
26587 0, /*tp_del*/
26588 0, /*tp_version_tag*/
26589 #if CYTHON_USE_TP_FINALIZE
26590 0, /*tp_finalize*/
26591 #else
26592 NULL, /*tp_finalize*/
26593 #endif
26594 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26595 #if CYTHON_VECTORCALL_TPNEW
26596 __pyx_tp_vectorcall_array, /*tp_vectorcall*/
26597 #else
26598 NULL, /*tp_vectorcall*/
26599 #endif
26600 #endif
26601 #if __PYX_NEED_TP_PRINT_SLOT == 1
26602 0, /*tp_print*/
26603 #endif
26604 #if PY_VERSION_HEX >= 0x030C0000
26605 0, /*tp_watched*/
26606 #endif
26607 #if PY_VERSION_HEX >= 0x030d00A4
26608 0, /*tp_versions_used*/
26609 #endif
26610 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26611 0, /*tp_pypy_flags*/
26612 #endif
26613};
26614#endif
26615
26616static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
26617#if CYTHON_VECTORCALL_TPNEW
26618 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
26619#else
26620 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
26621#endif
26622) {
26623 struct __pyx_MemviewEnum_obj *p = ((struct __pyx_MemviewEnum_obj *)o);
26624 p->name = Py_None; Py_INCREF(Py_None);
26625 return o;
26626}
26627
26628static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
26629#if CYTHON_VECTORCALL_TPNEW
26630 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26631#else
26632 PyObject *a, PyObject *k
26633#endif
26634) {
26635 PyObject *o;
26636 o = __Pyx_AllocateExtensionType(t, 0);
26637 if (unlikely(!o)) return 0;
26638 return __pyx_tp_new__initialisation_Enum(o,
26639#if CYTHON_VECTORCALL_TPNEW
26640 args, nargs, kwnames
26641#else
26642 a, k
26643#endif
26644);
26645}
26646
26647#if CYTHON_VECTORCALL_TPNEW
26648static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k) {
26649 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_Enum, t, a, k);
26650}
26651#endif
26652
26653#if CYTHON_VECTORCALL_TPNEW
26654static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
26655 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_MemviewEnum_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26656 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26657 }
26658 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26659 PyObject *o = __pyx_tp_new_vectorcall_Enum((PyTypeObject*)t, args, nargs, kwnames);
26660 if (likely(o)) {
26661 assert(Py_TYPE(o) == (PyTypeObject*)t);
26662 if (unlikely(__pyx_MemviewEnum___init__(o, args, nargs, kwnames) < 0)) {
26663 Py_CLEAR(o);
26664 }
26665 }
26666 return o;
26667}
26668#endif
26669
26670#if CYTHON_VECTORCALL_TPNEW
26671static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds) {
26672 return __Pyx_CallTpinitAsVectorcall(__pyx_MemviewEnum___init__, o, args, kwds);
26673}
26674#endif
26675
26676static void __pyx_tp_dealloc_Enum(PyObject *o) {
26677 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
26678 #if CYTHON_USE_TP_FINALIZE
26679 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26680 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
26681 if (PyObject_CallFinalizerFromDealloc(o)) return;
26682 }
26683 }
26684 #endif
26685 PyObject_GC_UnTrack(o);
26686 Py_CLEAR(p->name);
26687 PyTypeObject *tp = Py_TYPE(o);
26688 #if CYTHON_USE_TYPE_SLOTS
26689 (*tp->tp_free)(o);
26690 #else
26691 {
26692 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26693 if (tp_free) tp_free(o);
26694 }
26695 #endif
26696 #if CYTHON_USE_TYPE_SPECS
26697 Py_DECREF(tp);
26698 #endif
26699}
26700
26701static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
26702 int e;
26703 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
26704 {
26705 e = __Pyx_call_type_traverse(o, 1, v, a);
26706 if (e) return e;
26707 }
26708 if (p->name) {
26709 e = (*v)(p->name, a); if (e) return e;
26710 }
26711 return 0;
26712}
26713
26714static int __pyx_tp_clear_Enum(PyObject *o) {
26715 PyObject* tmp;
26716 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
26717 tmp = ((PyObject*)p->name);
26718 p->name = Py_None; Py_INCREF(Py_None);
26719 Py_XDECREF(tmp);
26720 return 0;
26721}
26722
26723static PyMethodDef __pyx_methods_Enum[] = {
26724 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26725 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26726 {0, 0, 0, 0}
26727};
26728#if CYTHON_USE_TYPE_SPECS
26729static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
26730 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
26731 {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
26732 {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
26733 {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
26734 {Py_tp_methods, (void *)__pyx_methods_Enum},
26735 {Py_tp_init, (void *)__pyx_tp_init_Enum},
26736 {Py_tp_new, (void *)__pyx_tp_new_Enum},
26737 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26738 #if CYTHON_VECTORCALL_TPNEW
26739 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_Enum},
26740 #endif
26741 #endif
26742 {0, 0},
26743};
26744static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
26745 "csmoothers.Enum",
26746 sizeof(struct __pyx_MemviewEnum_obj),
26747 0,
26748 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26749 __pyx_type___pyx_MemviewEnum_slots,
26750};
26751#else
26752
26753static PyTypeObject __pyx_type___pyx_MemviewEnum = {
26754 PyVarObject_HEAD_INIT(0, 0)
26755 "csmoothers.""Enum", /*tp_name*/
26756 sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
26757 0, /*tp_itemsize*/
26758 __pyx_tp_dealloc_Enum, /*tp_dealloc*/
26759 0, /*tp_vectorcall_offset*/
26760 0, /*tp_getattr*/
26761 0, /*tp_setattr*/
26762 0, /*tp_as_async*/
26763 __pyx_MemviewEnum___repr__, /*tp_repr*/
26764 0, /*tp_as_number*/
26765 0, /*tp_as_sequence*/
26766 0, /*tp_as_mapping*/
26767 0, /*tp_hash*/
26768 0, /*tp_call*/
26769 0, /*tp_str*/
26770 0, /*tp_getattro*/
26771 0, /*tp_setattro*/
26772 0, /*tp_as_buffer*/
26773 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26774 0, /*tp_doc*/
26775 __pyx_tp_traverse_Enum, /*tp_traverse*/
26776 __pyx_tp_clear_Enum, /*tp_clear*/
26777 0, /*tp_richcompare*/
26778 0, /*tp_weaklistoffset*/
26779 0, /*tp_iter*/
26780 0, /*tp_iternext*/
26781 __pyx_methods_Enum, /*tp_methods*/
26782 0, /*tp_members*/
26783 0, /*tp_getset*/
26784 0, /*tp_base*/
26785 0, /*tp_dict*/
26786 0, /*tp_descr_get*/
26787 0, /*tp_descr_set*/
26788 #if !CYTHON_USE_TYPE_SPECS
26789 0, /*tp_dictoffset*/
26790 #endif
26791 __pyx_tp_init_Enum, /*tp_init*/
26792 0, /*tp_alloc*/
26793 __pyx_tp_new_Enum, /*tp_new*/
26794 0, /*tp_free*/
26795 0, /*tp_is_gc*/
26796 0, /*tp_bases*/
26797 0, /*tp_mro*/
26798 0, /*tp_cache*/
26799 0, /*tp_subclasses*/
26800 0, /*tp_weaklist*/
26801 0, /*tp_del*/
26802 0, /*tp_version_tag*/
26803 #if CYTHON_USE_TP_FINALIZE
26804 0, /*tp_finalize*/
26805 #else
26806 NULL, /*tp_finalize*/
26807 #endif
26808 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26809 #if CYTHON_VECTORCALL_TPNEW
26810 __pyx_tp_vectorcall_Enum, /*tp_vectorcall*/
26811 #else
26812 NULL, /*tp_vectorcall*/
26813 #endif
26814 #endif
26815 #if __PYX_NEED_TP_PRINT_SLOT == 1
26816 0, /*tp_print*/
26817 #endif
26818 #if PY_VERSION_HEX >= 0x030C0000
26819 0, /*tp_watched*/
26820 #endif
26821 #if PY_VERSION_HEX >= 0x030d00A4
26822 0, /*tp_versions_used*/
26823 #endif
26824 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26825 0, /*tp_pypy_flags*/
26826 #endif
26827};
26828#endif
26829static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
26830
26831static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
26832#if CYTHON_VECTORCALL_TPNEW
26833 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26834#else
26835 PyObject *a, PyObject *k
26836#endif
26837) {
26838 struct __pyx_memoryview_obj *p = ((struct __pyx_memoryview_obj *)o);
26839 p->__pyx_vtab = __pyx_vtabptr_memoryview;
26840 p->obj = Py_None; Py_INCREF(Py_None);
26841 p->_size = Py_None; Py_INCREF(Py_None);
26842 p->view.obj = NULL;
26843 {
26844 int cinit_result = __pyx_memoryview___cinit__(o,
26845#if CYTHON_VECTORCALL_TPNEW
26846 args, nargs, kwnames
26847#else
26848 a, k
26849#endif
26850);
26851 if (unlikely(cinit_result)) goto bad;
26852 }
26853 return o;
26854 bad:
26855 Py_DECREF(o); o = 0;
26856 return NULL;
26857}
26858
26859static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
26860#if CYTHON_VECTORCALL_TPNEW
26861 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26862#else
26863 PyObject *a, PyObject *k
26864#endif
26865) {
26866 PyObject *o;
26867 o = __Pyx_AllocateExtensionType(t, 0);
26868 if (unlikely(!o)) return 0;
26869 return __pyx_tp_new__initialisation_memoryview(o,
26870#if CYTHON_VECTORCALL_TPNEW
26871 args, nargs, kwnames
26872#else
26873 a, k
26874#endif
26875);
26876}
26877
26878#if CYTHON_VECTORCALL_TPNEW
26879static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
26880 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_memoryview, t, a, k);
26881}
26882#endif
26883
26884#if CYTHON_VECTORCALL_TPNEW
26885static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
26886 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryview_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26887 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26888 }
26889 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26890 PyObject *o = __pyx_tp_new_vectorcall_memoryview((PyTypeObject*)t, args, nargs, kwnames);
26891 return o;
26892}
26893#endif
26894
26895static void __pyx_tp_dealloc_memoryview(PyObject *o) {
26896 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26897 #if CYTHON_USE_TP_FINALIZE
26898 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26899 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
26900 if (PyObject_CallFinalizerFromDealloc(o)) return;
26901 }
26902 }
26903 #endif
26904 PyObject_GC_UnTrack(o);
26905 {
26906 PyObject *etype, *eval, *etb;
26907 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26908 __Pyx_DeallocKeepAliveBegin(o);
26909 __pyx_memoryview___dealloc__(o);
26910 __Pyx_DeallocKeepAliveEnd(o);
26911 __Pyx_PyErr_RestoreException(etype, eval, etb);
26912 }
26913 Py_CLEAR(p->obj);
26914 Py_CLEAR(p->_size);
26915 PyTypeObject *tp = Py_TYPE(o);
26916 #if CYTHON_USE_TYPE_SLOTS
26917 (*tp->tp_free)(o);
26918 #else
26919 {
26920 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26921 if (tp_free) tp_free(o);
26922 }
26923 #endif
26924 #if CYTHON_USE_TYPE_SPECS
26925 Py_DECREF(tp);
26926 #endif
26927}
26928
26929static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
26930 int e;
26931 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26932 {
26933 e = __Pyx_call_type_traverse(o, 1, v, a);
26934 if (e) return e;
26935 }
26936 if (p->obj) {
26937 e = (*v)(p->obj, a); if (e) return e;
26938 }
26939 if (p->_size) {
26940 e = (*v)(p->_size, a); if (e) return e;
26941 }
26942 if (p->view.obj) {
26943 e = (*v)(p->view.obj, a); if (e) return e;
26944 }
26945 return 0;
26946}
26947
26948static int __pyx_tp_clear_memoryview(PyObject *o) {
26949 PyObject* tmp;
26950 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26951 tmp = ((PyObject*)p->obj);
26952 p->obj = Py_None; Py_INCREF(Py_None);
26953 Py_XDECREF(tmp);
26954 tmp = ((PyObject*)p->_size);
26955 p->_size = Py_None; Py_INCREF(Py_None);
26956 Py_XDECREF(tmp);
26957 Py_CLEAR(p->view.obj);
26958 return 0;
26959}
26960
26961static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
26962 PyObject *r;
26963 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return NULL;
26964 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
26965 binaryfunc f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
26966 #else
26967 binaryfunc f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
26968 #endif
26969 r = f(o, x);
26970 Py_DECREF(x);
26971 return r;
26972}
26973
26974static PyObject *__pyx_mp_subscript_memoryview(PyObject *o, PyObject *i) {
26975 return __pyx_memoryview___getitem__(o, i);
26976}
26977
26978static int __pyx_sq_ass_item_memoryview(PyObject *o, Py_ssize_t i, PyObject *v) {
26979 if (likely(v)) {
26980 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return -1;
26981 int r = __pyx_memoryview___setitem__(o, x, v);
26982 Py_DECREF(x);
26983 return r;
26984 } else {
26985 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
26986 return -1;
26987 }
26988}
26989
26990static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
26991 if (likely(v)) {
26992 return __pyx_memoryview___setitem__(o, i, v);
26993 } else {
26994 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
26995 return -1;
26996 }
26997}
26998
26999static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
27000 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
27001}
27002
27003static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
27004 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
27005}
27006
27007static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
27008 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
27009}
27010
27011static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
27012 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
27013}
27014
27015static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
27016 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
27017}
27018
27019static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
27020 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
27021}
27022
27023static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
27024 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
27025}
27026
27027static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
27028 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
27029}
27030
27031static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
27032 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
27033}
27034
27035static PyMethodDef __pyx_methods_memoryview[] = {
27036 {"is_c_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27037 {"is_f_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27038 {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27039 {"copy_fortran", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27040 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27041 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27042 {0, 0, 0, 0}
27043};
27044
27045static struct PyGetSetDef __pyx_getsets_memoryview[] = {
27046 {"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
27047 {"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
27048 {"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
27049 {"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
27050 {"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
27051 {"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
27052 {"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
27053 {"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
27054 {"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
27055 {0, 0, 0, 0, 0}
27056};
27057#if CYTHON_USE_TYPE_SPECS
27058#if !CYTHON_COMPILING_IN_LIMITED_API
27059
27060static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
27061 __pyx_memoryview_getbuffer, /*bf_getbuffer*/
27062 0, /*bf_releasebuffer*/
27063};
27064#endif
27065static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
27066 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
27067 {Py_tp_repr, (void *)__pyx_memoryview___repr__},
27068 {Py_sq_length, (void *)__pyx_memoryview___len__},
27069 {Py_sq_item, (void *)__pyx_sq_item_memoryview},
27070 {Py_sq_ass_item, (void *)__pyx_sq_ass_item_memoryview},
27071 {Py_mp_length, (void *)__pyx_memoryview___len__},
27072 {Py_mp_subscript, (void *)__pyx_mp_subscript_memoryview},
27073 {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
27074 {Py_tp_str, (void *)__pyx_memoryview___str__},
27075 #if defined(Py_bf_getbuffer)
27076 {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
27077 #endif
27078 {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
27079 {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
27080 {Py_tp_methods, (void *)__pyx_methods_memoryview},
27081 {Py_tp_getset, (void *)__pyx_getsets_memoryview},
27082 {Py_tp_new, (void *)__pyx_tp_new_memoryview},
27083 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27084 #if CYTHON_VECTORCALL_TPNEW
27085 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_memoryview},
27086 #endif
27087 #endif
27088 {0, 0},
27089};
27090static PyType_Spec __pyx_type___pyx_memoryview_spec = {
27091 "csmoothers.memoryview",
27092 sizeof(struct __pyx_memoryview_obj),
27093 0,
27094 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
27095 __pyx_type___pyx_memoryview_slots,
27096};
27097#else
27098
27099static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
27100 __pyx_memoryview___len__, /*sq_length*/
27101 0, /*sq_concat*/
27102 0, /*sq_repeat*/
27103 __pyx_sq_item_memoryview, /*sq_item*/
27104 0, /*sq_slice*/
27105 __pyx_sq_ass_item_memoryview, /*sq_ass_item*/
27106 0, /*sq_ass_slice*/
27107 0, /*sq_contains*/
27108 0, /*sq_inplace_concat*/
27109 0, /*sq_inplace_repeat*/
27110};
27111
27112static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
27113 __pyx_memoryview___len__, /*mp_length*/
27114 __pyx_mp_subscript_memoryview, /*mp_subscript*/
27115 __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
27116};
27117
27118static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
27119 __pyx_memoryview_getbuffer, /*bf_getbuffer*/
27120 0, /*bf_releasebuffer*/
27121};
27122
27123static PyTypeObject __pyx_type___pyx_memoryview = {
27124 PyVarObject_HEAD_INIT(0, 0)
27125 "csmoothers.""memoryview", /*tp_name*/
27126 sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
27127 0, /*tp_itemsize*/
27128 __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
27129 0, /*tp_vectorcall_offset*/
27130 0, /*tp_getattr*/
27131 0, /*tp_setattr*/
27132 0, /*tp_as_async*/
27133 __pyx_memoryview___repr__, /*tp_repr*/
27134 0, /*tp_as_number*/
27135 &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
27136 &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
27137 0, /*tp_hash*/
27138 0, /*tp_call*/
27139 __pyx_memoryview___str__, /*tp_str*/
27140 0, /*tp_getattro*/
27141 0, /*tp_setattro*/
27142 &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
27143 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
27144 0, /*tp_doc*/
27145 __pyx_tp_traverse_memoryview, /*tp_traverse*/
27146 __pyx_tp_clear_memoryview, /*tp_clear*/
27147 0, /*tp_richcompare*/
27148 0, /*tp_weaklistoffset*/
27149 0, /*tp_iter*/
27150 0, /*tp_iternext*/
27151 __pyx_methods_memoryview, /*tp_methods*/
27152 0, /*tp_members*/
27153 __pyx_getsets_memoryview, /*tp_getset*/
27154 0, /*tp_base*/
27155 0, /*tp_dict*/
27156 0, /*tp_descr_get*/
27157 0, /*tp_descr_set*/
27158 #if !CYTHON_USE_TYPE_SPECS
27159 0, /*tp_dictoffset*/
27160 #endif
27161 0, /*tp_init*/
27162 0, /*tp_alloc*/
27163 __pyx_tp_new_memoryview, /*tp_new*/
27164 0, /*tp_free*/
27165 0, /*tp_is_gc*/
27166 0, /*tp_bases*/
27167 0, /*tp_mro*/
27168 0, /*tp_cache*/
27169 0, /*tp_subclasses*/
27170 0, /*tp_weaklist*/
27171 0, /*tp_del*/
27172 0, /*tp_version_tag*/
27173 #if CYTHON_USE_TP_FINALIZE
27174 0, /*tp_finalize*/
27175 #else
27176 NULL, /*tp_finalize*/
27177 #endif
27178 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27179 #if CYTHON_VECTORCALL_TPNEW
27180 __pyx_tp_vectorcall_memoryview, /*tp_vectorcall*/
27181 #else
27182 NULL, /*tp_vectorcall*/
27183 #endif
27184 #endif
27185 #if __PYX_NEED_TP_PRINT_SLOT == 1
27186 0, /*tp_print*/
27187 #endif
27188 #if PY_VERSION_HEX >= 0x030C0000
27189 0, /*tp_watched*/
27190 #endif
27191 #if PY_VERSION_HEX >= 0x030d00A4
27192 0, /*tp_versions_used*/
27193 #endif
27194 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
27195 0, /*tp_pypy_flags*/
27196 #endif
27197};
27198#endif
27199static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
27200
27201static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
27202#if CYTHON_VECTORCALL_TPNEW
27203 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
27204#else
27205 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
27206#endif
27207) {
27208 struct __pyx_memoryviewslice_obj *p = ((struct __pyx_memoryviewslice_obj *)o);
27209 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
27210 p->from_object = Py_None; Py_INCREF(Py_None);
27211 p->from_slice.memview = NULL;
27212 return o;
27213}
27214
27215static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
27216#if CYTHON_VECTORCALL_TPNEW
27217 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
27218#else
27219 PyObject *a, PyObject *k
27220#endif
27221) {
27222 PyObject *o;
27223 o = __pyx_tp_new_vectorcall_memoryview(t,
27224#if CYTHON_VECTORCALL_TPNEW
27225 args, nargs, kwnames
27226#else
27227 a, k
27228#endif
27229);
27230 if (unlikely(!o)) return 0;
27231 return __pyx_tp_new__initialisation__memoryviewslice(o,
27232#if CYTHON_VECTORCALL_TPNEW
27233 args, nargs, kwnames
27234#else
27235 a, k
27236#endif
27237);
27238}
27239
27240#if CYTHON_VECTORCALL_TPNEW
27241static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
27242 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall__memoryviewslice, t, a, k);
27243}
27244#endif
27245
27246#if CYTHON_VECTORCALL_TPNEW
27247static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
27248 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryviewslice_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
27249 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
27250 }
27251 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
27252 PyObject *o = __pyx_tp_new_vectorcall__memoryviewslice((PyTypeObject*)t, args, nargs, kwnames);
27253 return o;
27254}
27255#endif
27256
27257static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
27258 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
27259 #if CYTHON_USE_TP_FINALIZE
27260 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
27261 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
27262 if (PyObject_CallFinalizerFromDealloc(o)) return;
27263 }
27264 }
27265 #endif
27266 PyObject_GC_UnTrack(o);
27267 {
27268 PyObject *etype, *eval, *etb;
27269 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
27270 __Pyx_DeallocKeepAliveBegin(o);
27271 __pyx_memoryviewslice___dealloc__(o);
27272 __Pyx_DeallocKeepAliveEnd(o);
27273 __Pyx_PyErr_RestoreException(etype, eval, etb);
27274 }
27275 Py_CLEAR(p->from_object);
27276 PyObject_GC_Track(o);
27277 __pyx_tp_dealloc_memoryview(o);
27278}
27279
27280static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
27281 int e;
27282 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
27283 e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
27284 if (p->from_object) {
27285 e = (*v)(p->from_object, a); if (e) return e;
27286 }
27287 return 0;
27288}
27289
27290static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
27291 PyObject* tmp;
27292 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
27293 __pyx_tp_clear_memoryview(o);
27294 tmp = ((PyObject*)p->from_object);
27295 p->from_object = Py_None; Py_INCREF(Py_None);
27296 Py_XDECREF(tmp);
27297 __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
27298 return 0;
27299}
27300
27301static PyMethodDef __pyx_methods__memoryviewslice[] = {
27302 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27303 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27304 {0, 0, 0, 0}
27305};
27306#if CYTHON_USE_TYPE_SPECS
27307static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
27308 {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
27309 {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
27310 {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
27311 {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
27312 {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
27313 {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
27314 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27315 #if CYTHON_VECTORCALL_TPNEW
27316 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall__memoryviewslice},
27317 #endif
27318 #endif
27319 {0, 0},
27320};
27321static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
27322 "csmoothers._memoryviewslice",
27323 sizeof(struct __pyx_memoryviewslice_obj),
27324 0,
27325 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
27326 __pyx_type___pyx_memoryviewslice_slots,
27327};
27328#else
27329
27330static PyTypeObject __pyx_type___pyx_memoryviewslice = {
27331 PyVarObject_HEAD_INIT(0, 0)
27332 "csmoothers.""_memoryviewslice", /*tp_name*/
27333 sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
27334 0, /*tp_itemsize*/
27335 __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
27336 0, /*tp_vectorcall_offset*/
27337 0, /*tp_getattr*/
27338 0, /*tp_setattr*/
27339 0, /*tp_as_async*/
27340 #if CYTHON_COMPILING_IN_PYPY || 0
27341 __pyx_memoryview___repr__, /*tp_repr*/
27342 #else
27343 0, /*tp_repr*/
27344 #endif
27345 0, /*tp_as_number*/
27346 0, /*tp_as_sequence*/
27347 0, /*tp_as_mapping*/
27348 0, /*tp_hash*/
27349 0, /*tp_call*/
27350 #if CYTHON_COMPILING_IN_PYPY || 0
27351 __pyx_memoryview___str__, /*tp_str*/
27352 #else
27353 0, /*tp_str*/
27354 #endif
27355 0, /*tp_getattro*/
27356 0, /*tp_setattro*/
27357 0, /*tp_as_buffer*/
27358 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
27359 PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
27360 __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
27361 __pyx_tp_clear__memoryviewslice, /*tp_clear*/
27362 0, /*tp_richcompare*/
27363 0, /*tp_weaklistoffset*/
27364 0, /*tp_iter*/
27365 0, /*tp_iternext*/
27366 __pyx_methods__memoryviewslice, /*tp_methods*/
27367 0, /*tp_members*/
27368 0, /*tp_getset*/
27369 0, /*tp_base*/
27370 0, /*tp_dict*/
27371 0, /*tp_descr_get*/
27372 0, /*tp_descr_set*/
27373 #if !CYTHON_USE_TYPE_SPECS
27374 0, /*tp_dictoffset*/
27375 #endif
27376 0, /*tp_init*/
27377 0, /*tp_alloc*/
27378 __pyx_tp_new__memoryviewslice, /*tp_new*/
27379 0, /*tp_free*/
27380 0, /*tp_is_gc*/
27381 0, /*tp_bases*/
27382 0, /*tp_mro*/
27383 0, /*tp_cache*/
27384 0, /*tp_subclasses*/
27385 0, /*tp_weaklist*/
27386 0, /*tp_del*/
27387 0, /*tp_version_tag*/
27388 #if CYTHON_USE_TP_FINALIZE
27389 0, /*tp_finalize*/
27390 #else
27391 NULL, /*tp_finalize*/
27392 #endif
27393 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27394 #if CYTHON_VECTORCALL_TPNEW
27395 __pyx_tp_vectorcall__memoryviewslice, /*tp_vectorcall*/
27396 #else
27397 NULL, /*tp_vectorcall*/
27398 #endif
27399 #endif
27400 #if __PYX_NEED_TP_PRINT_SLOT == 1
27401 0, /*tp_print*/
27402 #endif
27403 #if PY_VERSION_HEX >= 0x030C0000
27404 0, /*tp_watched*/
27405 #endif
27406 #if PY_VERSION_HEX >= 0x030d00A4
27407 0, /*tp_versions_used*/
27408 #endif
27409 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
27410 0, /*tp_pypy_flags*/
27411 #endif
27412};
27413#endif
27414
27415static PyMethodDef __pyx_methods[] = {
27416 {0, 0, 0, 0}
27417};
27418/* #### Code section: initfunc_declarations ### */
27419static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
27420static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
27421static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
27422static CYTHON_SMALL_CODE int __Pyx_InitAfterSharedUtility(void); /*proto*/
27423static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
27424static CYTHON_SMALL_CODE int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
27425static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
27426static CYTHON_SMALL_CODE int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
27427static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_10csmoothers_cASMFactor(__pyx_mstatetype *__pyx_mstate); /*proto*/
27428static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_10csmoothers_cBASMFactor(__pyx_mstatetype *__pyx_mstate); /*proto*/
27429static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
27430static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
27431static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
27432static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
27433static CYTHON_SMALL_CODE int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
27434static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
27435static CYTHON_SMALL_CODE int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
27436static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
27437/* #### Code section: init_module ### */
27438
27439static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
27440 __Pyx_RefNannyDeclarations
27441 CYTHON_UNUSED_VAR(__pyx_mstate);
27442 __Pyx_RefNannySetupContext("__Pyx_modinit_Global_init_code", 0);
27443 /*--- Global init code ---*/
27444 __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
27445 generic = Py_None; Py_INCREF(Py_None);
27446 strided = Py_None; Py_INCREF(Py_None);
27447 indirect = Py_None; Py_INCREF(Py_None);
27448 contiguous = Py_None; Py_INCREF(Py_None);
27449 indirect_contiguous = Py_None; Py_INCREF(Py_None);
27450 __Pyx_RefNannyFinishContext();
27451 return 0;
27452}
27453
27454static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
27455 __Pyx_RefNannyDeclarations
27456 CYTHON_UNUSED_VAR(__pyx_mstate);
27457 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_export_code", 0);
27458 /*--- Variable export code ---*/
27459 __Pyx_RefNannyFinishContext();
27460 return 0;
27461}
27462
27463static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
27464 __Pyx_RefNannyDeclarations
27465 CYTHON_UNUSED_VAR(__pyx_mstate);
27466 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_export_code", 0);
27467 /*--- Function export code ---*/
27468 __Pyx_RefNannyFinishContext();
27469 return 0;
27470}
27471
27472static int __Pyx_modinit_Exttype___pyx_obj_10csmoothers_cASMFactor(__pyx_mstatetype *__pyx_mstate) {
27473 __Pyx_RefNannyDeclarations
27474 int __pyx_lineno = 0;
27475 const char *__pyx_filename = NULL;
27476 int __pyx_clineno = 0;
27477 CYTHON_UNUSED_VAR(__pyx_mstate);
27478 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_10csmoothers_cASMFactor", 0);
27479 /*--- Exttype __pyx_obj_10csmoothers_cASMFactor ---*/
27480 #if CYTHON_USE_TYPE_SPECS
27481 __pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10csmoothers_cASMFactor_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor)) __PYX_ERR(0, 12, __pyx_L1_error)
27482 #else
27483 __pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor = &__pyx_type_10csmoothers_cASMFactor;
27484 #endif
27485 #if !CYTHON_COMPILING_IN_LIMITED_API
27486 #endif
27487 #if !CYTHON_USE_TYPE_SPECS
27488 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor) < (0)) __PYX_ERR(0, 12, __pyx_L1_error)
27489 #endif
27490 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27491 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor);
27492 #endif
27493 #if !CYTHON_COMPILING_IN_LIMITED_API
27494 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor->tp_dictoffset && __pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor->tp_getattro == PyObject_GenericGetAttr)) {
27495 __pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor->tp_getattro = PyObject_GenericGetAttr;
27496 }
27497 #endif
27498 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_cASMFactor_2, (PyObject *) __pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor) < (0)) __PYX_ERR(0, 12, __pyx_L1_error)
27499 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_10csmoothers_cASMFactor) < (0)) __PYX_ERR(0, 12, __pyx_L1_error)
27500 __Pyx_RefNannyFinishContext();
27501 return 0;
27502 __pyx_L1_error:;
27503 __Pyx_RefNannyFinishContext();
27504 return -1;
27505}
27506
27507static int __Pyx_modinit_Exttype___pyx_obj_10csmoothers_cBASMFactor(__pyx_mstatetype *__pyx_mstate) {
27508 __Pyx_RefNannyDeclarations
27509 int __pyx_lineno = 0;
27510 const char *__pyx_filename = NULL;
27511 int __pyx_clineno = 0;
27512 CYTHON_UNUSED_VAR(__pyx_mstate);
27513 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_10csmoothers_cBASMFactor", 0);
27514 /*--- Exttype __pyx_obj_10csmoothers_cBASMFactor ---*/
27515 #if CYTHON_USE_TYPE_SPECS
27516 __pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10csmoothers_cBASMFactor_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor)) __PYX_ERR(0, 51, __pyx_L1_error)
27517 #else
27518 __pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor = &__pyx_type_10csmoothers_cBASMFactor;
27519 #endif
27520 #if !CYTHON_COMPILING_IN_LIMITED_API
27521 #endif
27522 #if !CYTHON_USE_TYPE_SPECS
27523 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor) < (0)) __PYX_ERR(0, 51, __pyx_L1_error)
27524 #endif
27525 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27526 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor);
27527 #endif
27528 #if !CYTHON_COMPILING_IN_LIMITED_API
27529 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor->tp_dictoffset && __pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor->tp_getattro == PyObject_GenericGetAttr)) {
27530 __pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor->tp_getattro = PyObject_GenericGetAttr;
27531 }
27532 #endif
27533 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_cBASMFactor_2, (PyObject *) __pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor) < (0)) __PYX_ERR(0, 51, __pyx_L1_error)
27534 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_10csmoothers_cBASMFactor) < (0)) __PYX_ERR(0, 51, __pyx_L1_error)
27535 __Pyx_RefNannyFinishContext();
27536 return 0;
27537 __pyx_L1_error:;
27538 __Pyx_RefNannyFinishContext();
27539 return -1;
27540}
27541
27542static int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate) {
27543 __Pyx_RefNannyDeclarations
27544 int __pyx_lineno = 0;
27545 const char *__pyx_filename = NULL;
27546 int __pyx_clineno = 0;
27547 CYTHON_UNUSED_VAR(__pyx_mstate);
27548 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_array_obj", 0);
27549 /*--- Exttype __pyx_array_obj ---*/
27550 __pyx_vtabptr_array = &__pyx_vtable_array;
27551 __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
27552 #if CYTHON_USE_TYPE_SPECS
27553 __pyx_mstate->__pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_array_type)) __PYX_ERR(1, 128, __pyx_L1_error)
27554 #if !CYTHON_COMPILING_IN_LIMITED_API
27555 __pyx_mstate->__pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
27556 if (!__pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
27557 __pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
27558 }
27559 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
27560 /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
27561 #elif defined(_MSC_VER)
27562 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
27563 #else
27564 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
27565 #endif
27566 #else
27567 __pyx_mstate->__pyx_array_type = &__pyx_type___pyx_array;
27568 #endif
27569 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_array_type, 1) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
27570 #if !CYTHON_COMPILING_IN_LIMITED_API
27571 #endif
27572 #if !CYTHON_USE_TYPE_SPECS
27573 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
27574 #endif
27575 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27576 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_array_type);
27577 #endif
27578 if (__Pyx_SetVtable(__pyx_mstate->__pyx_array_type, __pyx_vtabptr_array) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
27579 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
27580 __Pyx_RefNannyFinishContext();
27581 return 0;
27582 __pyx_L1_error:;
27583 __Pyx_RefNannyFinishContext();
27584 return -1;
27585}
27586
27587static int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate) {
27588 __Pyx_RefNannyDeclarations
27589 int __pyx_lineno = 0;
27590 const char *__pyx_filename = NULL;
27591 int __pyx_clineno = 0;
27592 CYTHON_UNUSED_VAR(__pyx_mstate);
27593 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_MemviewEnum_obj", 0);
27594 /*--- Exttype __pyx_MemviewEnum_obj ---*/
27595 #if CYTHON_USE_TYPE_SPECS
27596 __pyx_mstate->__pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_MemviewEnum_type)) __PYX_ERR(1, 318, __pyx_L1_error)
27597 #else
27598 __pyx_mstate->__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
27599 #endif
27600 #if !CYTHON_COMPILING_IN_LIMITED_API
27601 #endif
27602 #if !CYTHON_USE_TYPE_SPECS
27603 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
27604 #endif
27605 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27606 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_MemviewEnum_type);
27607 #endif
27608 #if !CYTHON_COMPILING_IN_LIMITED_API
27609 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_MemviewEnum_type->tp_dictoffset && __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
27610 __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro = PyObject_GenericGetAttr;
27611 }
27612 #endif
27613 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
27614 __Pyx_RefNannyFinishContext();
27615 return 0;
27616 __pyx_L1_error:;
27617 __Pyx_RefNannyFinishContext();
27618 return -1;
27619}
27620
27621static int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate) {
27622 __Pyx_RefNannyDeclarations
27623 int __pyx_lineno = 0;
27624 const char *__pyx_filename = NULL;
27625 int __pyx_clineno = 0;
27626 CYTHON_UNUSED_VAR(__pyx_mstate);
27627 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_memoryview_obj", 0);
27628 /*--- Exttype __pyx_memoryview_obj ---*/
27629 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
27630 __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
27631 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
27632 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
27633 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
27634 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
27635 __pyx_vtable_memoryview.setitem_indexed1 = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed1;
27636 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
27637 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
27638 __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
27639 #if CYTHON_USE_TYPE_SPECS
27640 __pyx_mstate->__pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_memoryview_type)) __PYX_ERR(1, 353, __pyx_L1_error)
27641 #if !CYTHON_COMPILING_IN_LIMITED_API
27642 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
27643 if (!__pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
27644 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
27645 }
27646 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
27647 /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
27648 #elif defined(_MSC_VER)
27649 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
27650 #else
27651 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
27652 #endif
27653 #else
27654 __pyx_mstate->__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
27655 #endif
27656 #if !CYTHON_COMPILING_IN_LIMITED_API
27657 #endif
27658 #if !CYTHON_USE_TYPE_SPECS
27659 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
27660 #endif
27661 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27662 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryview_type);
27663 #endif
27664 #if !CYTHON_COMPILING_IN_LIMITED_API
27665 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryview_type->tp_dictoffset && __pyx_mstate->__pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
27666 __pyx_mstate->__pyx_memoryview_type->tp_getattro = PyObject_GenericGetAttr;
27667 }
27668 #endif
27669 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryview_type, __pyx_vtabptr_memoryview) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
27670 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
27671 __Pyx_RefNannyFinishContext();
27672 return 0;
27673 __pyx_L1_error:;
27674 __Pyx_RefNannyFinishContext();
27675 return -1;
27676}
27677
27678static int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate) {
27679 __Pyx_RefNannyDeclarations
27680 PyObject *__pyx_t_1 = NULL;
27681 int __pyx_lineno = 0;
27682 const char *__pyx_filename = NULL;
27683 int __pyx_clineno = 0;
27684 CYTHON_UNUSED_VAR(__pyx_mstate);
27685 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_memoryviewslice_obj", 0);
27686 /*--- Exttype __pyx_memoryviewslice_obj ---*/
27687 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
27688 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
27689 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
27690 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
27691 __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
27692 #if CYTHON_USE_TYPE_SPECS
27693 __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 947, __pyx_L1_error)
27694 __Pyx_GOTREF(__pyx_t_1);
27695 __pyx_mstate->__pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
27696 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27697 if (unlikely(!__pyx_mstate->__pyx_memoryviewslice_type)) __PYX_ERR(1, 947, __pyx_L1_error)
27698 #else
27699 __pyx_mstate->__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
27700 #endif
27701 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_memoryviewslice_type, 1) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
27702 #if !CYTHON_COMPILING_IN_LIMITED_API
27703 __pyx_mstate_global->__pyx_memoryviewslice_type->tp_base = __pyx_mstate_global->__pyx_memoryview_type;
27704 #endif
27705 #if !CYTHON_USE_TYPE_SPECS
27706 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
27707 #endif
27708 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27709 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryviewslice_type);
27710 #endif
27711 #if !CYTHON_COMPILING_IN_LIMITED_API
27712 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryviewslice_type->tp_dictoffset && __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
27713 __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro = PyObject_GenericGetAttr;
27714 }
27715 #endif
27716 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
27717 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
27718 __Pyx_RefNannyFinishContext();
27719 return 0;
27720 __pyx_L1_error:;
27721 __Pyx_XDECREF(__pyx_t_1);
27722 __Pyx_RefNannyFinishContext();
27723 return -1;
27724}
27725
27726static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
27727 __Pyx_RefNannyDeclarations
27728 PyObject *__pyx_t_1 = NULL;
27729 int __pyx_lineno = 0;
27730 const char *__pyx_filename = NULL;
27731 int __pyx_clineno = 0;
27732 CYTHON_UNUSED_VAR(__pyx_mstate);
27733 __Pyx_RefNannySetupContext("__Pyx_modinit_Type_import_code", 0);
27734 /*--- Type import code ---*/
27735 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
27736 __Pyx_GOTREF(__pyx_t_1);
27737 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
27738 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27739 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
27740 #elif CYTHON_COMPILING_IN_LIMITED_API
27741 0, 0,
27742 #else
27743 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
27744 #endif
27745 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
27746 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27747 __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error)
27748 __Pyx_GOTREF(__pyx_t_1);
27749 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "dtype",
27750 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27751 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
27752 #elif CYTHON_COMPILING_IN_LIMITED_API
27753 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
27754 #else
27755 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
27756 #endif
27757 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 229, __pyx_L1_error)
27758 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flatiter",
27759 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27760 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
27761 #elif CYTHON_COMPILING_IN_LIMITED_API
27762 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
27763 #else
27764 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
27765 #endif
27766 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 286, __pyx_L1_error)
27767 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "broadcast",
27768 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27769 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
27770 #elif CYTHON_COMPILING_IN_LIMITED_API
27771 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
27772 #else
27773 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
27774 #endif
27775 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 290, __pyx_L1_error)
27776 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ndarray",
27777 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27778 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
27779 #elif CYTHON_COMPILING_IN_LIMITED_API
27780 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
27781 #else
27782 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
27783 #endif
27784 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 329, __pyx_L1_error)
27785 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "generic",
27786 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27787 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27788 #elif CYTHON_COMPILING_IN_LIMITED_API
27789 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27790 #else
27791 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27792 #endif
27793 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
27794 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "number",
27795 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27796 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27797 #elif CYTHON_COMPILING_IN_LIMITED_API
27798 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27799 #else
27800 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27801 #endif
27802 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
27803 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "integer",
27804 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27805 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27806 #elif CYTHON_COMPILING_IN_LIMITED_API
27807 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27808 #else
27809 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27810 #endif
27811 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
27812 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "signedinteger",
27813 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27814 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27815 #elif CYTHON_COMPILING_IN_LIMITED_API
27816 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27817 #else
27818 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27819 #endif
27820 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
27821 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "unsignedinteger",
27822 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27823 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27824 #elif CYTHON_COMPILING_IN_LIMITED_API
27825 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27826 #else
27827 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27828 #endif
27829 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
27830 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "inexact",
27831 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27832 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27833 #elif CYTHON_COMPILING_IN_LIMITED_API
27834 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27835 #else
27836 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27837 #endif
27838 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
27839 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "floating",
27840 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27841 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27842 #elif CYTHON_COMPILING_IN_LIMITED_API
27843 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27844 #else
27845 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27846 #endif
27847 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
27848 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "complexfloating",
27849 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27850 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27851 #elif CYTHON_COMPILING_IN_LIMITED_API
27852 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27853 #else
27854 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27855 #endif
27856 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
27857 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flexible",
27858 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27859 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27860 #elif CYTHON_COMPILING_IN_LIMITED_API
27861 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27862 #else
27863 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27864 #endif
27865 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
27866 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "character",
27867 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27868 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27869 #elif CYTHON_COMPILING_IN_LIMITED_API
27870 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27871 #else
27872 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
27873 #endif
27874 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
27875 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ufunc",
27876 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27877 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
27878 #elif CYTHON_COMPILING_IN_LIMITED_API
27879 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
27880 #else
27881 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
27882 #endif
27883 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 946, __pyx_L1_error)
27884 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27885 __pyx_t_1 = PyImport_ImportModule("proteus.superluWrappers"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 68, __pyx_L1_error)
27886 __Pyx_GOTREF(__pyx_t_1);
27887 __pyx_mstate->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = __Pyx_ImportType_3_3_0(__pyx_t_1, "proteus.superluWrappers", "cSparseMatrix",
27888 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27889 sizeof(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix),
27890 #elif CYTHON_COMPILING_IN_LIMITED_API
27891 sizeof(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix),
27892 #else
27893 sizeof(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix),
27894 #endif
27895 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix) __PYX_ERR(4, 68, __pyx_L1_error)
27896 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27897 __Pyx_RefNannyFinishContext();
27898 return 0;
27899 __pyx_L1_error:;
27900 __Pyx_XDECREF(__pyx_t_1);
27901 __Pyx_RefNannyFinishContext();
27902 return -1;
27903}
27904
27905static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
27906 __Pyx_RefNannyDeclarations
27907 CYTHON_UNUSED_VAR(__pyx_mstate);
27908 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_import_code", 0);
27909 /*--- Variable import code ---*/
27910 __Pyx_RefNannyFinishContext();
27911 return 0;
27912}
27913
27914static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
27915 __Pyx_RefNannyDeclarations
27916 CYTHON_UNUSED_VAR(__pyx_mstate);
27917 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_import_code", 0);
27918 /*--- Function import code ---*/
27919 __Pyx_RefNannyFinishContext();
27920 return 0;
27921}
27922
27923#if CYTHON_PEP489_MULTI_PHASE_INIT
27924static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
27925static int __pyx_pymod_exec_csmoothers(PyObject* module); /*proto*/
27926static PyModuleDef_Slot __pyx_moduledef_slots[] = {
27927 {Py_mod_create, (void*)__pyx_pymod_create},
27928 {Py_mod_exec, (void*)__pyx_pymod_exec_csmoothers},
27929 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
27930 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
27931 #endif
27932 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
27933 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
27934 #endif
27935 {0, NULL}
27936};
27937#endif
27938
27939#ifdef __cplusplus
27940namespace {
27941 struct PyModuleDef __pyx_moduledef =
27942 #else
27943 static struct PyModuleDef __pyx_moduledef =
27944 #endif
27945 {
27946 PyModuleDef_HEAD_INIT,
27947 "csmoothers",
27948 0, /* m_doc */
27949 #if CYTHON_USE_MODULE_STATE
27950 sizeof(__pyx_mstatetype), /* m_size */
27951 #else
27952 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
27953 #endif
27954 __pyx_methods /* m_methods */,
27955 #if CYTHON_PEP489_MULTI_PHASE_INIT
27956 __pyx_moduledef_slots, /* m_slots */
27957 #else
27958 NULL, /* m_reload */
27959 #endif
27960 #if CYTHON_USE_MODULE_STATE
27961 __pyx_m_traverse, /* m_traverse */
27962 __pyx_m_clear, /* m_clear */
27963 NULL /* m_free */
27964 #else
27965 NULL, /* m_traverse */
27966 NULL, /* m_clear */
27967 NULL /* m_free */
27968 #endif
27969 };
27970 #ifdef __cplusplus
27971} /* anonymous namespace */
27972#endif
27973
27974/* PyModInitFuncType */
27975#ifndef CYTHON_NO_PYINIT_EXPORT
27976 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27977#else
27978 #ifdef __cplusplus
27979 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
27980 #else
27981 #define __Pyx_PyMODINIT_FUNC PyObject *
27982 #endif
27983#endif
27984
27985__Pyx_PyMODINIT_FUNC PyInit_csmoothers(void) CYTHON_SMALL_CODE; /*proto*/
27986__Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)
27987#if CYTHON_PEP489_MULTI_PHASE_INIT
27988{
27989 return PyModuleDef_Init(&__pyx_moduledef);
27990}
27991/* ModuleCreationPEP489 */
27992#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
27993 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
27994static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
27995 {
27996 PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
27997 if (!module) {
27998 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
27999 goto bad; // BaseException
28000 }
28001 PyErr_Clear(); // just try the 3.8-3.12 version
28002 module = PyImport_ImportModule("_xxsubinterpreters");
28003 if (!module) goto bad;
28004 }
28005 PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
28006 Py_DECREF(module);
28007 if (!current) goto bad;
28008 if (PyTuple_Check(current)) {
28009 PyObject *new_current = PySequence_GetItem(current, 0);
28010 Py_DECREF(current);
28011 current = new_current;
28012 if (!new_current) goto bad;
28013 }
28014 long long as_c_int = PyLong_AsLongLong(current);
28015 Py_DECREF(current);
28016 return as_c_int;
28017 }
28018 bad:
28019 PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
28020 return -1;
28021}
28022#endif
28023#if !CYTHON_USE_MODULE_STATE
28024static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
28025 static PY_INT64_T main_interpreter_id = -1;
28026#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
28027 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
28028#elif CYTHON_COMPILING_IN_GRAAL
28029 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
28030#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
28031 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
28032 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
28033#elif CYTHON_COMPILING_IN_LIMITED_API
28034 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
28035#else
28036 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
28037#endif
28038 if (unlikely(current_id == -1)) {
28039 return -1;
28040 }
28041 if (main_interpreter_id == -1) {
28042 main_interpreter_id = current_id;
28043 return 0;
28044 } else if (unlikely(main_interpreter_id != current_id)) {
28045 PyErr_SetString(
28046 PyExc_ImportError,
28047 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
28048 return -1;
28049 }
28050 return 0;
28051}
28052#endif
28053static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
28054{
28055 PyObject *value = PyObject_GetAttrString(spec, from_name);
28056 int result = 0;
28057 if (likely(value)) {
28058 if (allow_none || value != Py_None) {
28059 result = PyDict_SetItemString(moddict, to_name, value);
28060 }
28061 Py_DECREF(value);
28062 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
28063 PyErr_Clear();
28064 } else {
28065 result = -1;
28066 }
28067 return result;
28068}
28069static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
28070 PyObject *module = NULL, *moddict, *modname;
28071 CYTHON_UNUSED_VAR(def);
28072 #if !CYTHON_USE_MODULE_STATE
28073 if (__Pyx_check_single_interpreter())
28074 return NULL;
28075 #endif
28076 if (__pyx_m)
28077 return __Pyx_NewRef(__pyx_m);
28078 modname = PyObject_GetAttrString(spec, "name");
28079 if (unlikely(!modname)) goto bad;
28080 module = PyModule_NewObject(modname);
28081 Py_DECREF(modname);
28082 if (unlikely(!module)) goto bad;
28083 moddict = PyModule_GetDict(module);
28084 if (unlikely(!moddict)) goto bad;
28085 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
28086 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
28087 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
28088 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
28089 return module;
28090bad:
28091 Py_XDECREF(module);
28092 return NULL;
28093}
28094
28095
28096static CYTHON_SMALL_CODE int __pyx_pymod_exec_csmoothers(PyObject *__pyx_pyinit_module)
28097#endif
28098{
28099 int stringtab_initialized = 0;
28100 #if CYTHON_USE_MODULE_STATE
28101 int pystate_addmodule_run = 0;
28102 #endif
28103 __pyx_mstatetype *__pyx_mstate = NULL;
28104 PyObject *__pyx_t_1 = NULL;
28105 PyObject *__pyx_t_2 = NULL;
28106 PyObject *__pyx_t_3 = NULL;
28107 PyObject *__pyx_t_4 = NULL;
28108 PyObject *__pyx_t_5 = NULL;
28109 size_t __pyx_t_6;
28110 static PyThread_type_lock __pyx_t_7[8];
28111 int __pyx_t_8;
28112 PyObject *__pyx_t_9 = NULL;
28113 PyObject *__pyx_t_10 = NULL;
28114 int __pyx_lineno = 0;
28115 const char *__pyx_filename = NULL;
28116 int __pyx_clineno = 0;
28117 __Pyx_RefNannyDeclarations
28118 #if CYTHON_PEP489_MULTI_PHASE_INIT
28119 if (__pyx_m) {
28120 if (__pyx_m == __pyx_pyinit_module) return 0;
28121 PyErr_SetString(PyExc_RuntimeError, "Module 'csmoothers' has already been imported. Re-initialisation is not supported.");
28122 return -1;
28123 }
28124 #else
28125 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
28126 #endif
28127 /*--- Module creation code ---*/
28128 #if CYTHON_PEP489_MULTI_PHASE_INIT
28129 __pyx_t_1 = __pyx_pyinit_module;
28130 Py_INCREF(__pyx_t_1);
28131 #else
28132 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
28133 #endif
28134 #if CYTHON_USE_MODULE_STATE
28135 {
28136 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
28137 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "csmoothers" pseudovariable */
28138 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28139 pystate_addmodule_run = 1;
28140 }
28141 #else
28142 __pyx_m = __pyx_t_1;
28143 #endif
28144 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28145 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
28146 #endif
28147 __pyx_mstate = __pyx_mstate_global;
28148 CYTHON_UNUSED_VAR(__pyx_t_1);
28149 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
28150 Py_INCREF(__pyx_mstate->__pyx_d);
28151 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
28152 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
28153 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28154 /* ImportRefnannyAPI */
28155 #if CYTHON_REFNANNY
28156 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
28157 if (!__Pyx_RefNanny) {
28158 if (PyErr_ExceptionMatches(PyExc_Exception)) {
28159 PyErr_Clear();
28160 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
28161 }
28162 if (!__Pyx_RefNanny)
28163 Py_FatalError("failed to import 'refnanny' module");
28164 }
28165 #endif
28166
28167__Pyx_RefNannySetupContext("PyInit_csmoothers", 0);
28168 __Pyx_init_runtime_version();
28169 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28170 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
28171 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
28172 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
28173 /*--- Library function declarations ---*/
28174 /*--- Initialize various global constants etc. ---*/
28175 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28176 stringtab_initialized = 1;
28177 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28178 if (__pyx_module_is_main_csmoothers) {
28179 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28180 }
28181 {
28182 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
28183 if (!PyDict_GetItemString(modules, "csmoothers")) {
28184 if (unlikely((PyDict_SetItemString(modules, "csmoothers", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28185 }
28186 }
28187 /*--- Builtin init code ---*/
28188 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28189 /*--- Constants init code ---*/
28190 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28191 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28192 /*--- Global type/function init code ---*/
28193 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
28194 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
28195 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
28196 /*--- Type init code ---*/
28197 if (unlikely((__Pyx_modinit_Exttype___pyx_obj_10csmoothers_cASMFactor(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28198 if (unlikely((__Pyx_modinit_Exttype___pyx_obj_10csmoothers_cBASMFactor(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28199 if (unlikely((__Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28200 if (unlikely((__Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28201 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28202 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28203 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28204 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
28205 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
28206 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28207 /*--- Execution code ---*/
28208
28209 /* "View.MemoryView":118
28210 *
28211 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
28212 * try: # <<<<<<<<<<<<<<
28213 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
28214 * except:
28215*/
28216 {
28217 __Pyx_PyThreadState_declare
28218 __Pyx_PyThreadState_assign
28219 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
28220 __Pyx_XGOTREF(__pyx_t_1);
28221 __Pyx_XGOTREF(__pyx_t_2);
28222 __Pyx_XGOTREF(__pyx_t_3);
28223 /*try:*/ {
28224
28225 /* "View.MemoryView":119
28226 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
28227 * try:
28228 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
28229 * except:
28230 *
28231*/
28232 __pyx_t_5 = NULL;
28233 __pyx_t_6 = 1;
28234 {
28235 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_collections_abc};
28236 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin___import__, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
28237 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28238 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
28239 __Pyx_GOTREF(__pyx_t_4);
28240 }
28241 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 119, __pyx_L2_error)
28242 __Pyx_GOTREF(__pyx_t_5);
28243 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28244 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
28245 __Pyx_GOTREF(__pyx_t_4);
28246 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28247 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
28248 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
28249 __Pyx_GIVEREF(__pyx_t_4);
28250 __pyx_t_4 = 0;
28251
28252 /* "View.MemoryView":118
28253 *
28254 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
28255 * try: # <<<<<<<<<<<<<<
28256 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
28257 * except:
28258*/
28259 }
28260 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28261 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28262 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28263 goto __pyx_L7_try_end;
28264 __pyx_L2_error:;
28265 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28266 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28267
28268 /* "View.MemoryView":120
28269 * try:
28270 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
28271 * except: # <<<<<<<<<<<<<<
28272 *
28273 * __pyx_collections_abc_Sequence = None
28274*/
28275 /*except:*/ {
28276 __Pyx_ErrRestore(0,0,0);
28277
28278 /* "View.MemoryView":122
28279 * except:
28280 *
28281 * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<<
28282 *
28283 *
28284*/
28285 __Pyx_INCREF(Py_None);
28286 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
28287 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
28288 __Pyx_GIVEREF(Py_None);
28289 goto __pyx_L3_exception_handled;
28290 }
28291 __pyx_L3_exception_handled:;
28292 __Pyx_XGIVEREF(__pyx_t_1);
28293 __Pyx_XGIVEREF(__pyx_t_2);
28294 __Pyx_XGIVEREF(__pyx_t_3);
28295 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
28296 __pyx_L7_try_end:;
28297 }
28298
28299 /* "View.MemoryView":258
28300 *
28301 *
28302 * try: # <<<<<<<<<<<<<<
28303 * count = __pyx_collections_abc_Sequence.count
28304 * index = __pyx_collections_abc_Sequence.index
28305*/
28306 {
28307 __Pyx_PyThreadState_declare
28308 __Pyx_PyThreadState_assign
28309 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
28310 __Pyx_XGOTREF(__pyx_t_3);
28311 __Pyx_XGOTREF(__pyx_t_2);
28312 __Pyx_XGOTREF(__pyx_t_1);
28313 /*try:*/ {
28314
28315 /* "View.MemoryView":259
28316 *
28317 * try:
28318 * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
28319 * index = __pyx_collections_abc_Sequence.index
28320 * except:
28321*/
28322 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 259, __pyx_L10_error)
28323 __Pyx_GOTREF(__pyx_t_4);
28324 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(1, 259, __pyx_L10_error)
28325 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28326
28327 /* "View.MemoryView":260
28328 * try:
28329 * count = __pyx_collections_abc_Sequence.count
28330 * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
28331 * except:
28332 * pass
28333*/
28334 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 260, __pyx_L10_error)
28335 __Pyx_GOTREF(__pyx_t_4);
28336 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(1, 260, __pyx_L10_error)
28337 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28338
28339 /* "View.MemoryView":258
28340 *
28341 *
28342 * try: # <<<<<<<<<<<<<<
28343 * count = __pyx_collections_abc_Sequence.count
28344 * index = __pyx_collections_abc_Sequence.index
28345*/
28346 }
28347 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28348 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28349 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28350 goto __pyx_L15_try_end;
28351 __pyx_L10_error:;
28352 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28353 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28354
28355 /* "View.MemoryView":261
28356 * count = __pyx_collections_abc_Sequence.count
28357 * index = __pyx_collections_abc_Sequence.index
28358 * except: # <<<<<<<<<<<<<<
28359 * pass
28360 *
28361*/
28362 /*except:*/ {
28363 __Pyx_ErrRestore(0,0,0);
28364 goto __pyx_L11_exception_handled;
28365 }
28366 __pyx_L11_exception_handled:;
28367 __Pyx_XGIVEREF(__pyx_t_3);
28368 __Pyx_XGIVEREF(__pyx_t_2);
28369 __Pyx_XGIVEREF(__pyx_t_1);
28370 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
28371 __pyx_L15_try_end:;
28372 }
28373
28374 /* "View.MemoryView":326
28375 * return self.name
28376 *
28377 * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
28378 * cdef strided = Enum("<strided and direct>") # default
28379 * cdef indirect = Enum("<strided and indirect>")
28380*/
28381 __pyx_t_5 = NULL;
28382 __pyx_t_6 = 1;
28383 {
28384 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct_or_indirect};
28385 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
28386 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28387 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 326, __pyx_L1_error)
28388 __Pyx_GOTREF((PyObject *)__pyx_t_4);
28389 }
28390 __Pyx_XGOTREF(generic);
28391 __Pyx_DECREF_SET(generic, ((PyObject *)__pyx_t_4));
28392 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
28393 __pyx_t_4 = 0;
28394
28395 /* "View.MemoryView":327
28396 *
28397 * cdef generic = Enum("<strided and direct or indirect>")
28398 * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
28399 * cdef indirect = Enum("<strided and indirect>")
28400 *
28401*/
28402 __pyx_t_5 = NULL;
28403 __pyx_t_6 = 1;
28404 {
28405 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct};
28406 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
28407 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28408 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 327, __pyx_L1_error)
28409 __Pyx_GOTREF((PyObject *)__pyx_t_4);
28410 }
28411 __Pyx_XGOTREF(strided);
28412 __Pyx_DECREF_SET(strided, ((PyObject *)__pyx_t_4));
28413 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
28414 __pyx_t_4 = 0;
28415
28416 /* "View.MemoryView":328
28417 * cdef generic = Enum("<strided and direct or indirect>")
28418 * cdef strided = Enum("<strided and direct>") # default
28419 * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
28420 *
28421 *
28422*/
28423 __pyx_t_5 = NULL;
28424 __pyx_t_6 = 1;
28425 {
28426 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_indirect};
28427 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
28428 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28429 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 328, __pyx_L1_error)
28430 __Pyx_GOTREF((PyObject *)__pyx_t_4);
28431 }
28432 __Pyx_XGOTREF(indirect);
28433 __Pyx_DECREF_SET(indirect, ((PyObject *)__pyx_t_4));
28434 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
28435 __pyx_t_4 = 0;
28436
28437 /* "View.MemoryView":331
28438 *
28439 *
28440 * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
28441 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
28442 *
28443*/
28444 __pyx_t_5 = NULL;
28445 __pyx_t_6 = 1;
28446 {
28447 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_direct};
28448 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
28449 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28450 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 331, __pyx_L1_error)
28451 __Pyx_GOTREF((PyObject *)__pyx_t_4);
28452 }
28453 __Pyx_XGOTREF(contiguous);
28454 __Pyx_DECREF_SET(contiguous, ((PyObject *)__pyx_t_4));
28455 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
28456 __pyx_t_4 = 0;
28457
28458 /* "View.MemoryView":332
28459 *
28460 * cdef contiguous = Enum("<contiguous and direct>")
28461 * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
28462 *
28463 *
28464*/
28465 __pyx_t_5 = NULL;
28466 __pyx_t_6 = 1;
28467 {
28468 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_indirect};
28469 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
28470 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28471 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 332, __pyx_L1_error)
28472 __Pyx_GOTREF((PyObject *)__pyx_t_4);
28473 }
28474 __Pyx_XGOTREF(indirect_contiguous);
28475 __Pyx_DECREF_SET(indirect_contiguous, ((PyObject *)__pyx_t_4));
28476 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
28477 __pyx_t_4 = 0;
28478
28479 /* "View.MemoryView":340
28480 *
28481 *
28482 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
28483 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
28484 * PyThread_allocate_lock(),
28485*/
28486 __pyx_memoryview_thread_locks_used = 0;
28487
28488 /* "View.MemoryView":341
28489 *
28490 * cdef int __pyx_memoryview_thread_locks_used = 0
28491 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
28492 * PyThread_allocate_lock(),
28493 * PyThread_allocate_lock(),
28494*/
28495 __pyx_t_7[0] = PyThread_allocate_lock();
28496 __pyx_t_7[1] = PyThread_allocate_lock();
28497 __pyx_t_7[2] = PyThread_allocate_lock();
28498 __pyx_t_7[3] = PyThread_allocate_lock();
28499 __pyx_t_7[4] = PyThread_allocate_lock();
28500 __pyx_t_7[5] = PyThread_allocate_lock();
28501 __pyx_t_7[6] = PyThread_allocate_lock();
28502 __pyx_t_7[7] = PyThread_allocate_lock();
28503 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_7, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
28504
28505 /* "View.MemoryView":979
28506 *
28507 *
28508 * try: # <<<<<<<<<<<<<<
28509 * count = __pyx_collections_abc_Sequence.count
28510 * index = __pyx_collections_abc_Sequence.index
28511*/
28512 {
28513 __Pyx_PyThreadState_declare
28514 __Pyx_PyThreadState_assign
28515 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
28516 __Pyx_XGOTREF(__pyx_t_1);
28517 __Pyx_XGOTREF(__pyx_t_2);
28518 __Pyx_XGOTREF(__pyx_t_3);
28519 /*try:*/ {
28520
28521 /* "View.MemoryView":980
28522 *
28523 * try:
28524 * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
28525 * index = __pyx_collections_abc_Sequence.index
28526 * except:
28527*/
28528 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 980, __pyx_L18_error)
28529 __Pyx_GOTREF(__pyx_t_4);
28530 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(1, 980, __pyx_L18_error)
28531 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28532
28533 /* "View.MemoryView":981
28534 * try:
28535 * count = __pyx_collections_abc_Sequence.count
28536 * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
28537 * except:
28538 * pass
28539*/
28540 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 981, __pyx_L18_error)
28541 __Pyx_GOTREF(__pyx_t_4);
28542 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(1, 981, __pyx_L18_error)
28543 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28544
28545 /* "View.MemoryView":979
28546 *
28547 *
28548 * try: # <<<<<<<<<<<<<<
28549 * count = __pyx_collections_abc_Sequence.count
28550 * index = __pyx_collections_abc_Sequence.index
28551*/
28552 }
28553 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28554 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28555 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28556 goto __pyx_L23_try_end;
28557 __pyx_L18_error:;
28558 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28559 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28560
28561 /* "View.MemoryView":982
28562 * count = __pyx_collections_abc_Sequence.count
28563 * index = __pyx_collections_abc_Sequence.index
28564 * except: # <<<<<<<<<<<<<<
28565 * pass
28566 *
28567*/
28568 /*except:*/ {
28569 __Pyx_ErrRestore(0,0,0);
28570 goto __pyx_L19_exception_handled;
28571 }
28572 __pyx_L19_exception_handled:;
28573 __Pyx_XGIVEREF(__pyx_t_1);
28574 __Pyx_XGIVEREF(__pyx_t_2);
28575 __Pyx_XGIVEREF(__pyx_t_3);
28576 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
28577 __pyx_L23_try_end:;
28578 }
28579
28580 /* "View.MemoryView":985
28581 * pass
28582 *
28583 * try: # <<<<<<<<<<<<<<
28584 * if __pyx_collections_abc_Sequence:
28585 *
28586*/
28587 {
28588 __Pyx_PyThreadState_declare
28589 __Pyx_PyThreadState_assign
28590 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
28591 __Pyx_XGOTREF(__pyx_t_3);
28592 __Pyx_XGOTREF(__pyx_t_2);
28593 __Pyx_XGOTREF(__pyx_t_1);
28594 /*try:*/ {
28595
28596 /* "View.MemoryView":986
28597 *
28598 * try:
28599 * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
28600 *
28601 *
28602*/
28603 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 986, __pyx_L26_error)
28604 if (__pyx_t_8) {
28605
28606
28607 /* "View.MemoryView":990
28608 *
28609 *
28610 * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<<
28611 * __pyx_collections_abc_Sequence.register(array)
28612 * except:
28613*/
28614 __pyx_t_5 = __pyx_collections_abc_Sequence;
28615 __Pyx_INCREF(__pyx_t_5);
28616 __pyx_t_6 = 0;
28617 {
28618 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_memoryviewslice_type)};
28619 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
28620 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28621 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 990, __pyx_L26_error)
28622 __Pyx_GOTREF(__pyx_t_4);
28623 }
28624 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28625
28626 /* "View.MemoryView":991
28627 *
28628 * __pyx_collections_abc_Sequence.register(_memoryviewslice)
28629 * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<<
28630 * except:
28631 * pass # ignore failure, it's a minor issue
28632*/
28633 __pyx_t_5 = __pyx_collections_abc_Sequence;
28634 __Pyx_INCREF(__pyx_t_5);
28635 __pyx_t_6 = 0;
28636 {
28637 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_array_type)};
28638 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
28639 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28640 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 991, __pyx_L26_error)
28641 __Pyx_GOTREF(__pyx_t_4);
28642 }
28643 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28644
28645 /* "View.MemoryView":986
28646 *
28647 * try:
28648 * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
28649 *
28650 *
28651*/
28652 }
28653
28654 /* "View.MemoryView":985
28655 * pass
28656 *
28657 * try: # <<<<<<<<<<<<<<
28658 * if __pyx_collections_abc_Sequence:
28659 *
28660*/
28661 }
28662 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28663 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28664 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28665 goto __pyx_L31_try_end;
28666 __pyx_L26_error:;
28667 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28668 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28669
28670 /* "View.MemoryView":992
28671 * __pyx_collections_abc_Sequence.register(_memoryviewslice)
28672 * __pyx_collections_abc_Sequence.register(array)
28673 * except: # <<<<<<<<<<<<<<
28674 * pass # ignore failure, it's a minor issue
28675 *
28676*/
28677 /*except:*/ {
28678 __Pyx_ErrRestore(0,0,0);
28679 goto __pyx_L27_exception_handled;
28680 }
28681 __pyx_L27_exception_handled:;
28682 __Pyx_XGIVEREF(__pyx_t_3);
28683 __Pyx_XGIVEREF(__pyx_t_2);
28684 __Pyx_XGIVEREF(__pyx_t_1);
28685 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
28686 __pyx_L31_try_end:;
28687 }
28688
28689 /* "(tree fragment)":4
28690 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
28691 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
28692 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
28693 * cdef object __pyx_result
28694 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
28695*/
28696 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_mstate_global->__pyx_n_u_View_MemoryView); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
28697 __Pyx_GOTREF(__pyx_t_4);
28698 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum, __pyx_t_4) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
28699 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28700
28701 /* "csmoothers.pyx":2
28702 * # cython language_level=3
28703 * import numpy as np # <<<<<<<<<<<<<<
28704 * import cython
28705 * cimport numpy as np
28706*/
28707 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
28708 __pyx_t_4 = __pyx_t_1;
28709 __Pyx_GOTREF(__pyx_t_4);
28710 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_4) < (0)) __PYX_ERR(0, 2, __pyx_L1_error)
28711 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28712
28713 /* "csmoothers.pyx":6
28714 * cimport numpy as np
28715 *
28716 * class ASMFactor(object): # <<<<<<<<<<<<<<
28717 *
28718 * def __init__(self, L):
28719*/
28720 __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
28721 __Pyx_GOTREF(__pyx_t_4);
28722 __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6, __pyx_L1_error)
28723 __Pyx_GOTREF(__pyx_t_5);
28724 __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_ASMFactor, __pyx_mstate_global->__pyx_n_u_ASMFactor, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, (PyObject *) NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 6, __pyx_L1_error)
28725 __Pyx_GOTREF(__pyx_t_9);
28726 if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[3]) {
28727 if (unlikely((PyDict_SetItemString(__pyx_t_9, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[3]) < 0))) __PYX_ERR(0, 6, __pyx_L1_error)
28728 }
28729
28730 /* "csmoothers.pyx":8
28731 * class ASMFactor(object):
28732 *
28733 * def __init__(self, L): # <<<<<<<<<<<<<<
28734 * self.L = L
28735 * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
28736*/
28737 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_9ASMFactor_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ASMFactor___init, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 8, __pyx_L1_error)
28738 __Pyx_GOTREF(__pyx_t_10);
28739 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28740 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
28741 #endif
28742 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_10) < (0)) __PYX_ERR(0, 8, __pyx_L1_error)
28743 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
28744
28745 /* "csmoothers.pyx":6
28746 * cimport numpy as np
28747 *
28748 * class ASMFactor(object): # <<<<<<<<<<<<<<
28749 *
28750 * def __init__(self, L):
28751*/
28752 __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASMFactor, __pyx_t_4, __pyx_t_9, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 6, __pyx_L1_error)
28753 __Pyx_GOTREF(__pyx_t_10);
28754 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28755 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
28756 #endif
28757 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ASMFactor, __pyx_t_10) < (0)) __PYX_ERR(0, 6, __pyx_L1_error)
28758 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
28759 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28760 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28761 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28762
28763 /* "(tree fragment)":1
28764 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
28765 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
28766 * def __setstate_cython__(self, __pyx_state):
28767*/
28768 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_10cASMFactor_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cASMFactor___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
28769 __Pyx_GOTREF(__pyx_t_4);
28770 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28771 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28772 #endif
28773 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
28774 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28775
28776 /* "(tree fragment)":3
28777 * def __reduce_cython__(self):
28778 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
28779 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
28780 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
28781*/
28782 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_10cASMFactor_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cASMFactor___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
28783 __Pyx_GOTREF(__pyx_t_4);
28784 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28785 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28786 #endif
28787 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
28788 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28789
28790 /* "csmoothers.pyx":43
28791 *
28792 *
28793 * class BASMFactor(object): # <<<<<<<<<<<<<<
28794 *
28795 * def __init__(self, L, bs):
28796*/
28797 __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[5]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error)
28798 __Pyx_GOTREF(__pyx_t_4);
28799 __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error)
28800 __Pyx_GOTREF(__pyx_t_5);
28801 __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_BASMFactor, __pyx_mstate_global->__pyx_n_u_BASMFactor, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, (PyObject *) NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error)
28802 __Pyx_GOTREF(__pyx_t_9);
28803 if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[5]) {
28804 if (unlikely((PyDict_SetItemString(__pyx_t_9, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[5]) < 0))) __PYX_ERR(0, 43, __pyx_L1_error)
28805 }
28806
28807 /* "csmoothers.pyx":45
28808 * class BASMFactor(object):
28809 *
28810 * def __init__(self, L, bs): # <<<<<<<<<<<<<<
28811 * self.L = L
28812 * self.bs = bs
28813*/
28814 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_10BASMFactor_1__init__, 0, __pyx_mstate_global->__pyx_n_u_BASMFactor___init, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
28815 __Pyx_GOTREF(__pyx_t_10);
28816 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28817 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
28818 #endif
28819 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_10) < (0)) __PYX_ERR(0, 45, __pyx_L1_error)
28820 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
28821
28822 /* "csmoothers.pyx":43
28823 *
28824 *
28825 * class BASMFactor(object): # <<<<<<<<<<<<<<
28826 *
28827 * def __init__(self, L, bs):
28828*/
28829 __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BASMFactor, __pyx_t_4, __pyx_t_9, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 43, __pyx_L1_error)
28830 __Pyx_GOTREF(__pyx_t_10);
28831 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28832 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
28833 #endif
28834 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_BASMFactor, __pyx_t_10) < (0)) __PYX_ERR(0, 43, __pyx_L1_error)
28835 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
28836 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28837 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28838 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28839
28840 /* "(tree fragment)":1
28841 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
28842 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
28843 * def __setstate_cython__(self, __pyx_state):
28844*/
28845 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_11cBASMFactor_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cBASMFactor___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
28846 __Pyx_GOTREF(__pyx_t_4);
28847 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28848 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28849 #endif
28850 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
28851 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28852
28853 /* "(tree fragment)":3
28854 * def __reduce_cython__(self):
28855 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
28856 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
28857 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
28858*/
28859 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_11cBASMFactor_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cBASMFactor___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
28860 __Pyx_GOTREF(__pyx_t_4);
28861 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28862 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28863 #endif
28864 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
28865 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28866
28867 /* "csmoothers.pyx":85
28868 * self.subdomain_col_pivots)
28869 *
28870 * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
28871 * """
28872 *
28873*/
28874 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_1jacobi_NR_prepare, 0, __pyx_mstate_global->__pyx_n_u_jacobi_NR_prepare, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
28875 __Pyx_GOTREF(__pyx_t_4);
28876 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28877 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28878 #endif
28879 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_jacobi_NR_prepare, __pyx_t_4) < (0)) __PYX_ERR(0, 85, __pyx_L1_error)
28880 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28881
28882 /* "csmoothers.pyx":110
28883 * cjacobi_NR_prepare(&AS, w, tol, &M[0])
28884 *
28885 * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
28886 * """
28887 *
28888*/
28889 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_3jacobi_NR_solve, 0, __pyx_mstate_global->__pyx_n_u_jacobi_NR_solve, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error)
28890 __Pyx_GOTREF(__pyx_t_4);
28891 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28892 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28893 #endif
28894 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_jacobi_NR_solve, __pyx_t_4) < (0)) __PYX_ERR(0, 110, __pyx_L1_error)
28895 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28896
28897 /* "csmoothers.pyx":137
28898 * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
28899 *
28900 * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
28901 * """
28902 *
28903*/
28904 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_5nl_jacobi_NR_solve, 0, __pyx_mstate_global->__pyx_n_u_nl_jacobi_NR_solve, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error)
28905 __Pyx_GOTREF(__pyx_t_4);
28906 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28907 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28908 #endif
28909 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_nl_jacobi_NR_solve, __pyx_t_4) < (0)) __PYX_ERR(0, 137, __pyx_L1_error)
28910 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28911
28912 /* "csmoothers.pyx":166
28913 * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
28914 *
28915 * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
28916 * """
28917 *
28918*/
28919 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_7gauss_seidel_NR_preare, 0, __pyx_mstate_global->__pyx_n_u_gauss_seidel_NR_preare, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
28920 __Pyx_GOTREF(__pyx_t_4);
28921 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28922 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28923 #endif
28924 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_gauss_seidel_NR_preare, __pyx_t_4) < (0)) __PYX_ERR(0, 166, __pyx_L1_error)
28925 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28926
28927 /* "csmoothers.pyx":191
28928 * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
28929 *
28930 * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
28931 * """
28932 *
28933*/
28934 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_9gauss_seidel_NR_solve, 0, __pyx_mstate_global->__pyx_n_u_gauss_seidel_NR_solve, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
28935 __Pyx_GOTREF(__pyx_t_4);
28936 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28937 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28938 #endif
28939 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_gauss_seidel_NR_solve, __pyx_t_4) < (0)) __PYX_ERR(0, 191, __pyx_L1_error)
28940 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28941
28942 /* "csmoothers.pyx":218
28943 * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
28944 *
28945 * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
28946 * """
28947 *
28948*/
28949 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve, 0, __pyx_mstate_global->__pyx_n_u_nl_gauss_seidel_NR_solve, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error)
28950 __Pyx_GOTREF(__pyx_t_4);
28951 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28952 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28953 #endif
28954 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_nl_gauss_seidel_NR_solve, __pyx_t_4) < (0)) __PYX_ERR(0, 218, __pyx_L1_error)
28955 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28956
28957 /* "csmoothers.pyx":252
28958 * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
28959 *
28960 * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
28961 * """
28962 *
28963*/
28964 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_13asm_NR_prepare, 0, __pyx_mstate_global->__pyx_n_u_asm_NR_prepare, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
28965 __Pyx_GOTREF(__pyx_t_4);
28966 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28967 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28968 #endif
28969 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_asm_NR_prepare, __pyx_t_4) < (0)) __PYX_ERR(0, 252, __pyx_L1_error)
28970 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28971
28972 /* "csmoothers.pyx":278
28973 * asmFactor.subdomain_pivots)
28974 *
28975 * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
28976 * """
28977 *
28978*/
28979 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_15asm_NR_solve, 0, __pyx_mstate_global->__pyx_n_u_asm_NR_solve, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
28980 __Pyx_GOTREF(__pyx_t_4);
28981 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28982 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28983 #endif
28984 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_asm_NR_solve, __pyx_t_4) < (0)) __PYX_ERR(0, 278, __pyx_L1_error)
28985 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28986
28987 /* "csmoothers.pyx":322
28988 * asmFactor.subdomain_pivots)
28989 *
28990 * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
28991 * """
28992 *
28993*/
28994 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_17basm_NR_prepare, 0, __pyx_mstate_global->__pyx_n_u_basm_NR_prepare, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
28995 __Pyx_GOTREF(__pyx_t_4);
28996 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28997 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
28998 #endif
28999 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_basm_NR_prepare, __pyx_t_4) < (0)) __PYX_ERR(0, 322, __pyx_L1_error)
29000 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29001
29002 /* "csmoothers.pyx":351
29003 *
29004 *
29005 * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
29006 * """
29007 *
29008*/
29009 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_19basm_NR_solve, 0, __pyx_mstate_global->__pyx_n_u_basm_NR_solve, NULL, __pyx_mstate_global->__pyx_n_u_csmoothers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
29010 __Pyx_GOTREF(__pyx_t_4);
29011 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
29012 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
29013 #endif
29014 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_basm_NR_solve, __pyx_t_4) < (0)) __PYX_ERR(0, 351, __pyx_L1_error)
29015 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29016
29017 /* "csmoothers.pyx":1
29018 * # cython language_level=3 # <<<<<<<<<<<<<<
29019 * import numpy as np
29020 * import cython
29021*/
29022 __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
29023 __Pyx_GOTREF(__pyx_t_4);
29024 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
29025 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29026
29027 /*--- Wrapped vars code ---*/
29028
29029 goto __pyx_L0;
29030 __pyx_L1_error:;
29031 __Pyx_XDECREF(__pyx_t_4);
29032 __Pyx_XDECREF(__pyx_t_5);
29033 __Pyx_XDECREF(__pyx_t_9);
29034 __Pyx_XDECREF(__pyx_t_10);
29035 if (__pyx_m) {
29036 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
29037 __Pyx_AddTraceback("init csmoothers", __pyx_clineno, __pyx_lineno, __pyx_filename);
29038 }
29039 #if !CYTHON_USE_MODULE_STATE
29040 Py_CLEAR(__pyx_m);
29041 #else
29042 Py_DECREF(__pyx_m);
29043 if (pystate_addmodule_run) {
29044 PyObject *tp, *value, *tb;
29045 __Pyx_PyErr_FetchException(&tp, &value, &tb);
29046 __Pyx_State_RemoveModule(&__pyx_moduledef);
29047 __Pyx_PyErr_RestoreException(tp, value, tb);
29048 }
29049 #endif
29050 } else if (!PyErr_Occurred()) {
29051 PyErr_SetString(PyExc_ImportError, "init csmoothers");
29052 }
29053 __pyx_L0:;
29054 __Pyx_RefNannyFinishContext();
29055 #if CYTHON_PEP489_MULTI_PHASE_INIT
29056 return (__pyx_m != NULL) ? 0 : -1;
29057 #else
29058 return __pyx_m;
29059 #endif
29060}
29061/* #### Code section: pystring_table ### */
29062/* #### Code section: cached_builtins ### */
29063
29064static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
29065 int __pyx_lineno = 0;
29066 const char *__pyx_filename = NULL;
29067 int __pyx_clineno = 0;
29068 CYTHON_UNUSED_VAR(__pyx_mstate);
29069 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_object); if (!__pyx_builtin_object) __PYX_ERR(0, 6, __pyx_L1_error)
29070 __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 119, __pyx_L1_error)
29071 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 175, __pyx_L1_error)
29072 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 436, __pyx_L1_error)
29073 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(1, 662, __pyx_L1_error)
29074
29075 /* Cached unbound methods */
29076 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
29077 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
29078 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
29079 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
29080 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
29081 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
29082 return 0;
29083 __pyx_L1_error:;
29084 return -1;
29085}
29086/* #### Code section: cached_constants ### */
29087
29088static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
29089 __Pyx_RefNannyDeclarations
29090 int __pyx_lineno = 0;
29091 const char *__pyx_filename = NULL;
29092 int __pyx_clineno = 0;
29093 CYTHON_UNUSED_VAR(__pyx_mstate);
29094 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
29095
29096 /* "View.MemoryView":625
29097 * def suboffsets(self):
29098 * if self.view.suboffsets == NULL:
29099 * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
29100 *
29101 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
29102*/
29103 __pyx_mstate_global->__pyx_tuple[0] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(1, 625, __pyx_L1_error)
29104 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
29105 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
29106 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_1);
29107 if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[0], 0, __pyx_mstate_global->__pyx_int_neg_1) != (0)) __PYX_ERR(1, 625, __pyx_L1_error);
29108 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
29109
29110 /* "View.MemoryView":745
29111 *
29112 * if first_ellipsis_index >= 0:
29113 * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
29114 *
29115 * for idx in range(first_ellipsis_index):
29116*/
29117 __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(1, 745, __pyx_L1_error)
29118 __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
29119 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
29120
29121 /* "View.MemoryView":763
29122 *
29123 * have_slices = True
29124 * index_tuple += (slice(None),) * (ndim - idx) # <<<<<<<<<<<<<<
29125 *
29126 * return have_slices, index_tuple
29127*/
29128 __pyx_mstate_global->__pyx_tuple[1] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 763, __pyx_L1_error)
29129 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
29130 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
29131 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
29132 if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[1], 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 763, __pyx_L1_error);
29133 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
29134
29135 /* "csmoothers.pyx":6
29136 * cimport numpy as np
29137 *
29138 * class ASMFactor(object): # <<<<<<<<<<<<<<
29139 *
29140 * def __init__(self, L):
29141*/
29142 {
29143 PyObject* __pyx_temp[1] = {__pyx_builtin_object};
29144 __pyx_mstate_global->__pyx_tuple[2] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 6, __pyx_L1_error)
29145 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
29146 }
29147 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
29148 {
29149 PyObject* __pyx_temp[1] = {__pyx_builtin_object};
29150 __pyx_mstate_global->__pyx_tuple[3] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 6, __pyx_L1_error)
29151 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
29152 }
29153 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
29154
29155 /* "csmoothers.pyx":43
29156 *
29157 *
29158 * class BASMFactor(object): # <<<<<<<<<<<<<<
29159 *
29160 * def __init__(self, L, bs):
29161*/
29162 {
29163 PyObject* __pyx_temp[1] = {__pyx_builtin_object};
29164 __pyx_mstate_global->__pyx_tuple[4] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 43, __pyx_L1_error)
29165 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
29166 }
29167 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
29168 {
29169 PyObject* __pyx_temp[1] = {__pyx_builtin_object};
29170 __pyx_mstate_global->__pyx_tuple[5] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 43, __pyx_L1_error)
29171 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
29172 }
29173 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
29174 #if CYTHON_IMMORTAL_CONSTANTS
29175 {
29176 PyObject **table = __pyx_mstate->__pyx_tuple;
29177 for (Py_ssize_t i=0; i<6; ++i) {
29178 #if PY_VERSION_HEX >= 0x030F0000
29179 PyUnstable_SetImmortal(table[i]);
29180 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29181 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
29182 #if PY_VERSION_HEX < 0x030E0000
29183 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
29184 #else
29185 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29186 #endif
29187 {
29188 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29189 }
29190 #else
29191 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
29192 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29193 #endif
29194 }
29195 }
29196 #endif
29197 #if CYTHON_IMMORTAL_CONSTANTS
29198 {
29199 PyObject **table = __pyx_mstate->__pyx_slice;
29200 for (Py_ssize_t i=0; i<1; ++i) {
29201 #if PY_VERSION_HEX >= 0x030F0000
29202 PyUnstable_SetImmortal(table[i]);
29203 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29204 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
29205 #if PY_VERSION_HEX < 0x030E0000
29206 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
29207 #else
29208 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29209 #endif
29210 {
29211 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29212 }
29213 #else
29214 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
29215 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29216 #endif
29217 }
29218 }
29219 #endif
29220 __Pyx_RefNannyFinishContext();
29221 return 0;
29222 __pyx_L1_error:;
29223 __Pyx_RefNannyFinishContext();
29224 return -1;
29225}
29226/* #### Code section: init_constants ### */
29227
29228static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
29229 int __pyx_lineno = 0;
29230 const char *__pyx_filename = NULL;
29231 int __pyx_clineno = 0;
29232 CYTHON_UNUSED_VAR(__pyx_mstate);
29233 {
29234 const struct { const unsigned int length: 8; } str_length_index[] = {{6},{8},{15},{1},{2},{15},{23},{25},{32},{20},{22},{1},{1},{37},{45},{22},{179},{8},{15},{7},{6},{2},{9},{50},{39},{34},{22},{30},{37},{1},{5},{9},{18},{10},{19},{8},{1},{1},{1},{8},{15},{20},{12},{9},{17},{8},{7},{8},{12},{10},{8},{8},{13},{10},{15},{8},{7},{11},{14},{11},{10},{19},{14},{12},{10},{17},{13},{12},{12},{19},{8},{11},{12},{14},{13},{3},{15},{9},{14},{12},{18},{4},{10},{15},{13},{2},{1},{10},{28},{30},{11},{29},{31},{18},{5},{10},{2},{15},{6},{9},{5},{5},{6},{7},{22},{21},{2},{5},{5},{8},{17},{15},{7},{4},{4},{2},{4},{24},{18},{10},{2},{2},{5},{3},{6},{4},{3},{8},{4},{10},{5},{4},{5},{4},{4},{6},{3},{6},{6},{6},{1},{1}};
29235 const struct { const unsigned int length: 6; } bytes_length_index[] = {{1},{9},{18},{18},{20},{20},{22},{22},{30},{30},{25},{28},{37},{24}};
29236 #ifndef CYTHON_COMPRESS_STRINGS
29237 #define CYTHON_COMPRESS_STRINGS 90
29238 #endif
29239 #if (CYTHON_COMPRESS_STRINGS) == 1 /* compression: zlib (1110 bytes) */
29240static const char cstring[] = "x\332}U;O$G\020\006\335!Y\326\005F~\310\201\203\346\345\305\006\006#\335Y\347\023\302Z0H\310\007\307C\262\234\265zzjv\373\350\351\236\355\307\336\256#\302\013\t/\334pB\207\033\022\022n\270?\303?\301\3253\373\002NH3\3335U\365UW}]]K\230#\277t\210\216\337\003w{\353\316\000\220\324\260F\006\312\375\024\275!\273\047\220i\323\375K\300\007\242S\262\313\265r\242\341\265\267\204\251\204$\302\004\334C\265Pc\203uF$\220\3148\023m\236\264\337\327M<\367~?`JiG\230\265\242\241\210\323\304\000K\266\264\222]\222\225I\2661\311c\325fR$$\323\tl\022\350\344\210\305P5^\013\373\326Rm\234a\252\266I\032\030j\354l\233,\007\334\212\260\216\260\344T; \256\211\304\034t]S+\202\272\004\244\210\3010\007\270[\310\017\243\232\340\244\310\331\341\331\326\313\327/\313l\r\004\032-\261>\346\022\023\005\033H\213\275\220\016\243\273n\0166\"\307)\351jO\024`^XE\216~\263\000\327\004E,\270 \220ZY3sB+\212p\241\032\265\021M\242\r\001}\304\244\205\210%\tE?\340Z\312`\323\312F,\346\211\260,\226\000*\3746\270\260\225\224(\215\005\245\314KG(5\220x\016\224\222\304\227\021\225V[X`[0\211V.\224p\224*\237\345\335\210rm \312\020\047\2301\254KR&dU\205\310r\244v\326\315g\3145\037y\344\006\323\364v\233\333Lk\254\320\330(\357v|\231W\360bRj\2164\223j\203\2049\026}\306Z\235X\240\274j\026\033\325\353\227\007\307\307\365\313\223#\306\2356\023!\242\264*a\177\242\332\177l<\224R\344V\330\267\047\027\227\320\362\2408\204\226\217\246\335O\351Y\267\203\357\037x\364\364\024:\356\002RJG\307\203\364!U\341\000\247B\003\234p\220\005E\0220a\325<,\251W\345\212\036v\014\256\330)\2452!J3&T\271\202c\223\320\330\326^\226\200\314h\212w\324\010(\r\212e\245Z\205L)\315\r\344\314\224\032\244\227\362&\360+\353\263\352k\264i\020CKV\222W\271\340W\030\373P\215\375\332.\360\036b\264<\223\343\035\306\3752\221xyKf\024\320\t\037\330\302\223\254\354L\245\023y\212s`C\311|r.\224\357\317\310\227X\212\205\023\206\305v\250\260\241\275\264\307\013\005\330\342\343\216\240\261OS\274\2406\253P(\320\323\2131\017\243/\253e\033\345\256\342BG\223(6f\026\342\t2\276\017\215g""\261\261\345\323$\371l\033=\340\342\236\355Q\3053\325\361\375\247\242\354?\035Fb\366\330/\024G\032\307D\371\025\327^\271\351\325J\376N\312\003F\316\252\001\217}\215s\021\360\204\313Y\006\306h\223J\326\2608\027\361\272\216\246c\203y\3546\013x\257\344\210\t$\342\241\266$D$8\240\241\023\032\335V?\377\300{\306u,f(\234*J\014\016\3530\251\303\204\016\375\2418\216\370LI\372\331\rP\377\000\256\020G\265I\300\250\\\231r\342`qU}9r\220k\334\266!,\016h\0132E\326F\263\256\234\031!Ad\321 \225\220[\247\3615\236;\247%^\000D\373\034G\016\340\337\202\007\373\241\363\356z~\370\374\313\217\0337\347\327\363\377}5\267\260\332\333\351\325{\347\303\325\255b\244Y\013\337=6\\\333.Z\250\371fn\341\307\360=\250\275\356?\353\277\272\235\257t\233\305NQ\037l\355\365\371\355\267\267\014u\337\215b\r\326~\375\227\367\277\356\277\275\233\257\264?\027\213\305\322`c\267\177\320\267\267\233w\301\367\373\271\205\345\336bo\251\2673\\^\031.o\024\325\032\236\312\272\022l\275\372peu\270\202\211\225kx*k\255\307z\255\301\372o\345.\317\356^\r\316\316+CT\234\027\254h\r\243\355\331\347\272>\374\342\305\307\303\233\305\260\034\335,\3412x\361\303\247?{\255\342y\261_\260\341\372fQ\277\347\364\356\323\033,9)\226\213\372\377\335\3625\t";
29241 PyObject *data = __Pyx_DecompressString(cstring, 1110, 1);
29242 #define __Pyx_DecompressString_LZSS_UNUSED
29243 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
29244 const char* const bytes = __Pyx_PyBytes_AsString(data);
29245 #if !CYTHON_ASSUME_SAFE_MACROS
29246 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
29247 #endif
29248 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90 /* compression: lzss (1489 bytes) */
29249static const char cstring[] = "\377 at 0x o\377bject>(t\377ree frag\377ment).: \377<MemoryV\377iew of <\377contiguo\377us and d\263ir4\001\007\rin\021\005s\277trided\"\010 7or \004\031><(\tA\006\377>?Cannot\377 assign \377to read-\277only m\240\002v\376\242\000Invalid\377 mode, esxp\324\000|\000\047c\047t\001\377\047fortran\317\047, gH\000%\005sh\367ape\222\000 axi\377s Note t\375h\226 Cython\375 \021\000delibe\317ratek\000\320\001ct\373er!\001n PEPo-484\212\"re\303!\177s subcl\246\000\373es\261!built\375i\260\000ypes. \377If you n\311e\224 \303\000p\316\000%\tth\277en set\200\000e\373 \047\357\002ation\377_typing\047\366\355$iv\242\000o Fa\377lse.add_>\231 ecoll\305@+\000\377s.abcdis\277ableen\002\001g\367cis\004\003dno \377default \377__reduce\337__ duM\002no{n-\262@vial\033\000\377cinit__n\377umpy._co\357re.m5\000iar\377ray fail\316\300\003imp\330 \033\tum\267ath\021\016pr\333 u\177s/csmoo\350\000\177rs.pyxu\235\002\276\320Aalloc\344 >[\003data.\013\020\254C\374\376a\333cs.AASC\377IIASMFacwtor\000\006.__\275\003\365B\023\006B\013\017Elli\377psisLMRS\177equence\357\204\001}.\364\204\007__Pyx\001\000\377Dict_Nex?tRef__\230D\274 \333__\355B__\001\005ge_titem\r\001d0\001\356\027\000doc\034\001fun\014\003\002\037\000st\320`0\001\272#\005\002~\354\"__mainJ\001\357metaR\006mod\373uli\002mro_e\277ntriesp\001n\273am\200\002new\177\001p\237repar\222\002\334 _\177checksu\212\000\300\n\001n\004\025\001\321`\370@\037\001unopickY\000En \005\363vt\272a\316\001qual\210Z\005\250e\261fc\241\205\002\365\001\304de\275x\202!set_\216\005s\343et\341\006\003\006.\007tes\266\341`_c\265F_c\244G_\373cS\310\000seMat\277rix_is\202\204\001o\377utineabc\376\250e_buffer\347asm\372C\006\000_NR\371_\201$\007\004solve\377asyncio.\367cor@\003sbas\253eb1\006b-\013b0\tb\013sc\233\007c\330i\277\205\004\204%\017\n\214\341\016\323\010cB*\031\235\204\n5\017lz\201 _\243`trac\277\000\177ckcount\321\205\007\307dXd\334B\261 \333\212\003en\377codeenum\376\307\210\002errorfl\377agsforma\375t\227\211\004gauss_?seidel\276$\311`\374\006\r""\310\"idinde\365x\345\204\001s\000\002izej\037acobi\363(\007\007\374\"\307mem\246\212\001\236\212\001\262\204\001nc\177ndimnl_L\022\374\025\0000\014node_o\377rdernpnr\356\224\210\002obj\273\214\003pac\377kpopregi\377sterself\247set\345\210\004\341\212\002s\236\000s\357tart\035\000pst\375o\001\000ructto\367lun:\001upda\377tevalues\377wxO\200\001\330\004\n\377\210+\220Q\200\001\360\020\377\000\005$\2401\240A\240_Q\330$-\250\013\004%\014\001\177\240a\330%/\250q!\000\377\024\000\005&\240Q\240a\377\320\0478\270\003\2705\300\375\001\016\003,\2501\250A\320\377->\270c\300\025\300a\372I\000\026E\004\320%6\260c\277\270\023\270L\310\001\020\003*\377\250\021\250!\320+<\270\277C\270s\300,\310(\001\030\377\000\005\"\240\021\240!\240\3771\330\"#\330\"+\250\244\002\003\010\000#\223\000\033\000#\030\001\240?A\330#$\330#\226\000\003\002\372\010\000$\030\003\047\240a\240q\367\320(9a\002\003\3105\320\373PQ1\003.\250Q\250a\037\250q\330./\000\000\000\003\t\000\377\200A\330\010\014\210E\220\335\021\003\001F\220!\013\000\320\014\377\034\230K\240q\250\004\250\377B\250a\330(,\250A\356\030\nO\230:\360\000d\250\"\003\250A";
29250 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 1489, 2126);
29251 #define __Pyx_DecompressString_UNUSED
29252 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
29253 const char* const bytes = __Pyx_PyBytes_AsString(data);
29254 #if !CYTHON_ASSUME_SAFE_MACROS
29255 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
29256 #endif
29257 #else /* compression: none (2126 bytes) */
29258static const char bytes[] = " at 0x object>(tree fragment).: <MemoryView of <contiguous and direct><contiguous and indirect><strided and direct or indirect><strided and direct><strided and indirect>>?Cannot assign to read-only memoryviewInvalid mode, expected \047c\047 or \047fortran\047, got Invalid shape in axis Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the \047annotation_typing\047 directive to False.add_notecollections.abcdisableenablegcisenabledno default __reduce__ due to non-trivial __cinit__numpy._core.multiarray failed to importnumpy._core.umath failed to importproteus/csmoothers.pyxunable to allocate array data.unable to allocate shape and strides.AASCIIASMFactorASMFactor.__init__BASMFactorBASMFactor.__init__EllipsisLMRSequenceView.MemoryView__Pyx_PyDict_NextRef__annotate____class____class_getitem____dict____doc____func____getstate____import____init____main____metaclass____module____mro_entries____name____new____prepare____pyx_checksum__pyx_state__pyx_type__pyx_unpickle_Enum__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex____set_name____setstate____setstate_cython____test___cASMFactor_cBASMFactor_cSparseMatrix_is_coroutineabcallocate_bufferasmFactorasm_NR_prepareasm_NR_solveasyncio.coroutinesbasebasmFactorbasm_NR_preparebasm_NR_solvebsccASMFactorcASMFactor.__reduce_cython__cASMFactor.__setstate_cython__cBASMFactorcBASMFactor.__reduce_cython__cBASMFactor.__setstate_cython__cline_in_tracebackcountcsmoothersdXdtype_is_objectencodeenumerateerrorflagsformatfortrangauss_seidel_NR_prearegauss_seidel_NR_solveidindexitemsitemsizejacobi_NR_preparejacobi_NR_solvememviewmodenamencndimnl_gauss_seidel_NR_solvenl_jacobi_NR_solvenode_ordernpnrnumpyobjobjectpackpopregisterselfsetdefaultshapesizestartstepstopstructtolunpackupdatevalueswxO\200\001\330\004\n\210+\220Q\200\001\360\020\000\005$\2401\240A\240Q\330$-\250Q\200\001\360\020\000\005%\240A\240Q\240a\330%/\250q\200\001\360\024\000\005&""\240Q\240a\320\0478\270\003\2705\300\001\200\001\360\024\000\005,\2501\250A\320->\270c\300\025\300a\200\001\360\026\000\005$\2401\240A\320%6\260c\270\023\270L\310\001\200\001\360\026\000\005*\250\021\250!\320+<\270C\270s\300,\310a\200\001\360\030\000\005\"\240\021\240!\2401\330\"#\330\"+\2501\330\"#\330\"#\330\"#\200\001\360\030\000\005#\240!\2401\240A\330#$\330#-\250Q\330#$\330#$\330#$\200\001\360\030\000\005\047\240a\240q\320(9\270\023\270L\310\003\3105\320PQ\200\001\360\030\000\005.\250Q\250a\250q\330./\330./\330./\330./\330./\200A\330\010\014\210E\220\021\330\010\014\210F\220!\330\010\014\320\014\034\230K\240q\250\004\250B\250a\330(,\250A\200A\330\010\014\210E\220\021\330\010\014\210O\230:\240Q\240d\250\"\250A";
29259 PyObject *data = NULL;
29260 #define __Pyx_DecompressString_UNUSED
29261 #define __Pyx_DecompressString_LZSS_UNUSED
29262 #endif
29263 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
29264 Py_ssize_t pos = 0;
29265 for (int i = 0; i < 142; i++) {
29266 Py_ssize_t bytes_length = str_length_index[i].length;
29267 PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
29268 if (likely(string) && i >= 29) PyUnicode_InternInPlace(&string);
29269 if (unlikely(!string)) {
29270 Py_XDECREF(data);
29271 __PYX_ERR(0, 1, __pyx_L1_error)
29272 }
29273 stringtab[i] = string;
29274 pos += bytes_length;
29275 }
29276 for (int i = 142; i < 156; i++) {
29277 Py_ssize_t bytes_length = bytes_length_index[i-142].length;
29278 PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
29279 stringtab[i] = string;
29280 pos += bytes_length;
29281 if (unlikely(!string)) {
29282 Py_XDECREF(data);
29283 __PYX_ERR(0, 1, __pyx_L1_error)
29284 }
29285 }
29286 Py_XDECREF(data);
29287 for (Py_ssize_t i = 0; i < 156; i++) {
29288 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
29289 __PYX_ERR(0, 1, __pyx_L1_error)
29290 }
29291 }
29292 #if CYTHON_IMMORTAL_CONSTANTS
29293 {
29294 PyObject **table = stringtab + 142;
29295 for (Py_ssize_t i=0; i<14; ++i) {
29296 #if PY_VERSION_HEX >= 0x030F0000
29297 PyUnstable_SetImmortal(table[i]);
29298 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29299 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
29300 #if PY_VERSION_HEX < 0x030E0000
29301 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
29302 #else
29303 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29304 #endif
29305 {
29306 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29307 }
29308 #else
29309 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
29310 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29311 #endif
29312 }
29313 }
29314 #endif
29315 }
29316 {
29317 PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
29318 int8_t const cint_constants_1[] = {0,-1};
29319 int32_t const cint_constants_4[] = {136983863L};
29320 for (int i = 0; i < 3; i++) {
29321 numbertab[i] = PyLong_FromLong((i < 2 ? cint_constants_1[i - 0] : cint_constants_4[i - 2]));
29322 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
29323 }
29324 }
29325 #if CYTHON_IMMORTAL_CONSTANTS
29326 {
29327 PyObject **table = __pyx_mstate->__pyx_number_tab;
29328 for (Py_ssize_t i=0; i<3; ++i) {
29329 #if PY_VERSION_HEX >= 0x030F0000
29330 PyUnstable_SetImmortal(table[i]);
29331 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29332 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
29333 #if PY_VERSION_HEX < 0x030E0000
29334 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
29335 #else
29336 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29337 #endif
29338 {
29339 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29340 }
29341 #else
29342 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
29343 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29344 #endif
29345 }
29346 }
29347 #endif
29348 return 0;
29349 __pyx_L1_error:;
29350 return -1;
29351}
29352/* #### Code section: init_codeobjects ### */
29353#ifdef __cplusplus
29354namespace {
29355#endif
29356typedef struct {
29357 unsigned int argcount : 3;
29358 unsigned int num_posonly_args : 1;
29359 unsigned int num_kwonly_args : 1;
29360 unsigned int nlocals : 3;
29361 unsigned int flags : 10;
29362 unsigned int first_line : 9;
29363} __Pyx_PyCode_New_function_description;
29364#ifdef __cplusplus
29365} /* anonymous namespace */
29366#endif
29367/* NewCodeObj.proto */
29368static PyObject* __Pyx_PyCode_New(
29369 const __Pyx_PyCode_New_function_description descr,
29370 PyObject * const *varnames,
29371 PyObject *filename,
29372 PyObject *funcname,
29373 PyObject *line_table,
29374 PyObject *tuple_dedup_map
29375);
29376
29377
29378static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
29379 PyObject* tuple_dedup_map = PyDict_New();
29380 if (unlikely(!tuple_dedup_map)) return -1;
29381 {
29382 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 8};
29383 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_L};
29384 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_E_O_Qd_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
29385 }
29386 {
29387 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
29388 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
29389 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
29390 }
29391 {
29392 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
29393 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
29394 __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
29395 }
29396 {
29397 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 45};
29398 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_L, __pyx_mstate->__pyx_n_u_bs};
29399 __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_E_F_Kq_Ba_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
29400 }
29401 {
29402 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
29403 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
29404 __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
29405 }
29406 {
29407 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
29408 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
29409 __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
29410 }
29411 {
29412 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 85};
29413 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_M};
29414 __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_jacobi_NR_prepare, __pyx_mstate->__pyx_kp_b_iso88591_Qa_8_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
29415 }
29416 {
29417 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 110};
29418 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_node_order, __pyx_mstate->__pyx_n_u_dX};
29419 __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_jacobi_NR_solve, __pyx_mstate->__pyx_kp_b_iso88591_1A_6c_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
29420 }
29421 {
29422 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 137};
29423 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_node_order, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_dX};
29424 __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_nl_jacobi_NR_solve, __pyx_mstate->__pyx_kp_b_iso88591_aq_9_L_5PQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
29425 }
29426 {
29427 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 166};
29428 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_M};
29429 __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_gauss_seidel_NR_preare, __pyx_mstate->__pyx_kp_b_iso88591_1A_c_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
29430 }
29431 {
29432 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 191};
29433 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_node_order, __pyx_mstate->__pyx_n_u_dX};
29434 __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_gauss_seidel_NR_solve, __pyx_mstate->__pyx_kp_b_iso88591_Cs_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
29435 }
29436 {
29437 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 218};
29438 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_node_order, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_dX};
29439 __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_nl_gauss_seidel_NR_solve, __pyx_mstate->__pyx_kp_b_iso88591_Qaq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
29440 }
29441 {
29442 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 252};
29443 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_asmFactor};
29444 __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_asm_NR_prepare, __pyx_mstate->__pyx_kp_b_iso88591_1AQ_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
29445 }
29446 {
29447 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 278};
29448 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_asmFactor, __pyx_mstate->__pyx_n_u_node_order, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_dX};
29449 __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_asm_NR_solve, __pyx_mstate->__pyx_kp_b_iso88591_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
29450 }
29451 {
29452 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 322};
29453 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_basmFactor};
29454 __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_basm_NR_prepare, __pyx_mstate->__pyx_kp_b_iso88591_AQa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
29455 }
29456 {
29457 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 351};
29458 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_basmFactor, __pyx_mstate->__pyx_n_u_node_order, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_dX};
29459 __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_csmoothers_pyx, __pyx_mstate->__pyx_n_u_basm_NR_solve, __pyx_mstate->__pyx_kp_b_iso88591_1A_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
29460 }
29461 Py_DECREF(tuple_dedup_map);
29462 return 0;
29463 bad:
29464 Py_DECREF(tuple_dedup_map);
29465 return -1;
29466}
29467/* #### Code section: init_globals ### */
29468
29469static int __Pyx_InitGlobals(void) {
29470 int __pyx_lineno = 0;
29471 const char *__pyx_filename = NULL;
29472 int __pyx_clineno = 0;
29473 /* PythonCompatibility.init */
29474 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0)); else
29475
29476 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29477
29478 /* PyFrozenDict.init */
29479 #if CYTHON_COMPILING_IN_LIMITED_API
29480 {
29481 PyObject *builtins = PyEval_GetBuiltins(); // borrowed
29482 if (likely(builtins)) {
29483 PyObject *type_name = PyUnicode_FromStringAndSize("frozendict", sizeof("frozendict")-1);
29484 if (likely(type_name)) {
29485 PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
29486 Py_DECREF(type_name);
29487 if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
29488 PyErr_Clear();
29489 frozendict_type = (PyObject*) &PyDict_Type;
29490 Py_INCREF(frozendict_type);
29491 }
29492 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
29493 }
29494 }
29495 } // error handling follows
29496 #endif
29497
29498 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29499
29500 /* AssertionsEnabled.init */
29501 if (likely(__Pyx_init_assertions_enabled() == 0)); else
29502
29503 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29504
29505 /* NumpyImportArray.init */
29506 /*
29507 * Cython has automatically inserted a call to _import_array since
29508 * you didn't include one when you cimported numpy. To disable this
29509 * add the line
29510 * <void>numpy._import_array
29511 */
29512 #ifdef NPY_FEATURE_VERSION
29513 #ifndef NO_IMPORT_ARRAY
29514 if (unlikely(_import_array() == -1)) {
29515 PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import "
29516 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
29517 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
29518 }
29519 #endif
29520 #endif
29521
29522 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29523
29524 /* CommonTypesMetaclass.init */
29525 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
29526
29527 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29528
29529 /* CachedMethodType.init */
29530 #if CYTHON_COMPILING_IN_LIMITED_API
29531 {
29532 PyObject *typesModule=NULL;
29533 typesModule = PyImport_ImportModule("types");
29534 if (typesModule) {
29535 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
29536 Py_DECREF(typesModule);
29537 }
29538 } // error handling follows
29539 #endif
29540
29541 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29542
29543 return 0;
29544 __pyx_L1_error:;
29545 return -1;
29546}
29547/* #### Code section: init_after_shared_utility ### */
29548
29549static int __Pyx_InitAfterSharedUtility(void) {
29550 int __pyx_lineno = 0;
29551 const char *__pyx_filename = NULL;
29552 int __pyx_clineno = 0;
29553 /* CythonFunctionPerModule.init */
29554 if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
29555
29556 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29557
29558 return 0;
29559 __pyx_L1_error:;
29560 return -1;
29561}
29562/* #### Code section: cleanup_globals ### */
29563/* #### Code section: cleanup_module ### */
29564/* #### Code section: main_method ### */
29565/* #### Code section: utility_code_pragmas ### */
29566#ifdef _MSC_VER
29567#pragma warning( push )
29568/* Warning 4127: conditional expression is constant
29569 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
29570 * compile-time, so this warning is not useful
29571 */
29572#pragma warning( disable : 4127 )
29573#endif
29574
29575
29576
29577/* #### Code section: utility_code_def ### */
29578
29579/* --- Runtime support code --- */
29580/* Refnanny */
29581#if CYTHON_REFNANNY
29582static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
29583 PyObject *m = NULL, *p = NULL;
29584 void *r = NULL;
29585 m = PyImport_ImportModule(modname);
29586 if (!m) goto end;
29587 p = PyObject_GetAttrString(m, "RefNannyAPI");
29588 if (!p) goto end;
29589 r = PyLong_AsVoidPtr(p);
29590end:
29591 Py_XDECREF(p);
29592 Py_XDECREF(m);
29593 return (__Pyx_RefNannyAPIStruct *)r;
29594}
29595#endif
29596
29597/* FastTypeChecks (used by GivenExceptionMatches) */
29598#if CYTHON_COMPILING_IN_CPYTHON
29599static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
29600 while (a) {
29601 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
29602 if (a == b)
29603 return 1;
29604 }
29605 return b == &PyBaseObject_Type;
29606}
29607static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
29608 PyObject *mro;
29609 if (a == b) return 1;
29610 mro = a->tp_mro;
29611 if (likely(mro)) {
29612 Py_ssize_t i, n;
29613 n = PyTuple_GET_SIZE(mro);
29614 for (i = 0; i < n; i++) {
29615 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
29616 return 1;
29617 }
29618 return 0;
29619 }
29620 return __Pyx_InBases(a, b);
29621}
29622static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
29623 PyObject *mro;
29624 if (cls == a || cls == b) return 1;
29625 mro = cls->tp_mro;
29626 if (likely(mro)) {
29627 Py_ssize_t i, n;
29628 n = PyTuple_GET_SIZE(mro);
29629 for (i = 0; i < n; i++) {
29630 PyObject *base = PyTuple_GET_ITEM(mro, i);
29631 if (base == (PyObject *)a || base == (PyObject *)b)
29632 return 1;
29633 }
29634 return 0;
29635 }
29636 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
29637}
29638#endif
29639
29640/* PyErrFetchRestore (used by GivenExceptionMatches) */
29641#if CYTHON_FAST_THREAD_STATE
29642static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
29643#if PY_VERSION_HEX >= 0x030C00A6
29644 PyObject *tmp_value;
29645 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
29646 if (value) {
29647 #if CYTHON_COMPILING_IN_CPYTHON
29648 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
29649 #endif
29650 PyException_SetTraceback(value, tb);
29651 }
29652 tmp_value = tstate->current_exception;
29653 tstate->current_exception = value;
29654 Py_XDECREF(tmp_value);
29655 Py_XDECREF(type);
29656 Py_XDECREF(tb);
29657#else
29658 PyObject *tmp_type, *tmp_value, *tmp_tb;
29659 tmp_type = tstate->curexc_type;
29660 tmp_value = tstate->curexc_value;
29661 tmp_tb = tstate->curexc_traceback;
29662 tstate->curexc_type = type;
29663 tstate->curexc_value = value;
29664 tstate->curexc_traceback = tb;
29665 Py_XDECREF(tmp_type);
29666 Py_XDECREF(tmp_value);
29667 Py_XDECREF(tmp_tb);
29668#endif
29669}
29670static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29671#if PY_VERSION_HEX >= 0x030C00A6
29672 PyObject* exc_value;
29673 exc_value = tstate->current_exception;
29674 tstate->current_exception = 0;
29675 *value = exc_value;
29676 *type = NULL;
29677 *tb = NULL;
29678 if (exc_value) {
29679 *type = (PyObject*) Py_TYPE(exc_value);
29680 Py_INCREF(*type);
29681 #if CYTHON_COMPILING_IN_CPYTHON
29682 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
29683 Py_XINCREF(*tb);
29684 #else
29685 *tb = PyException_GetTraceback(exc_value);
29686 #endif
29687 }
29688#else
29689 *type = tstate->curexc_type;
29690 *value = tstate->curexc_value;
29691 *tb = tstate->curexc_traceback;
29692 tstate->curexc_type = 0;
29693 tstate->curexc_value = 0;
29694 tstate->curexc_traceback = 0;
29695#endif
29696}
29697#endif
29698
29699/* GivenExceptionMatches (used by PyErrExceptionMatches) */
29700#if CYTHON_COMPILING_IN_CPYTHON
29701static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
29702 if (exc_type1) {
29703 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
29704 } else {
29705 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
29706 }
29707}
29708static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29709 Py_ssize_t i, n;
29710 assert(PyExceptionClass_Check(exc_type));
29711 n = PyTuple_GET_SIZE(tuple);
29712 for (i=0; i<n; i++) {
29713 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
29714 }
29715 for (i=0; i<n; i++) {
29716 PyObject *t = PyTuple_GET_ITEM(tuple, i);
29717 if (likely(PyExceptionClass_Check(t))) {
29718 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
29719 } else {
29720 }
29721 }
29722 return 0;
29723}
29724static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
29725 if (likely(err == exc_type)) return 1;
29726 if (likely(PyExceptionClass_Check(err))) {
29727 if (likely(PyExceptionClass_Check(exc_type))) {
29728 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
29729 } else if (likely(PyTuple_Check(exc_type))) {
29730 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
29731 } else {
29732 }
29733 }
29734 return PyErr_GivenExceptionMatches(err, exc_type);
29735}
29736static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
29737 assert(PyExceptionClass_Check(exc_type1));
29738 assert(PyExceptionClass_Check(exc_type2));
29739 if (likely(err == exc_type1 || err == exc_type2)) return 1;
29740 if (likely(PyExceptionClass_Check(err))) {
29741 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
29742 }
29743 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
29744}
29745#endif
29746
29747/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
29748#if CYTHON_FAST_THREAD_STATE
29749static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29750 Py_ssize_t i, n;
29751 n = PyTuple_GET_SIZE(tuple);
29752 for (i=0; i<n; i++) {
29753 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
29754 }
29755 for (i=0; i<n; i++) {
29756 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
29757 }
29758 return 0;
29759}
29760static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
29761 int result;
29762 PyObject *exc_type;
29763#if PY_VERSION_HEX >= 0x030C00A6
29764 PyObject *current_exception = tstate->current_exception;
29765 if (unlikely(!current_exception)) return 0;
29766 exc_type = (PyObject*) Py_TYPE(current_exception);
29767 if (exc_type == err) return 1;
29768#else
29769 exc_type = tstate->curexc_type;
29770 if (exc_type == err) return 1;
29771 if (unlikely(!exc_type)) return 0;
29772#endif
29773 #if CYTHON_AVOID_BORROWED_REFS
29774 Py_INCREF(exc_type);
29775 #endif
29776 if (unlikely(PyTuple_Check(err))) {
29777 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
29778 } else {
29779 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
29780 }
29781 #if CYTHON_AVOID_BORROWED_REFS
29782 Py_DECREF(exc_type);
29783 #endif
29784 return result;
29785}
29786#endif
29787
29788/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
29789#if CYTHON_USE_TYPE_SLOTS
29790static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
29791 PyTypeObject* tp = Py_TYPE(obj);
29792 if (likely(tp->tp_getattro))
29793 return tp->tp_getattro(obj, attr_name);
29794 return PyObject_GetAttr(obj, attr_name);
29795}
29796#endif
29797
29798/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
29799#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
29800static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
29801 __Pyx_PyThreadState_declare
29802 __Pyx_PyThreadState_assign
29803 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
29804 __Pyx_PyErr_Clear();
29805}
29806#endif
29807static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
29808 PyObject *result;
29809#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
29810 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
29811 return result;
29812#else
29813#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
29814 PyTypeObject* tp = Py_TYPE(obj);
29815 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
29816 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
29817 }
29818#endif
29819 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
29820 if (unlikely(!result)) {
29821 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
29822 }
29823 return result;
29824#endif
29825}
29826
29827/* GetBuiltinName */
29828static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
29829 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
29830 if (unlikely(!result) && !PyErr_Occurred()) {
29831 PyErr_Format(PyExc_NameError,
29832 "name '%U' is not defined", name);
29833 }
29834 return result;
29835}
29836
29837/* CopyObjectArray (used by TupleOrListFromArrayImpl) */
29838#if CYTHON_COMPILING_IN_CPYTHON
29839static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
29840 PyObject *v;
29841 Py_ssize_t i;
29842 for (i = 0; i < length; i++) {
29843 v = dest[i] = src[i];
29844 Py_INCREF(v);
29845 }
29846}
29847#endif
29848
29849/* TupleOrListFromArrayImpl (used by TupleFromArray) */
29850#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
29851CYTHON_UNUSED static PyObject *
29852__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) {
29853 if (n <= 0) {
29854 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
29855 }
29856 PyObject *res = PyTuple_New(n);
29857 if (unlikely(res == NULL)) return NULL;
29858 #if CYTHON_COMPILING_IN_CPYTHON
29859 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
29860 #else
29861 Py_ssize_t i;
29862 for (i = 0; i < n; i++) {
29863 Py_INCREF(src[i]);
29864 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
29865 Py_DECREF(res);
29866 return NULL;
29867 }
29868 }
29869 #endif
29870 return res;
29871}
29872#endif
29873
29874/* PyObjectCompare (used by UnicodeEquals) */
29875#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
29876#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
29877static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
29878 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
29879 int result = PyUnicode_Equal(s1, s2);
29880 #if !CYTHON_COMPILING_IN_CPYTHON
29881 if (unlikely(result == -1)) return -1;
29882 #endif
29883 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
29884 #else
29885 int result = PyUnicode_Compare(s1, s2);
29886 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
29887 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
29888 #endif
29889__pyx_return_true:
29890 return 1;
29891__pyx_return_false:
29892 return 0;
29893}
29894#endif
29895static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop) {
29896 CYTHON_UNUSED_VAR(pyop);
29897 if (unlikely(op1 == Py_None)) {
29898 if (op2 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
29899 }
29900 if (unlikely(op2 == Py_None)) {
29901 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
29902 }
29903
29904 if (likely(op1 != Py_None)) {
29905 if (op1 == op2) goto __pyx_return_true;
29906 if (likely(op2 != Py_None)) {
29907 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
29908 }
29909 goto __pyx_richcmp;
29910 }
29911
29912 if ((0)) goto __pyx_richcmp;
29913 if ((0)) goto __pyx_return_true;
29914 if ((0)) goto __pyx_return_false;
29915__pyx_richcmp:
29916 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
29917__pyx_return_true:
29918 return 1;
29919__pyx_return_false:
29920 return 0;
29921}
29922
29923/* fastcall */
29924#if CYTHON_VECTORCALL
29925static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
29926{
29927 Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
29928 #if !CYTHON_ASSUME_SAFE_SIZE
29929 if (unlikely(n == -1)) return NULL;
29930 #endif
29931 for (i = 0; i < n; i++)
29932 {
29933 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
29934 #if !CYTHON_ASSUME_SAFE_MACROS
29935 if (unlikely(!namei)) return NULL;
29936 #endif
29937 if (s == namei) return kwvalues[i];
29938 }
29939 for (i = 0; i < n; i++)
29940 {
29941 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
29942 #if !CYTHON_ASSUME_SAFE_MACROS
29943 if (unlikely(!namei)) return NULL;
29944 #endif
29945 int eq = __Pyx_PyUnicode_Equals(s, namei);
29946 if (unlikely(eq != 0)) {
29947 if (unlikely(eq < 0)) return NULL;
29948 return kwvalues[i];
29949 }
29950 }
29951 return NULL;
29952}
29953#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
29954CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
29955 Py_ssize_t i, nkwargs;
29956 PyObject *dict;
29957#if !CYTHON_ASSUME_SAFE_SIZE
29958 nkwargs = PyTuple_Size(kwnames);
29959 if (unlikely(nkwargs < 0)) return NULL;
29960#else
29961 nkwargs = PyTuple_GET_SIZE(kwnames);
29962#endif
29963 dict = PyDict_New();
29964 if (unlikely(!dict))
29965 return NULL;
29966 for (i=0; i<nkwargs; i++) {
29967#if !CYTHON_ASSUME_SAFE_MACROS
29968 PyObject *key = PyTuple_GetItem(kwnames, i);
29969 if (!key) goto bad;
29970#else
29971 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
29972#endif
29973 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
29974 goto bad;
29975 }
29976 return dict;
29977bad:
29978 Py_DECREF(dict);
29979 return NULL;
29980}
29981#endif
29982#endif
29983
29984/* PyObjectCall (used by PyObjectFastCall) */
29985#if CYTHON_COMPILING_IN_CPYTHON
29986static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
29987 PyObject *result;
29988 ternaryfunc call = Py_TYPE(func)->tp_call;
29989 if (unlikely(!call))
29990 return PyObject_Call(func, arg, kw);
29991 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
29992 return NULL;
29993 result = (*call)(func, arg, kw);
29994 Py_LeaveRecursiveCall();
29995 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29996 PyErr_SetString(
29997 PyExc_SystemError,
29998 "NULL result without error in PyObject_Call");
29999 }
30000 return result;
30001}
30002#endif
30003
30004/* PyObjectCallMethO (used by PyObjectFastCall) */
30005#if CYTHON_COMPILING_IN_CPYTHON
30006static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
30007 PyObject *self, *result;
30008 PyCFunction cfunc;
30009 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
30010 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
30011 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
30012 return NULL;
30013 result = cfunc(self, arg);
30014 Py_LeaveRecursiveCall();
30015 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
30016 PyErr_SetString(
30017 PyExc_SystemError,
30018 "NULL result without error in PyObject_Call");
30019 }
30020 return result;
30021}
30022#endif
30023
30024/* PyObjectFastCall (used by PyObjectCallOneArg) */
30025#if CYTHON_COMPILING_IN_LIMITED_API
30026static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
30027 PyObject *argstuple;
30028 PyObject *result = 0;
30029 size_t i;
30030 argstuple = PyTuple_New((Py_ssize_t)nargs);
30031 if (unlikely(!argstuple)) return NULL;
30032 for (i = 0; i < nargs; i++) {
30033 Py_INCREF(args[i]);
30034 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
30035 }
30036 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
30037 bad:
30038 Py_DECREF(argstuple);
30039 return result;
30040}
30041#endif
30042#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
30043 #if CYTHON_COMPILING_IN_CPYTHON
30044static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
30045 PyTypeObject *tp = Py_TYPE(callable);
30046 #if defined(__Pyx_CyFunction_USED)
30047 if (__Pyx_CyFunction_CheckExact(callable)) {
30048 return __Pyx_CyFunction_func_vectorcall(callable);
30049 }
30050 #endif
30051 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
30052 return NULL;
30053 }
30054 assert(PyCallable_Check(callable));
30055 Py_ssize_t offset = tp->tp_vectorcall_offset;
30056 assert(offset > 0);
30057 vectorcallfunc ptr;
30058 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
30059 return ptr;
30060}
30061 #else
30062 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
30063 #endif
30064#endif
30065static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwargs) {
30066 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
30067#if CYTHON_COMPILING_IN_CPYTHON
30068 if (nargs == 0 && kwargs == NULL) {
30069 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
30070 return __Pyx_PyObject_CallMethO(func, NULL);
30071 }
30072 else if (nargs == 1 && kwargs == NULL) {
30073 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
30074 return __Pyx_PyObject_CallMethO(func, args[0]);
30075 }
30076#endif
30077 if (kwargs == NULL) {
30078 #if CYTHON_VECTORCALL
30079 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30080 return PyObject_Vectorcall(func, args, nargsf, NULL);
30081 #else
30082 vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
30083 if (f) {
30084 return f(func, args, nargsf, NULL);
30085 }
30086 #endif
30087 #endif
30088 }
30089 if (nargs == 0) {
30090 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
30091 }
30092 #if CYTHON_COMPILING_IN_LIMITED_API
30093 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
30094 #elif CYTHON_COMPILING_IN_PYPY
30095 return PyObject_VectorcallDict(func, args, (size_t) nargs, kwargs);
30096 #else
30097 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
30098 #endif
30099}
30100
30101/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
30102static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
30103 PyObject *args[2] = {NULL, arg};
30104 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
30105}
30106
30107/* IgnoreException (used by UnpackUnboundCMethod_impl) */
30108static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
30109 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
30110 PyErr_Clear();
30111 return 1;
30112 }
30113 return 0;
30114}
30115
30116/* UnpackUnboundCMethod_impl (used by UnpackUnboundCMethod) */
30117#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
30118static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
30119 PyObject *result;
30120 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
30121 if (unlikely(!selfless_args)) return NULL;
30122 result = PyObject_Call(method, selfless_args, kwargs);
30123 Py_DECREF(selfless_args);
30124 return result;
30125}
30126#else
30127static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
30128 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
30129}
30130#endif
30131static PyMethodDef __Pyx_UnboundCMethod_Def = {
30132 "CythonUnboundCMethod",
30133 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
30134#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
30135 METH_VARARGS | METH_KEYWORDS,
30136#else
30137 METH_FASTCALL | METH_KEYWORDS,
30138#endif
30139 NULL
30140};
30141static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
30142 PyObject *method, *result=NULL;
30143 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
30144 if (unlikely(!method))
30145 return -1;
30146 result = method;
30147#if CYTHON_COMPILING_IN_CPYTHON
30148 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
30149 {
30150 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
30151 target->func = descr->d_method->ml_meth;
30152 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
30153 } else
30154#endif
30155#if CYTHON_COMPILING_IN_PYPY
30156#else
30157 if (PyCFunction_Check(method))
30158#endif
30159 {
30160 PyObject *self;
30161 int self_found;
30162#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30163 self = PyObject_GetAttrString(method, "__self__");
30164 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
30165 return -1;
30166 }
30167#else
30168 self = PyCFunction_GET_SELF(method);
30169#endif
30170 self_found = (self && self != Py_None);
30171#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30172 Py_XDECREF(self);
30173#endif
30174 if (self_found) {
30175 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
30176 if (unlikely(!unbound_method)) return -1;
30177 Py_DECREF(method);
30178 result = unbound_method;
30179 }
30180 }
30181#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
30182 if (unlikely(target->method)) {
30183 Py_DECREF(result);
30184 } else
30185#endif
30186 target->method = result;
30187 return 0;
30188}
30189
30190/* CallUnboundCMethod0 */
30191#if CYTHON_COMPILING_IN_CPYTHON
30192static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
30193 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
30194 if (likely(was_initialized == 2 && cfunc->func)) {
30195 if (likely(cfunc->flag == METH_NOARGS))
30196 return __Pyx_CallCFunction(cfunc, self, NULL);
30197 if (likely(cfunc->flag == METH_FASTCALL))
30198 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
30199 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
30200 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
30201 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
30202 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
30203 if (cfunc->flag == METH_VARARGS)
30204 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
30205 return __Pyx__CallUnboundCMethod0(cfunc, self);
30206 }
30207#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
30208 else if (unlikely(was_initialized == 1)) {
30209 __Pyx_CachedCFunction tmp_cfunc = {
30210#ifndef __cplusplus
30211 0
30212#endif
30213 };
30214 tmp_cfunc.type = cfunc->type;
30215 tmp_cfunc.method_name = cfunc->method_name;
30216 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
30217 }
30218#endif
30219 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
30220 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
30221 return result;
30222}
30223#endif
30224static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
30225 PyObject *result;
30226 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
30227 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
30228 return result;
30229}
30230
30231/* py_dict_items (used by OwnedDictNext) */
30232static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
30233 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
30234}
30235
30236/* py_dict_values (used by OwnedDictNext) */
30237static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
30238 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
30239}
30240
30241/* OwnedDictNext (used by ParseKeywordsImpl) */
30242#if CYTHON_AVOID_BORROWED_REFS
30243static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
30244 PyObject *next = NULL;
30245 if (!*ppos) {
30246 if (pvalue) {
30247 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
30248 if (unlikely(!dictview)) goto bad;
30249 *ppos = PyObject_GetIter(dictview);
30250 Py_DECREF(dictview);
30251 } else {
30252 *ppos = PyObject_GetIter(p);
30253 }
30254 if (unlikely(!*ppos)) goto bad;
30255 }
30256 next = PyIter_Next(*ppos);
30257 if (!next) {
30258 if (PyErr_Occurred()) goto bad;
30259 return 0;
30260 }
30261 if (pkey && pvalue) {
30262 *pkey = __Pyx_PySequence_ITEM(next, 0);
30263 if (unlikely(*pkey)) goto bad;
30264 *pvalue = __Pyx_PySequence_ITEM(next, 1);
30265 if (unlikely(*pvalue)) goto bad;
30266 Py_DECREF(next);
30267 } else if (pkey) {
30268 *pkey = next;
30269 } else {
30270 assert(pvalue);
30271 *pvalue = next;
30272 }
30273 return 1;
30274 bad:
30275 Py_XDECREF(next);
30276#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
30277 PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
30278#else
30279 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
30280#endif
30281 if (pkey) *pkey = NULL;
30282 if (pvalue) *pvalue = NULL;
30283 return 0;
30284}
30285#else // !CYTHON_AVOID_BORROWED_REFS
30286static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
30287 int result = PyDict_Next(p, ppos, pkey, pvalue);
30288 if (likely(result == 1)) {
30289 if (pkey) Py_INCREF(*pkey);
30290 if (pvalue) Py_INCREF(*pvalue);
30291 }
30292 return result;
30293}
30294#endif
30295
30296/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
30297static void __Pyx_RaiseDoubleKeywordsError(
30298 const char* func_name,
30299 PyObject* kw_name)
30300{
30301 PyErr_Format(PyExc_TypeError,
30302 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
30303}
30304
30305/* CallUnboundCMethod2 */
30306#if CYTHON_COMPILING_IN_CPYTHON
30307static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
30308 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
30309 if (likely(was_initialized == 2 && cfunc->func)) {
30310 PyObject *args[2] = {arg1, arg2};
30311 if (cfunc->flag == METH_FASTCALL) {
30312 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
30313 }
30314 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
30315 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
30316 }
30317#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
30318 else if (unlikely(was_initialized == 1)) {
30319 __Pyx_CachedCFunction tmp_cfunc = {
30320#ifndef __cplusplus
30321 0
30322#endif
30323 };
30324 tmp_cfunc.type = cfunc->type;
30325 tmp_cfunc.method_name = cfunc->method_name;
30326 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
30327 }
30328#endif
30329 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
30330 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
30331 return result;
30332}
30333#endif
30334static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
30335 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
30336#if CYTHON_COMPILING_IN_CPYTHON
30337 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
30338 PyObject *result = NULL;
30339 PyObject *args = PyTuple_New(2);
30340 if (unlikely(!args)) return NULL;
30341 Py_INCREF(arg1);
30342 PyTuple_SET_ITEM(args, 0, arg1);
30343 Py_INCREF(arg2);
30344 PyTuple_SET_ITEM(args, 1, arg2);
30345 if (cfunc->flag & METH_KEYWORDS)
30346 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
30347 else
30348 result = __Pyx_CallCFunction(cfunc, self, args);
30349 Py_DECREF(args);
30350 return result;
30351 }
30352#endif
30353 {
30354 PyObject *args[4] = {NULL, self, arg1, arg2};
30355 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
30356 }
30357}
30358
30359/* ParseKeywordsImpl (used by ParseKeywords) */
30360static int __Pyx_ValidateDuplicatePosArgs(
30361 PyObject *kwds,
30362 PyObject ** const argnames[],
30363 PyObject ** const *first_kw_arg,
30364 const char* function_name)
30365{
30366 PyObject ** const *name = argnames;
30367 while (name != first_kw_arg) {
30368 PyObject *key = **name;
30369 int found = PyDict_Contains(kwds, key);
30370 if (unlikely(found)) {
30371 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
30372 goto bad;
30373 }
30374 name++;
30375 }
30376 return 0;
30377bad:
30378 return -1;
30379}
30380#if CYTHON_USE_UNICODE_INTERNALS
30381static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
30382 int kind;
30383 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
30384 if (len != PyUnicode_GET_LENGTH(s2)) return 0;
30385 kind = PyUnicode_KIND(s1);
30386 if (kind != PyUnicode_KIND(s2)) return 0;
30387 const void *data1 = PyUnicode_DATA(s1);
30388 const void *data2 = PyUnicode_DATA(s2);
30389 return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
30390}
30391#endif
30392static int __Pyx_MatchKeywordArg_str(
30393 PyObject *key,
30394 PyObject ** const argnames[],
30395 PyObject ** const *first_kw_arg,
30396 size_t *index_found,
30397 const char *function_name)
30398{
30399 PyObject ** const *name;
30400 #if CYTHON_USE_UNICODE_INTERNALS
30401 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
30402 if (unlikely(key_hash == -1)) {
30403 key_hash = PyObject_Hash(key);
30404 if (unlikely(key_hash == -1))
30405 goto bad;
30406 }
30407 #endif
30408 name = first_kw_arg;
30409 while (*name) {
30410 PyObject *name_str = **name;
30411 #if CYTHON_USE_UNICODE_INTERNALS
30412 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
30413 *index_found = (size_t) (name - argnames);
30414 return 1;
30415 }
30416 #else
30417 #if CYTHON_ASSUME_SAFE_SIZE
30418 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
30419 #endif
30420 {
30421 int cmp = PyUnicode_Compare(name_str, key);
30422 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
30423 if (cmp == 0) {
30424 *index_found = (size_t) (name - argnames);
30425 return 1;
30426 }
30427 }
30428 #endif
30429 name++;
30430 }
30431 name = argnames;
30432 while (name != first_kw_arg) {
30433 PyObject *name_str = **name;
30434 #if CYTHON_USE_UNICODE_INTERNALS
30435 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
30436 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
30437 goto arg_passed_twice;
30438 }
30439 #else
30440 #if CYTHON_ASSUME_SAFE_SIZE
30441 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
30442 #endif
30443 {
30444 if (unlikely(name_str == key)) goto arg_passed_twice;
30445 int cmp = PyUnicode_Compare(name_str, key);
30446 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
30447 if (cmp == 0) goto arg_passed_twice;
30448 }
30449 #endif
30450 name++;
30451 }
30452 return 0;
30453arg_passed_twice:
30454 __Pyx_RaiseDoubleKeywordsError(function_name, key);
30455 goto bad;
30456bad:
30457 return -1;
30458}
30459static int __Pyx_MatchKeywordArg_nostr(
30460 PyObject *key,
30461 PyObject ** const argnames[],
30462 PyObject ** const *first_kw_arg,
30463 size_t *index_found,
30464 const char *function_name)
30465{
30466 PyObject ** const *name;
30467 if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
30468 name = first_kw_arg;
30469 while (*name) {
30470 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
30471 if (cmp == 1) {
30472 *index_found = (size_t) (name - argnames);
30473 return 1;
30474 }
30475 if (unlikely(cmp == -1)) goto bad;
30476 name++;
30477 }
30478 name = argnames;
30479 while (name != first_kw_arg) {
30480 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
30481 if (unlikely(cmp != 0)) {
30482 if (cmp == 1) goto arg_passed_twice;
30483 else goto bad;
30484 }
30485 name++;
30486 }
30487 return 0;
30488arg_passed_twice:
30489 __Pyx_RaiseDoubleKeywordsError(function_name, key);
30490 goto bad;
30491invalid_keyword_type:
30492 PyErr_Format(PyExc_TypeError,
30493 "%.200s() keywords must be strings", function_name);
30494 goto bad;
30495bad:
30496 return -1;
30497}
30498static CYTHON_INLINE int __Pyx_MatchKeywordArg(
30499 PyObject *key,
30500 PyObject ** const argnames[],
30501 PyObject ** const *first_kw_arg,
30502 size_t *index_found,
30503 const char *function_name)
30504{
30505 return likely(PyUnicode_CheckExact(key)) ?
30506 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
30507 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
30508}
30509static void __Pyx_RejectUnknownKeyword(
30510 PyObject *kwds,
30511 PyObject ** const argnames[],
30512 PyObject ** const *first_kw_arg,
30513 const char *function_name)
30514{
30515 #if CYTHON_AVOID_BORROWED_REFS
30516 PyObject *pos = NULL;
30517 #else
30518 Py_ssize_t pos = 0;
30519 #endif
30520 PyObject *key = NULL;
30521 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
30522 #if CYTHON_AVOID_BORROWED_REFS
30523 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
30524 #else
30525 (void) __Pyx_PyDict_NextRef;
30526 while (PyDict_Next(kwds, &pos, &key, NULL))
30527 #endif
30528 {
30529 PyObject** const *name = first_kw_arg;
30530 while (*name && (**name != key)) name++;
30531 if (!*name) {
30532 size_t index_found = 0;
30533 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
30534 if (cmp != 1) {
30535 if (cmp == 0) {
30536 PyErr_Format(PyExc_TypeError,
30537 "%s() got an unexpected keyword argument '%U'",
30538 function_name, key);
30539 }
30540 #if CYTHON_AVOID_BORROWED_REFS
30541 Py_DECREF(key);
30542 #endif
30543 break;
30544 }
30545 }
30546 #if CYTHON_AVOID_BORROWED_REFS
30547 Py_DECREF(key);
30548 #endif
30549 }
30550 __Pyx_END_CRITICAL_SECTION();
30551 #if CYTHON_AVOID_BORROWED_REFS
30552 Py_XDECREF(pos);
30553 #endif
30554 assert(PyErr_Occurred());
30555}
30556static int __Pyx_ParseKeywordDict(
30557 PyObject *kwds,
30558 PyObject ** const argnames[],
30559 PyObject *values[],
30560 Py_ssize_t num_pos_args,
30561 Py_ssize_t num_kwargs,
30562 const char* function_name,
30563 int ignore_unknown_kwargs)
30564{
30565 PyObject** const *name;
30566 PyObject** const *first_kw_arg = argnames + num_pos_args;
30567 Py_ssize_t extracted = 0;
30568#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
30569 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
30570#endif
30571 name = first_kw_arg;
30572 while (*name && num_kwargs > extracted) {
30573 PyObject * key = **name;
30574 PyObject *value;
30575 int found = 0;
30576 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
30577 found = PyDict_GetItemRef(kwds, key, &value);
30578 #else
30579 value = PyDict_GetItemWithError(kwds, key);
30580 if (value) {
30581 Py_INCREF(value);
30582 found = 1;
30583 } else {
30584 if (unlikely(PyErr_Occurred())) goto bad;
30585 }
30586 #endif
30587 if (found) {
30588 if (unlikely(found < 0)) goto bad;
30589 values[name-argnames] = value;
30590 extracted++;
30591 }
30592 name++;
30593 }
30594 if (num_kwargs > extracted) {
30595 if (ignore_unknown_kwargs) {
30596 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
30597 goto bad;
30598 } else {
30599 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
30600 goto bad;
30601 }
30602 }
30603 return 0;
30604bad:
30605 return -1;
30606}
30607static int __Pyx_ParseKeywordDictToDict(
30608 PyObject *kwds,
30609 PyObject ** const argnames[],
30610 PyObject *kwds2,
30611 PyObject *values[],
30612 Py_ssize_t num_pos_args,
30613 const char* function_name)
30614{
30615 PyObject** const *name;
30616 PyObject** const *first_kw_arg = argnames + num_pos_args;
30617 Py_ssize_t len;
30618#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
30619 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
30620#endif
30621 if (PyDict_Update(kwds2, kwds) < 0) goto bad;
30622 name = first_kw_arg;
30623 while (*name) {
30624 PyObject *key = **name;
30625 PyObject *value;
30626#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
30627 int found = PyDict_Pop(kwds2, key, &value);
30628 if (found) {
30629 if (unlikely(found < 0)) goto bad;
30630 values[name-argnames] = value;
30631 }
30632#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
30633 int found = PyDict_GetItemRef(kwds2, key, &value);
30634 if (found) {
30635 if (unlikely(found < 0)) goto bad;
30636 values[name-argnames] = value;
30637 if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
30638 }
30639#else
30640 #if CYTHON_COMPILING_IN_CPYTHON
30641 value = _PyDict_Pop(kwds2, key, kwds2);
30642 #else
30643 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
30644 #endif
30645 if (value == kwds2) {
30646 Py_DECREF(value);
30647 } else {
30648 if (unlikely(!value)) goto bad;
30649 values[name-argnames] = value;
30650 }
30651#endif
30652 name++;
30653 }
30654 len = PyDict_Size(kwds2);
30655 if (len > 0) {
30656 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
30657 } else if (unlikely(len == -1)) {
30658 goto bad;
30659 }
30660 return 0;
30661bad:
30662 return -1;
30663}
30664static int __Pyx_ParseKeywordsTuple(
30665 PyObject *kwds,
30666 PyObject * const *kwvalues,
30667 PyObject ** const argnames[],
30668 PyObject *kwds2,
30669 PyObject *values[],
30670 Py_ssize_t num_pos_args,
30671 Py_ssize_t num_kwargs,
30672 const char* function_name,
30673 int ignore_unknown_kwargs)
30674{
30675 PyObject *key = NULL;
30676 PyObject** const * name;
30677 PyObject** const *first_kw_arg = argnames + num_pos_args;
30678 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
30679#if CYTHON_AVOID_BORROWED_REFS
30680 key = __Pyx_PySequence_ITEM(kwds, pos);
30681#else
30682 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
30683#endif
30684#if !CYTHON_ASSUME_SAFE_MACROS
30685 if (unlikely(!key)) goto bad;
30686#endif
30687 name = first_kw_arg;
30688 while (*name && (**name != key)) name++;
30689 if (*name) {
30690 PyObject *value = kwvalues[pos];
30691 values[name-argnames] = __Pyx_NewRef(value);
30692 } else {
30693 size_t index_found = 0;
30694 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
30695 if (cmp == 1) {
30696 PyObject *value = kwvalues[pos];
30697 values[index_found] = __Pyx_NewRef(value);
30698 } else {
30699 if (unlikely(cmp == -1)) goto bad;
30700 if (kwds2) {
30701 PyObject *value = kwvalues[pos];
30702 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
30703 } else if (!ignore_unknown_kwargs) {
30704 goto invalid_keyword;
30705 }
30706 }
30707 }
30708 #if CYTHON_AVOID_BORROWED_REFS
30709 Py_DECREF(key);
30710 key = NULL;
30711 #endif
30712 }
30713 return 0;
30714invalid_keyword:
30715 PyErr_Format(PyExc_TypeError,
30716 "%s() got an unexpected keyword argument '%U'",
30717 function_name, key);
30718 goto bad;
30719bad:
30720 #if CYTHON_AVOID_BORROWED_REFS
30721 Py_XDECREF(key);
30722 #endif
30723 return -1;
30724}
30725
30726/* ParseKeywords */
30727static int __Pyx_ParseKeywords(
30728 PyObject *kwds,
30729 PyObject * const *kwvalues,
30730 PyObject ** const argnames[],
30731 PyObject *kwds2,
30732 PyObject *values[],
30733 Py_ssize_t num_pos_args,
30734 Py_ssize_t num_kwargs,
30735 const char* function_name,
30736 int ignore_unknown_kwargs)
30737{
30738 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
30739 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
30740 else if (kwds2)
30741 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
30742 else
30743 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
30744}
30745
30746/* RaiseArgTupleInvalid */
30747static void __Pyx_RaiseArgtupleInvalid(
30748 const char* func_name,
30749 int exact,
30750 Py_ssize_t num_min,
30751 Py_ssize_t num_max,
30752 Py_ssize_t num_found)
30753{
30754 Py_ssize_t num_expected;
30755 const char *more_or_less;
30756 if (num_found < num_min) {
30757 num_expected = num_min;
30758 more_or_less = "at least";
30759 } else {
30760 num_expected = num_max;
30761 more_or_less = "at most";
30762 }
30763 if (exact) {
30764 more_or_less = "exactly";
30765 }
30766 PyErr_Format(PyExc_TypeError,
30767 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
30768 func_name, more_or_less, num_expected,
30769 (num_expected == 1) ? "" : "s", num_found);
30770}
30771
30772/* ArgTypeTestError (used by ArgTypeTest) */
30773static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact)
30774{
30775 __Pyx_TypeName type_name;
30776 __Pyx_TypeName obj_type_name;
30777 PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
30778 int from_annotation_subclass = 0;
30779 if (unlikely(!type)) {
30780 PyErr_SetString(PyExc_SystemError, "Missing type object");
30781 return;
30782 } else if (exact == 2) {
30783 if (__Pyx_TypeCheck(obj, type)) {
30784 from_annotation_subclass = 1;
30785 extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
30786 }
30787 }
30788 type_name = __Pyx_PyType_GetFullyQualifiedName(type);
30789 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30790 if (unlikely(!type_name)) return;
30791 #endif
30792 obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
30793 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30794 if (unlikely(!obj_type_name)) goto obj_type_name_failed;
30795 #endif
30796 PyErr_Format(PyExc_TypeError,
30797 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")"
30798#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
30799 "%s%U"
30800#endif
30801 , name, type_name, obj_type_name
30802#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
30803 , (from_annotation_subclass ? ". " : ""), extra_info
30804#endif
30805 );
30806#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
30807 if (exact == 2 && from_annotation_subclass) {
30808 PyObject *res;
30809 PyObject *vargs[2];
30810 vargs[0] = PyErr_GetRaisedException();
30811 vargs[1] = extra_info;
30812 res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
30813 Py_XDECREF(res);
30814 PyErr_SetRaisedException(vargs[0]);
30815 }
30816#endif
30817 __Pyx_DECREF_TypeName(obj_type_name);
30818#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30819obj_type_name_failed:
30820#endif
30821 __Pyx_DECREF_TypeName(type_name);
30822 return;
30823}
30824
30825/* ArgTypeTest */
30826static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) {
30827 if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
30828 return 1;
30829 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
30830 return 1;
30831 __Pyx_ArgTypeError(obj, type, name, exact);
30832 return 0;
30833}
30834
30835/* PyObjectFastCallMethod */
30836#if !CYTHON_VECTORCALL
30837static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
30838 PyObject *result;
30839 switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
30840 case 1:
30841 return PyObject_CallMethodObjArgs(args[0], name, NULL);
30842 case 2:
30843 return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
30844 case 3:
30845 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
30846 case 4:
30847 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
30848 case 5:
30849 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
30850 }
30851 PyObject *attr = PyObject_GetAttr(args[0], name);
30852 if (unlikely(!attr))
30853 return NULL;
30854 result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
30855 Py_DECREF(attr);
30856 return result;
30857}
30858#endif
30859
30860/* FormatTypeName (used by RaiseErrorWithObjectType1) */
30861#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30862static __Pyx_TypeName
30863__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
30864{
30865 PyObject *module = NULL, *name = NULL, *result = NULL;
30866 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
30867 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
30868 __pyx_mstate_global->__pyx_n_u_qualname);
30869 #else
30870 name = PyType_GetQualName(tp);
30871 #endif
30872 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
30873 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
30874 __pyx_mstate_global->__pyx_n_u_module);
30875 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
30876 if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
30877 result = name;
30878 name = NULL;
30879 goto done;
30880 }
30881 result = PyUnicode_FromFormat("%U.%U", module, name);
30882 if (unlikely(result == NULL)) goto bad;
30883 done:
30884 Py_XDECREF(name);
30885 Py_XDECREF(module);
30886 return result;
30887 bad:
30888 PyErr_Clear();
30889 if (name) {
30890 result = name;
30891 name = NULL;
30892 } else {
30893 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
30894 }
30895 goto done;
30896}
30897#endif
30898
30899/* RaiseErrorWithObjectType1 (used by RaiseUnexpectedTypeError) */
30900static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj) {
30901 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
30902 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30903 if (unlikely(!type_name)) return;
30904 #endif
30905 PyErr_Format(exc_type, message, arg, type_name);
30906 __Pyx_DECREF_TypeName(type_name);
30907}
30908
30909/* RaiseUnexpectedTypeError */
30910static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) {
30911 __Pyx_RaiseTypeErrorWithObjectType1(
30912 "Expected %.42s, got " __Pyx_FMT_TYPENAME,
30913 expected, obj);
30914 return 0;
30915}
30916
30917/* RaiseException */
30918static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
30919 PyObject* owned_instance = NULL;
30920 if (tb == Py_None) {
30921 tb = 0;
30922 } else if (tb && !PyTraceBack_Check(tb)) {
30923 PyErr_SetString(PyExc_TypeError,
30924 "raise: arg 3 must be a traceback or None");
30925 goto bad;
30926 }
30927 if (value == Py_None)
30928 value = 0;
30929 if (PyExceptionInstance_Check(type)) {
30930 if (value) {
30931 PyErr_SetString(PyExc_TypeError,
30932 "instance exception may not have a separate value");
30933 goto bad;
30934 }
30935 value = type;
30936 type = (PyObject*) Py_TYPE(value);
30937 } else if (PyExceptionClass_Check(type)) {
30938 PyObject *instance_class = NULL;
30939 if (value && PyExceptionInstance_Check(value)) {
30940 instance_class = (PyObject*) Py_TYPE(value);
30941 if (instance_class != type) {
30942 int is_subclass = PyObject_IsSubclass(instance_class, type);
30943 if (!is_subclass) {
30944 instance_class = NULL;
30945 } else if (unlikely(is_subclass == -1)) {
30946 goto bad;
30947 } else {
30948 type = instance_class;
30949 }
30950 }
30951 }
30952 if (!instance_class) {
30953 PyObject *args;
30954 if (!value)
30955 args = PyTuple_New(0);
30956 else if (PyTuple_Check(value)) {
30957 Py_INCREF(value);
30958 args = value;
30959 } else
30960 args = PyTuple_Pack(1, value);
30961 if (!args)
30962 goto bad;
30963 owned_instance = PyObject_Call(type, args, NULL);
30964 Py_DECREF(args);
30965 if (!owned_instance)
30966 goto bad;
30967 value = owned_instance;
30968 if (!PyExceptionInstance_Check(value)) {
30969 PyErr_Format(PyExc_TypeError,
30970 "calling %R should have returned an instance of "
30971 "BaseException, not %R",
30972 type, Py_TYPE(value));
30973 goto bad;
30974 }
30975 }
30976 } else {
30977 PyErr_SetString(PyExc_TypeError,
30978 "raise: exception class must be a subclass of BaseException");
30979 goto bad;
30980 }
30981 if (cause) {
30982 PyObject *fixed_cause;
30983 if (cause == Py_None) {
30984 fixed_cause = NULL;
30985 } else if (PyExceptionClass_Check(cause)) {
30986 fixed_cause = PyObject_CallObject(cause, NULL);
30987 if (fixed_cause == NULL)
30988 goto bad;
30989 } else if (PyExceptionInstance_Check(cause)) {
30990 fixed_cause = cause;
30991 Py_INCREF(fixed_cause);
30992 } else {
30993 PyErr_SetString(PyExc_TypeError,
30994 "exception causes must derive from "
30995 "BaseException");
30996 goto bad;
30997 }
30998 PyException_SetCause(value, fixed_cause);
30999 }
31000 PyErr_SetObject(type, value);
31001 if (tb) {
31002#if PY_VERSION_HEX >= 0x030C00A6
31003 PyException_SetTraceback(value, tb);
31004#elif CYTHON_FAST_THREAD_STATE
31005 PyThreadState *tstate = __Pyx_PyThreadState_Current;
31006 PyObject* tmp_tb = tstate->curexc_traceback;
31007 if (tb != tmp_tb) {
31008 Py_INCREF(tb);
31009 tstate->curexc_traceback = tb;
31010 Py_XDECREF(tmp_tb);
31011 }
31012#else
31013 PyObject *tmp_type, *tmp_value, *tmp_tb;
31014 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
31015 Py_INCREF(tb);
31016 PyErr_Restore(tmp_type, tmp_value, tb);
31017 Py_XDECREF(tmp_tb);
31018#endif
31019 }
31020bad:
31021 Py_XDECREF(owned_instance);
31022 return;
31023}
31024
31025/* CIntToDigits (used by CIntToPyUnicode) */
31026static const char DIGIT_PAIRS_10[2*10*10+1] = {
31027 "00010203040506070809"
31028 "10111213141516171819"
31029 "20212223242526272829"
31030 "30313233343536373839"
31031 "40414243444546474849"
31032 "50515253545556575859"
31033 "60616263646566676869"
31034 "70717273747576777879"
31035 "80818283848586878889"
31036 "90919293949596979899"
31037};
31038static const char DIGIT_PAIRS_8[2*8*8+1] = {
31039 "0001020304050607"
31040 "1011121314151617"
31041 "2021222324252627"
31042 "3031323334353637"
31043 "4041424344454647"
31044 "5051525354555657"
31045 "6061626364656667"
31046 "7071727374757677"
31047};
31048static const char DIGITS_HEX[2*16+1] = {
31049 "0123456789abcdef"
31050 "0123456789ABCDEF"
31051};
31052
31053/* BuildPyUnicode (used by COrdinalToPyUnicode) */
31054static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
31055 int prepend_sign, char padding_char) {
31056 PyObject *uval;
31057 Py_ssize_t uoffset = ulength - clength;
31058#if CYTHON_USE_UNICODE_INTERNALS
31059 Py_ssize_t i;
31060 void *udata;
31061 uval = PyUnicode_New(ulength, 127);
31062 if (unlikely(!uval)) return NULL;
31063 udata = PyUnicode_DATA(uval);
31064 if (uoffset > 0) {
31065 i = 0;
31066 if (prepend_sign) {
31067 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
31068 i++;
31069 }
31070 for (; i < uoffset; i++) {
31071 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
31072 }
31073 }
31074 for (i=0; i < clength; i++) {
31075 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
31076 }
31077#else
31078 {
31079 PyObject *sign = NULL, *padding = NULL;
31080 uval = NULL;
31081 if (uoffset > 0) {
31082 prepend_sign = !!prepend_sign;
31083 if (uoffset > prepend_sign) {
31084 padding = PyUnicode_FromOrdinal(padding_char);
31085 if (likely(padding) && uoffset > prepend_sign + 1) {
31086 PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
31087 Py_DECREF(padding);
31088 padding = tmp;
31089 }
31090 if (unlikely(!padding)) goto done_or_error;
31091 }
31092 if (prepend_sign) {
31093 sign = PyUnicode_FromOrdinal('-');
31094 if (unlikely(!sign)) goto done_or_error;
31095 }
31096 }
31097 uval = PyUnicode_DecodeASCII(chars, clength, NULL);
31098 if (likely(uval) && padding) {
31099 PyObject *tmp = PyUnicode_Concat(padding, uval);
31100 Py_DECREF(uval);
31101 uval = tmp;
31102 }
31103 if (likely(uval) && sign) {
31104 PyObject *tmp = PyUnicode_Concat(sign, uval);
31105 Py_DECREF(uval);
31106 uval = tmp;
31107 }
31108done_or_error:
31109 Py_XDECREF(padding);
31110 Py_XDECREF(sign);
31111 }
31112#endif
31113 return uval;
31114}
31115
31116/* COrdinalToPyUnicode (used by CIntToPyUnicode) */
31117static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
31118 return value <= 1114111;
31119}
31120static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
31121 Py_ssize_t padding_length = ulength - 1;
31122 if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
31123 char chars[256];
31124 if (value <= 255) {
31125 memset(chars, padding_char, (size_t) padding_length);
31126 chars[ulength-1] = (char) value;
31127 return PyUnicode_DecodeLatin1(chars, ulength, NULL);
31128 }
31129 char *cpos = chars + sizeof(chars);
31130 if (value < 0x800) {
31131 *--cpos = (char) (0x80 | (value & 0x3f));
31132 value >>= 6;
31133 *--cpos = (char) (0xc0 | (value & 0x1f));
31134 } else if (value < 0x10000) {
31135 *--cpos = (char) (0x80 | (value & 0x3f));
31136 value >>= 6;
31137 *--cpos = (char) (0x80 | (value & 0x3f));
31138 value >>= 6;
31139 *--cpos = (char) (0xe0 | (value & 0x0f));
31140 } else {
31141 *--cpos = (char) (0x80 | (value & 0x3f));
31142 value >>= 6;
31143 *--cpos = (char) (0x80 | (value & 0x3f));
31144 value >>= 6;
31145 *--cpos = (char) (0x80 | (value & 0x3f));
31146 value >>= 6;
31147 *--cpos = (char) (0xf0 | (value & 0x07));
31148 }
31149 cpos -= padding_length;
31150 memset(cpos, padding_char, (size_t) padding_length);
31151 return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
31152 }
31153 if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
31154 const char chars[1] = {(char) value};
31155 return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
31156 }
31157 {
31158 PyObject *uchar, *padding_uchar, *padding, *result;
31159 padding_uchar = PyUnicode_FromOrdinal(padding_char);
31160 if (unlikely(!padding_uchar)) return NULL;
31161 padding = PySequence_Repeat(padding_uchar, padding_length);
31162 Py_DECREF(padding_uchar);
31163 if (unlikely(!padding)) return NULL;
31164 uchar = PyUnicode_FromOrdinal(value);
31165 if (unlikely(!uchar)) {
31166 Py_DECREF(padding);
31167 return NULL;
31168 }
31169 result = PyUnicode_Concat(padding, uchar);
31170 Py_DECREF(padding);
31171 Py_DECREF(uchar);
31172 return result;
31173 }
31174}
31175
31176/* CIntToPyUnicode */
31177static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char) {
31178#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31179#pragma GCC diagnostic push
31180#pragma GCC diagnostic ignored "-Wconversion"
31181#endif
31182 const int neg_one = (int) -1, const_zero = (int) 0;
31183#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31184#pragma GCC diagnostic pop
31185#endif
31186 const int is_unsigned = neg_one > const_zero;
31187 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
31188 !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
31189 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
31190 return NULL;
31191 }
31192 if (width <= 1) {
31193 return PyUnicode_FromOrdinal((int) value);
31194 }
31195 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
31196}
31197static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
31198 char digits[sizeof(int)*3+2];
31199 char *dpos, *end = digits + sizeof(int)*3+2;
31200 const char *hex_digits = DIGITS_HEX;
31201 Py_ssize_t length, ulength;
31202 int prepend_sign, last_one_off;
31203 int remaining;
31204#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31205#pragma GCC diagnostic push
31206#pragma GCC diagnostic ignored "-Wconversion"
31207#endif
31208 const int neg_one = (int) -1, const_zero = (int) 0;
31209#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31210#pragma GCC diagnostic pop
31211#endif
31212 const int is_unsigned = neg_one > const_zero;
31213 if (format_char == 'X') {
31214 hex_digits += 16;
31215 format_char = 'x';
31216 }
31217 remaining = value;
31218 last_one_off = 0;
31219 dpos = end;
31220 do {
31221 int digit_pos;
31222 switch (format_char) {
31223 case 'o':
31224 digit_pos = abs((int)(remaining % (8*8)));
31225 remaining = (int) (remaining / (8*8));
31226 dpos -= 2;
31227 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
31228 last_one_off = (digit_pos < 8);
31229 break;
31230 case 'd':
31231 digit_pos = abs((int)(remaining % (10*10)));
31232 remaining = (int) (remaining / (10*10));
31233 dpos -= 2;
31234 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
31235 last_one_off = (digit_pos < 10);
31236 break;
31237 case 'x':
31238 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
31239 remaining = (int) (remaining / 16);
31240 break;
31241 default:
31242 assert(0);
31243 break;
31244 }
31245 } while (unlikely(remaining != 0));
31246 assert(!last_one_off || *dpos == '0');
31247 dpos += last_one_off;
31248 length = end - dpos;
31249 ulength = length;
31250 prepend_sign = 0;
31251 if (!is_unsigned && value <= neg_one) {
31252 if (padding_char == ' ' || width <= length + 1) {
31253 *(--dpos) = '-';
31254 ++length;
31255 } else {
31256 prepend_sign = 1;
31257 }
31258 ++ulength;
31259 }
31260 if (width > ulength) {
31261 ulength = width;
31262 }
31263 if (ulength == 1) {
31264 return PyUnicode_FromOrdinal(*dpos);
31265 }
31266 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
31267}
31268
31269/* CIntToPyUnicode */
31270static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char) {
31271#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31272#pragma GCC diagnostic push
31273#pragma GCC diagnostic ignored "-Wconversion"
31274#endif
31275 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
31276#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31277#pragma GCC diagnostic pop
31278#endif
31279 const int is_unsigned = neg_one > const_zero;
31280 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
31281 !(sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
31282 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
31283 return NULL;
31284 }
31285 if (width <= 1) {
31286 return PyUnicode_FromOrdinal((int) value);
31287 }
31288 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
31289}
31290static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
31291 char digits[sizeof(Py_ssize_t)*3+2];
31292 char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
31293 const char *hex_digits = DIGITS_HEX;
31294 Py_ssize_t length, ulength;
31295 int prepend_sign, last_one_off;
31296 Py_ssize_t remaining;
31297#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31298#pragma GCC diagnostic push
31299#pragma GCC diagnostic ignored "-Wconversion"
31300#endif
31301 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
31302#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31303#pragma GCC diagnostic pop
31304#endif
31305 const int is_unsigned = neg_one > const_zero;
31306 if (format_char == 'X') {
31307 hex_digits += 16;
31308 format_char = 'x';
31309 }
31310 remaining = value;
31311 last_one_off = 0;
31312 dpos = end;
31313 do {
31314 int digit_pos;
31315 switch (format_char) {
31316 case 'o':
31317 digit_pos = abs((int)(remaining % (8*8)));
31318 remaining = (Py_ssize_t) (remaining / (8*8));
31319 dpos -= 2;
31320 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
31321 last_one_off = (digit_pos < 8);
31322 break;
31323 case 'd':
31324 digit_pos = abs((int)(remaining % (10*10)));
31325 remaining = (Py_ssize_t) (remaining / (10*10));
31326 dpos -= 2;
31327 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
31328 last_one_off = (digit_pos < 10);
31329 break;
31330 case 'x':
31331 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
31332 remaining = (Py_ssize_t) (remaining / 16);
31333 break;
31334 default:
31335 assert(0);
31336 break;
31337 }
31338 } while (unlikely(remaining != 0));
31339 assert(!last_one_off || *dpos == '0');
31340 dpos += last_one_off;
31341 length = end - dpos;
31342 ulength = length;
31343 prepend_sign = 0;
31344 if (!is_unsigned && value <= neg_one) {
31345 if (padding_char == ' ' || width <= length + 1) {
31346 *(--dpos) = '-';
31347 ++length;
31348 } else {
31349 prepend_sign = 1;
31350 }
31351 ++ulength;
31352 }
31353 if (width > ulength) {
31354 ulength = width;
31355 }
31356 if (ulength == 1) {
31357 return PyUnicode_FromOrdinal(*dpos);
31358 }
31359 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
31360}
31361
31362/* JoinPyUnicode */
31363static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind) {
31364#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH && CYTHON_USE_UNICODE_INTERNALS
31365 PyObject *result_uval;
31366 int result_ukind, kind_shift;
31367 Py_ssize_t i, char_pos;
31368 void *result_udata;
31369 static const Py_UCS4 max_char[5] = {0x7fU, 0xffU, 0xffffU, 0xffffU, 0x10ffffU};
31370 assert (kind >= 0);
31371 if (kind > PyUnicode_4BYTE_KIND) kind = PyUnicode_4BYTE_KIND;
31372 result_uval = PyUnicode_New(result_ulength, max_char[kind]);
31373 if (unlikely(!result_uval)) return NULL;
31374 kind_shift = kind >> 1; // 0, 1, 2
31375 result_ukind = 1 << kind_shift; // 1, 2, 4
31376 result_udata = PyUnicode_DATA(result_uval);
31377 assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
31378 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
31379 goto overflow;
31380 char_pos = 0;
31381 for (i=0; i < value_count; i++) {
31382 int ukind;
31383 Py_ssize_t ulength;
31384 void *udata;
31385 PyObject *uval = values[i];
31386 if (__Pyx_PyUnicode_READY(uval) == (-1))
31387 goto bad;
31388 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
31389 #if !CYTHON_ASSUME_SAFE_SIZE
31390 if (unlikely(ulength < 0)) goto bad;
31391 #endif
31392 if (unlikely(!ulength))
31393 continue;
31394 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
31395 goto overflow;
31396 ukind = __Pyx_PyUnicode_KIND(uval);
31397 udata = __Pyx_PyUnicode_DATA(uval);
31398 if (ukind == result_ukind) {
31399 memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
31400 } else {
31401 #if PY_VERSION_HEX >= 0x030d0000
31402 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
31403 #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
31404 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
31405 #else
31406 Py_ssize_t j;
31407 for (j=0; j < ulength; j++) {
31408 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
31409 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
31410 }
31411 #endif
31412 }
31413 char_pos += ulength;
31414 }
31415 return result_uval;
31416overflow:
31417 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
31418bad:
31419 Py_DECREF(result_uval);
31420 return NULL;
31421#else
31422 Py_ssize_t i;
31423 PyObject *result = NULL;
31424 PyObject *value_tuple = PyTuple_New(value_count);
31425 if (unlikely(!value_tuple)) return NULL;
31426 CYTHON_UNUSED_VAR(kind);
31427 CYTHON_UNUSED_VAR(result_ulength);
31428 for (i=0; i<value_count; i++) {
31429 Py_INCREF(values[i]);
31430 if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
31431 }
31432 result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
31433bad:
31434 Py_DECREF(value_tuple);
31435 return result;
31436#endif
31437}
31438
31439/* UnicodeEqualsUCS4 (used by UnicodeEquals_uchar) */
31440#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL)
31441static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals) {
31442 Py_ssize_t length;
31443 Py_UCS4 ch1;
31444 int kind;
31445 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0)) goto bad;
31446 length = __Pyx_PyUnicode_GET_LENGTH(s1);
31447 #if !CYTHON_ASSUME_SAFE_SIZE
31448 if (unlikely(length < 0)) goto bad;
31449 #endif
31450 if (length != 1) goto return_ne;
31451 kind = PyUnicode_KIND(s1);
31452 if (ch2 < 256) {
31453 if (likely(kind == PyUnicode_1BYTE_KIND)) {
31454 ch1 = PyUnicode_1BYTE_DATA(s1)[0];
31455 } else if (kind == PyUnicode_2BYTE_KIND) {
31456 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
31457 } else {
31458 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
31459 }
31460 } else if (ch2 < 65536) {
31461 if (kind == PyUnicode_2BYTE_KIND) {
31462 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
31463 } else if (kind == PyUnicode_4BYTE_KIND) {
31464 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
31465 } else {
31466 goto return_ne;
31467 }
31468 } else {
31469 if (kind == PyUnicode_4BYTE_KIND){
31470 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
31471 } else {
31472 goto return_ne;
31473 }
31474 }
31475 if (ch1 == ch2) {
31476 goto return_eq;
31477 } else {
31478 goto return_ne;
31479 }
31480return_eq:
31481 return (equals == Py_EQ);
31482return_ne:
31483 return (equals == Py_NE);
31484bad:
31485 return -1;
31486}
31487#endif
31488
31489/* PyObjectCompare */
31490#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
31491#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
31492static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
31493 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
31494 int result = PyUnicode_Equal(s1, s2);
31495 #if !CYTHON_COMPILING_IN_CPYTHON
31496 if (unlikely(result == -1)) return -1;
31497 #endif
31498 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
31499 #else
31500 int result = PyUnicode_Compare(s1, s2);
31501 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
31502 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
31503 #endif
31504__pyx_return_true:
31505 return 1;
31506__pyx_return_false:
31507 return 0;
31508}
31509#endif
31510static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop) {
31511 CYTHON_UNUSED_VAR(pyop);
31512 if (unlikely(op2 == Py_None)) {
31513 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
31514 }
31515 if (PyFloat_CheckExact(op1)) {
31516 goto __pyx_richcmp;
31517 }
31518 if (PyLong_CheckExact(op1)) {
31519 if (op1 == op2) goto __pyx_return_true;
31520 goto __pyx_richcmp;
31521 }
31522
31523 if (likely(PyUnicode_CheckExact(op1))) {
31524 if (op1 == op2) goto __pyx_return_true;
31525 if (likely(op2 != Py_None)) {
31526 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
31527 }
31528 goto __pyx_richcmp;
31529 }
31530
31531 if ((0)) goto __pyx_richcmp;
31532 if ((0)) goto __pyx_return_true;
31533 if ((0)) goto __pyx_return_false;
31534__pyx_richcmp:
31535 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
31536__pyx_return_true:
31537 return 1;
31538__pyx_return_false:
31539 return 0;
31540}
31541
31542/* PyObjectCompare */
31543#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
31544#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
31545#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
31546static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyBytesPyBytesEq(PyObject* s1, PyObject* s2) {
31547 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
31548 const char *ps1, *ps2;
31549 Py_ssize_t length = PyBytes_GET_SIZE(s1);
31550 if (length != PyBytes_GET_SIZE(s2)) goto __pyx_return_false;
31551 ps1 = PyBytes_AS_STRING(s1);
31552 ps2 = PyBytes_AS_STRING(s2);
31553 #else
31554 char *ps1, *ps2;
31555 Py_ssize_t length, length2;
31556 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length) == -1)) return NULL;
31557 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return NULL;
31558 if (length != length2) goto __pyx_return_false;
31559 #endif
31560 if (ps1[0] != ps2[0]) goto __pyx_return_false;
31561 if (length == 1) goto __pyx_return_true;
31562 {
31563 int cmp;
31564#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
31565 Py_hash_t hash1 = ((PyBytesObject*)s1)->ob_shash;
31566 Py_hash_t hash2 = ((PyBytesObject*)s2)->ob_shash;
31567 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) goto __pyx_return_false;
31568#endif
31569 cmp = memcmp(ps1, ps2, (size_t)length);
31570 if (cmp == 0) goto __pyx_return_true; else goto __pyx_return_false;
31571 }
31572__pyx_return_true:
31573 Py_RETURN_TRUE;
31574__pyx_return_false:
31575 Py_RETURN_FALSE;
31576}
31577#endif
31578#endif
31579#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
31580#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
31581#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
31582static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyByteArrayPyBytesEq(PyObject* s1, PyObject* s2) {
31583 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
31584 const char *ps1, *ps2;
31585 Py_ssize_t length = PyByteArray_GET_SIZE(s1);
31586 if (length != PyBytes_GET_SIZE(s2)) goto __pyx_return_false;
31587 ps1 = PyByteArray_AS_STRING(s1);
31588 ps2 = PyBytes_AS_STRING(s2);
31589 #else
31590 char *ps1, *ps2;
31591 Py_ssize_t length, length2;
31592 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return NULL;
31593 length = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length == -1)) return NULL;
31594 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return NULL;
31595 if (length != length2) goto __pyx_return_false;
31596 #endif
31597 if (length == 0) goto __pyx_return_true;
31598 if (ps1[0] != ps2[0]) goto __pyx_return_false;
31599 if (length == 1) goto __pyx_return_true;
31600 {
31601 int cmp;
31602 cmp = memcmp(ps1, ps2, (size_t)length);
31603 if (cmp == 0) goto __pyx_return_true; else goto __pyx_return_false;
31604 }
31605__pyx_return_true:
31606 Py_RETURN_TRUE;
31607__pyx_return_false:
31608 Py_RETURN_FALSE;
31609}
31610#endif
31611#endif
31612static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2, int pyop) {
31613 CYTHON_UNUSED_VAR(pyop);
31614 if (unlikely(op2 == Py_None)) {
31615 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
31616 }
31617 if (PyFloat_CheckExact(op1)) {
31618 goto __pyx_richcmp;
31619 }
31620 if (PyLong_CheckExact(op1)) {
31621 if (op1 == op2) goto __pyx_return_true;
31622 goto __pyx_richcmp;
31623 }
31624 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
31625 if (likely(PyBytes_CheckExact(op1))) {
31626 if (op1 == op2) goto __pyx_return_true;
31627 if (likely(op2 != Py_None)) {
31628 return __Pyx_PyObject_ComparePyBytesPyBytesEq(op1, op2);
31629 }
31630 goto __pyx_richcmp;
31631 }
31632 #endif
31633 if ((0)) goto __pyx_richcmp;
31634 if ((0)) goto __pyx_return_true;
31635 if ((0)) goto __pyx_return_false;
31636__pyx_richcmp:
31637 return PyObject_RichCompare(op1, op2, Py_EQ);
31638__pyx_return_true:
31639 Py_RETURN_TRUE;
31640__pyx_return_false:
31641 Py_RETURN_FALSE;
31642}
31643
31644/* GetAttr */
31645static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
31646#if CYTHON_USE_TYPE_SLOTS
31647 if (likely(PyUnicode_Check(n)))
31648 return __Pyx_PyObject_GetAttrStr(o, n);
31649#endif
31650 return PyObject_GetAttr(o, n);
31651}
31652
31653/* PyFrozenDict (used by GetItemInt) */
31654#if CYTHON_COMPILING_IN_LIMITED_API
31655static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
31656 return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
31657}
31658#endif
31659
31660/* GettItemInt_wraparound (used by GetItemInt) */
31661#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31662static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
31663 assert(*i < 0);
31664 if (likely(sm->sq_length)) {
31665 Py_ssize_t l = sm->sq_length(o);
31666 if (likely(l >= 0)) {
31667 *i += l;
31668 } else {
31669 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
31670 return -1;
31671 PyErr_Clear();
31672 }
31673 }
31674 return 0;
31675}
31676#endif
31677
31678/* GetItemInt */
31679static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
31680 PyObject *r;
31681 if (unlikely(!j)) return NULL;
31682 r = PyObject_GetItem(o, j);
31683 Py_DECREF(j);
31684 return r;
31685}
31686static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
31687 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
31688}
31689static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
31690 int wraparound, int boundscheck, int unsafe_shared) {
31691 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
31692#if CYTHON_AVOID_BORROWED_REFS
31693 CYTHON_UNUSED_VAR(boundscheck);
31694 Py_ssize_t wrapped_i = i;
31695 if (wraparound & unlikely(i < 0)) {
31696 Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
31697 #if !CYTHON_ASSUME_SAFE_SIZE
31698 if (unlikely(size < 0)) return NULL;
31699 #endif
31700 wrapped_i += size;
31701 }
31702 return __Pyx_PyList_GetItemRef(o, wrapped_i);
31703#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
31704 Py_ssize_t wrapped_i = i;
31705 Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
31706 if (wraparound & unlikely(i < 0)) {
31707 wrapped_i += size;
31708 }
31709 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
31710 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
31711 }
31712 return __Pyx_GetItemInt_Generic_size(o, i);
31713#else
31714 (void)wraparound;
31715 (void)boundscheck;
31716 return PySequence_GetItem(o, i);
31717#endif
31718}
31719static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
31720 int wraparound, int boundscheck, int unsafe_shared) {
31721 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
31722#if CYTHON_AVOID_BORROWED_REFS
31723 CYTHON_UNUSED_VAR(boundscheck);
31724 Py_ssize_t wrapped_i = i;
31725 if (wraparound & unlikely(i < 0)) {
31726 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
31727 #if !CYTHON_ASSUME_SAFE_SIZE
31728 if (unlikely(size < 0)) return NULL;
31729 #endif
31730 wrapped_i += size;
31731 }
31732 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
31733 return PySequence_ITEM(o, wrapped_i);
31734 #else
31735 if (unlikely(wrapped_i < 0)) {
31736 PyErr_SetString(PyExc_IndexError, "tuple index out of range");
31737 return NULL;
31738 }
31739 return PySequence_GetItem(o, wrapped_i);
31740 #endif
31741#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
31742 Py_ssize_t wrapped_i = i;
31743 Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
31744 if (wraparound & unlikely(i < 0)) {
31745 wrapped_i += size;
31746 }
31747 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
31748 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
31749 }
31750 return __Pyx_GetItemInt_Generic_size(o, i);
31751#else
31752 (void)wraparound;
31753 (void)boundscheck;
31754 return PySequence_GetItem(o, i);
31755#endif
31756}
31757#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31758static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
31759 PyObject *r, *key = PyLong_FromSsize_t(i);
31760 if (unlikely(!key)) return NULL;
31761 r = getitem(o, key);
31762 Py_DECREF(key);
31763 return r;
31764}
31765#endif
31766static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
31767 int wraparound, int boundscheck, int unsafe_shared) {
31768 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
31769#if CYTHON_ASSUME_SAFE_SIZE
31770 if (PyList_CheckExact(o)) {
31771 return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
31772 } else
31773 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31774 if (PyTuple_CheckExact(o)) {
31775 return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
31776 } else
31777 #endif
31778#else
31779 if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
31780 return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
31781 } else
31782#endif
31783#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31784 if (PyDict_CheckExact(o)) {
31785 return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
31786 #if defined(PyFrozenDict_CheckExact)
31787 } else if (PyFrozenDict_CheckExact(o)) {
31788 return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
31789 #endif
31790 } else
31791 {
31792 PyTypeObject *obj_type = Py_TYPE(o);
31793 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
31794 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
31795 PyMappingMethods *mm = obj_type->tp_as_mapping;
31796 if (mm && mm->mp_subscript)
31797 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
31798 }
31799 PySequenceMethods *sm = obj_type->tp_as_sequence;
31800 if (likely(sm && sm->sq_item)) {
31801 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
31802 return NULL;
31803 return sm->sq_item(o, i);
31804 }
31805 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
31806 PyMappingMethods *mm = obj_type->tp_as_mapping;
31807 if (likely(mm && mm->mp_subscript))
31808 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
31809 }
31810 }
31811#else
31812 if (!PyMapping_Check(o)) {
31813 return PySequence_GetItem(o, i);
31814 }
31815#endif
31816 (void)wraparound;
31817 (void)boundscheck;
31818 return __Pyx_GetItemInt_Generic_size(o, i);
31819}
31820
31821/* RaiseErrorWithObjectType (used by ObjectGetItem) */
31822static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj) {
31823 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
31824 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31825 if (unlikely(!type_name)) return;
31826 #endif
31827 PyErr_Format(exc_type, message, type_name);
31828 __Pyx_DECREF_TypeName(type_name);
31829}
31830
31831/* ObjectGetItem */
31832#if CYTHON_USE_TYPE_SLOTS
31833static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
31834 PyObject *runerr = NULL;
31835 Py_ssize_t key_value;
31836 key_value = __Pyx_PyIndex_AsSsize_t(index);
31837 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
31838 return __Pyx_GetItemInt_Fast(obj, key_value, 1, 1, 1);
31839 }
31840 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
31841 PyErr_Clear();
31842 __Pyx_RaiseErrorWithObjectType(
31843 PyExc_IndexError,
31844 "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer",
31845 index);
31846 }
31847 return NULL;
31848}
31849static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
31850 if (likely(PyType_Check(obj))) {
31851 if ((PyTypeObject*)obj == &PyType_Type) {
31852 return Py_GenericAlias(obj, key);
31853 }
31854 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
31855 if (!meth) {
31856 if (PyErr_Occurred()) {
31857 return NULL;
31858 }
31859 } else {
31860 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
31861 Py_DECREF(meth);
31862 return result;
31863 }
31864 }
31865 __Pyx_RaiseTypeErrorWithObjectType(
31866 "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj);
31867 return NULL;
31868}
31869static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
31870 PyTypeObject *tp = Py_TYPE(obj);
31871 PyMappingMethods *mm = tp->tp_as_mapping;
31872 PySequenceMethods *sm = tp->tp_as_sequence;
31873 if (likely(mm && mm->mp_subscript)) {
31874 return mm->mp_subscript(obj, key);
31875 }
31876 if (likely(sm && sm->sq_item)) {
31877 return __Pyx_PyObject_GetIndex(obj, key);
31878 }
31879 return __Pyx_PyObject_GetItem_Slow(obj, key);
31880}
31881#endif
31882
31883/* RejectKeywords */
31884static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
31885 PyObject *key = NULL;
31886 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds))) {
31887 key = __Pyx_PySequence_ITEM(kwds, 0);
31888 } else {
31889#if CYTHON_AVOID_BORROWED_REFS
31890 PyObject *pos = NULL;
31891#else
31892 Py_ssize_t pos = 0;
31893#endif
31894#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
31895 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
31896#endif
31897 __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
31898#if CYTHON_AVOID_BORROWED_REFS
31899 Py_XDECREF(pos);
31900#endif
31901 }
31902 if (likely(key)) {
31903 PyErr_Format(PyExc_TypeError,
31904 "%s() got an unexpected keyword argument '%U'",
31905 function_name, key);
31906 Py_DECREF(key);
31907 }
31908}
31909
31910/* DivInt[Py_ssize_t] */
31911static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
31912 Py_ssize_t q = a / b;
31913 Py_ssize_t r = a - q*b;
31914 Py_ssize_t adapt_python = (b_is_constant ?
31915 ((r != 0) & ((r < 0) ^ (b < 0))) :
31916 ((r != 0) & ((r ^ b) < 0))
31917 );
31918 return q - adapt_python;
31919}
31920
31921/* GetAttr3 */
31922#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
31923static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
31924 __Pyx_PyThreadState_declare
31925 __Pyx_PyThreadState_assign
31926 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
31927 return NULL;
31928 __Pyx_PyErr_Clear();
31929 Py_INCREF(d);
31930 return d;
31931}
31932#endif
31933static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
31934 PyObject *r;
31935#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
31936 int res = PyObject_GetOptionalAttr(o, n, &r);
31937 return (res != 0) ? r : __Pyx_NewRef(d);
31938#else
31939 #if CYTHON_USE_TYPE_SLOTS
31940 if (likely(PyUnicode_Check(n))) {
31941 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
31942 if (unlikely(!r) && likely(!PyErr_Occurred())) {
31943 r = __Pyx_NewRef(d);
31944 }
31945 return r;
31946 }
31947 #endif
31948 r = PyObject_GetAttr(o, n);
31949 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
31950#endif
31951}
31952
31953/* PyDictVersioning (used by GetModuleGlobalName) */
31954#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
31955static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
31956 PyObject *dict = Py_TYPE(obj)->tp_dict;
31957 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
31958}
31959static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
31960 PyObject **dictptr = NULL;
31961 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
31962 if (offset) {
31963#if CYTHON_COMPILING_IN_CPYTHON
31964 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
31965#else
31966 dictptr = _PyObject_GetDictPtr(obj);
31967#endif
31968 }
31969 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
31970}
31971static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
31972 PyObject *dict = Py_TYPE(obj)->tp_dict;
31973 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
31974 return 0;
31975 return obj_dict_version == __Pyx_get_object_dict_version(obj);
31976}
31977#endif
31978
31979/* GetModuleGlobalName */
31980#if CYTHON_USE_DICT_VERSIONS
31981static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
31982#else
31983static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
31984#endif
31985{
31986 PyObject *result;
31987#if CYTHON_COMPILING_IN_LIMITED_API
31988 if (unlikely(!__pyx_m)) {
31989 if (!PyErr_Occurred())
31990 PyErr_SetNone(PyExc_NameError);
31991 return NULL;
31992 }
31993 result = PyObject_GetAttr(__pyx_m, name);
31994 if (likely(result)) {
31995 return result;
31996 }
31997 if (!__Pyx_IgnoreException(PyExc_Exception)) {
31998 return NULL; // BaseException
31999 }
32000#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
32001 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
32002 if (!__Pyx_IgnoreException(PyExc_Exception)) {
32003 return NULL; // BaseException
32004 }
32005 }
32006 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
32007 if (likely(result)) {
32008 return result;
32009 }
32010#else
32011 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
32012 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
32013 if (likely(result)) {
32014 return __Pyx_NewRef(result);
32015 }
32016 PyObject *exc = PyErr_Occurred();
32017 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
32018 return NULL; // BaseException
32019 }
32020#endif
32021 return __Pyx_GetBuiltinName(name);
32022}
32023
32024/* RaiseTooManyValuesToUnpack */
32025static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
32026 PyErr_Format(PyExc_ValueError,
32027 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
32028}
32029
32030/* RaiseNeedMoreValuesToUnpack */
32031static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
32032 PyErr_Format(PyExc_ValueError,
32033 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
32034 index, (index == 1) ? "" : "s");
32035}
32036
32037/* RaiseNoneIterError */
32038static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
32039 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
32040}
32041
32042/* GetTopmostException (used by SaveResetException) */
32043#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
32044static _PyErr_StackItem *
32045__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
32046{
32047 _PyErr_StackItem *exc_info = tstate->exc_info;
32048 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
32049 exc_info->previous_item != NULL)
32050 {
32051 exc_info = exc_info->previous_item;
32052 }
32053 return exc_info;
32054}
32055#endif
32056
32057/* SaveResetException */
32058#if CYTHON_FAST_THREAD_STATE
32059static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
32060 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
32061 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
32062 PyObject *exc_value = exc_info->exc_value;
32063 if (exc_value == NULL || exc_value == Py_None) {
32064 *value = NULL;
32065 *type = NULL;
32066 *tb = NULL;
32067 } else {
32068 *value = exc_value;
32069 Py_INCREF(*value);
32070 *type = (PyObject*) Py_TYPE(exc_value);
32071 Py_INCREF(*type);
32072 *tb = PyException_GetTraceback(exc_value);
32073 }
32074 #elif CYTHON_USE_EXC_INFO_STACK
32075 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
32076 *type = exc_info->exc_type;
32077 *value = exc_info->exc_value;
32078 *tb = exc_info->exc_traceback;
32079 Py_XINCREF(*type);
32080 Py_XINCREF(*value);
32081 Py_XINCREF(*tb);
32082 #else
32083 *type = tstate->exc_type;
32084 *value = tstate->exc_value;
32085 *tb = tstate->exc_traceback;
32086 Py_XINCREF(*type);
32087 Py_XINCREF(*value);
32088 Py_XINCREF(*tb);
32089 #endif
32090}
32091static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
32092 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
32093 _PyErr_StackItem *exc_info = tstate->exc_info;
32094 PyObject *tmp_value = exc_info->exc_value;
32095 exc_info->exc_value = value;
32096 Py_XDECREF(tmp_value);
32097 Py_XDECREF(type);
32098 Py_XDECREF(tb);
32099 #else
32100 PyObject *tmp_type, *tmp_value, *tmp_tb;
32101 #if CYTHON_USE_EXC_INFO_STACK
32102 _PyErr_StackItem *exc_info = tstate->exc_info;
32103 tmp_type = exc_info->exc_type;
32104 tmp_value = exc_info->exc_value;
32105 tmp_tb = exc_info->exc_traceback;
32106 exc_info->exc_type = type;
32107 exc_info->exc_value = value;
32108 exc_info->exc_traceback = tb;
32109 #else
32110 tmp_type = tstate->exc_type;
32111 tmp_value = tstate->exc_value;
32112 tmp_tb = tstate->exc_traceback;
32113 tstate->exc_type = type;
32114 tstate->exc_value = value;
32115 tstate->exc_traceback = tb;
32116 #endif
32117 Py_XDECREF(tmp_type);
32118 Py_XDECREF(tmp_value);
32119 Py_XDECREF(tmp_tb);
32120 #endif
32121}
32122#endif
32123
32124/* RaiseErrorWithObjectTypes (used by ExtTypeTest) */
32125static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
32126 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
32127 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
32128 if (unlikely(!type_name1)) return;
32129 #endif
32130 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
32131 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
32132 if (unlikely(!type_name2)) goto type2_failed;
32133 #endif
32134 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
32135 __Pyx_DECREF_TypeName(type_name2);
32136#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
32137type2_failed:
32138#endif
32139 __Pyx_DECREF_TypeName(type_name1);
32140}
32141
32142/* ExtTypeTest */
32143static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
32144 if (unlikely(!type)) {
32145 PyErr_SetString(PyExc_SystemError, "Missing type object");
32146 return 0;
32147 }
32148 if (likely(__Pyx_TypeCheck(obj, type)))
32149 return 1;
32150 __Pyx_RaiseTypeErrorWithTypes(
32151 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
32152 Py_TYPE(obj), type);
32153 return 0;
32154}
32155
32156/* GetException */
32157#if CYTHON_FAST_THREAD_STATE
32158static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
32159#else
32160static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
32161#endif
32162{
32163 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
32164#if CYTHON_FAST_THREAD_STATE
32165 PyObject *tmp_type, *tmp_value, *tmp_tb;
32166 #if PY_VERSION_HEX >= 0x030C0000
32167 local_value = tstate->current_exception;
32168 tstate->current_exception = 0;
32169 #else
32170 local_type = tstate->curexc_type;
32171 local_value = tstate->curexc_value;
32172 local_tb = tstate->curexc_traceback;
32173 tstate->curexc_type = 0;
32174 tstate->curexc_value = 0;
32175 tstate->curexc_traceback = 0;
32176 #endif
32177#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
32178 local_value = PyErr_GetRaisedException();
32179#else
32180 PyErr_Fetch(&local_type, &local_value, &local_tb);
32181#endif
32182#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
32183 if (likely(local_value)) {
32184 local_type = (PyObject*) Py_TYPE(local_value);
32185 Py_INCREF(local_type);
32186 local_tb = PyException_GetTraceback(local_value);
32187 }
32188#else
32189 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
32190#if CYTHON_FAST_THREAD_STATE
32191 if (unlikely(tstate->curexc_type))
32192#else
32193 if (unlikely(PyErr_Occurred()))
32194#endif
32195 goto bad;
32196 if (local_tb) {
32197 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
32198 goto bad;
32199 }
32200#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000
32201 Py_XINCREF(local_tb);
32202 Py_XINCREF(local_type);
32203 Py_XINCREF(local_value);
32204 *type = local_type;
32205 *value = local_value;
32206 *tb = local_tb;
32207#if CYTHON_FAST_THREAD_STATE
32208 #if CYTHON_USE_EXC_INFO_STACK
32209 {
32210 _PyErr_StackItem *exc_info = tstate->exc_info;
32211 #if PY_VERSION_HEX >= 0x030B00a4
32212 tmp_value = exc_info->exc_value;
32213 exc_info->exc_value = local_value;
32214 tmp_type = NULL;
32215 tmp_tb = NULL;
32216 Py_XDECREF(local_type);
32217 Py_XDECREF(local_tb);
32218 #else
32219 tmp_type = exc_info->exc_type;
32220 tmp_value = exc_info->exc_value;
32221 tmp_tb = exc_info->exc_traceback;
32222 exc_info->exc_type = local_type;
32223 exc_info->exc_value = local_value;
32224 exc_info->exc_traceback = local_tb;
32225 #endif
32226 }
32227 #else
32228 tmp_type = tstate->exc_type;
32229 tmp_value = tstate->exc_value;
32230 tmp_tb = tstate->exc_traceback;
32231 tstate->exc_type = local_type;
32232 tstate->exc_value = local_value;
32233 tstate->exc_traceback = local_tb;
32234 #endif
32235 Py_XDECREF(tmp_type);
32236 Py_XDECREF(tmp_value);
32237 Py_XDECREF(tmp_tb);
32238#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
32239 PyErr_SetHandledException(local_value);
32240 Py_XDECREF(local_value);
32241 Py_XDECREF(local_type);
32242 Py_XDECREF(local_tb);
32243#else
32244 PyErr_SetExcInfo(local_type, local_value, local_tb);
32245#endif
32246 return 0;
32247#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
32248bad:
32249 *type = 0;
32250 *value = 0;
32251 *tb = 0;
32252 Py_XDECREF(local_type);
32253 Py_XDECREF(local_value);
32254 Py_XDECREF(local_tb);
32255 return -1;
32256#endif
32257}
32258
32259/* SwapException */
32260#if CYTHON_FAST_THREAD_STATE
32261static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
32262 PyObject *tmp_type, *tmp_value, *tmp_tb;
32263 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
32264 _PyErr_StackItem *exc_info = tstate->exc_info;
32265 tmp_value = exc_info->exc_value;
32266 exc_info->exc_value = *value;
32267 if (tmp_value == NULL || tmp_value == Py_None) {
32268 Py_XDECREF(tmp_value);
32269 tmp_value = NULL;
32270 tmp_type = NULL;
32271 tmp_tb = NULL;
32272 } else {
32273 tmp_type = (PyObject*) Py_TYPE(tmp_value);
32274 Py_INCREF(tmp_type);
32275 #if CYTHON_COMPILING_IN_CPYTHON
32276 tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
32277 Py_XINCREF(tmp_tb);
32278 #else
32279 tmp_tb = PyException_GetTraceback(tmp_value);
32280 #endif
32281 }
32282 #elif CYTHON_USE_EXC_INFO_STACK
32283 _PyErr_StackItem *exc_info = tstate->exc_info;
32284 tmp_type = exc_info->exc_type;
32285 tmp_value = exc_info->exc_value;
32286 tmp_tb = exc_info->exc_traceback;
32287 exc_info->exc_type = *type;
32288 exc_info->exc_value = *value;
32289 exc_info->exc_traceback = *tb;
32290 #else
32291 tmp_type = tstate->exc_type;
32292 tmp_value = tstate->exc_value;
32293 tmp_tb = tstate->exc_traceback;
32294 tstate->exc_type = *type;
32295 tstate->exc_value = *value;
32296 tstate->exc_traceback = *tb;
32297 #endif
32298 *type = tmp_type;
32299 *value = tmp_value;
32300 *tb = tmp_tb;
32301}
32302#else
32303static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
32304 PyObject *tmp_type, *tmp_value, *tmp_tb;
32305 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
32306 PyErr_SetExcInfo(*type, *value, *tb);
32307 *type = tmp_type;
32308 *value = tmp_value;
32309 *tb = tmp_tb;
32310}
32311#endif
32312
32313/* HasAttr (used by ImportImpl) */
32314#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
32315static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
32316 PyObject *r;
32317 if (unlikely(!PyUnicode_Check(n))) {
32318 PyErr_SetString(PyExc_TypeError,
32319 "hasattr(): attribute name must be string");
32320 return -1;
32321 }
32322 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
32323 if (!r) {
32324 return (unlikely(PyErr_Occurred())) ? -1 : 0;
32325 } else {
32326 Py_DECREF(r);
32327 return 1;
32328 }
32329}
32330#endif
32331
32332/* TupleOrListFromArrayImpl (used by ListFromArray) */
32333CYTHON_UNUSED static PyObject *
32334__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) {
32335 PyObject *res = PyList_New(n);
32336 if (unlikely(res == NULL)) return NULL;
32337 #if CYTHON_COMPILING_IN_CPYTHON
32338 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
32339 #else
32340 Py_ssize_t i;
32341 for (i = 0; i < n; i++) {
32342 Py_INCREF(src[i]);
32343 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
32344 Py_DECREF(res);
32345 return NULL;
32346 }
32347 }
32348 #endif
32349 return res;
32350}
32351
32352/* ImportImpl (used by Import) */
32353static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
32354 PyObject *imported_module = PyImport_GetModule(qualname);
32355 if (unlikely(!imported_module)) {
32356 *module = NULL;
32357 if (PyErr_Occurred()) {
32358 return -1;
32359 }
32360 return 0;
32361 }
32362 *module = imported_module;
32363 return 1;
32364}
32365static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
32366 PyObject *imported_module;
32367 PyObject *top_level_package_name;
32368 Py_ssize_t i;
32369 int status, module_found;
32370 Py_ssize_t dot_index;
32371 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
32372 if (unlikely(!module_found || module_found == -1)) {
32373 *module = NULL;
32374 return module_found;
32375 }
32376 if (imported_names) {
32377 for (i = 0; i < len_imported_names; i++) {
32378 PyObject *imported_name = imported_names[i];
32379#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
32380 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
32381#else
32382 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
32383 if (unlikely(has_imported_attribute == -1)) goto error;
32384#endif
32385 if (!has_imported_attribute) {
32386 goto not_found;
32387 }
32388 }
32389 *module = imported_module;
32390 return 1;
32391 }
32392 dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
32393 if (dot_index == -1) {
32394 *module = imported_module;
32395 return 1;
32396 }
32397 if (unlikely(dot_index == -2)) goto error;
32398 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
32399 if (unlikely(!top_level_package_name)) goto error;
32400 Py_DECREF(imported_module);
32401 status = __Pyx__Import_GetModule(top_level_package_name, module);
32402 Py_DECREF(top_level_package_name);
32403 return status;
32404error:
32405 Py_DECREF(imported_module);
32406 *module = NULL;
32407 return -1;
32408not_found:
32409 Py_DECREF(imported_module);
32410 *module = NULL;
32411 return 0;
32412}
32413static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
32414 PyObject *module = 0;
32415 PyObject *empty_dict = 0;
32416 PyObject *from_list = 0;
32417 int module_found;
32418 if (!qualname) {
32419 qualname = name;
32420 }
32421 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
32422 if (likely(module_found == 1)) {
32423 return module;
32424 } else if (unlikely(module_found == -1)) {
32425 return NULL;
32426 }
32427 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
32428 empty_dict = PyFrozenDict_New(NULL);
32429 #else
32430 empty_dict = PyDict_New();
32431 #endif
32432 if (unlikely(!empty_dict))
32433 goto bad;
32434 if (imported_names) {
32435 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
32436 if (unlikely(!from_list))
32437 goto bad;
32438 }
32439 if (level == -1) {
32440 const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
32441 if (package_sep != (0)) {
32442 module = PyImport_ImportModuleLevelObject(
32443 name, moddict, empty_dict, from_list, 1);
32444 if (unlikely(!module)) {
32445 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
32446 goto bad;
32447 PyErr_Clear();
32448 }
32449 }
32450 level = 0;
32451 }
32452 if (!module) {
32453 module = PyImport_ImportModuleLevelObject(
32454 name, moddict, empty_dict, from_list, level);
32455 }
32456bad:
32457 Py_XDECREF(from_list);
32458 Py_XDECREF(empty_dict);
32459 return module;
32460}
32461
32462/* Import */
32463static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
32464 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
32465}
32466
32467/* ListAppendAndDecrefInternal (used by ListCompAppendAndDecref) */
32468#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
32469static CYTHON_INLINE void __Pyx__ListComp_AppendAndDecref(PyObject* list, Py_ssize_t len, PyObject* x) {
32470 PyList_SET_ITEM(list, len, x);
32471 Py_SET_SIZE(list, len + 1);
32472}
32473#endif
32474
32475/* ListCompAppendAndDecref */
32476#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
32477static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
32478 PyListObject* L = (PyListObject*) list;
32479 Py_ssize_t len = Py_SIZE(list);
32480 if (likely(L->allocated > len)) {
32481 __Pyx__ListComp_AppendAndDecref(list, len, x);
32482 return 0;
32483 }
32484 int result = PyList_Append(list, x);
32485 Py_DECREF(x);
32486 return result;
32487}
32488#else
32489static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
32490 int result = PyList_Append(list, x);
32491 Py_DECREF(x);
32492 return result;
32493}
32494#endif
32495
32496/* PySequenceMultiply */
32497#if CYTHON_USE_TYPE_SLOTS
32498static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
32499 PyObject *result, *pymul = PyLong_FromSsize_t(mul);
32500 if (unlikely(!pymul))
32501 return NULL;
32502 result = PyNumber_Multiply(seq, pymul);
32503 Py_DECREF(pymul);
32504 return result;
32505}
32506static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
32507 PyTypeObject *type = Py_TYPE(seq);
32508 if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
32509 return type->tp_as_sequence->sq_repeat(seq, mul);
32510 } else {
32511 return __Pyx_PySequence_Multiply_Generic(seq, mul);
32512 }
32513}
32514#endif
32515
32516/* PyNumberBinop */
32517#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
32518#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32519#ifndef __Pyx_DEFINED_BinopTypeError
32520#define __Pyx_DEFINED_BinopTypeError
32521static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
32522 char opname[4] = {op[0], op[1], 0, 0};
32523 if (inplace) {
32524 opname[op[1] ? 2 : 1] = '=';
32525 }
32526 __Pyx_RaiseErrorWithObjectTypes1(
32527 PyExc_TypeError,
32528 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
32529 opname, op1, op2);
32530}
32531#endif
32532#endif
32533#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
32534#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
32535static PyObject* __Pyx_PyNumber_Multiply_xfloat_int(PyObject *op1, PyObject *op2, int inplace) {
32536 if (likely(op2 != Py_None)) {
32537 double int_op2;
32538 #if CYTHON_USE_PYLONG_INTERNALS
32539 if (__Pyx_PyLong_IsCompact(op2)) {
32540 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
32541 int_op2 = (double) compact_op2;
32542 } else
32543 #endif
32544 {
32545 int_op2 = PyLong_AsDouble(op2);
32546 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
32547 }
32548 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32549 #if !CYTHON_ASSUME_SAFE_MACROS
32550 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
32551 #endif
32552 if (float_op1 == 0.) return __Pyx_NewRef(op1);
32553 return PyFloat_FromDouble(float_op1 * int_op2);
32554 }
32555 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32556 {
32557 PyTypeObject *type_op2 = Py_TYPE(op2);
32558 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
32559 if (likely(slot_func)) {
32560 PyObject *result = slot_func(op1, op2);
32561 if (likely(result != Py_NotImplemented)) {
32562 return result;
32563 }
32564 Py_DECREF(result);
32565 }
32566 __Pyx_BinopTypeError(op1, op2, "*", inplace);
32567 return NULL;
32568 }
32569 #else
32570 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
32571 #endif
32572}
32573#endif
32574#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_int
32575#define __Pyx_DEFINED_PyNumber_Multiply_xint_int
32576static PyObject* __Pyx_PyNumber_Multiply_xint_int(PyObject *op1, PyObject *op2, int inplace) {
32577 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32578 {
32579 PyTypeObject *type_op2 = Py_TYPE(op2);
32580 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
32581 if (likely(slot_func)) {
32582 PyObject *result = slot_func(op1, op2);
32583 if (likely(result != Py_NotImplemented)) {
32584 return result;
32585 }
32586 Py_DECREF(result);
32587 }
32588 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
32589 if (likely(repeat_func)) {
32590 Py_ssize_t count;
32591 #if CYTHON_USE_PYLONG_INTERNALS
32592 if (__Pyx_PyLong_IsCompact(op1)) {
32593 count = __Pyx_PyLong_CompactValue(op1);
32594 } else
32595 #endif
32596 {
32597 count = PyLong_AsSsize_t(op1);
32598 if (unlikely((count == -1) && PyErr_Occurred())) return NULL;
32599 }
32600 return repeat_func(op2, count);
32601 }
32602 __Pyx_BinopTypeError(op1, op2, "*", inplace);
32603 return NULL;
32604 }
32605 #else
32606 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
32607 #endif
32608}
32609#endif
32610static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2, int inplace) {
32611 if (PyFloat_CheckExact(op1)) {
32612 return __Pyx_PyNumber_Multiply_xfloat_int(op1, op2, inplace);
32613 }
32614 if (likely(PyLong_CheckExact(op1))) {
32615 if (likely(op2 != Py_None)) {
32616 #if CYTHON_USE_PYLONG_INTERNALS
32617 if (__Pyx_PyLong_IsCompact(op1)) {
32618 long long int_op1 = (long long) __Pyx_PyLong_CompactValue(op1);
32619 if (int_op1 == 0) return __Pyx_NewRef(op1);
32620 if (__Pyx_PyLong_IsCompact(op2)) {
32621 long long int_op2 = (long long) __Pyx_PyLong_CompactValue(op2);
32622 if (int_op2 == 0) return __Pyx_NewRef(op2);
32623 return PyLong_FromLongLong(int_op1 * int_op2);
32624 }
32625 }
32626 else if (__Pyx_PyLong_IsZero(op2)) return __Pyx_NewRef(op2);
32627 #endif
32628 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_multiply, binaryfunc);
32629 if (likely(slot_func)) {
32630 return slot_func(op1, op2);
32631 }
32632 }
32633 return __Pyx_PyNumber_Multiply_xint_int(op1, op2, inplace);
32634 }
32635 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
32636}
32637#endif
32638
32639/* PyObjectFormatAndDecref */
32640static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
32641 if (unlikely(!s)) return NULL;
32642 if (likely(PyUnicode_CheckExact(s))) return s;
32643 return __Pyx_PyObject_FormatAndDecref(s, f);
32644}
32645static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
32646 PyObject *result;
32647 if (unlikely(!s)) return NULL;
32648 result = PyObject_Format(s, f);
32649 Py_DECREF(s);
32650 return result;
32651}
32652
32653/* PyObjectFormat */
32654#if CYTHON_USE_UNICODE_WRITER
32655static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
32656 int ret;
32657 _PyUnicodeWriter writer;
32658 if (likely(PyFloat_CheckExact(obj))) {
32659 _PyUnicodeWriter_Init(&writer);
32660 ret = _PyFloat_FormatAdvancedWriter(
32661 &writer,
32662 obj,
32663 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
32664 } else if (likely(PyLong_CheckExact(obj))) {
32665 _PyUnicodeWriter_Init(&writer);
32666 ret = _PyLong_FormatAdvancedWriter(
32667 &writer,
32668 obj,
32669 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
32670 } else {
32671 return PyObject_Format(obj, format_spec);
32672 }
32673 if (unlikely(ret == -1)) {
32674 _PyUnicodeWriter_Dealloc(&writer);
32675 return NULL;
32676 }
32677 return _PyUnicodeWriter_Finish(&writer);
32678}
32679#endif
32680
32681/* SetItemInt */
32682static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
32683 int r;
32684 if (unlikely(!j)) return -1;
32685 r = PyObject_SetItem(o, j, v);
32686 Py_DECREF(j);
32687 return r;
32688}
32689#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
32690static CYTHON_INLINE int __Pyx_SetItemInt_Fast_mapping(PyObject *o, objobjargproc setitem, Py_ssize_t i, PyObject *value) {
32691 PyObject *key = PyLong_FromSsize_t(i);
32692 if (unlikely(!key)) return -1;
32693 int r = setitem(o, key, value);
32694 Py_DECREF(key);
32695 return r;
32696}
32697#endif
32698static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
32699 int wraparound, int boundscheck, int unsafe_shared) {
32700 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
32701#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
32702 if (PyList_CheckExact(o)) {
32703 Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
32704 if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
32705 Py_INCREF(v);
32706 return PyList_SetItem(o, n, v);
32707 } else if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
32708 PyObject* old;
32709 Py_INCREF(v);
32710 old = PyList_GET_ITEM(o, n);
32711 PyList_SET_ITEM(o, n, v);
32712 Py_DECREF(old);
32713 return 0;
32714 }
32715 } else
32716#endif
32717#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
32718 if (PyDict_CheckExact(o)) {
32719 return __Pyx_SetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_ass_subscript, i, v);
32720 } else
32721 {
32722 PyTypeObject *obj_type = Py_TYPE(o);
32723 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
32724 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
32725 PyMappingMethods *mm = obj_type->tp_as_mapping;
32726 if (mm && mm->mp_ass_subscript)
32727 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i, v);
32728 }
32729 PySequenceMethods *sm = obj_type->tp_as_sequence;
32730 if (likely(sm && sm->sq_ass_item)) {
32731 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
32732 return -1;
32733 return sm->sq_ass_item(o, i, v);
32734 }
32735 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
32736 PyMappingMethods *mm = obj_type->tp_as_mapping;
32737 if (likely(mm && mm->mp_ass_subscript))
32738 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i, v);
32739 }
32740 }
32741#else
32742 if (!PyMapping_Check(o)) {
32743 return PySequence_SetItem(o, i, v);
32744 }
32745#endif
32746 (void)wraparound;
32747 (void)boundscheck;
32748 return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i), v);
32749}
32750
32751/* RaiseUnboundLocalError */
32752static void __Pyx_RaiseUnboundLocalError(const char *varname) {
32753 PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
32754}
32755
32756/* DivInt[long] */
32757static CYTHON_INLINE long __Pyx_div_long(long a, long b, int b_is_constant) {
32758 long q = a / b;
32759 long r = a - q*b;
32760 long adapt_python = (b_is_constant ?
32761 ((r != 0) & ((r < 0) ^ (b < 0))) :
32762 ((r != 0) & ((r ^ b) < 0))
32763 );
32764 return q - adapt_python;
32765}
32766
32767/* PyObjectSetAttrStr */
32768#if CYTHON_USE_TYPE_SLOTS
32769static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
32770 PyTypeObject* tp = Py_TYPE(obj);
32771 if (likely(tp->tp_setattro))
32772 return tp->tp_setattro(obj, attr_name, value);
32773 return PyObject_SetAttr(obj, attr_name, value);
32774}
32775#endif
32776
32777/* BufferIndexError */
32778static void __Pyx_RaiseBufferIndexError(int axis) {
32779 PyErr_Format(PyExc_IndexError,
32780 "Out of bounds on buffer access (axis %d)", axis);
32781}
32782
32783/* AllocateExtensionType */
32784static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
32785 if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
32786 allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
32787 return alloc_func(t, 0);
32788 } else {
32789 newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
32790 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
32791 if (!tp_new) {
32792 PyObject *new_str = PyUnicode_FromString("__new__");
32793 if (likely(new_str)) {
32794 PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
32795 Py_DECREF(new_str);
32796 return o;
32797 } else
32798 return NULL;
32799 } else
32800 #endif
32801 return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
32802 }
32803}
32804
32805/* CallSlotAsVectorcallUnpackDict (used by CallSlotAsVectorcall) */
32806static CYTHON_INLINE int __Pyx_CallSlotAsVectorcallUnpackDict(Py_ssize_t args_size, PyObject *keys_dict, PyObject **args, PyObject *kwnames) {
32807 Py_ssize_t pos = 0, i = 0;
32808 PyObject *key, *value;
32809 while (PyDict_Next(keys_dict, &pos, &key, &value)) {
32810 Py_INCREF(value);
32811 args[args_size+i] = value;
32812 Py_INCREF(key);
32813 if (unlikely(__Pyx_PyTuple_SET_ITEM(kwnames, i, key) == -1)) {
32814 return -1;
32815 }
32816 ++i;
32817 }
32818 return 0;
32819}
32820
32821/* CallSlotAsVectorcall */
32822#if CYTHON_VECTORCALL_TPNEW
32823static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k) {
32824 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
32825#if !CYTHON_ASSUME_SAFE_SIZE
32826 if (unlikely(k_size < 0)) return NULL;
32827#endif
32828 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
32829#if !CYTHON_ASSUME_SAFE_SIZE
32830 if (unlikely(a_size < 0)) return NULL;
32831#endif
32832#if CYTHON_ASSUME_SAFE_MACROS
32833 if (k_size == 0) {
32834 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
32835 }
32836#else
32837 if (k_size == 0 && a_size == 0) {
32838 return f(o, NULL, 0, NULL);
32839 }
32840#endif
32841 PyObject *stack_args[5];
32842 PyObject **args = stack_args;
32843 Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
32844 if (a_size > maxnargs - k_size) {
32845 PyErr_NoMemory();
32846 return NULL;
32847 }
32848 Py_ssize_t total_size = a_size + k_size;
32849 if (total_size > 5) {
32850 args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
32851 if (unlikely(!args)) {
32852 PyErr_NoMemory();
32853 return NULL;
32854 }
32855 }
32856 PyObject * result = NULL;
32857 PyObject *kwnames = NULL;
32858 int unpack_dict_result;
32859 Py_ssize_t i = 0;
32860 for (; i < a_size; ++i) {
32861 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
32862#if !CYTHON_ASSUME_SAFE_MACROS
32863 if (unlikely(!args[i])) goto cleanup;
32864#endif
32865 }
32866#if !CYTHON_ASSUME_SAFE_MACROS
32867 if (k) // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
32868#endif
32869 {
32870 kwnames = PyTuple_New(k_size);
32871 if (unlikely(!kwnames)) goto cleanup;
32872 __Pyx_BEGIN_CRITICAL_SECTION(k);
32873 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
32874 __Pyx_END_CRITICAL_SECTION();
32875 if (unlikely(unpack_dict_result == -1)) goto cleanup;
32876 }
32877 result = f(o, args, a_size, kwnames);
32878 cleanup:
32879 Py_XDECREF(kwnames);
32880 for (i=a_size; i<total_size; ++i) {
32881 Py_XDECREF(args[i]);
32882 }
32883 if (args != stack_args) {
32884 PyMem_Free(args);
32885 }
32886 return result;
32887}
32888#endif
32889
32890/* CallNewInitFromVectorcall */
32891#if CYTHON_VECTORCALL_TPNEW
32892static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
32893 newfunc tp_new = __Pyx_PyType_GetSlot(t, tp_new, newfunc);
32894 if (unlikely(!tp_new)) {
32895 __Pyx_RaiseErrorWithType(PyExc_TypeError, "cannot create " __Pyx_FMT_TYPENAME " instances", t);
32896 return NULL;
32897 }
32898 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
32899 PyObject *result = NULL, *args_tuple = NULL, *kwds_dict = NULL;
32900 Py_ssize_t kw_size = kwnames ? __Pyx_PyTuple_GET_SIZE(kwnames) : 0;
32901#if !CYTHON_ASSUME_SAFE_SIZE
32902 if (unlikely(kw_size == -1)) {
32903 return NULL;
32904 }
32905#endif
32906 if (kw_size) {
32907 kwds_dict = __Pyx_PyDict_NewPresized(kw_size);
32908 if (unlikely(!kwds_dict)) {
32909 return NULL;
32910 }
32911 for (Py_ssize_t i=0; i<kw_size; ++i) {
32912 PyObject *v = args[nargs + i];
32913 PyObject *k = __Pyx_PyTuple_GET_ITEM(kwnames, i);
32914#if !CYTHON_ASSUME_SAFE_MACROS
32915 if (unlikely(!k)) {
32916 goto end;
32917 }
32918#endif
32919 if (unlikely(PyDict_SetItem(kwds_dict, k, v) < 0)) {
32920 goto end;
32921 }
32922 }
32923 }
32924 if (nargs) {
32925 args_tuple = __Pyx_PyTuple_FromArray(args, nargs);
32926 if (unlikely(!args_tuple)) {
32927 goto end;
32928 }
32929 } else {
32930 args_tuple = __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
32931 }
32932 result = tp_new(t, args_tuple, kwds_dict);
32933 if (unlikely(!result)) {
32934 goto end;
32935 }
32936 if (PyObject_TypeCheck(result, t)) {
32937 initproc tp_init = __Pyx_PyObject_GetSlot(result, tp_init, initproc);
32938 if (tp_init && unlikely(tp_init(result, args_tuple, kwds_dict) < 0)) {
32939 Py_CLEAR(result);
32940 }
32941 }
32942 end:
32943 Py_XDECREF(args_tuple);
32944 Py_XDECREF(kwds_dict);
32945 return result;
32946}
32947#endif
32948
32949/* CallSlotAsVectorcall */
32950#if CYTHON_VECTORCALL_TPNEW
32951static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k) {
32952 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
32953#if !CYTHON_ASSUME_SAFE_SIZE
32954 if (unlikely(k_size < 0)) return -1;
32955#endif
32956 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
32957#if !CYTHON_ASSUME_SAFE_SIZE
32958 if (unlikely(a_size < 0)) return -1;
32959#endif
32960#if CYTHON_ASSUME_SAFE_MACROS
32961 if (k_size == 0) {
32962 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
32963 }
32964#else
32965 if (k_size == 0 && a_size == 0) {
32966 return f(o, NULL, 0, NULL);
32967 }
32968#endif
32969 PyObject *stack_args[5];
32970 PyObject **args = stack_args;
32971 Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
32972 if (a_size > maxnargs - k_size) {
32973 PyErr_NoMemory();
32974 return -1;
32975 }
32976 Py_ssize_t total_size = a_size + k_size;
32977 if (total_size > 5) {
32978 args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
32979 if (unlikely(!args)) {
32980 PyErr_NoMemory();
32981 return -1;
32982 }
32983 }
32984 int result = -1;
32985 PyObject *kwnames = NULL;
32986 int unpack_dict_result;
32987 Py_ssize_t i = 0;
32988 for (; i < a_size; ++i) {
32989 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
32990#if !CYTHON_ASSUME_SAFE_MACROS
32991 if (unlikely(!args[i])) goto cleanup;
32992#endif
32993 }
32994#if !CYTHON_ASSUME_SAFE_MACROS
32995 if (k) // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
32996#endif
32997 {
32998 kwnames = PyTuple_New(k_size);
32999 if (unlikely(!kwnames)) goto cleanup;
33000 __Pyx_BEGIN_CRITICAL_SECTION(k);
33001 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
33002 __Pyx_END_CRITICAL_SECTION();
33003 if (unlikely(unpack_dict_result == -1)) goto cleanup;
33004 }
33005 result = f(o, args, a_size, kwnames);
33006 cleanup:
33007 Py_XDECREF(kwnames);
33008 for (i=a_size; i<total_size; ++i) {
33009 Py_XDECREF(args[i]);
33010 }
33011 if (args != stack_args) {
33012 PyMem_Free(args);
33013 }
33014 return result;
33015}
33016#endif
33017
33018/* CallTypeTraverse */
33019#if !CYTHON_USE_TYPE_SPECS
33020#else
33021static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
33022 if (!always_call) {
33023 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
33024 unsigned long flags = PyType_GetFlags(base);
33025 if (flags & Py_TPFLAGS_HEAPTYPE) {
33026 return 0;
33027 }
33028 }
33029 Py_VISIT((PyObject*)Py_TYPE(o));
33030 return 0;
33031}
33032#endif
33033
33034/* PyObjectCallMethod0 (used by PyType_Ready) */
33035static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
33036#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
33037 return PyObject_VectorcallMethod(method_name, &obj, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
33038#elif CYTHON_COMPILING_IN_LIMITED_API
33039 return PyObject_CallMethodObjArgs(obj, method_name, NULL);
33040#else
33041 return PyObject_CallMethodNoArgs(obj, method_name);
33042#endif
33043}
33044
33045/* GetTypeDictOffset (used by ValidateBasesTuple) */
33046#if !CYTHON_USE_TYPE_SLOTS
33047CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result) {
33048 PyObject *tp_dictoffset_o;
33049 Py_ssize_t tp_dictoffset;
33050 tp_dictoffset_o = PyObject_GetAttrString(tp, "__dictoffset__");
33051 if (unlikely(!tp_dictoffset_o)) return -1;
33052 tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
33053 Py_DECREF(tp_dictoffset_o);
33054 if (unlikely(require_cython_valid_result && tp_dictoffset == 0)) {
33055 PyErr_SetString(
33056 PyExc_TypeError,
33057 "'type' doesn't have a dictoffset");
33058 return -1;
33059 } else if (unlikely(require_cython_valid_result && tp_dictoffset < 0)) {
33060 PyErr_SetString(
33061 PyExc_TypeError,
33062 "'type' has an unexpected negative dictoffset. "
33063 "Please report this as Cython bug");
33064 return -1;
33065 }
33066 return tp_dictoffset;
33067}
33068#endif
33069
33070/* ValidateBasesTuple (used by PyType_Ready) */
33071#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
33072static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases) {
33073 Py_ssize_t i, n;
33074#if CYTHON_ASSUME_SAFE_SIZE
33075 n = PyTuple_GET_SIZE(bases);
33076#else
33077 n = PyTuple_Size(bases);
33078 if (unlikely(n < 0)) return -1;
33079#endif
33080 if (!has_dictoffset) {
33081 PyObject *b;
33082#if CYTHON_AVOID_BORROWED_REFS
33083 b = PySequence_GetItem(bases, 0);
33084 if (!b) return -1;
33085#elif CYTHON_ASSUME_SAFE_MACROS
33086 b = PyTuple_GET_ITEM(bases, 0);
33087#else
33088 b = PyTuple_GetItem(bases, 0);
33089 if (!b) return -1;
33090#endif
33091#if CYTHON_USE_TYPE_SLOTS
33092 has_dictoffset = ((PyTypeObject*)b)->tp_dictoffset != 0;
33093#else
33094 Py_ssize_t dictoffset = __Pyx_GetTypeDictOffset(b, 0);
33095 has_dictoffset = dictoffset != 0;
33096#endif
33097#if CYTHON_AVOID_BORROWED_REFS
33098 Py_DECREF(b);
33099#endif
33100#if !CYTHON_USE_TYPE_SLOTS
33101 if (dictoffset == -1 && PyErr_Occurred()) return -1;
33102#endif
33103 }
33104 for (i = 1; i < n; i++)
33105 {
33106 PyTypeObject *b;
33107#if CYTHON_AVOID_BORROWED_REFS
33108 PyObject *b0 = PySequence_GetItem(bases, i);
33109 if (!b0) return -1;
33110#elif CYTHON_ASSUME_SAFE_MACROS
33111 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
33112#else
33113 PyObject *b0 = PyTuple_GetItem(bases, i);
33114 if (!b0) return -1;
33115#endif
33116 b = (PyTypeObject*) b0;
33117 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
33118 {
33119 __Pyx_RaiseErrorWithType(
33120 PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b);
33121#if CYTHON_AVOID_BORROWED_REFS
33122 Py_DECREF(b0);
33123#endif
33124 return -1;
33125 }
33126 if (!has_dictoffset)
33127 {
33128 Py_ssize_t b_dictoffset = 0;
33129#if CYTHON_USE_TYPE_SLOTS
33130 b_dictoffset = b->tp_dictoffset;
33131#else
33132 b_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)b, 0);
33133 if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
33134#endif
33135 if (b_dictoffset) {
33136 __Pyx_RaiseErrorWithType1(
33137 PyExc_TypeError,
33138 "extension type '%.200s' has no __dict__ slot, "
33139 "but base type '" __Pyx_FMT_TYPENAME "' has: "
33140 "either add 'cdef dict __dict__' to the extension type "
33141 "or add '__slots__ = [...]' to the base type",
33142 type_name, b);
33143#if !CYTHON_USE_TYPE_SLOTS
33144 dictoffset_return:
33145#endif
33146#if CYTHON_AVOID_BORROWED_REFS
33147 Py_DECREF(b0);
33148#endif
33149 return -1;
33150 }
33151 }
33152#if CYTHON_AVOID_BORROWED_REFS
33153 Py_DECREF(b0);
33154#endif
33155 }
33156 return 0;
33157}
33158#endif
33159
33160/* PyType_Ready */
33161CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
33162 while (t) {
33163 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
33164 if (bases) {
33165 return 1;
33166 }
33167 t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
33168 }
33169 return 0;
33170}
33171static int __Pyx_PyType_Ready(PyTypeObject *t) {
33172#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON
33173 (void)__Pyx_PyObject_CallMethod0;
33174#if CYTHON_USE_TYPE_SPECS
33175 (void)__Pyx_validate_bases_tuple;
33176#endif
33177 return PyType_Ready(t);
33178#else
33179 int r;
33180 if (!__Pyx_PyType_HasMultipleInheritance(t)) {
33181 return PyType_Ready(t);
33182 }
33183 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
33184 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset != 0, bases) == -1))
33185 return -1;
33186 {
33187 int gc_was_enabled;
33188 #if PY_VERSION_HEX >= 0x030A00b1
33189 gc_was_enabled = PyGC_Disable();
33190 (void)__Pyx_PyObject_CallMethod0;
33191 #else
33192 PyObject *ret, *py_status;
33193 PyObject *gc = NULL;
33194 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
33195 !CYTHON_COMPILING_IN_GRAAL
33196 gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
33197 #endif
33198 if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
33199 if (unlikely(!gc)) return -1;
33200 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
33201 if (unlikely(!py_status)) {
33202 Py_DECREF(gc);
33203 return -1;
33204 }
33205 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
33206 Py_DECREF(py_status);
33207 if (gc_was_enabled > 0) {
33208 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
33209 if (unlikely(!ret)) {
33210 Py_DECREF(gc);
33211 return -1;
33212 }
33213 Py_DECREF(ret);
33214 } else if (unlikely(gc_was_enabled == -1)) {
33215 Py_DECREF(gc);
33216 return -1;
33217 }
33218 #endif
33219 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
33220#if PY_VERSION_HEX >= 0x030A0000
33221 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
33222#endif
33223 r = PyType_Ready(t);
33224 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
33225 #if PY_VERSION_HEX >= 0x030A00b1
33226 if (gc_was_enabled)
33227 PyGC_Enable();
33228 #else
33229 if (gc_was_enabled) {
33230 PyObject *tp, *v, *tb;
33231 PyErr_Fetch(&tp, &v, &tb);
33232 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
33233 if (likely(ret || r == -1)) {
33234 Py_XDECREF(ret);
33235 PyErr_Restore(tp, v, tb);
33236 } else {
33237 Py_XDECREF(tp);
33238 Py_XDECREF(v);
33239 Py_XDECREF(tb);
33240 r = -1;
33241 }
33242 }
33243 Py_DECREF(gc);
33244 #endif
33245 }
33246 return r;
33247#endif
33248}
33249
33250/* LimitedApiGetTypeTypeDict (used by DelItemOnTypeDict) */
33251#if CYTHON_COMPILING_IN_LIMITED_API
33252static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp) {
33253 static Py_ssize_t tp_dictoffset = 0;
33254 if (unlikely(tp_dictoffset == 0)) {
33255 tp_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)(&PyType_Type), 1);
33256 if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
33257 tp_dictoffset = 0; // try again next time?
33258 return NULL;
33259 }
33260 }
33261 return *(PyObject**)((char*)tp + tp_dictoffset);
33262}
33263#endif
33264
33265/* DelItemOnTypeDict (used by SetupReduce) */
33266static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
33267 int result;
33268 PyObject *tp_dict;
33269#if CYTHON_COMPILING_IN_LIMITED_API
33270 tp_dict = __Pyx_GetTypeTypeDict(tp);
33271 if (unlikely(!tp_dict)) return -1;
33272#else
33273 tp_dict = tp->tp_dict;
33274#endif
33275 result = PyDict_DelItem(tp_dict, k);
33276 if (likely(!result)) PyType_Modified(tp);
33277 return result;
33278}
33279
33280/* SetItemOnTypeDict (used by SetupReduce) */
33281static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
33282 int result;
33283 PyObject *tp_dict;
33284#if CYTHON_COMPILING_IN_LIMITED_API
33285 tp_dict = __Pyx_GetTypeTypeDict(tp);
33286 if (unlikely(!tp_dict)) return -1;
33287#else
33288 tp_dict = tp->tp_dict;
33289#endif
33290 result = PyDict_SetItem(tp_dict, k, v);
33291 if (likely(!result)) {
33292 PyType_Modified(tp);
33293 if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
33294 PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL);
33295 if (!setNameResult) return -1;
33296 Py_DECREF(setNameResult);
33297 }
33298 }
33299 return result;
33300}
33301
33302/* SetupReduce */
33303static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
33304 int ret;
33305 PyObject *name_attr;
33306 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_2);
33307 if (likely(name_attr)) {
33308 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
33309 } else {
33310 ret = -1;
33311 }
33312 if (unlikely(ret < 0) && __Pyx_IgnoreException(PyExc_Exception)) {
33313 ret = 0; // But BaseException is still propagated.
33314 }
33315 Py_XDECREF(name_attr);
33316 return ret;
33317}
33318static PyObject *__Pyx_setup_reduce_get_reduce_attribute(PyObject *type_obj, PyObject *name, int allow_not_present) {
33319#if CYTHON_USE_PYTYPE_LOOKUP
33320 CYTHON_UNUSED_VAR(allow_not_present);
33321 return _PyType_Lookup((PyTypeObject*)type_obj, name);
33322#else
33323 if (allow_not_present) {
33324 return __Pyx_PyObject_GetAttrStrNoError(type_obj, name);
33325 } else {
33326 return __Pyx_PyObject_GetAttrStr(type_obj, name);
33327 }
33328#endif
33329}
33330static int __Pyx_setup_reduce(PyObject* type_obj) {
33331 int ret = 0;
33332 PyObject *object_reduce = NULL;
33333 PyObject *object_getstate = NULL;
33334 PyObject *object_reduce_ex = NULL;
33335 PyObject *reduce = NULL;
33336 PyObject *reduce_ex = NULL;
33337 PyObject *reduce_cython = NULL;
33338 PyObject *setstate = NULL;
33339 PyObject *setstate_cython = NULL;
33340 PyObject *getstate = NULL;
33341 getstate = __Pyx_setup_reduce_get_reduce_attribute(type_obj, __pyx_mstate_global->__pyx_n_u_getstate, 1);
33342 if (!getstate && PyErr_Occurred()) {
33343 goto __PYX_BAD;
33344 }
33345 if (getstate) {
33346 object_getstate = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate, 1);
33347 if (!object_getstate && PyErr_Occurred()) {
33348 goto __PYX_BAD;
33349 }
33350 if (object_getstate != getstate) {
33351 goto __PYX_GOOD;
33352 }
33353 }
33354 object_reduce_ex = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex, 0);
33355 if (unlikely(!object_reduce_ex)) goto __PYX_BAD;
33356 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
33357 if (reduce_ex == object_reduce_ex) {
33358 object_reduce = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce, 0);
33359 if (!object_reduce) goto __PYX_BAD;
33360 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
33361 int try_to_replace_reduce = (reduce == object_reduce);
33362 if (!try_to_replace_reduce) {
33363 try_to_replace_reduce = __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython);
33364 if (unlikely(try_to_replace_reduce < 0)) {
33365 goto __PYX_BAD;
33366 }
33367 }
33368 if (try_to_replace_reduce) {
33369 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
33370 if (likely(reduce_cython)) {
33371 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
33372 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
33373 } else if (reduce == object_reduce || PyErr_Occurred()) {
33374 goto __PYX_BAD;
33375 }
33376 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
33377 int try_to_replace_setstate;
33378 if (!setstate) {
33379 PyObject *exc = PyErr_Occurred();
33380 if (exc && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
33381 goto __PYX_BAD;
33382 }
33383 try_to_replace_setstate = 1;
33384 } else {
33385 try_to_replace_setstate = __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython);
33386 if (unlikely(try_to_replace_setstate < 0)) {
33387 goto __PYX_BAD;
33388 }
33389 }
33390 if (try_to_replace_setstate) {
33391 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
33392 if (likely(setstate_cython)) {
33393 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
33394 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
33395 } else if (!setstate || PyErr_Occurred()) {
33396 goto __PYX_BAD;
33397 }
33398 }
33399 PyType_Modified((PyTypeObject*)type_obj);
33400 }
33401 }
33402 goto __PYX_GOOD;
33403__PYX_BAD:
33404 if (!PyErr_Occurred()) {
33405 __Pyx_RaiseErrorWithType(
33406 PyExc_RuntimeError,
33407 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME,
33408 (PyTypeObject*)type_obj);
33409 }
33410 ret = -1;
33411__PYX_GOOD:
33412#if !CYTHON_USE_PYTYPE_LOOKUP
33413 Py_XDECREF(object_reduce);
33414 Py_XDECREF(object_reduce_ex);
33415 Py_XDECREF(object_getstate);
33416 Py_XDECREF(getstate);
33417#endif
33418 Py_XDECREF(reduce);
33419 Py_XDECREF(reduce_ex);
33420 Py_XDECREF(reduce_cython);
33421 Py_XDECREF(setstate);
33422 Py_XDECREF(setstate_cython);
33423 return ret;
33424}
33425
33426/* ApplySequenceOrMappingFlag */
33427#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_PYPY && CYTHON_USE_TYPE_SPECS)
33428int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence) {
33429 PyObject *abc;
33430 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
33431 if (unlikely(!collections_abc)) return -1;
33432 abc = PyObject_GetAttrString(collections_abc, is_sequence ? "Sequence": "Mapping");
33433 Py_DECREF(collections_abc);
33434 if (unlikely(!abc)) return -1;
33435 PyObject *register_result = PyObject_CallMethod(abc, "register", "O", (PyObject*)tp);
33436 Py_DECREF(abc);
33437 if (unlikely(!register_result)) return -1;
33438 Py_DECREF(register_result);
33439 return 0;
33440}
33441#elif CYTHON_COMPILING_IN_PYPY // && !CYTHON_USE_TYPE_SPECS
33442int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence) {
33443 CYTHON_UNUSED_VAR(tp);
33444 CYTHON_UNUSED_VAR(is_sequence);
33445 return PyErr_WarnEx(
33446 PyExc_RuntimeWarning,
33447 "cython.collection_type only works on PyPy with the C flag CYTHON_USE_TYPE_SPECS=1",
33448 1
33449 );
33450}
33451#endif
33452
33453/* GetVTable (used by MergeVTables) */
33454static int __Pyx_GetVtable(PyTypeObject *type, void** table) {
33455 void* ptr;
33456 *table = NULL;
33457#if CYTHON_COMPILING_IN_LIMITED_API
33458 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
33459#else
33460 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
33461#endif
33462 if (!ob)
33463 goto no_attr;
33464 ptr = PyCapsule_GetPointer(ob, 0);
33465 if (!ptr && !PyErr_Occurred())
33466 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
33467 Py_DECREF(ob);
33468 *table = ptr;
33469 return 1;
33470no_attr:
33471 if (PyErr_ExceptionMatches(CYTHON_COMPILING_IN_LIMITED_API ? PyExc_AttributeError : PyExc_KeyError)) {
33472 return 0;
33473 }
33474 Py_XDECREF(ob);
33475 return -1;
33476}
33477
33478/* MergeVTables (used by SetVTable) */
33479static int __Pyx_MergeVtables(PyTypeObject *type) {
33480 int i=0;
33481 Py_ssize_t size;
33482 void** base_vtables;
33483 void* unknown = (void*)-1;
33484 PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
33485 int base_depth = 0;
33486 {
33487 PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
33488 while (base) {
33489 base_depth += 1;
33490 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
33491 }
33492 }
33493 base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
33494 if (unlikely(!base_vtables)) {
33495 PyErr_NoMemory();
33496 return -1;
33497 }
33498 base_vtables[0] = unknown;
33499#if CYTHON_COMPILING_IN_LIMITED_API
33500 size = PyTuple_Size(bases);
33501 if (size < 0) goto other_failure;
33502#else
33503 size = PyTuple_GET_SIZE(bases);
33504#endif
33505 for (i = 1; i < size; i++) {
33506 PyObject *basei;
33507 void* base_vtable;
33508#if CYTHON_AVOID_BORROWED_REFS
33509 basei = PySequence_GetItem(bases, i);
33510 if (unlikely(!basei)) goto other_failure;
33511#elif !CYTHON_ASSUME_SAFE_MACROS
33512 basei = PyTuple_GetItem(bases, i);
33513 if (unlikely(!basei)) goto other_failure;
33514#else
33515 basei = PyTuple_GET_ITEM(bases, i);
33516#endif
33517 int get_vtable_result = __Pyx_GetVtable((PyTypeObject*)basei, &base_vtable);
33518#if CYTHON_AVOID_BORROWED_REFS
33519 Py_DECREF(basei);
33520#endif
33521 if (get_vtable_result != 1) {
33522 if (get_vtable_result == -1) {
33523 goto other_failure;
33524 }
33525 PyErr_Clear(); // Class doesn't have a vtable.
33526 } else {
33527 assert(base_vtable != NULL);
33528 int j;
33529 PyTypeObject* base = __Pyx_PyType_TryGetSlot(type, tp_base, PyTypeObject*);
33530#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33531 if (!base) goto bad;
33532#endif
33533 for (j = 0; j < base_depth; j++) {
33534 if (base_vtables[j] == unknown) {
33535 switch (__Pyx_GetVtable(base, &base_vtables[j])) {
33536 case 1:
33537 assert(base_vtables[j] == NULL);
33538 break;
33539 case 0:
33540 goto bad;
33541 case -1:
33542 default:
33543 goto other_failure;
33544 }
33545 base_vtables[j + 1] = unknown;
33546 }
33547 if (base_vtables[j] == base_vtable) {
33548 break;
33549 }
33550 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
33551#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33552 if (!base) goto bad;
33553#endif
33554 }
33555 }
33556 }
33557 PyMem_Free(base_vtables);
33558 return 0;
33559bad:
33560 {
33561 PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
33562 PyTypeObject* basei;
33563#if CYTHON_AVOID_BORROWED_REFS
33564 basei = (PyTypeObject*)PySequence_GetItem(bases, i);
33565 if (unlikely(!basei)) goto other_failure;
33566#elif !CYTHON_ASSUME_SAFE_MACROS
33567 basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
33568 if (unlikely(!basei)) goto other_failure;
33569#else
33570 basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
33571#endif
33572 __Pyx_RaiseTypeErrorWithTypes(
33573 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base, basei);
33574#if CYTHON_AVOID_BORROWED_REFS
33575 Py_DECREF(basei);
33576#endif
33577 }
33578other_failure:
33579 PyMem_Free(base_vtables);
33580 return -1;
33581}
33582
33583/* SetVTable */
33584static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
33585 PyObject *ob = PyCapsule_New(vtable, 0, 0);
33586 if (unlikely(!ob))
33587 goto bad;
33588#if CYTHON_COMPILING_IN_LIMITED_API
33589 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
33590#else
33591 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
33592#endif
33593 goto bad;
33594 Py_DECREF(ob);
33595 return __Pyx_MergeVtables(type);
33596bad:
33597 Py_XDECREF(ob);
33598 return -1;
33599}
33600
33601/* TypeImport */
33602#ifndef __PYX_HAVE_RT_ImportType_3_3_0
33603#define __PYX_HAVE_RT_ImportType_3_3_0
33604static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module, const char *module_name, const char *class_name,
33605 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
33606{
33607 PyObject *result = 0;
33608 Py_ssize_t basicsize;
33609 Py_ssize_t itemsize;
33610#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
33611 PyObject *py_basicsize;
33612 PyObject *py_itemsize;
33613#endif
33614 result = PyObject_GetAttrString(module, class_name);
33615 if (!result)
33616 goto bad;
33617 if (!PyType_Check(result)) {
33618 PyErr_Format(PyExc_TypeError,
33619 "%.200s.%.200s is not a type object",
33620 module_name, class_name);
33621 goto bad;
33622 }
33623#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
33624 basicsize = ((PyTypeObject *)result)->tp_basicsize;
33625 itemsize = ((PyTypeObject *)result)->tp_itemsize;
33626#else
33627 if (size == 0) {
33628 return (PyTypeObject *)result;
33629 }
33630 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
33631 if (!py_basicsize)
33632 goto bad;
33633 basicsize = PyLong_AsSsize_t(py_basicsize);
33634 Py_DECREF(py_basicsize);
33635 py_basicsize = 0;
33636 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
33637 goto bad;
33638 py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
33639 if (!py_itemsize)
33640 goto bad;
33641 itemsize = PyLong_AsSsize_t(py_itemsize);
33642 Py_DECREF(py_itemsize);
33643 py_itemsize = 0;
33644 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
33645 goto bad;
33646#endif
33647 if (itemsize) {
33648 if (size % alignment) {
33649 alignment = size % alignment;
33650 }
33651 if (itemsize < (Py_ssize_t)alignment)
33652 itemsize = (Py_ssize_t)alignment;
33653 }
33654 if ((size_t)(basicsize + itemsize) < size) {
33655 PyErr_Format(PyExc_ValueError,
33656 "%.200s.%.200s size changed, may indicate binary incompatibility. "
33657 "Expected %zd from C header, got %zd from PyObject",
33658 module_name, class_name, size, basicsize+itemsize);
33659 goto bad;
33660 }
33661 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
33662 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
33663 PyErr_Format(PyExc_ValueError,
33664 "%.200s.%.200s size changed, may indicate binary incompatibility. "
33665 "Expected %zd from C header, got %zd-%zd from PyObject",
33666 module_name, class_name, size, basicsize, basicsize+itemsize);
33667 goto bad;
33668 }
33669 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (size_t)basicsize > size) {
33670 if (PyErr_WarnFormat(NULL, 0,
33671 "%.200s.%.200s size changed, may indicate binary incompatibility. "
33672 "Expected %zd from C header, got %zd from PyObject",
33673 module_name, class_name, size, basicsize) < 0) {
33674 goto bad;
33675 }
33676 }
33677 return (PyTypeObject *)result;
33678bad:
33679 Py_XDECREF(result);
33680 return NULL;
33681}
33682#endif
33683
33684/* Py3UpdateBases */
33685static PyObject*
33686__Pyx_PEP560_update_bases(PyObject *bases)
33687{
33688 Py_ssize_t i, j, size_bases;
33689 PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
33690#if CYTHON_ASSUME_SAFE_SIZE
33691 size_bases = PyTuple_GET_SIZE(bases);
33692#else
33693 size_bases = PyTuple_Size(bases);
33694 if (size_bases < 0) return NULL;
33695#endif
33696 for (i = 0; i < size_bases; i++) {
33697#if CYTHON_AVOID_BORROWED_REFS
33698 Py_CLEAR(base);
33699#endif
33700#if CYTHON_ASSUME_SAFE_MACROS
33701 base = PyTuple_GET_ITEM(bases, i);
33702#else
33703 base = PyTuple_GetItem(bases, i);
33704 if (!base) goto error;
33705#endif
33706#if CYTHON_AVOID_BORROWED_REFS
33707 Py_INCREF(base);
33708#endif
33709 if (PyType_Check(base)) {
33710 if (new_bases) {
33711 if (PyList_Append(new_bases, base) < 0) {
33712 goto error;
33713 }
33714 }
33715 continue;
33716 }
33717 meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries);
33718 if (!meth && PyErr_Occurred()) {
33719 goto error;
33720 }
33721 if (!meth) {
33722 if (new_bases) {
33723 if (PyList_Append(new_bases, base) < 0) {
33724 goto error;
33725 }
33726 }
33727 continue;
33728 }
33729 new_base = __Pyx_PyObject_CallOneArg(meth, bases);
33730 Py_DECREF(meth);
33731 if (!new_base) {
33732 goto error;
33733 }
33734 if (!PyTuple_Check(new_base)) {
33735 PyErr_SetString(PyExc_TypeError,
33736 "__mro_entries__ must return a tuple");
33737 Py_DECREF(new_base);
33738 goto error;
33739 }
33740 if (!new_bases) {
33741 if (!(new_bases = PyList_New(i))) {
33742 goto error;
33743 }
33744 for (j = 0; j < i; j++) {
33745 PyObject *base_from_list;
33746#if CYTHON_ASSUME_SAFE_MACROS
33747 base_from_list = PyTuple_GET_ITEM(bases, j);
33748 PyList_SET_ITEM(new_bases, j, base_from_list);
33749 Py_INCREF(base_from_list);
33750#else
33751 base_from_list = PyTuple_GetItem(bases, j);
33752 if (!base_from_list) goto error;
33753 Py_INCREF(base_from_list);
33754 if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error;
33755#endif
33756 }
33757 }
33758#if CYTHON_ASSUME_SAFE_SIZE
33759 j = PyList_GET_SIZE(new_bases);
33760#else
33761 j = PyList_Size(new_bases);
33762 if (j < 0) goto error;
33763#endif
33764 if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
33765 goto error;
33766 }
33767 Py_DECREF(new_base);
33768 }
33769 if (!new_bases) {
33770 Py_INCREF(bases);
33771 return bases;
33772 }
33773 result = PyList_AsTuple(new_bases);
33774 Py_DECREF(new_bases);
33775#if CYTHON_AVOID_BORROWED_REFS
33776 Py_XDECREF(base);
33777#endif
33778 return result;
33779error:
33780 Py_XDECREF(new_bases);
33781#if CYTHON_AVOID_BORROWED_REFS
33782 Py_XDECREF(base);
33783#endif
33784 return NULL;
33785}
33786
33787/* CalculateMetaclass */
33788static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
33789 Py_ssize_t i, nbases;
33790#if CYTHON_ASSUME_SAFE_SIZE
33791 nbases = PyTuple_GET_SIZE(bases);
33792#else
33793 nbases = PyTuple_Size(bases);
33794 if (nbases < 0) return NULL;
33795#endif
33796 for (i=0; i < nbases; i++) {
33797 PyTypeObject *tmptype;
33798#if CYTHON_ASSUME_SAFE_MACROS
33799 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
33800#else
33801 PyObject *tmp = PyTuple_GetItem(bases, i);
33802 if (!tmp) return NULL;
33803#endif
33804 tmptype = Py_TYPE(tmp);
33805 if (!metaclass) {
33806 metaclass = tmptype;
33807 continue;
33808 }
33809 if (PyType_IsSubtype(metaclass, tmptype))
33810 continue;
33811 if (PyType_IsSubtype(tmptype, metaclass)) {
33812 metaclass = tmptype;
33813 continue;
33814 }
33815 PyErr_SetString(PyExc_TypeError,
33816 "metaclass conflict: "
33817 "the metaclass of a derived class "
33818 "must be a (non-strict) subclass "
33819 "of the metaclasses of all its bases");
33820 return NULL;
33821 }
33822 if (!metaclass) {
33823 metaclass = &PyType_Type;
33824 }
33825 Py_INCREF((PyObject*) metaclass);
33826 return (PyObject*) metaclass;
33827}
33828
33829/* dict_setdefault (used by FetchCommonType) */
33830static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
33831 PyObject* value;
33832#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
33833 PyDict_SetDefaultRef(d, key, default_value, &value);
33834#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
33835 PyObject *args[] = {d, key, default_value};
33836 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
33837#elif CYTHON_COMPILING_IN_LIMITED_API
33838 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
33839#else
33840 value = PyDict_SetDefault(d, key, default_value);
33841 if (unlikely(!value)) return NULL;
33842 Py_INCREF(value);
33843#endif
33844 return value;
33845}
33846
33847/* AddModuleRef (used by FetchSharedCythonModule) */
33848#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
33849 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
33850 PyObject *module_dict = PyImport_GetModuleDict();
33851 PyObject *m;
33852 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
33853 return NULL;
33854 }
33855 if (m != NULL && PyModule_Check(m)) {
33856 return m;
33857 }
33858 Py_XDECREF(m);
33859 m = PyModule_NewObject(name);
33860 if (m == NULL)
33861 return NULL;
33862 if (PyDict_CheckExact(module_dict)) {
33863 PyObject *new_m;
33864 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
33865 Py_DECREF(m);
33866 return new_m;
33867 } else {
33868 if (PyObject_SetItem(module_dict, name, m) != 0) {
33869 Py_DECREF(m);
33870 return NULL;
33871 }
33872 return m;
33873 }
33874 }
33875 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
33876 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
33877 return PyImport_AddModuleRef(name);
33878 }
33879 PyObject *py_name = PyUnicode_FromString(name);
33880 if (!py_name) return NULL;
33881 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
33882 Py_DECREF(py_name);
33883 return module;
33884 }
33885#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
33886 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
33887 PyObject *module = PyImport_AddModule(name);
33888 Py_XINCREF(module);
33889 return module;
33890 }
33891#endif
33892
33893/* FetchSharedCythonModule (used by FetchCommonType) */
33894static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
33895 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
33896}
33897
33898/* VerifyCachedType (used by FetchCommonType) */
33899static int __Pyx_VerifyCachedType(PyObject *cached_type,
33900 const char *name,
33901 Py_ssize_t expected_basicsize) {
33902 Py_ssize_t basicsize;
33903 if (!PyType_Check(cached_type)) {
33904 PyErr_Format(PyExc_TypeError,
33905 "Shared Cython type %.200s is not a type object", name);
33906 return -1;
33907 }
33908 if (expected_basicsize == 0) {
33909 return 0; // size is inherited, nothing useful to check
33910 }
33911#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
33912 if (expected_basicsize < 0) {
33913 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
33914 } else
33915#endif
33916 {
33917 #if CYTHON_COMPILING_IN_LIMITED_API
33918 PyObject *py_basicsize;
33919 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
33920 if (unlikely(!py_basicsize)) return -1;
33921 basicsize = PyLong_AsSsize_t(py_basicsize);
33922 Py_DECREF(py_basicsize);
33923 py_basicsize = NULL;
33924 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
33925 #else
33926 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
33927 #endif
33928 }
33929 if ((expected_basicsize >= 0) ?
33930 (basicsize != expected_basicsize) :
33931 (basicsize < -expected_basicsize)) {
33932 PyErr_Format(PyExc_TypeError,
33933 "Shared Cython type %.200s has the wrong size, try recompiling",
33934 name);
33935 return -1;
33936 }
33937 return 0;
33938}
33939
33940/* FetchCommonType (used by CommonTypesMetaclass) */
33941#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
33942static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
33943 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
33944 if (result && metaclass) {
33945 PyObject *old_tp = (PyObject*)Py_TYPE(result);
33946 Py_INCREF((PyObject*)metaclass);
33947 Py_SET_TYPE(result, metaclass);
33948 Py_DECREF(old_tp);
33949 PyType_Modified((PyTypeObject*)result);
33950 }
33951 return result;
33952}
33953#else
33954#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
33955#endif
33956static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
33957 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
33958 int get_item_ref_result;
33959 const char* object_name = strrchr(spec->name, '.');
33960 object_name = object_name ? object_name+1 : spec->name;
33961 py_object_name = PyUnicode_FromString(object_name);
33962 if (!py_object_name) return NULL;
33963 abi_module = __Pyx_FetchSharedCythonABIModule();
33964 if (!abi_module) goto done;
33965 abi_module_dict = PyModule_GetDict(abi_module);
33966 if (!abi_module_dict) goto done;
33967 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
33968 if (get_item_ref_result == 1) {
33969 if (__Pyx_VerifyCachedType(
33970 cached_type,
33971 object_name,
33972 spec->basicsize) < 0) {
33973 goto bad;
33974 }
33975 goto done;
33976 } else if (unlikely(get_item_ref_result == -1)) {
33977 goto bad;
33978 }
33979 cached_type = __Pyx_PyType_FromMetaclass(
33980 metaclass,
33981 CYTHON_USE_MODULE_STATE ? module : abi_module,
33982 spec, bases);
33983 if (unlikely(!cached_type)) goto bad;
33984 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
33985 if (unlikely(new_cached_type != cached_type)) {
33986 if (unlikely(!new_cached_type)) goto bad;
33987 Py_DECREF(cached_type);
33988 cached_type = new_cached_type;
33989 if (__Pyx_VerifyCachedType(
33990 cached_type,
33991 object_name,
33992 spec->basicsize) < 0) {
33993 goto bad;
33994 }
33995 goto done;
33996 } else {
33997 Py_DECREF(new_cached_type);
33998 }
33999done:
34000 Py_XDECREF(abi_module);
34001 Py_DECREF(py_object_name);
34002 assert(cached_type == NULL || PyType_Check(cached_type));
34003 return (PyTypeObject *) cached_type;
34004bad:
34005 Py_XDECREF(cached_type);
34006 cached_type = NULL;
34007 goto done;
34008}
34009
34010/* CommonTypesMetaclass (used by CythonFunctionShared) */
34011static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
34012 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
34013}
34014#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
34015static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
34016 PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
34017 return NULL;
34018}
34019static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
34020 PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
34021 return -1;
34022}
34023#endif
34024static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
34025 {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
34026 {0, 0, 0, 0, 0}
34027};
34028static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
34029 {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
34030 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
34031 {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
34032 {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
34033 {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
34034 #endif
34035 {0, 0}
34036};
34037static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
34038 __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
34039 0,
34040 0,
34041 Py_TPFLAGS_IMMUTABLETYPE |
34042 Py_TPFLAGS_DISALLOW_INSTANTIATION |
34043 Py_TPFLAGS_DEFAULT,
34044 __pyx_CommonTypesMetaclass_slots
34045};
34046static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
34047 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
34048 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
34049 if (unlikely(!bases)) {
34050 return -1;
34051 }
34052 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
34053 Py_DECREF(bases);
34054 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
34055 return -1;
34056 }
34057 return 0;
34058}
34059
34060/* CythonFunctionPerModule (used by CythonFunctionShared) */
34061#if CYTHON_COMPILING_IN_LIMITED_API
34062static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
34063 if (__Pyx_CyFunction_Check(func)) {
34064 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
34065 } else if (PyCFunction_Check(func)) {
34066 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
34067 }
34068 return 0;
34069}
34070static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
34071 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
34072 int result;
34073 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
34074 if (unlikely(!newFunc)) {
34075 PyErr_Clear(); // It's only an optimization, so don't throw an error
34076 return 0;
34077 }
34078 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
34079 Py_DECREF(newFunc);
34080 return result;
34081 }
34082 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
34083}
34084#else
34085static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
34086 if (PyMethod_Check(func)) {
34087 func = PyMethod_GET_FUNCTION(func);
34088 }
34089 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
34090}
34091#endif
34092static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
34093#if CYTHON_COMPILING_IN_LIMITED_API
34094 __Pyx_Py_XDECREF_SET(
34095 __Pyx__CyFunction_GetClassObj(f),
34096 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
34097#else
34098 __Pyx_Py_XDECREF_SET(
34099 ((PyCMethodObject *) (f))->mm_class,
34100 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
34101#endif
34102}
34103static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
34104 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34105 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
34106 if (unlikely(!m->defaults))
34107 return NULL;
34108 return m->defaults;
34109}
34110static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
34111 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34112 m->defaults_tuple = tuple;
34113 Py_INCREF(tuple);
34114}
34115static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
34116 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34117 m->defaults_kwdict = dict;
34118 Py_INCREF(dict);
34119}
34120static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
34121 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34122 m->func_annotations = dict;
34123 Py_INCREF(dict);
34124}
34125
34126/* PyMethodNew (used by CythonFunctionShared) */
34127#if CYTHON_COMPILING_IN_LIMITED_API
34128static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
34129 PyObject *result;
34130 CYTHON_UNUSED_VAR(typ);
34131 if (!self)
34132 return __Pyx_NewRef(func);
34133 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
34134 {
34135 PyObject *args[] = {func, self};
34136 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
34137 }
34138 #else
34139 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
34140 #endif
34141 return result;
34142}
34143#else
34144static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
34145 CYTHON_UNUSED_VAR(typ);
34146 if (!self)
34147 return __Pyx_NewRef(func);
34148 return PyMethod_New(func, self);
34149}
34150#endif
34151
34152/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
34153#if CYTHON_VECTORCALL
34154static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
34155{
34156 PyObject *res = NULL;
34157 PyObject *kwnames;
34158 PyObject **newargs;
34159 PyObject **kwvalues;
34160 Py_ssize_t i;
34161 #if CYTHON_AVOID_BORROWED_REFS
34162 PyObject *pos;
34163 #else
34164 Py_ssize_t pos;
34165 #endif
34166 size_t j;
34167 PyObject *key, *value;
34168 unsigned long keys_are_strings;
34169 #if !CYTHON_ASSUME_SAFE_SIZE
34170 Py_ssize_t nkw = PyDict_Size(kw);
34171 if (unlikely(nkw == -1)) return NULL;
34172 #else
34173 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
34174 #endif
34175 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
34176 if (unlikely(newargs == NULL)) {
34177 PyErr_NoMemory();
34178 return NULL;
34179 }
34180 for (j = 0; j < nargs; j++) newargs[j] = args[j];
34181 kwnames = PyTuple_New(nkw);
34182 if (unlikely(kwnames == NULL)) {
34183 PyMem_Free(newargs);
34184 return NULL;
34185 }
34186 kwvalues = newargs + nargs;
34187 pos = 0;
34188 i = 0;
34189 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
34190 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
34191 keys_are_strings &=
34192 #if CYTHON_COMPILING_IN_LIMITED_API
34193 PyType_GetFlags(Py_TYPE(key));
34194 #else
34195 Py_TYPE(key)->tp_flags;
34196 #endif
34197 #if !CYTHON_ASSUME_SAFE_MACROS
34198 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
34199 #else
34200 PyTuple_SET_ITEM(kwnames, i, key);
34201 #endif
34202 kwvalues[i] = value;
34203 i++;
34204 }
34205 if (unlikely(!keys_are_strings)) {
34206 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
34207 goto cleanup;
34208 }
34209 res = vc(func, newargs, nargs, kwnames);
34210cleanup:
34211 #if CYTHON_AVOID_BORROWED_REFS
34212 Py_DECREF(pos);
34213 #endif
34214 Py_DECREF(kwnames);
34215 for (i = 0; i < nkw; i++)
34216 Py_DECREF(kwvalues[i]);
34217 PyMem_Free(newargs);
34218 return res;
34219}
34220static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
34221{
34222 Py_ssize_t kw_size =
34223 likely(kw == NULL) ?
34224 0 :
34225#if !CYTHON_ASSUME_SAFE_SIZE
34226 PyDict_Size(kw);
34227#else
34228 PyDict_GET_SIZE(kw);
34229#endif
34230 if (kw_size == 0) {
34231 return vc(func, args, nargs, NULL);
34232 }
34233#if !CYTHON_ASSUME_SAFE_SIZE
34234 else if (unlikely(kw_size == -1)) {
34235 return NULL;
34236 }
34237#endif
34238 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
34239}
34240#endif
34241
34242/* CythonFunctionShared (used by CythonFunction) */
34243static PyObject *
34244__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
34245{
34246 if (unlikely(op->func_doc == NULL)) {
34247#if CYTHON_COMPILING_IN_LIMITED_API
34248 const char *doc = op->func_methoddef->ml_doc;
34249#else
34250 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
34251#endif
34252 if (doc) {
34253 op->func_doc = PyUnicode_FromString(doc);
34254 if (unlikely(op->func_doc == NULL))
34255 return NULL;
34256 } else {
34257 Py_INCREF(Py_None);
34258 return Py_None;
34259 }
34260 }
34261 Py_INCREF(op->func_doc);
34262 return op->func_doc;
34263}
34264static PyObject *
34265__Pyx_CyFunction_get_doc(PyObject *op_in, void *closure) {
34266 PyObject *result;
34267 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34268 CYTHON_UNUSED_VAR(closure);
34269 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34270 result = __Pyx_CyFunction_get_doc_locked(op);
34271 __Pyx_END_CRITICAL_SECTION();
34272 return result;
34273}
34274static int
34275__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value, void *context)
34276{
34277 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34278 CYTHON_UNUSED_VAR(context);
34279 if (value == NULL) {
34280 value = Py_None;
34281 }
34282 Py_INCREF(value);
34283 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34284 __Pyx_Py_XDECREF_SET(op->func_doc, value);
34285 __Pyx_END_CRITICAL_SECTION();
34286 return 0;
34287}
34288static PyObject *
34289__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
34290{
34291 if (unlikely(op->func_name == NULL)) {
34292#if CYTHON_COMPILING_IN_LIMITED_API
34293 const char *name = op->func_methoddef->ml_name;
34294#else
34295 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
34296#endif
34297 op->func_name = PyUnicode_InternFromString(name);
34298 if (unlikely(op->func_name == NULL))
34299 return NULL;
34300 }
34301 Py_INCREF(op->func_name);
34302 return op->func_name;
34303}
34304static PyObject *
34305__Pyx_CyFunction_get_name(PyObject *op, void *context)
34306{
34307 PyObject *result = NULL;
34308 CYTHON_UNUSED_VAR(context);
34309 __Pyx_BEGIN_CRITICAL_SECTION(op);
34310 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
34311 __Pyx_END_CRITICAL_SECTION();
34312 return result;
34313}
34314static int
34315__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value, void *context)
34316{
34317 CYTHON_UNUSED_VAR(context);
34318 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
34319 PyErr_SetString(PyExc_TypeError,
34320 "__name__ must be set to a string object");
34321 return -1;
34322 }
34323 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34324 Py_INCREF(value);
34325 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34326 __Pyx_Py_XDECREF_SET(op->func_name, value);
34327 __Pyx_END_CRITICAL_SECTION();
34328 return 0;
34329}
34330static PyObject *
34331__Pyx_CyFunction_get_qualname(PyObject *op_in, void *context)
34332{
34333 CYTHON_UNUSED_VAR(context);
34334 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34335 PyObject *result;
34336 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34337 Py_INCREF(op->func_qualname);
34338 result = op->func_qualname;
34339 __Pyx_END_CRITICAL_SECTION();
34340 return result;
34341}
34342static int
34343__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value, void *context)
34344{
34345 CYTHON_UNUSED_VAR(context);
34346 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
34347 PyErr_SetString(PyExc_TypeError,
34348 "__qualname__ must be set to a string object");
34349 return -1;
34350 }
34351 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34352 Py_INCREF(value);
34353 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34354 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
34355 __Pyx_END_CRITICAL_SECTION();
34356 return 0;
34357}
34358#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34359static PyObject *
34360__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
34361{
34362 CYTHON_UNUSED_VAR(context);
34363 if (unlikely(op->func_dict == NULL)) {
34364 op->func_dict = PyDict_New();
34365 if (unlikely(op->func_dict == NULL))
34366 return NULL;
34367 }
34368 Py_INCREF(op->func_dict);
34369 return op->func_dict;
34370}
34371#endif
34372static PyObject *
34373__Pyx_CyFunction_get_globals(PyObject *op_in, void *context)
34374{
34375 CYTHON_UNUSED_VAR(context);
34376 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34377 Py_INCREF(op->func_globals);
34378 return op->func_globals;
34379}
34380static PyObject *
34381__Pyx_CyFunction_get_closure(PyObject *op, void *context)
34382{
34383 CYTHON_UNUSED_VAR(op);
34384 CYTHON_UNUSED_VAR(context);
34385 Py_INCREF(Py_None);
34386 return Py_None;
34387}
34388static PyObject *
34389__Pyx_CyFunction_get_code(PyObject *op_in, void *context)
34390{
34391 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34392 PyObject* result = (op->func_code) ? op->func_code : Py_None;
34393 CYTHON_UNUSED_VAR(context);
34394 Py_INCREF(result);
34395 return result;
34396}
34397static int
34398__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
34399 int result = 0;
34400 PyObject *res = op->defaults_getter(op_obj);
34401 if (unlikely(!res))
34402 return -1;
34403 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34404 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
34405 Py_INCREF(op->defaults_tuple);
34406 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
34407 Py_INCREF(op->defaults_kwdict);
34408 #else
34409 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
34410 if (unlikely(!op->defaults_tuple)) result = -1;
34411 else {
34412 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
34413 if (unlikely(!op->defaults_kwdict)) result = -1;
34414 }
34415 #endif
34416 Py_DECREF(res);
34417 return result;
34418}
34419static int
34420__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value, void *context) {
34421 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34422 CYTHON_UNUSED_VAR(context);
34423 if (!value) {
34424 value = Py_None;
34425 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
34426 PyErr_SetString(PyExc_TypeError,
34427 "__defaults__ must be set to a tuple object");
34428 return -1;
34429 }
34430 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
34431 "currently affect the values used in function calls", 1);
34432 Py_INCREF(value);
34433 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34434 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
34435 __Pyx_END_CRITICAL_SECTION();
34436 return 0;
34437}
34438static PyObject *
34439__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
34440 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34441 PyObject* result = op->defaults_tuple;
34442 if (unlikely(!result)) {
34443 if (op->defaults_getter) {
34444 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
34445 result = op->defaults_tuple;
34446 } else {
34447 result = Py_None;
34448 }
34449 }
34450 Py_INCREF(result);
34451 return result;
34452}
34453static PyObject *
34454__Pyx_CyFunction_get_defaults(PyObject *op, void *context) {
34455 PyObject* result = NULL;
34456 CYTHON_UNUSED_VAR(context);
34457 __Pyx_BEGIN_CRITICAL_SECTION(op);
34458 result = __Pyx_CyFunction_get_defaults_locked(op);
34459 __Pyx_END_CRITICAL_SECTION();
34460 return result;
34461}
34462static int
34463__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value, void *context) {
34464 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34465 CYTHON_UNUSED_VAR(context);
34466 if (!value) {
34467 value = Py_None;
34468 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
34469 PyErr_SetString(PyExc_TypeError,
34470 "__kwdefaults__ must be set to a dict object");
34471 return -1;
34472 }
34473 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
34474 "currently affect the values used in function calls", 1);
34475 Py_INCREF(value);
34476 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34477 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
34478 __Pyx_END_CRITICAL_SECTION();
34479 return 0;
34480}
34481static PyObject *
34482__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
34483 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34484 PyObject* result = op->defaults_kwdict;
34485 if (unlikely(!result)) {
34486 if (op->defaults_getter) {
34487 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
34488 result = op->defaults_kwdict;
34489 } else {
34490 result = Py_None;
34491 }
34492 }
34493 Py_INCREF(result);
34494 return result;
34495}
34496static PyObject *
34497__Pyx_CyFunction_get_kwdefaults(PyObject *op, void *context) {
34498 PyObject* result;
34499 CYTHON_UNUSED_VAR(context);
34500 __Pyx_BEGIN_CRITICAL_SECTION(op);
34501 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
34502 __Pyx_END_CRITICAL_SECTION();
34503 return result;
34504}
34505static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
34506static int
34507__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value, void *context) {
34508 CYTHON_UNUSED_VAR(context);
34509 if (!value || value == Py_None) {
34510 value = NULL;
34511 } else if (unlikely(!PyDict_Check(value))) {
34512 PyErr_SetString(PyExc_TypeError,
34513 "__annotations__ must be set to a dict object");
34514 return -1;
34515 }
34516 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34517 Py_XINCREF(value);
34518 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34519 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
34520 __Pyx_END_CRITICAL_SECTION();
34521 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0)) return -1;
34522 return 0;
34523}
34524static int
34525__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
34526 /* Return 1 if the function dict exists, 0 otherwise. This cannot fail:
34527 * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
34528#if CYTHON_COMPILING_IN_PYPY
34529 *dict = PyObject_GenericGetDict(op_in, NULL);
34530#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
34531 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
34532#else
34533 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
34534 *dict = likely(dictptr) ? *dictptr : NULL;
34535#endif
34536 return *dict ? 1 : 0;
34537}
34538static int
34539__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
34540 PyObject *dict;
34541 int dict_found;
34542 *annotate = NULL;
34543 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
34544 if (!dict_found) return 0;
34545 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
34546}
34547static int
34548__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
34549 PyObject *dict;
34550 int dict_found;
34551 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
34552 if (!dict_found) return 0;
34553 if (value) {
34554 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
34555 } else {
34556#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
34557 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
34558#else
34559 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
34560 if (result == 1) {
34561 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
34562 }
34563 return result;
34564#endif
34565 }
34566}
34567static int
34568__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
34569 PyObject *dict;
34570 int result;
34571#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34572 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
34573#else
34574 dict = PyObject_GenericGetDict(op_in, NULL);
34575#endif
34576 if (unlikely(!dict)) return -1;
34577 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
34578 Py_DECREF(dict);
34579 return result;
34580}
34581static PyObject *
34582__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
34583 PyObject* result = op->func_annotations;
34584 if (unlikely(!result)) {
34585 result = PyDict_New();
34586 if (unlikely(!result)) return NULL;
34587 op->func_annotations = result;
34588 }
34589 Py_INCREF(result);
34590 return result;
34591}
34592static PyObject *
34593__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) {
34594 PyObject *annotate = NULL;
34595 PyObject *result = NULL;
34596 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34597 CYTHON_UNUSED_VAR(context);
34598 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34599 result = __Pyx_XNewRef(op->func_annotations);
34600 __Pyx_END_CRITICAL_SECTION();
34601 if (result) return result;
34602 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
34603 if (!annotate || annotate == Py_None) {
34604 Py_XDECREF(annotate);
34605 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34606 result = __Pyx_CyFunction_get_annotations_locked(op);
34607 __Pyx_END_CRITICAL_SECTION();
34608 return result;
34609 }
34610 PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE
34611 if (likely(format)) {
34612 if (!Py_EnterRecursiveCall(" cyfunction __annotations__.__get__")) {
34613 result = __Pyx_PyObject_CallOneArg(annotate, format);
34614 Py_LeaveRecursiveCall();
34615 Py_DECREF(format);
34616 }
34617 }
34618 Py_DECREF(annotate);
34619 if (unlikely(!result)) return NULL;
34620 if (unlikely(!PyDict_Check(result))) {
34621 PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
34622 Py_DECREF(result);
34623 return NULL;
34624 }
34625 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34626 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
34627 __Pyx_END_CRITICAL_SECTION();
34628 return result;
34629}
34630static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
34631 CYTHON_UNUSED_VAR(arg);
34632 if (unlikely(!self)) {
34633 PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
34634 return NULL;
34635 }
34636 PyObject *result;
34637 if (Py_EnterRecursiveCall(" in cyfunction annotate")) {
34638 return NULL;
34639 }
34640 result = __Pyx_CyFunction_get_annotations(self, NULL);
34641 Py_LeaveRecursiveCall();
34642 return result;
34643}
34644static PyObject *
34645__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context);
34646static int
34647__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
34648 CYTHON_UNUSED_VAR(context);
34649 if (value == NULL) {
34650 PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
34651 return -1;
34652 }
34653 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
34654 PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
34655 return -1;
34656 }
34657 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
34658#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
34659 PyCFunction cfunction = PyCFunction_GetFunction(value);
34660 if (unlikely(!cfunction)) return -1;
34661 PyObject *value_self = PyCFunction_GetSelf(value);
34662 if (unlikely(!value_self && PyErr_Occurred())) return -1;
34663#else
34664 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
34665 PyObject *value_self = PyCFunction_GET_SELF(value);
34666#endif
34667 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
34668 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
34669 }
34670 }
34671 if (value != Py_None) {
34672 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34673 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34674 Py_CLEAR(op->func_annotations);
34675 __Pyx_END_CRITICAL_SECTION();
34676 }
34677 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
34678}
34679#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
34680static PyObject *
34681__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
34682 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
34683 if (is_coroutine) {
34684 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
34685 fromlist = PyList_New(1);
34686 if (unlikely(!fromlist)) return NULL;
34687 Py_INCREF(marker);
34688#if CYTHON_ASSUME_SAFE_MACROS
34689 PyList_SET_ITEM(fromlist, 0, marker);
34690#else
34691 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
34692 Py_DECREF(fromlist);
34693 return NULL;
34694 }
34695#endif
34696 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
34697 Py_DECREF(fromlist);
34698 if (unlikely(!module)) {
34699 goto ignore_or_error;
34700 }
34701 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
34702 Py_DECREF(module);
34703 if (likely(is_coroutine_value)) {
34704 return is_coroutine_value;
34705 }
34706ignore_or_error:
34707 if (!__Pyx_IgnoreException(PyExc_Exception)) {
34708 return NULL;
34709 }
34710 }
34711 return __Pyx_PyBool_FromLong(is_coroutine);
34712}
34713static PyObject *
34714__Pyx_CyFunction_get_is_coroutine(PyObject *op_in, void *context) {
34715 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34716 PyObject *result;
34717 CYTHON_UNUSED_VAR(context);
34718 if (op->func_is_coroutine) {
34719 return __Pyx_NewRef(op->func_is_coroutine);
34720 }
34721 result = __Pyx_CyFunction_get_is_coroutine_value(op);
34722 if (unlikely(!result))
34723 return NULL;
34724 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34725 if (op->func_is_coroutine) {
34726 Py_DECREF(result);
34727 result = __Pyx_NewRef(op->func_is_coroutine);
34728 } else {
34729 op->func_is_coroutine = __Pyx_NewRef(result);
34730 }
34731 __Pyx_END_CRITICAL_SECTION();
34732 return result;
34733}
34734#endif
34735static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func, const char* message, Py_ssize_t size) {
34736#if CYTHON_COMPILING_IN_LIMITED_API
34737 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
34738 if (!py_name) return;
34739 PyErr_Format(PyExc_TypeError,
34740 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
34741 py_name, message, size);
34742 Py_DECREF(py_name);
34743#else
34744 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
34745 PyErr_Format(PyExc_TypeError,
34746 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
34747 name, message, size);
34748#endif
34749}
34750static void __Pyx_CyFunction_raise_type_error(PyObject *func, const char* message) {
34751#if CYTHON_COMPILING_IN_LIMITED_API
34752 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
34753 if (!py_name) return;
34754 PyErr_Format(PyExc_TypeError,
34755 "%.200S() %s",
34756 py_name, message);
34757 Py_DECREF(py_name);
34758#else
34759 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
34760 PyErr_Format(PyExc_TypeError,
34761 "%.200s() %s",
34762 name, message);
34763#endif
34764}
34765#if CYTHON_COMPILING_IN_LIMITED_API
34766static PyObject *
34767__Pyx_CyFunction_get_module(PyObject *op_in, void *context) {
34768 CYTHON_UNUSED_VAR(context);
34769 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34770 Py_INCREF(op->func_module);
34771 return op->func_module;
34772}
34773static int
34774__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value, void *context) {
34775 CYTHON_UNUSED_VAR(context);
34776 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34777 if (value == NULL) {
34778 value = Py_None;
34779 }
34780 Py_INCREF(value);
34781 PyObject *old = op->func_module;
34782 op->func_module = value;
34783 Py_DECREF(old);
34784 return 0;
34785}
34786#endif
34787static PyGetSetDef __pyx_CyFunction_getsets[] = {
34788 {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
34789 {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
34790 {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
34791 {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
34792 {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
34793#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34794 {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
34795 {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
34796#else
34797 {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
34798 {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
34799#endif
34800 {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
34801 {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
34802 {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
34803 {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
34804 {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
34805 {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
34806 {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
34807 {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
34808 {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
34809 {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
34810 {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
34811#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
34812 {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
34813#endif
34814#if CYTHON_COMPILING_IN_LIMITED_API
34815 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
34816#endif
34817 {0, 0, 0, 0, 0}
34818};
34819static PyMemberDef __pyx_CyFunction_members[] = {
34820#if !CYTHON_COMPILING_IN_LIMITED_API
34821 {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
34822#endif
34823#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
34824 {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
34825 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
34826#endif
34827#if CYTHON_VECTORCALL
34828#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
34829 {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
34830 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
34831#else
34832 {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
34833#endif
34834#if CYTHON_COMPILING_IN_LIMITED_API
34835 {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
34836 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
34837#else
34838 {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
34839#endif
34840#endif
34841 {0, 0, 0, 0, 0}
34842};
34843static PyObject *
34844__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
34845{
34846 PyObject *result = NULL;
34847 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
34848 CYTHON_UNUSED_VAR(args);
34849 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
34850 Py_INCREF(m->func_qualname);
34851 result = m->func_qualname;
34852 __Pyx_END_CRITICAL_SECTION();
34853 return result;
34854}
34855static PyMethodDef __pyx_CyFunction_methods[] = {
34856 {"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
34857 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
34858 "on Cython functions."},
34859 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
34860 {0, 0, 0, 0}
34861};
34862static PyObject *
34863__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
34864 PyObject *annotate = NULL;
34865 CYTHON_UNUSED_VAR(context);
34866 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
34867 if (annotate) return annotate;
34868 PyObject *method = PyCFunction_New(
34869 &__pyx_CyFunction_methods[0],
34870 op_in);
34871 return method;
34872}
34873#if CYTHON_COMPILING_IN_LIMITED_API
34874#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
34875#else
34876#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
34877#endif
34878static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
34879 PyMethodDef *ml, int flags, PyObject* qualname,
34880 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
34881 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
34882#if !CYTHON_COMPILING_IN_LIMITED_API
34883 PyCFunctionObject *cf = (PyCFunctionObject*) op;
34884#endif
34885 if (unlikely(op == NULL))
34886 return NULL;
34887#if CYTHON_COMPILING_IN_LIMITED_API
34888 op->func_methoddef = ml;
34889 Py_INCREF(module);
34890 op->func_module = module;
34891#endif
34892 op->flags = flags;
34893 __Pyx_CyFunction_weakreflist(op) = NULL;
34894#if !CYTHON_COMPILING_IN_LIMITED_API
34895 cf->m_ml = ml;
34896 cf->m_self = (PyObject *) op;
34897#endif
34898 Py_XINCREF(closure);
34899 op->func_closure = closure;
34900#if !CYTHON_COMPILING_IN_LIMITED_API
34901 Py_XINCREF(module);
34902 cf->m_module = module;
34903#endif
34904#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
34905 op->func_dict = NULL;
34906#endif
34907 op->func_name = NULL;
34908 Py_INCREF(qualname);
34909 op->func_qualname = qualname;
34910 op->func_doc = NULL;
34911#if CYTHON_COMPILING_IN_LIMITED_API
34912 op->func_classobj = NULL;
34913#else
34914 ((PyCMethodObject*)op)->mm_class = NULL;
34915#endif
34916 op->func_globals = globals;
34917 Py_INCREF(op->func_globals);
34918 Py_XINCREF(code);
34919 op->func_code = code;
34920 op->defaults = NULL;
34921 op->defaults_tuple = NULL;
34922 op->defaults_kwdict = NULL;
34923 op->defaults_getter = NULL;
34924 op->func_annotations = NULL;
34925#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
34926 op->func_is_coroutine = NULL;
34927#endif
34928#if CYTHON_VECTORCALL
34929 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
34930 case METH_NOARGS:
34931 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
34932 break;
34933 case METH_O:
34934 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
34935 break;
34936 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
34937 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
34938 break;
34939 case METH_FASTCALL | METH_KEYWORDS:
34940 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
34941 break;
34942 case METH_VARARGS | METH_KEYWORDS:
34943 __Pyx_CyFunction_func_vectorcall(op) = NULL;
34944 break;
34945 default:
34946 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
34947 Py_DECREF(op_in);
34948 return NULL;
34949 }
34950#endif
34951 return op_in;
34952}
34953static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
34954{
34955 Py_CLEAR(m->func_closure);
34956#if CYTHON_COMPILING_IN_LIMITED_API
34957 Py_CLEAR(m->func_module);
34958#else
34959 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
34960#endif
34961#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
34962 Py_CLEAR(m->func_dict);
34963#elif PY_VERSION_HEX < 0x030d0000
34964 _PyObject_ClearManagedDict((PyObject*)m);
34965#else
34966 PyObject_ClearManagedDict((PyObject*)m);
34967#endif
34968 Py_CLEAR(m->func_name);
34969 Py_CLEAR(m->func_qualname);
34970 Py_CLEAR(m->func_doc);
34971 Py_CLEAR(m->func_globals);
34972 Py_CLEAR(m->func_code);
34973#if CYTHON_COMPILING_IN_LIMITED_API
34974 Py_CLEAR(m->func_classobj);
34975#else
34976 {
34977 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
34978 ((PyCMethodObject *) (m))->mm_class = NULL;
34979 Py_XDECREF(cls);
34980 }
34981#endif
34982 Py_CLEAR(m->defaults_tuple);
34983 Py_CLEAR(m->defaults_kwdict);
34984 Py_CLEAR(m->func_annotations);
34985#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
34986 Py_CLEAR(m->func_is_coroutine);
34987#endif
34988 Py_CLEAR(m->defaults);
34989 return 0;
34990}
34991static int
34992__Pyx_CyFunction_clear(PyObject *m)
34993{
34994 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
34995}
34996static void __Pyx__CyFunction_dealloc(PyObject *m)
34997{
34998 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
34999 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
35000 PyObject_ClearWeakRefs(m);
35001 __Pyx__CyFunction_clear(cyfunc);
35002 __Pyx_PyHeapTypeObject_GC_Del(m);
35003}
35004static void __Pyx_CyFunction_dealloc(PyObject *m)
35005{
35006 PyObject_GC_UnTrack(m);
35007 __Pyx__CyFunction_dealloc(m);
35008}
35009static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit, void *arg)
35010{
35011 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
35012 {
35013 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
35014 if (e) return e;
35015 }
35016 Py_VISIT(m->func_closure);
35017#if CYTHON_COMPILING_IN_LIMITED_API
35018 Py_VISIT(m->func_module);
35019#else
35020 Py_VISIT(((PyCFunctionObject*)m)->m_module);
35021#endif
35022#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35023 Py_VISIT(m->func_dict);
35024#else
35025 {
35026 int e =
35027#if PY_VERSION_HEX < 0x030d0000
35028 _PyObject_VisitManagedDict
35029#else
35030 PyObject_VisitManagedDict
35031#endif
35032 ((PyObject*)m, visit, arg);
35033 if (e != 0) return e;
35034 }
35035#endif
35036 __Pyx_VISIT_CONST(m->func_name);
35037 __Pyx_VISIT_CONST(m->func_qualname);
35038 Py_VISIT(m->func_doc);
35039 Py_VISIT(m->func_globals);
35040 __Pyx_VISIT_CONST(m->func_code);
35041 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
35042 Py_VISIT(m->defaults_tuple);
35043 Py_VISIT(m->defaults_kwdict);
35044 Py_VISIT(m->func_annotations);
35045#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35046 Py_VISIT(m->func_is_coroutine);
35047#endif
35048 Py_VISIT(m->defaults);
35049 return 0;
35050}
35051static PyObject*
35052__Pyx_CyFunction_repr(PyObject *op_in)
35053{
35054 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35055 PyObject *repr;
35056 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35057 repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
35058 op->func_qualname, (void *)op);
35059 __Pyx_END_CRITICAL_SECTION();
35060 return repr;
35061}
35062static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
35063#if CYTHON_COMPILING_IN_LIMITED_API
35064 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35065 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35066 int flags = cyfunc->func_methoddef->ml_flags;
35067#else
35068 PyCFunctionObject* f = (PyCFunctionObject*)func;
35069 PyCFunction meth = f->m_ml->ml_meth;
35070 int flags = f->m_ml->ml_flags;
35071#endif
35072 Py_ssize_t size;
35073 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
35074 case METH_VARARGS:
35075 if (likely(kw == NULL || PyDict_Size(kw) == 0))
35076 return (*meth)(self, arg);
35077 break;
35078 case METH_VARARGS | METH_KEYWORDS:
35079 return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
35080 case METH_NOARGS:
35081 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
35082#if CYTHON_ASSUME_SAFE_SIZE
35083 size = PyTuple_GET_SIZE(arg);
35084#else
35085 size = PyTuple_Size(arg);
35086 if (unlikely(size < 0)) return NULL;
35087#endif
35088 if (likely(size == 0))
35089 return (*meth)(self, NULL);
35090 __Pyx_CyFunction_raise_argument_count_error(
35091 func,
35092 "takes no arguments", size);
35093 return NULL;
35094 }
35095 break;
35096 case METH_O:
35097 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
35098#if CYTHON_ASSUME_SAFE_SIZE
35099 size = PyTuple_GET_SIZE(arg);
35100#else
35101 size = PyTuple_Size(arg);
35102 if (unlikely(size < 0)) return NULL;
35103#endif
35104 if (likely(size == 1)) {
35105 PyObject *result, *arg0;
35106 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35107 arg0 = PyTuple_GET_ITEM(arg, 0);
35108 #else
35109 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
35110 #endif
35111 result = (*meth)(self, arg0);
35112 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
35113 Py_DECREF(arg0);
35114 #endif
35115 return result;
35116 }
35117 __Pyx_CyFunction_raise_argument_count_error(
35118 func,
35119 "takes exactly one argument", size);
35120 return NULL;
35121 }
35122 break;
35123 default:
35124 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
35125 return NULL;
35126 }
35127 __Pyx_CyFunction_raise_type_error(
35128 func, "takes no keyword arguments");
35129 return NULL;
35130}
35131static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
35132 PyObject *result;
35133 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
35134 return result;
35135}
35136static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
35137 PyObject *result;
35138 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35139#if CYTHON_VECTORCALL
35140 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
35141 if (vc) {
35142#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
35143 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
35144#else
35145 (void) &__Pyx_PyVectorcall_FastCallDict;
35146 return PyVectorcall_Call(func, args, kw);
35147#endif
35148 }
35149#endif
35150 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
35151 Py_ssize_t argc;
35152 PyObject *new_args;
35153 PyObject *self;
35154#if CYTHON_ASSUME_SAFE_SIZE
35155 argc = PyTuple_GET_SIZE(args);
35156#else
35157 argc = PyTuple_Size(args);
35158 if (unlikely(argc < 0)) return NULL;
35159#endif
35160 new_args = PyTuple_GetSlice(args, 1, argc);
35161 if (unlikely(!new_args))
35162 return NULL;
35163 self = PyTuple_GetItem(args, 0);
35164 if (unlikely(!self)) {
35165 Py_DECREF(new_args);
35166 PyErr_Format(PyExc_TypeError,
35167 "unbound method %.200S() needs an argument",
35168 cyfunc->func_qualname);
35169 return NULL;
35170 }
35171 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
35172 Py_DECREF(new_args);
35173 } else {
35174 result = __Pyx_CyFunction_Call(func, args, kw);
35175 }
35176 return result;
35177}
35178#if CYTHON_VECTORCALL
35179static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
35180{
35181 int ret = 0;
35182 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
35183 if (unlikely(nargs < 1)) {
35184 __Pyx_CyFunction_raise_type_error(
35185 func, "needs an argument");
35186 return -1;
35187 }
35188 ret = 1;
35189 }
35190 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
35191 __Pyx_CyFunction_raise_type_error(
35192 func, "takes no keyword arguments");
35193 return -1;
35194 }
35195 return ret;
35196}
35197static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
35198{
35199 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35200 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35201 PyObject *self;
35202#if CYTHON_COMPILING_IN_LIMITED_API
35203 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35204 if (unlikely(!meth)) return NULL;
35205#else
35206 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35207#endif
35208 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
35209 case 1:
35210 self = args[0];
35211 args += 1;
35212 nargs -= 1;
35213 break;
35214 case 0:
35215 self = func;
35216 break;
35217 default:
35218 return NULL;
35219 }
35220 if (unlikely(nargs != 0)) {
35221 __Pyx_CyFunction_raise_argument_count_error(
35222 func, "takes no arguments", nargs);
35223 return NULL;
35224 }
35225 return meth(self, NULL);
35226}
35227static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
35228{
35229 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35230 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35231 PyObject *self;
35232#if CYTHON_COMPILING_IN_LIMITED_API
35233 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35234 if (unlikely(!meth)) return NULL;
35235#else
35236 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35237#endif
35238 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
35239 case 1:
35240 self = args[0];
35241 args += 1;
35242 nargs -= 1;
35243 break;
35244 case 0:
35245 self = func;
35246 break;
35247 default:
35248 return NULL;
35249 }
35250 if (unlikely(nargs != 1)) {
35251 __Pyx_CyFunction_raise_argument_count_error(
35252 func, "takes exactly one argument", nargs);
35253 return NULL;
35254 }
35255 return meth(self, args[0]);
35256}
35257static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
35258{
35259 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35260 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35261 PyObject *self;
35262#if CYTHON_COMPILING_IN_LIMITED_API
35263 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35264 if (unlikely(!meth)) return NULL;
35265#else
35266 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35267#endif
35268 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
35269 case 1:
35270 self = args[0];
35271 args += 1;
35272 nargs -= 1;
35273 break;
35274 case 0:
35275 self = func;
35276 break;
35277 default:
35278 return NULL;
35279 }
35280 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
35281}
35282static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
35283{
35284 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35285 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
35286 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35287 PyObject *self;
35288#if CYTHON_COMPILING_IN_LIMITED_API
35289 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35290 if (unlikely(!meth)) return NULL;
35291#else
35292 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35293#endif
35294 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
35295 case 1:
35296 self = args[0];
35297 args += 1;
35298 nargs -= 1;
35299 break;
35300 case 0:
35301 self = func;
35302 break;
35303 default:
35304 return NULL;
35305 }
35306 #if PY_VERSION_HEX < 0x030e00A6
35307 size_t nargs_value = (size_t) nargs;
35308 #else
35309 Py_ssize_t nargs_value = nargs;
35310 #endif
35311 return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
35312}
35313#endif
35314static PyType_Slot __pyx_CyFunctionType_slots[] = {
35315 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
35316 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
35317 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
35318 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
35319 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
35320 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
35321 {Py_tp_members, (void *)__pyx_CyFunction_members},
35322 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
35323 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
35324 {0, 0},
35325};
35326static PyType_Spec __pyx_CyFunctionType_spec = {
35327 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
35328 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
35329 0,
35330#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
35331 Py_TPFLAGS_METHOD_DESCRIPTOR |
35332#endif
35333#if CYTHON_VECTORCALL
35334#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
35335 Py_TPFLAGS_HAVE_VECTORCALL |
35336#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
35337 _Py_TPFLAGS_HAVE_VECTORCALL |
35338#endif
35339#endif // CYTHON_VECTORCALL
35340#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
35341 Py_TPFLAGS_MANAGED_DICT |
35342#endif
35343 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
35344 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
35345 __pyx_CyFunctionType_slots
35346};
35347static int __pyx_CyFunction_init(PyObject *module) {
35348 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
35349 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
35350 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
35351 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
35352 return -1;
35353 }
35354 return 0;
35355}
35356
35357/* CythonFunction */
35358static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
35359 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
35360 (void)&__Pyx_Get_CyFunction_Type;
35361 PyObject *op = __Pyx_CyFunction_Init(
35362 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
35363 ml, flags, qualname, closure, module, globals, code
35364 );
35365 if (likely(op)) {
35366 PyObject_GC_Track(op);
35367 }
35368 return op;
35369}
35370static PyTypeObject *__Pyx_Get_CyFunction_Type(void) {
35371 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
35372 Py_INCREF((PyObject*)tp);
35373 return tp;
35374}
35375
35376/* PyObjectCall2Args (used by Py3ClassCreate) */
35377static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
35378 PyObject *args[3] = {NULL, arg1, arg2};
35379 return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
35380}
35381
35382/* PyObjectLookupSpecial (used by Py3ClassCreate) */
35383#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
35384static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
35385 PyObject *res;
35386 PyTypeObject *tp = Py_TYPE(obj);
35387 res = _PyType_Lookup(tp, attr_name);
35388 if (likely(res)) {
35389 descrgetfunc f = Py_TYPE(res)->tp_descr_get;
35390 if (!f) {
35391 Py_INCREF(res);
35392 } else {
35393 res = f(res, obj, (PyObject *)tp);
35394 }
35395 } else if (with_error) {
35396 PyErr_SetObject(PyExc_AttributeError, attr_name);
35397 }
35398 return res;
35399}
35400#endif
35401
35402/* Py3ClassCreate */
35403static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
35404 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
35405 PyObject *ns;
35406 if (metaclass) {
35407 PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare);
35408 if (prep) {
35409 PyObject *pargs[3] = {NULL, name, bases};
35410 ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
35411 Py_DECREF(prep);
35412 } else {
35413 if (unlikely(PyErr_Occurred()))
35414 return NULL;
35415 ns = PyDict_New();
35416 }
35417 } else {
35418 ns = PyDict_New();
35419 }
35420 if (unlikely(!ns))
35421 return NULL;
35422 if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
35423 if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
35424 if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad;
35425 return ns;
35426bad:
35427 Py_DECREF(ns);
35428 return NULL;
35429}
35430static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
35431 PyObject *dict, PyObject *mkw,
35432 int calculate_metaclass, int allow_py2_metaclass) {
35433 PyObject *result;
35434 PyObject *owned_metaclass = NULL;
35435 PyObject *margs[4] = {NULL, name, bases, dict};
35436 if (allow_py2_metaclass) {
35437 owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass);
35438 if (owned_metaclass) {
35439 metaclass = owned_metaclass;
35440 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
35441 PyErr_Clear();
35442 } else {
35443 return NULL;
35444 }
35445 }
35446 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
35447 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
35448 Py_XDECREF(owned_metaclass);
35449 if (unlikely(!metaclass))
35450 return NULL;
35451 owned_metaclass = metaclass;
35452 }
35453 result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
35454 Py_XDECREF(owned_metaclass);
35455 return result;
35456}
35457
35458/* CLineInTraceback (used by AddTraceback) */
35459#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
35460#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
35461#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
35462#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35463#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
35464#else
35465PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
35466 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
35467 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
35468}
35469#endif
35470static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
35471 PyObject *use_cline = NULL;
35472 PyObject *ptype, *pvalue, *ptraceback;
35473 PyObject *cython_runtime_dict;
35474 CYTHON_MAYBE_UNUSED_VAR(tstate);
35475 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
35476 return c_line;
35477 }
35478 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
35479 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
35480 if (likely(cython_runtime_dict)) {
35481 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
35482 use_cline, cython_runtime_dict,
35483 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
35484 }
35485 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
35486 c_line = 0;
35487 }
35488 Py_XDECREF(use_cline);
35489 Py_XDECREF(cython_runtime_dict);
35490 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
35491 return c_line;
35492}
35493#endif
35494
35495/* CodeObjectCache (used by AddTraceback) */
35496static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
35497 int start = 0, mid = 0, end = count - 1;
35498 if (end >= 0 && code_line > entries[end].code_line) {
35499 return count;
35500 }
35501 while (start < end) {
35502 mid = start + (end - start) / 2;
35503 if (code_line < entries[mid].code_line) {
35504 end = mid;
35505 } else if (code_line > entries[mid].code_line) {
35506 start = mid + 1;
35507 } else {
35508 return mid;
35509 }
35510 }
35511 if (code_line <= entries[mid].code_line) {
35512 return mid;
35513 } else {
35514 return mid + 1;
35515 }
35516}
35517static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
35518 __Pyx_CachedCodeObjectType* code_object;
35519 int pos;
35520 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
35521 return NULL;
35522 }
35523 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
35524 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
35525 return NULL;
35526 }
35527 code_object = code_cache->entries[pos].code_object;
35528 Py_INCREF(code_object);
35529 return code_object;
35530}
35531static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
35532#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
35533 (void)__pyx__find_code_object;
35534 return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
35535#else
35536 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
35537#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35538 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
35539 if (old_count < 0) {
35540 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
35541 return NULL;
35542 }
35543#endif
35544 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
35545#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35546 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
35547#endif
35548 return result;
35549#endif
35550}
35551static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
35552{
35553 int pos, i;
35554 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
35555 if (unlikely(!code_line)) {
35556 return;
35557 }
35558 if (unlikely(!entries)) {
35559 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
35560 if (likely(entries)) {
35561 code_cache->entries = entries;
35562 code_cache->max_count = 64;
35563 code_cache->count = 1;
35564 entries[0].code_line = code_line;
35565 entries[0].code_object = code_object;
35566 Py_INCREF(code_object);
35567 }
35568 return;
35569 }
35570 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
35571 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
35572 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
35573 entries[pos].code_object = code_object;
35574 Py_INCREF(code_object);
35575 Py_DECREF(tmp);
35576 return;
35577 }
35578 if (code_cache->count == code_cache->max_count) {
35579 int new_max = code_cache->max_count + 64;
35580 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
35581 code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
35582 if (unlikely(!entries)) {
35583 return;
35584 }
35585 code_cache->entries = entries;
35586 code_cache->max_count = new_max;
35587 }
35588 for (i=code_cache->count; i>pos; i--) {
35589 entries[i] = entries[i-1];
35590 }
35591 entries[pos].code_line = code_line;
35592 entries[pos].code_object = code_object;
35593 code_cache->count++;
35594 Py_INCREF(code_object);
35595}
35596static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
35597#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
35598 (void)__pyx__insert_code_object;
35599 return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
35600#else
35601 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
35602#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35603 __pyx_nonatomic_int_type expected = 0;
35604 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
35605 return;
35606 }
35607#endif
35608 __pyx__insert_code_object(code_cache, code_line, code_object);
35609#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35610 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
35611#endif
35612#endif
35613}
35614
35615/* AddTraceback */
35616#include "compile.h"
35617#include "frameobject.h"
35618#include "traceback.h"
35619#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
35620 #ifndef Py_BUILD_CORE
35621 #define Py_BUILD_CORE 1
35622 #endif
35623 #include "internal/pycore_frame.h"
35624#endif
35625#if CYTHON_COMPILING_IN_LIMITED_API
35626static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
35627 PyObject *firstlineno, PyObject *name) {
35628 PyObject *replace = NULL;
35629 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
35630 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
35631 replace = PyObject_GetAttrString(code, "replace");
35632 if (likely(replace)) {
35633 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
35634 Py_DECREF(replace);
35635 return result;
35636 }
35637 return NULL;
35638}
35639static void __Pyx_AddTraceback(const char *funcname, int c_line,
35640 int py_line, const char *filename) {
35641 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
35642 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
35643 PyObject *exc_type, *exc_value, *exc_traceback;
35644 int success = 0;
35645 if (c_line) {
35646 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
35647 }
35648 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
35649 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
35650 if (!code_object) {
35651 code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
35652 if (unlikely(!code_object)) goto bad;
35653 py_py_line = PyLong_FromLong(py_line);
35654 if (unlikely(!py_py_line)) goto bad;
35655 if (c_line) {
35656 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
35657 } else {
35658 py_funcname = PyUnicode_FromString(funcname);
35659 }
35660 if (unlikely(!py_funcname)) goto bad;
35661 dict = PyDict_New();
35662 if (unlikely(!dict)) goto bad;
35663 {
35664 PyObject *old_code_object = code_object;
35665 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
35666 Py_DECREF(old_code_object);
35667 }
35668 if (unlikely(!code_object)) goto bad;
35669 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
35670 } else {
35671 dict = PyDict_New();
35672 }
35673 getframe = PySys_GetObject("_getframe");
35674 if (unlikely(!getframe)) goto bad;
35675 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
35676 frame = PyEval_EvalCode(code_object, dict, dict);
35677 if (unlikely(!frame) || frame == Py_None) goto bad;
35678 success = 1;
35679 bad:
35680 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
35681 Py_XDECREF(code_object);
35682 Py_XDECREF(py_py_line);
35683 Py_XDECREF(py_funcname);
35684 Py_XDECREF(dict);
35685 Py_XDECREF(replace);
35686 if (success) {
35687 PyTraceBack_Here(
35688 (struct _frame*)frame);
35689 }
35690 Py_XDECREF(frame);
35691}
35692#else
35693static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
35694 const char *funcname, int c_line,
35695 int py_line, const char *filename) {
35696 PyCodeObject *py_code = NULL;
35697 PyObject *py_funcname = NULL;
35698 if (c_line) {
35699 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
35700 if (!py_funcname) goto bad;
35701 funcname = PyUnicode_AsUTF8(py_funcname);
35702 if (!funcname) goto bad;
35703 }
35704 py_code = PyCode_NewEmpty(filename, funcname, py_line);
35705 Py_XDECREF(py_funcname);
35706 return py_code;
35707bad:
35708 Py_XDECREF(py_funcname);
35709 return NULL;
35710}
35711static void __Pyx_AddTraceback(const char *funcname, int c_line,
35712 int py_line, const char *filename) {
35713 PyCodeObject *py_code = 0;
35714 PyFrameObject *py_frame = 0;
35715 PyThreadState *tstate = __Pyx_PyThreadState_Current;
35716 PyObject *ptype, *pvalue, *ptraceback;
35717 if (c_line) {
35718 c_line = __Pyx_CLineForTraceback(tstate, c_line);
35719 }
35720 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
35721 if (!py_code) {
35722 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
35723 py_code = __Pyx_CreateCodeObjectForTraceback(
35724 funcname, c_line, py_line, filename);
35725 if (!py_code) {
35726 /* If the code object creation fails, then we should clear the
35727 fetched exception references and propagate the new exception */
35728 Py_XDECREF(ptype);
35729 Py_XDECREF(pvalue);
35730 Py_XDECREF(ptraceback);
35731 goto bad;
35732 }
35733 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
35734 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
35735 }
35736 py_frame = PyFrame_New(
35737 tstate, /*PyThreadState *tstate,*/
35738 py_code, /*PyCodeObject *code,*/
35739 __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/
35740 0 /*PyObject *locals*/
35741 );
35742 if (!py_frame) goto bad;
35743 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
35744 PyTraceBack_Here(py_frame);
35745bad:
35746 Py_XDECREF(py_code);
35747 Py_XDECREF(py_frame);
35748}
35749#endif
35750
35751/* MemviewRefcount */
35752#include <stdio.h>
35753#ifndef _Py_NO_RETURN
35754#define _Py_NO_RETURN
35755#endif
35756_Py_NO_RETURN
35757static void __pyx_fatalerror(const char *fmt, ...) {
35758 va_list vargs;
35759 char msg[200];
35760#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
35761 va_start(vargs, fmt);
35762#else
35763 va_start(vargs);
35764#endif
35765 vsnprintf(msg, 200, fmt, vargs);
35766 va_end(vargs);
35767 Py_FatalError(msg);
35768}
35769static CYTHON_INLINE int
35770__pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
35771 PyThread_type_lock lock)
35772{
35773 int result;
35774 PyThread_acquire_lock(lock, 1);
35775 result = (*acquisition_count)++;
35776 PyThread_release_lock(lock);
35777 return result;
35778}
35779static CYTHON_INLINE int
35780__pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
35781 PyThread_type_lock lock)
35782{
35783 int result;
35784 PyThread_acquire_lock(lock, 1);
35785 result = (*acquisition_count)--;
35786 PyThread_release_lock(lock);
35787 return result;
35788}
35789static CYTHON_INLINE void
35790__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
35791{
35792 __pyx_nonatomic_int_type old_acquisition_count;
35793 struct __pyx_memoryview_obj *memview = memslice->memview;
35794 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
35795 return;
35796 }
35797 old_acquisition_count = __pyx_add_acquisition_count(memview);
35798 if (unlikely(old_acquisition_count <= 0)) {
35799 if (likely(old_acquisition_count == 0)) {
35800 if (have_gil) {
35801 Py_INCREF((PyObject *) memview);
35802 } else {
35803 PyGILState_STATE _gilstate = PyGILState_Ensure();
35804 Py_INCREF((PyObject *) memview);
35805 PyGILState_Release(_gilstate);
35806 }
35807 } else {
35808 __pyx_fatalerror("Acquisition count is %d (line %d)",
35809 old_acquisition_count+1, lineno);
35810 }
35811 }
35812}
35813static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
35814 int have_gil, int lineno) {
35815 __pyx_nonatomic_int_type old_acquisition_count;
35816 struct __pyx_memoryview_obj *memview = memslice->memview;
35817 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
35818 memslice->memview = NULL;
35819 return;
35820 }
35821 old_acquisition_count = __pyx_sub_acquisition_count(memview);
35822 memslice->data = NULL;
35823 if (likely(old_acquisition_count > 1)) {
35824 memslice->memview = NULL;
35825 } else if (likely(old_acquisition_count == 1)) {
35826 if (have_gil) {
35827 Py_CLEAR(memslice->memview);
35828 } else {
35829 PyGILState_STATE _gilstate = PyGILState_Ensure();
35830 Py_CLEAR(memslice->memview);
35831 PyGILState_Release(_gilstate);
35832 }
35833 } else {
35834 __pyx_fatalerror("Acquisition count is %d (line %d)",
35835 old_acquisition_count-1, lineno);
35836 }
35837}
35838
35839/* MemviewSliceIsContig */
35840static int
35841__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
35842{
35843 int i, index, step, start;
35844 Py_ssize_t itemsize = mvs.memview->view.itemsize;
35845 if (order == 'F') {
35846 step = 1;
35847 start = 0;
35848 } else {
35849 step = -1;
35850 start = ndim - 1;
35851 }
35852 for (i = 0; i < ndim; i++) {
35853 index = start + step * i;
35854 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
35855 return 0;
35856 itemsize *= mvs.shape[index];
35857 }
35858 return 1;
35859}
35860
35861/* OverlappingSlices */
35862static void
35863__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
35864 void **out_start, void **out_end,
35865 int ndim, size_t itemsize)
35866{
35867 char *start, *end;
35868 int i;
35869 start = end = slice->data;
35870 for (i = 0; i < ndim; i++) {
35871 Py_ssize_t stride = slice->strides[i];
35872 Py_ssize_t extent = slice->shape[i];
35873 if (extent == 0) {
35874 *out_start = *out_end = start;
35875 return;
35876 } else {
35877 if (stride > 0)
35878 end += stride * (extent - 1);
35879 else
35880 start += stride * (extent - 1);
35881 }
35882 }
35883 *out_start = start;
35884 *out_end = end + itemsize;
35885}
35886static int
35887__pyx_slices_overlap(__Pyx_memviewslice *slice1,
35888 __Pyx_memviewslice *slice2,
35889 int ndim, size_t itemsize)
35890{
35891 void *start1, *end1, *start2, *end2;
35892 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
35893 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
35894 return (start1 < end2) && (start2 < end1);
35895}
35896
35897/* MemviewSliceInit */
35898static int
35899__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
35900 int ndim,
35901 __Pyx_memviewslice *memviewslice,
35902 int memview_is_new_reference)
35903{
35904 __Pyx_RefNannyDeclarations
35905 int i, retval=-1;
35906 Py_buffer *buf = &memview->view;
35907 __Pyx_RefNannySetupContext("init_memviewslice", 0);
35908 if (unlikely(memviewslice->memview || memviewslice->data)) {
35909 PyErr_SetString(PyExc_ValueError,
35910 "memviewslice is already initialized!");
35911 goto fail;
35912 }
35913 if (buf->strides) {
35914 for (i = 0; i < ndim; i++) {
35915 memviewslice->strides[i] = buf->strides[i];
35916 }
35917 } else {
35918 Py_ssize_t stride = buf->itemsize;
35919 for (i = ndim - 1; i >= 0; i--) {
35920 memviewslice->strides[i] = stride;
35921 stride *= buf->shape[i];
35922 }
35923 }
35924 for (i = 0; i < ndim; i++) {
35925 memviewslice->shape[i] = buf->shape[i];
35926 if (buf->suboffsets) {
35927 memviewslice->suboffsets[i] = buf->suboffsets[i];
35928 } else {
35929 memviewslice->suboffsets[i] = -1;
35930 }
35931 }
35932 memviewslice->memview = memview;
35933 memviewslice->data = (char *)buf->buf;
35934 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
35935 Py_INCREF((PyObject*)memview);
35936 }
35937 retval = 0;
35938 goto no_fail;
35939fail:
35940 memviewslice->memview = 0;
35941 memviewslice->data = 0;
35942 retval = -1;
35943no_fail:
35944 __Pyx_RefNannyFinishContext();
35945 return retval;
35946}
35947
35948/* SliceMemoryviewSlice */
35949static void __pyx_memoryview_slice_memviewslice_err_dim(PyObject *error, const char* msg, int dim) {
35950 PyGILState_STATE gilstate = PyGILState_Ensure();
35951 PyErr_Format(error, msg, dim);
35952 PyGILState_Release(gilstate);
35953}
35954static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
35955 __Pyx_memviewslice *dst,
35956 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
35957 int dim, int new_ndim, int *suboffset_dim,
35958 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
35959 int have_start, int have_stop, int have_step,
35960 int is_slice) {
35961 if (!is_slice) {
35962 if (start < 0) {
35963 start += shape;
35964 }
35965 if (unlikely(!(0 <= start && start < shape))) {
35966 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim);
35967 return -1;
35968 }
35969 } else {
35970 int negative_step;
35971 if (have_step) {
35972 negative_step = step < 0;
35973 if (unlikely(step == 0)) {
35974 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim);
35975 return -1;
35976 }
35977 } else {
35978 negative_step = 0;
35979 step = 1;
35980 }
35981 if (have_start) {
35982 if (start < 0) {
35983 start += shape;
35984 if (start < 0) {
35985 start = 0;
35986 }
35987 } else if (start >= shape) {
35988 start = negative_step ? (shape - 1) : shape;
35989 }
35990 } else {
35991 start = negative_step ? (shape - 1) : 0;
35992 }
35993 if (have_stop) {
35994 if (stop < 0) {
35995 stop += shape;
35996 if (stop < 0) {
35997 stop = 0;
35998 }
35999 } else if (stop > shape) {
36000 stop = shape;
36001 }
36002 } else {
36003 stop = negative_step ? -1 : shape;
36004 }
36005 Py_ssize_t new_shape = (stop - start) / step;
36006 if ((stop - start) - step * new_shape) {
36007 ++new_shape;
36008 }
36009 if (new_shape < 0) {
36010 new_shape = 0;
36011 }
36012 dst->strides[new_ndim] = stride * step;
36013 dst->shape[new_ndim] = new_shape;
36014 dst->suboffsets[new_ndim] = suboffset;
36015 }
36016 if (suboffset_dim[0] < 0) {
36017 dst->data += start * stride;
36018 } else {
36019 dst->suboffsets[suboffset_dim[0]] += start * stride;
36020 }
36021 if (suboffset >= 0) {
36022 if (!is_slice) {
36023 if (likely(new_ndim == 0)) {
36024 dst->data = ((char **)(dst->data))[0] + suboffset;
36025 } else {
36026 __pyx_memoryview_slice_memviewslice_err_dim(
36027 PyExc_IndexError,
36028 "All dimensions preceding dimension %d must be indexed and not sliced",
36029 dim);
36030 return -1;
36031 }
36032 } else {
36033 suboffset_dim[0] = new_ndim;
36034 }
36035 }
36036 return 0;
36037}
36038
36039/* CIntFromPyVerify */
36040#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
36041 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
36042#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
36043 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
36044#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
36045 {\
36046 func_type value = func_value;\
36047 if (sizeof(target_type) < sizeof(func_type)) {\
36048 if (unlikely(value != (func_type) (target_type) value)) {\
36049 func_type zero = 0;\
36050 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
36051 return (target_type) -1;\
36052 if (is_unsigned && unlikely(value < zero))\
36053 goto raise_neg_overflow;\
36054 else\
36055 goto raise_overflow;\
36056 }\
36057 }\
36058 return (target_type) value;\
36059 }
36060
36061/* IsLittleEndian (used by BufferFormatCheck) */
36062static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
36063{
36064 union {
36065 uint32_t u32;
36066 uint8_t u8[4];
36067 } S;
36068 S.u32 = 0x01020304;
36069 return S.u8[0] == 4;
36070}
36071
36072/* BufferFormatCheck (used by MemviewSliceValidateAndInit) */
36073static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
36074 __Pyx_BufFmt_StackElem* stack,
36075 const __Pyx_TypeInfo* type) {
36076 stack[0].field = &ctx->root;
36077 stack[0].parent_offset = 0;
36078 ctx->root.type = type;
36079 ctx->root.name = "buffer dtype";
36080 ctx->root.offset = 0;
36081 ctx->head = stack;
36082 ctx->head->field = &ctx->root;
36083 ctx->fmt_offset = 0;
36084 ctx->head->parent_offset = 0;
36085 ctx->new_packmode = '@';
36086 ctx->enc_packmode = '@';
36087 ctx->new_count = 1;
36088 ctx->enc_count = 0;
36089 ctx->enc_type = 0;
36090 ctx->is_complex = 0;
36091 ctx->is_valid_array = 0;
36092 ctx->struct_alignment = 0;
36093 while (type->typegroup == 'S') {
36094 ++ctx->head;
36095 ctx->head->field = type->fields;
36096 ctx->head->parent_offset = 0;
36097 type = type->fields->type;
36098 }
36099}
36100static int __Pyx_BufFmt_ParseNumber(const char** ts) {
36101 int count;
36102 const char* t = *ts;
36103 if (*t < '0' || *t > '9') {
36104 return -1;
36105 } else {
36106 count = *t++ - '0';
36107 while (*t >= '0' && *t <= '9') {
36108 count *= 10;
36109 count += *t++ - '0';
36110 }
36111 }
36112 *ts = t;
36113 return count;
36114}
36115static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
36116 int number = __Pyx_BufFmt_ParseNumber(ts);
36117 if (number == -1)
36118 PyErr_Format(PyExc_ValueError,\
36119 "Does not understand character buffer dtype format string ('%c')", **ts);
36120 return number;
36121}
36122static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
36123 PyErr_Format(PyExc_ValueError,
36124 "Unexpected format string character: '%c'", ch);
36125}
36126static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
36127 switch (ch) {
36128 case '?': return "'bool'";
36129 case 'c': return "'char'";
36130 case 'b': return "'signed char'";
36131 case 'B': return "'unsigned char'";
36132 case 'h': return "'short'";
36133 case 'H': return "'unsigned short'";
36134 case 'i': return "'int'";
36135 case 'I': return "'unsigned int'";
36136 case 'l': return "'long'";
36137 case 'L': return "'unsigned long'";
36138 case 'q': return "'long long'";
36139 case 'Q': return "'unsigned long long'";
36140 case 'f': return (is_complex ? "'complex float'" : "'float'");
36141 case 'd': return (is_complex ? "'complex double'" : "'double'");
36142 case 'g': return (is_complex ? "'complex long double'" : "'long double'");
36143 case 'T': return "a struct";
36144 case 'O': return "Python object";
36145 case 'P': return "a pointer";
36146 case 's': case 'p': return "a string";
36147 case 0: return "end";
36148 default: return "unparsable format string";
36149 }
36150}
36151static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
36152 switch (ch) {
36153 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36154 case 'h': case 'H': return 2;
36155 case 'i': case 'I': case 'l': case 'L': return 4;
36156 case 'q': case 'Q': return 8;
36157 case 'f': return (is_complex ? 8 : 4);
36158 case 'd': return (is_complex ? 16 : 8);
36159 case 'g': {
36160 PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
36161 return 0;
36162 }
36163 case 'O': case 'P': return sizeof(void*);
36164 default:
36165 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36166 return 0;
36167 }
36168}
36169static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
36170 switch (ch) {
36171 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36172 case 'h': case 'H': return sizeof(short);
36173 case 'i': case 'I': return sizeof(int);
36174 case 'l': case 'L': return sizeof(long);
36175 case 'q': case 'Q': return sizeof(PY_LONG_LONG);
36176 case 'f': return sizeof(float) * (is_complex ? 2 : 1);
36177 case 'd': return sizeof(double) * (is_complex ? 2 : 1);
36178 case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
36179 case 'O': case 'P': return sizeof(void*);
36180 default: {
36181 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36182 return 0;
36183 }
36184 }
36185}
36186typedef struct { char c; short x; } __Pyx_st_short;
36187typedef struct { char c; int x; } __Pyx_st_int;
36188typedef struct { char c; long x; } __Pyx_st_long;
36189typedef struct { char c; float x; } __Pyx_st_float;
36190typedef struct { char c; double x; } __Pyx_st_double;
36191typedef struct { char c; long double x; } __Pyx_st_longdouble;
36192typedef struct { char c; void *x; } __Pyx_st_void_p;
36193typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
36194static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
36195 CYTHON_UNUSED_VAR(is_complex);
36196 switch (ch) {
36197 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36198 case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
36199 case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
36200 case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
36201 case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
36202 case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
36203 case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
36204 case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
36205 case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
36206 default:
36207 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36208 return 0;
36209 }
36210}
36211/* These are for computing the padding at the end of the struct to align
36212 on the first member of the struct. This will probably the same as above,
36213 but we don't have any guarantees.
36214 */
36215typedef struct { short x; char c; } __Pyx_pad_short;
36216typedef struct { int x; char c; } __Pyx_pad_int;
36217typedef struct { long x; char c; } __Pyx_pad_long;
36218typedef struct { float x; char c; } __Pyx_pad_float;
36219typedef struct { double x; char c; } __Pyx_pad_double;
36220typedef struct { long double x; char c; } __Pyx_pad_longdouble;
36221typedef struct { void *x; char c; } __Pyx_pad_void_p;
36222typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
36223static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
36224 CYTHON_UNUSED_VAR(is_complex);
36225 switch (ch) {
36226 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
36227 case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
36228 case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
36229 case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
36230 case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
36231 case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
36232 case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
36233 case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
36234 case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
36235 default:
36236 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36237 return 0;
36238 }
36239}
36240static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
36241 switch (ch) {
36242 case 'c':
36243 return 'H';
36244 case 'b': case 'h': case 'i':
36245 case 'l': case 'q': case 's': case 'p':
36246 return 'I';
36247 case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
36248 return 'U';
36249 case 'f': case 'd': case 'g':
36250 return (is_complex ? 'C' : 'R');
36251 case 'O':
36252 return 'O';
36253 case 'P':
36254 return 'P';
36255 default: {
36256 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36257 return 0;
36258 }
36259 }
36260}
36261static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
36262 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
36263 const char* expected;
36264 const char* quote;
36265 if (ctx->head == NULL) {
36266 expected = "end";
36267 quote = "";
36268 } else {
36269 expected = ctx->head->field->type->name;
36270 quote = "'";
36271 }
36272 PyErr_Format(PyExc_ValueError,
36273 "Buffer dtype mismatch, expected %s%s%s but got %s",
36274 quote, expected, quote,
36275 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
36276 } else {
36277 const __Pyx_StructField* field = ctx->head->field;
36278 const __Pyx_StructField* parent = (ctx->head - 1)->field;
36279 PyErr_Format(PyExc_ValueError,
36280 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
36281 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
36282 parent->type->name, field->name);
36283 }
36284}
36285static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
36286 char group;
36287 size_t size, offset, arraysize = 1;
36288 if (ctx->enc_type == 0) return 0;
36289 if (ctx->head->field->type->arraysize[0]) {
36290 int i, ndim = 0;
36291 if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
36292 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
36293 ndim = 1;
36294 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
36295 PyErr_Format(PyExc_ValueError,
36296 "Expected a dimension of size %zu, got %zu",
36297 ctx->head->field->type->arraysize[0], ctx->enc_count);
36298 return -1;
36299 }
36300 }
36301 if (!ctx->is_valid_array) {
36302 PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
36303 ctx->head->field->type->ndim, ndim);
36304 return -1;
36305 }
36306 for (i = 0; i < ctx->head->field->type->ndim; i++) {
36307 arraysize *= ctx->head->field->type->arraysize[i];
36308 }
36309 ctx->is_valid_array = 0;
36310 ctx->enc_count = 1;
36311 }
36312 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
36313 do {
36314 const __Pyx_StructField* field = ctx->head->field;
36315 const __Pyx_TypeInfo* type = field->type;
36316 if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
36317 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
36318 } else {
36319 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
36320 }
36321 if (ctx->enc_packmode == '@') {
36322 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
36323 size_t align_mod_offset;
36324 if (align_at == 0) return -1;
36325 align_mod_offset = ctx->fmt_offset % align_at;
36326 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
36327 if (ctx->struct_alignment == 0)
36328 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
36329 ctx->is_complex);
36330 }
36331 if (type->size != size || type->typegroup != group) {
36332 if (type->typegroup == 'C' && type->fields != NULL) {
36333 size_t parent_offset = ctx->head->parent_offset + field->offset;
36334 ++ctx->head;
36335 ctx->head->field = type->fields;
36336 ctx->head->parent_offset = parent_offset;
36337 continue;
36338 }
36339 if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
36340 } else {
36341 __Pyx_BufFmt_RaiseExpected(ctx);
36342 return -1;
36343 }
36344 }
36345 offset = ctx->head->parent_offset + field->offset;
36346 if (ctx->fmt_offset != offset) {
36347 PyErr_Format(PyExc_ValueError,
36348 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
36349 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
36350 return -1;
36351 }
36352 ctx->fmt_offset += size;
36353 if (arraysize)
36354 ctx->fmt_offset += (arraysize - 1) * size;
36355 --ctx->enc_count;
36356 while (1) {
36357 if (field == &ctx->root) {
36358 ctx->head = NULL;
36359 if (ctx->enc_count != 0) {
36360 __Pyx_BufFmt_RaiseExpected(ctx);
36361 return -1;
36362 }
36363 break;
36364 }
36365 ctx->head->field = ++field;
36366 if (field->type == NULL) {
36367 --ctx->head;
36368 field = ctx->head->field;
36369 continue;
36370 } else if (field->type->typegroup == 'S') {
36371 size_t parent_offset = ctx->head->parent_offset + field->offset;
36372 if (field->type->fields->type == NULL) continue;
36373 field = field->type->fields;
36374 ++ctx->head;
36375 ctx->head->field = field;
36376 ctx->head->parent_offset = parent_offset;
36377 break;
36378 } else {
36379 break;
36380 }
36381 }
36382 } while (ctx->enc_count);
36383 ctx->enc_type = 0;
36384 ctx->is_complex = 0;
36385 return 0;
36386}
36387static int
36388__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
36389{
36390 const char *ts = *tsp;
36391 int i = 0, number, ndim;
36392 ++ts;
36393 if (ctx->new_count != 1) {
36394 PyErr_SetString(PyExc_ValueError,
36395 "Cannot handle repeated arrays in format string");
36396 return -1;
36397 }
36398 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
36399 ndim = ctx->head->field->type->ndim;
36400 while (*ts && *ts != ')') {
36401 switch (*ts) {
36402 case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
36403 default: break;
36404 }
36405 number = __Pyx_BufFmt_ExpectNumber(&ts);
36406 if (number == -1) return -1;
36407 if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
36408 PyErr_Format(PyExc_ValueError,
36409 "Expected a dimension of size %zu, got %d",
36410 ctx->head->field->type->arraysize[i], number);
36411 return -1;
36412 }
36413 if (*ts != ',' && *ts != ')') {
36414 PyErr_Format(PyExc_ValueError,
36415 "Expected a comma in format string, got '%c'", *ts);
36416 return -1;
36417 }
36418 if (*ts == ',') ts++;
36419 i++;
36420 }
36421 if (i != ndim) {
36422 PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
36423 ctx->head->field->type->ndim, i);
36424 return -1;
36425 }
36426 if (!*ts) {
36427 PyErr_SetString(PyExc_ValueError,
36428 "Unexpected end of format string, expected ')'");
36429 return -1;
36430 }
36431 ctx->is_valid_array = 1;
36432 ctx->new_count = 1;
36433 *tsp = ++ts;
36434 return 0;
36435}
36436static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
36437 int got_Z = 0;
36438 while (1) {
36439 switch(*ts) {
36440 case 0:
36441 if (ctx->enc_type != 0 && ctx->head == NULL) {
36442 __Pyx_BufFmt_RaiseExpected(ctx);
36443 return NULL;
36444 }
36445 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36446 if (ctx->head != NULL) {
36447 __Pyx_BufFmt_RaiseExpected(ctx);
36448 return NULL;
36449 }
36450 return ts;
36451 case ' ':
36452 case '\r':
36453 case '\n':
36454 ++ts;
36455 break;
36456 case '<':
36457 if (!__Pyx_Is_Little_Endian()) {
36458 PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
36459 return NULL;
36460 }
36461 ctx->new_packmode = '=';
36462 ++ts;
36463 break;
36464 case '>':
36465 case '!':
36466 if (__Pyx_Is_Little_Endian()) {
36467 PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
36468 return NULL;
36469 }
36470 ctx->new_packmode = '=';
36471 ++ts;
36472 break;
36473 case '=':
36474 case '@':
36475 case '^':
36476 ctx->new_packmode = *ts++;
36477 break;
36478 case 'T':
36479 {
36480 const char* ts_after_sub;
36481 size_t i, struct_count = ctx->new_count;
36482 size_t struct_alignment = ctx->struct_alignment;
36483 ctx->new_count = 1;
36484 ++ts;
36485 if (*ts != '\x7B') {
36486 PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '\x7B' after 'T'");
36487 return NULL;
36488 }
36489 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36490 ctx->enc_type = 0;
36491 ctx->enc_count = 0;
36492 ctx->struct_alignment = 0;
36493 ++ts;
36494 ts_after_sub = ts;
36495 for (i = 0; i != struct_count; ++i) {
36496 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
36497 if (!ts_after_sub) return NULL;
36498 }
36499 ts = ts_after_sub;
36500 if (struct_alignment) ctx->struct_alignment = struct_alignment;
36501 }
36502 break;
36503 case '\x7D':
36504 {
36505 size_t alignment = ctx->struct_alignment;
36506 ++ts;
36507 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36508 ctx->enc_type = 0;
36509 if (alignment && ctx->fmt_offset % alignment) {
36510 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
36511 }
36512 }
36513 return ts;
36514 case 'x':
36515 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36516 ctx->fmt_offset += ctx->new_count;
36517 ctx->new_count = 1;
36518 ctx->enc_count = 0;
36519 ctx->enc_type = 0;
36520 ctx->enc_packmode = ctx->new_packmode;
36521 ++ts;
36522 break;
36523 case 'Z':
36524 got_Z = 1;
36525 ++ts;
36526 if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
36527 __Pyx_BufFmt_RaiseUnexpectedChar('Z');
36528 return NULL;
36529 }
36530 CYTHON_FALLTHROUGH;
36531 case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
36532 case 'l': case 'L': case 'q': case 'Q':
36533 case 'f': case 'd': case 'g':
36534 case 'O': case 'p':
36535 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
36536 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
36537 ctx->enc_count += ctx->new_count;
36538 ctx->new_count = 1;
36539 got_Z = 0;
36540 ++ts;
36541 break;
36542 }
36543 CYTHON_FALLTHROUGH;
36544 case 's':
36545 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
36546 ctx->enc_count = ctx->new_count;
36547 ctx->enc_packmode = ctx->new_packmode;
36548 ctx->enc_type = *ts;
36549 ctx->is_complex = got_Z;
36550 ++ts;
36551 ctx->new_count = 1;
36552 got_Z = 0;
36553 break;
36554 case ':':
36555 ++ts;
36556 while(*ts != ':') ++ts;
36557 ++ts;
36558 break;
36559 case '(':
36560 if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
36561 break;
36562 default:
36563 {
36564 int number = __Pyx_BufFmt_ExpectNumber(&ts);
36565 if (number == -1) return NULL;
36566 ctx->new_count = (size_t)number;
36567 }
36568 }
36569 }
36570}
36571
36572/* TypeInfoCompare (used by MemviewSliceValidateAndInit) */
36573static int
36574__pyx_typeinfo_cmp(const __Pyx_TypeInfo *a, const __Pyx_TypeInfo *b)
36575{
36576 int i;
36577 if (!a || !b)
36578 return 0;
36579 if (a == b)
36580 return 1;
36581 if (a->size != b->size || a->typegroup != b->typegroup ||
36582 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
36583 if (a->typegroup == 'H' || b->typegroup == 'H') {
36584 return a->size == b->size;
36585 } else {
36586 return 0;
36587 }
36588 }
36589 if (a->ndim) {
36590 for (i = 0; i < a->ndim; i++)
36591 if (a->arraysize[i] != b->arraysize[i])
36592 return 0;
36593 }
36594 if (a->typegroup == 'S') {
36595 if (a->flags != b->flags)
36596 return 0;
36597 if (a->fields || b->fields) {
36598 if (!(a->fields && b->fields))
36599 return 0;
36600 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
36601 const __Pyx_StructField *field_a = a->fields + i;
36602 const __Pyx_StructField *field_b = b->fields + i;
36603 if (field_a->offset != field_b->offset ||
36604 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
36605 return 0;
36606 }
36607 return !a->fields[i].type && !b->fields[i].type;
36608 }
36609 }
36610 return 1;
36611}
36612
36613/* MemviewSliceValidateAndInit (used by ObjectToMemviewSlice) */
36614static int
36615__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
36616{
36617 if (buf->shape[dim] <= 1)
36618 return 1;
36619 if (buf->strides) {
36620 if (spec & __Pyx_MEMVIEW_CONTIG) {
36621 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
36622 if (unlikely(buf->strides[dim] != sizeof(void *))) {
36623 PyErr_Format(PyExc_ValueError,
36624 "Buffer is not indirectly contiguous "
36625 "in dimension %d.", dim);
36626 goto fail;
36627 }
36628 } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
36629 PyErr_SetString(PyExc_ValueError,
36630 "Buffer and memoryview are not contiguous "
36631 "in the same dimension.");
36632 goto fail;
36633 }
36634 }
36635 if (spec & __Pyx_MEMVIEW_FOLLOW) {
36636 Py_ssize_t stride = buf->strides[dim];
36637 if (stride < 0)
36638 stride = -stride;
36639 if (unlikely(stride < buf->itemsize)) {
36640 PyErr_SetString(PyExc_ValueError,
36641 "Buffer and memoryview are not contiguous "
36642 "in the same dimension.");
36643 goto fail;
36644 }
36645 }
36646 } else {
36647 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
36648 PyErr_Format(PyExc_ValueError,
36649 "C-contiguous buffer is not contiguous in "
36650 "dimension %d", dim);
36651 goto fail;
36652 } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
36653 PyErr_Format(PyExc_ValueError,
36654 "C-contiguous buffer is not indirect in "
36655 "dimension %d", dim);
36656 goto fail;
36657 } else if (unlikely(buf->suboffsets)) {
36658 PyErr_SetString(PyExc_ValueError,
36659 "Buffer exposes suboffsets but no strides");
36660 goto fail;
36661 }
36662 }
36663 return 1;
36664fail:
36665 return 0;
36666}
36667static int
36668__pyx_check_suboffsets(Py_buffer *buf, int dim, int ndim, int spec)
36669{
36670 CYTHON_UNUSED_VAR(ndim);
36671 if (spec & __Pyx_MEMVIEW_DIRECT) {
36672 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
36673 PyErr_Format(PyExc_ValueError,
36674 "Buffer not compatible with direct access "
36675 "in dimension %d.", dim);
36676 goto fail;
36677 }
36678 }
36679 if (spec & __Pyx_MEMVIEW_PTR) {
36680 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
36681 PyErr_Format(PyExc_ValueError,
36682 "Buffer is not indirectly accessible "
36683 "in dimension %d.", dim);
36684 goto fail;
36685 }
36686 }
36687 return 1;
36688fail:
36689 return 0;
36690}
36691static int
36692__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
36693{
36694 int i;
36695 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
36696 Py_ssize_t stride = 1;
36697 for (i = 0; i < ndim; i++) {
36698 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
36699 PyErr_SetString(PyExc_ValueError,
36700 "Buffer not fortran contiguous.");
36701 goto fail;
36702 }
36703 stride = stride * buf->shape[i];
36704 }
36705 } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
36706 Py_ssize_t stride = 1;
36707 for (i = ndim - 1; i >- 1; i--) {
36708 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
36709 PyErr_SetString(PyExc_ValueError,
36710 "Buffer not C contiguous.");
36711 goto fail;
36712 }
36713 stride = stride * buf->shape[i];
36714 }
36715 }
36716 return 1;
36717fail:
36718 return 0;
36719}
36720static int __Pyx_ValidateAndInit_memviewslice(
36721 int *axes_specs,
36722 int c_or_f_flag,
36723 int buf_flags,
36724 int ndim,
36725 const __Pyx_TypeInfo *dtype,
36726 __Pyx_BufFmt_StackElem stack[],
36727 __Pyx_memviewslice *memviewslice,
36728 PyObject *original_obj)
36729{
36730 struct __pyx_memoryview_obj *memview, *new_memview;
36731 __Pyx_RefNannyDeclarations
36732 Py_buffer *buf;
36733 int i, spec = 0, retval = -1;
36734 __Pyx_BufFmt_Context ctx;
36735 int from_memoryview = __pyx_memoryview_check(original_obj);
36736 __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
36737 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
36738 original_obj)->typeinfo)) {
36739 memview = (struct __pyx_memoryview_obj *) original_obj;
36740 new_memview = NULL;
36741 } else {
36742 memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
36743 original_obj, buf_flags, 0, dtype);
36744 new_memview = memview;
36745 if (unlikely(!memview))
36746 goto fail;
36747 }
36748 buf = &memview->view;
36749 if (unlikely(buf->ndim != ndim)) {
36750 PyErr_Format(PyExc_ValueError,
36751 "Buffer has wrong number of dimensions (expected %d, got %d)",
36752 ndim, buf->ndim);
36753 goto fail;
36754 }
36755 if (new_memview) {
36756 __Pyx_BufFmt_Init(&ctx, stack, dtype);
36757 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
36758 }
36759 if (unlikely((unsigned) buf->itemsize != dtype->size)) {
36760 PyErr_Format(PyExc_ValueError,
36761 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
36762 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
36763 buf->itemsize,
36764 (buf->itemsize > 1) ? "s" : "",
36765 dtype->name,
36766 dtype->size,
36767 (dtype->size > 1) ? "s" : "");
36768 goto fail;
36769 }
36770 if (buf->len > 0) {
36771 for (i = 0; i < ndim; i++) {
36772 spec = axes_specs[i];
36773 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
36774 goto fail;
36775 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
36776 goto fail;
36777 }
36778 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
36779 goto fail;
36780 }
36781 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
36782 new_memview != NULL) == -1)) {
36783 goto fail;
36784 }
36785 retval = 0;
36786 goto no_fail;
36787fail:
36788 Py_XDECREF((PyObject*)new_memview);
36789 retval = -1;
36790no_fail:
36791 __Pyx_RefNannyFinishContext();
36792 return retval;
36793}
36794
36795/* ObjectToMemviewSlice */
36796static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
36797 __Pyx_memviewslice result = __Pyx_MEMSLICE_INIT;
36798 __Pyx_BufFmt_StackElem stack[1];
36799 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
36800 int retcode;
36801 if (obj == Py_None) {
36802 result.memview = (struct __pyx_memoryview_obj *) Py_None;
36803 return result;
36804 }
36805 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
36806 PyBUF_RECORDS_RO | writable_flag, 1,
36807 &__Pyx_TypeInfo_double, stack,
36808 &result, obj);
36809 if (unlikely(retcode == -1))
36810 goto __pyx_fail;
36811 return result;
36812__pyx_fail:
36813 result.memview = NULL;
36814 result.data = NULL;
36815 return result;
36816}
36817
36818/* ObjectToMemviewSlice */
36819static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
36820 __Pyx_memviewslice result = __Pyx_MEMSLICE_INIT;
36821 __Pyx_BufFmt_StackElem stack[1];
36822 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
36823 int retcode;
36824 if (obj == Py_None) {
36825 result.memview = (struct __pyx_memoryview_obj *) Py_None;
36826 return result;
36827 }
36828 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
36829 PyBUF_RECORDS_RO | writable_flag, 1,
36830 &__Pyx_TypeInfo_int, stack,
36831 &result, obj);
36832 if (unlikely(retcode == -1))
36833 goto __pyx_fail;
36834 return result;
36835__pyx_fail:
36836 result.memview = NULL;
36837 result.data = NULL;
36838 return result;
36839}
36840
36841/* Declarations */
36842#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
36843 #ifdef __cplusplus
36844 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
36845 return ::std::complex< float >(x, y);
36846 }
36847 #else
36848 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
36849 return x + y*(__pyx_t_float_complex)_Complex_I;
36850 }
36851 #endif
36852#else
36853 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
36854 __pyx_t_float_complex z;
36855 z.real = x;
36856 z.imag = y;
36857 return z;
36858 }
36859#endif
36860
36861/* Arithmetic */
36862#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
36863#else
36864 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36865 return (a.real == b.real) && (a.imag == b.imag);
36866 }
36867 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36868 __pyx_t_float_complex z;
36869 z.real = a.real + b.real;
36870 z.imag = a.imag + b.imag;
36871 return z;
36872 }
36873 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36874 __pyx_t_float_complex z;
36875 z.real = a.real - b.real;
36876 z.imag = a.imag - b.imag;
36877 return z;
36878 }
36879 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36880 __pyx_t_float_complex z;
36881 z.real = a.real * b.real - a.imag * b.imag;
36882 z.imag = a.real * b.imag + a.imag * b.real;
36883 return z;
36884 }
36885 #if 1
36886 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36887 if (b.imag == 0) {
36888 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
36889 } else if (fabsf(b.real) >= fabsf(b.imag)) {
36890 if (b.real == 0 && b.imag == 0) {
36891 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
36892 } else {
36893 float r = b.imag / b.real;
36894 float s = (float)(1.0) / (b.real + b.imag * r);
36895 return __pyx_t_float_complex_from_parts(
36896 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
36897 }
36898 } else {
36899 float r = b.real / b.imag;
36900 float s = (float)(1.0) / (b.imag + b.real * r);
36901 return __pyx_t_float_complex_from_parts(
36902 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
36903 }
36904 }
36905 #else
36906 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36907 if (b.imag == 0) {
36908 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
36909 } else {
36910 float denom = b.real * b.real + b.imag * b.imag;
36911 return __pyx_t_float_complex_from_parts(
36912 (a.real * b.real + a.imag * b.imag) / denom,
36913 (a.imag * b.real - a.real * b.imag) / denom);
36914 }
36915 }
36916 #endif
36917 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
36918 __pyx_t_float_complex z;
36919 z.real = -a.real;
36920 z.imag = -a.imag;
36921 return z;
36922 }
36923 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
36924 return (a.real == 0) && (a.imag == 0);
36925 }
36926 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
36927 __pyx_t_float_complex z;
36928 z.real = a.real;
36929 z.imag = -a.imag;
36930 return z;
36931 }
36932 #if 1
36933 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
36934 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
36935 return sqrtf(z.real*z.real + z.imag*z.imag);
36936 #else
36937 return hypotf(z.real, z.imag);
36938 #endif
36939 }
36940 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36941 __pyx_t_float_complex z;
36942 float r, lnr, theta, z_r, z_theta;
36943 if (b.imag == 0 && b.real == (int)b.real) {
36944 if (b.real < 0) {
36945 float denom = a.real * a.real + a.imag * a.imag;
36946 a.real = a.real / denom;
36947 a.imag = -a.imag / denom;
36948 b.real = -b.real;
36949 }
36950 switch ((int)b.real) {
36951 case 0:
36952 z.real = 1;
36953 z.imag = 0;
36954 return z;
36955 case 1:
36956 return a;
36957 case 2:
36958 return __Pyx_c_prod_float(a, a);
36959 case 3:
36960 z = __Pyx_c_prod_float(a, a);
36961 return __Pyx_c_prod_float(z, a);
36962 case 4:
36963 z = __Pyx_c_prod_float(a, a);
36964 return __Pyx_c_prod_float(z, z);
36965 }
36966 }
36967 if (a.imag == 0) {
36968 if (a.real == 0) {
36969 return a;
36970 } else if ((b.imag == 0) && (a.real >= 0)) {
36971 z.real = powf(a.real, b.real);
36972 z.imag = 0;
36973 return z;
36974 } else if (a.real > 0) {
36975 r = a.real;
36976 theta = 0;
36977 } else {
36978 r = -a.real;
36979 theta = atan2f(0.0, -1.0);
36980 }
36981 } else {
36982 r = __Pyx_c_abs_float(a);
36983 theta = atan2f(a.imag, a.real);
36984 }
36985 lnr = logf(r);
36986 z_r = expf(lnr * b.real - theta * b.imag);
36987 z_theta = theta * b.real + lnr * b.imag;
36988 z.real = z_r * cosf(z_theta);
36989 z.imag = z_r * sinf(z_theta);
36990 return z;
36991 }
36992 #endif
36993#endif
36994
36995/* Declarations */
36996#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
36997 #ifdef __cplusplus
36998 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
36999 return ::std::complex< double >(x, y);
37000 }
37001 #else
37002 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
37003 return x + y*(__pyx_t_double_complex)_Complex_I;
37004 }
37005 #endif
37006#else
37007 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
37008 __pyx_t_double_complex z;
37009 z.real = x;
37010 z.imag = y;
37011 return z;
37012 }
37013#endif
37014
37015/* Arithmetic */
37016#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37017#else
37018 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37019 return (a.real == b.real) && (a.imag == b.imag);
37020 }
37021 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37022 __pyx_t_double_complex z;
37023 z.real = a.real + b.real;
37024 z.imag = a.imag + b.imag;
37025 return z;
37026 }
37027 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37028 __pyx_t_double_complex z;
37029 z.real = a.real - b.real;
37030 z.imag = a.imag - b.imag;
37031 return z;
37032 }
37033 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37034 __pyx_t_double_complex z;
37035 z.real = a.real * b.real - a.imag * b.imag;
37036 z.imag = a.real * b.imag + a.imag * b.real;
37037 return z;
37038 }
37039 #if 1
37040 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37041 if (b.imag == 0) {
37042 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37043 } else if (fabs(b.real) >= fabs(b.imag)) {
37044 if (b.real == 0 && b.imag == 0) {
37045 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
37046 } else {
37047 double r = b.imag / b.real;
37048 double s = (double)(1.0) / (b.real + b.imag * r);
37049 return __pyx_t_double_complex_from_parts(
37050 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
37051 }
37052 } else {
37053 double r = b.real / b.imag;
37054 double s = (double)(1.0) / (b.imag + b.real * r);
37055 return __pyx_t_double_complex_from_parts(
37056 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
37057 }
37058 }
37059 #else
37060 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37061 if (b.imag == 0) {
37062 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37063 } else {
37064 double denom = b.real * b.real + b.imag * b.imag;
37065 return __pyx_t_double_complex_from_parts(
37066 (a.real * b.real + a.imag * b.imag) / denom,
37067 (a.imag * b.real - a.real * b.imag) / denom);
37068 }
37069 }
37070 #endif
37071 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
37072 __pyx_t_double_complex z;
37073 z.real = -a.real;
37074 z.imag = -a.imag;
37075 return z;
37076 }
37077 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
37078 return (a.real == 0) && (a.imag == 0);
37079 }
37080 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
37081 __pyx_t_double_complex z;
37082 z.real = a.real;
37083 z.imag = -a.imag;
37084 return z;
37085 }
37086 #if 1
37087 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
37088 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
37089 return sqrt(z.real*z.real + z.imag*z.imag);
37090 #else
37091 return hypot(z.real, z.imag);
37092 #endif
37093 }
37094 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37095 __pyx_t_double_complex z;
37096 double r, lnr, theta, z_r, z_theta;
37097 if (b.imag == 0 && b.real == (int)b.real) {
37098 if (b.real < 0) {
37099 double denom = a.real * a.real + a.imag * a.imag;
37100 a.real = a.real / denom;
37101 a.imag = -a.imag / denom;
37102 b.real = -b.real;
37103 }
37104 switch ((int)b.real) {
37105 case 0:
37106 z.real = 1;
37107 z.imag = 0;
37108 return z;
37109 case 1:
37110 return a;
37111 case 2:
37112 return __Pyx_c_prod_double(a, a);
37113 case 3:
37114 z = __Pyx_c_prod_double(a, a);
37115 return __Pyx_c_prod_double(z, a);
37116 case 4:
37117 z = __Pyx_c_prod_double(a, a);
37118 return __Pyx_c_prod_double(z, z);
37119 }
37120 }
37121 if (a.imag == 0) {
37122 if (a.real == 0) {
37123 return a;
37124 } else if ((b.imag == 0) && (a.real >= 0)) {
37125 z.real = pow(a.real, b.real);
37126 z.imag = 0;
37127 return z;
37128 } else if (a.real > 0) {
37129 r = a.real;
37130 theta = 0;
37131 } else {
37132 r = -a.real;
37133 theta = atan2(0.0, -1.0);
37134 }
37135 } else {
37136 r = __Pyx_c_abs_double(a);
37137 theta = atan2(a.imag, a.real);
37138 }
37139 lnr = log(r);
37140 z_r = exp(lnr * b.real - theta * b.imag);
37141 z_theta = theta * b.real + lnr * b.imag;
37142 z.real = z_r * cos(z_theta);
37143 z.imag = z_r * sin(z_theta);
37144 return z;
37145 }
37146 #endif
37147#endif
37148
37149/* Declarations */
37150#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37151 #ifdef __cplusplus
37152 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
37153 return ::std::complex< long double >(x, y);
37154 }
37155 #else
37156 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
37157 return x + y*(__pyx_t_long_double_complex)_Complex_I;
37158 }
37159 #endif
37160#else
37161 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
37162 __pyx_t_long_double_complex z;
37163 z.real = x;
37164 z.imag = y;
37165 return z;
37166 }
37167#endif
37168
37169/* Arithmetic */
37170#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37171#else
37172 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37173 return (a.real == b.real) && (a.imag == b.imag);
37174 }
37175 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37176 __pyx_t_long_double_complex z;
37177 z.real = a.real + b.real;
37178 z.imag = a.imag + b.imag;
37179 return z;
37180 }
37181 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37182 __pyx_t_long_double_complex z;
37183 z.real = a.real - b.real;
37184 z.imag = a.imag - b.imag;
37185 return z;
37186 }
37187 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37188 __pyx_t_long_double_complex z;
37189 z.real = a.real * b.real - a.imag * b.imag;
37190 z.imag = a.real * b.imag + a.imag * b.real;
37191 return z;
37192 }
37193 #if 1
37194 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37195 if (b.imag == 0) {
37196 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37197 } else if (fabsl(b.real) >= fabsl(b.imag)) {
37198 if (b.real == 0 && b.imag == 0) {
37199 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
37200 } else {
37201 long double r = b.imag / b.real;
37202 long double s = (long double)(1.0) / (b.real + b.imag * r);
37203 return __pyx_t_long_double_complex_from_parts(
37204 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
37205 }
37206 } else {
37207 long double r = b.real / b.imag;
37208 long double s = (long double)(1.0) / (b.imag + b.real * r);
37209 return __pyx_t_long_double_complex_from_parts(
37210 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
37211 }
37212 }
37213 #else
37214 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37215 if (b.imag == 0) {
37216 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37217 } else {
37218 long double denom = b.real * b.real + b.imag * b.imag;
37219 return __pyx_t_long_double_complex_from_parts(
37220 (a.real * b.real + a.imag * b.imag) / denom,
37221 (a.imag * b.real - a.real * b.imag) / denom);
37222 }
37223 }
37224 #endif
37225 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
37226 __pyx_t_long_double_complex z;
37227 z.real = -a.real;
37228 z.imag = -a.imag;
37229 return z;
37230 }
37231 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
37232 return (a.real == 0) && (a.imag == 0);
37233 }
37234 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
37235 __pyx_t_long_double_complex z;
37236 z.real = a.real;
37237 z.imag = -a.imag;
37238 return z;
37239 }
37240 #if 1
37241 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
37242 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
37243 return sqrtl(z.real*z.real + z.imag*z.imag);
37244 #else
37245 return hypotl(z.real, z.imag);
37246 #endif
37247 }
37248 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37249 __pyx_t_long_double_complex z;
37250 long double r, lnr, theta, z_r, z_theta;
37251 if (b.imag == 0 && b.real == (int)b.real) {
37252 if (b.real < 0) {
37253 long double denom = a.real * a.real + a.imag * a.imag;
37254 a.real = a.real / denom;
37255 a.imag = -a.imag / denom;
37256 b.real = -b.real;
37257 }
37258 switch ((int)b.real) {
37259 case 0:
37260 z.real = 1;
37261 z.imag = 0;
37262 return z;
37263 case 1:
37264 return a;
37265 case 2:
37266 return __Pyx_c_prod_long__double(a, a);
37267 case 3:
37268 z = __Pyx_c_prod_long__double(a, a);
37269 return __Pyx_c_prod_long__double(z, a);
37270 case 4:
37271 z = __Pyx_c_prod_long__double(a, a);
37272 return __Pyx_c_prod_long__double(z, z);
37273 }
37274 }
37275 if (a.imag == 0) {
37276 if (a.real == 0) {
37277 return a;
37278 } else if ((b.imag == 0) && (a.real >= 0)) {
37279 z.real = powl(a.real, b.real);
37280 z.imag = 0;
37281 return z;
37282 } else if (a.real > 0) {
37283 r = a.real;
37284 theta = 0;
37285 } else {
37286 r = -a.real;
37287 theta = atan2l(0.0, -1.0);
37288 }
37289 } else {
37290 r = __Pyx_c_abs_long__double(a);
37291 theta = atan2l(a.imag, a.real);
37292 }
37293 lnr = logl(r);
37294 z_r = expl(lnr * b.real - theta * b.imag);
37295 z_theta = theta * b.real + lnr * b.imag;
37296 z.real = z_r * cosl(z_theta);
37297 z.imag = z_r * sinl(z_theta);
37298 return z;
37299 }
37300 #endif
37301#endif
37302
37303/* MemviewSliceCopy */
37304static __Pyx_memviewslice
37305__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
37306 const char *mode, int ndim,
37307 Py_ssize_t sizeof_dtype, int contig_flag,
37308 int dtype_is_object)
37309{
37310 __Pyx_RefNannyDeclarations
37311 int i;
37312 __Pyx_memviewslice new_mvs = __Pyx_MEMSLICE_INIT;
37313 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
37314 Py_buffer *buf = &from_memview->view;
37315 PyObject *shape_tuple = NULL;
37316 struct __pyx_array_obj *array_obj = NULL;
37317 struct __pyx_memoryview_obj *memview_obj = NULL;
37318 __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
37319 for (i = 0; i < ndim; i++) {
37320 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
37321 PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
37322 "indirect dimensions (axis %d)", i);
37323 goto fail;
37324 }
37325 }
37326 shape_tuple = PyTuple_New(ndim);
37327 if (unlikely(!shape_tuple)) {
37328 goto fail;
37329 }
37330 __Pyx_GOTREF(shape_tuple);
37331 for(i = 0; i < ndim; i++) {
37332 PyObject *temp_int = PyLong_FromSsize_t(from_mvs->shape[i]);
37333 if(unlikely(!temp_int)) {
37334 goto fail;
37335 } else {
37336#if CYTHON_ASSUME_SAFE_MACROS
37337 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
37338#else
37339 if (PyTuple_SetItem(shape_tuple, i, temp_int) < 0) {
37340 goto fail;
37341 }
37342#endif
37343 }
37344 }
37345 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, mode, NULL);
37346 if (unlikely(!array_obj)) {
37347 goto fail;
37348 }
37349 __Pyx_GOTREF(array_obj);
37350 memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
37351 (PyObject *) array_obj, contig_flag,
37352 dtype_is_object,
37353 from_mvs->memview->typeinfo);
37354 if (unlikely(!memview_obj))
37355 goto fail;
37356 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
37357 goto fail;
37358 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
37359 dtype_is_object) < 0))
37360 goto fail;
37361 goto no_fail;
37362fail:
37363 __Pyx_XDECREF((PyObject *) new_mvs.memview);
37364 new_mvs.memview = NULL;
37365 new_mvs.data = NULL;
37366no_fail:
37367 __Pyx_XDECREF(shape_tuple);
37368 __Pyx_XDECREF((PyObject *) array_obj);
37369 __Pyx_RefNannyFinishContext();
37370 return new_mvs;
37371}
37372
37373/* CIntFromPy */
37374static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
37375static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(void) {
37376 const char* type_name = "int";
37377 PyErr_Format(PyExc_OverflowError,
37378 "can't convert negative value to %.200s", type_name);
37379 return (int) -1;
37380}
37381static int __Pyx_raise_overflow___Pyx_PyLong_As_int(void) {
37382 const char* type_name = "int";
37383 PyErr_Format(PyExc_OverflowError,
37384 "value too large to convert to %.200s", type_name);
37385 return (int) -1;
37386}
37387static CYTHON_INLINE int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
37388 const int is_unsigned = 1;
37389#if CYTHON_USE_PYLONG_INTERNALS
37390 {
37391 const digit* digits = __Pyx_PyLong_Digits(x);
37392 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37393 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
37394 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
37395 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37396 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
37397 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37398 }
37399 } else
37400 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
37401 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
37402 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37403 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
37404 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37405 }
37406 } else
37407 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
37408 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
37409 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37410 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
37411 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37412 }
37413 } else
37414 {}
37415 }
37416#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
37417 if (unlikely(Py_SIZE(x) < 0)) {
37418 goto raise_neg_overflow;
37419 }
37420#else
37421 {
37422 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37423 if (unlikely(result < 0))
37424 return (int) -1;
37425 if (unlikely(result == 1))
37426 goto raise_neg_overflow;
37427 }
37428#endif
37429 if ((sizeof(int) <= sizeof(unsigned long))) {
37430 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
37431 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
37432 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37433 }
37434 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
37435raise_neg_overflow:
37436 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37437raise_overflow:
37438 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37439}
37440static CYTHON_INLINE int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
37441 const int is_unsigned = 0;
37442#if CYTHON_USE_PYLONG_INTERNALS
37443 if (__Pyx_PyLong_IsNeg(x)) {
37444 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37445 const digit* digits = __Pyx_PyLong_Digits(x);
37446 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
37447 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37448 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37449 __PYX_VERIFY_RETURN_INT(int, long, ival)
37450 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
37451 return (int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37452 }
37453 } else
37454 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
37455 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37456 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37457 __PYX_VERIFY_RETURN_INT(int, long, ival)
37458 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
37459 return (int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37460 }
37461 } else
37462 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
37463 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
37464 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37465 __PYX_VERIFY_RETURN_INT(int, long, ival)
37466 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
37467 return (int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37468 }
37469 } else
37470 {}
37471 } else {
37472 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37473 const digit* digits = __Pyx_PyLong_Digits(x);
37474 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
37475 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37476 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37477 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
37478 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37479 }
37480 } else
37481 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
37482 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37483 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37484 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
37485 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37486 }
37487 } else
37488 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
37489 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
37490 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37491 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
37492 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37493 }
37494 } else
37495 {}
37496 }
37497#endif
37498 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
37499 if ((sizeof(int) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
37500 __PYX_VERIFY_RETURN_INT_EXC(int, int, PyLong_AsInt(x))
37501 } else
37502 #endif
37503 if ((sizeof(int) <= sizeof(long))) {
37504 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
37505 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
37506 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
37507 }
37508 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
37509raise_neg_overflow:
37510 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37511raise_overflow:
37512 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37513}
37514static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
37515#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37516#pragma GCC diagnostic push
37517#pragma GCC diagnostic ignored "-Wconversion"
37518#endif
37519 const int neg_one = (int) -1, const_zero = (int) 0;
37520#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37521#pragma GCC diagnostic pop
37522#endif
37523 const int is_unsigned = neg_one > const_zero;
37524 int val;
37525 int ret = -1;
37526#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
37527 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
37528 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
37529 if (unlikely(bytes_copied == -1)) {
37530 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
37531 goto raise_overflow;
37532 } else {
37533 ret = 0;
37534 }
37535#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
37536 int one = 1; int is_little = (int)*(unsigned char *)&one;
37537 unsigned char *bytes = (unsigned char *)&val;
37538 ret = _PyLong_AsByteArray((PyLongObject *)x,
37539 bytes, sizeof(val),
37540 is_little, !is_unsigned);
37541 if ((0)) goto raise_overflow;
37542#else
37543 PyObject *v;
37544 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
37545 int bits, remaining_bits, is_negative = 0;
37546 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
37547 if (likely(PyLong_CheckExact(x))) {
37548 v = __Pyx_NewRef(x);
37549 } else {
37550 v = PyNumber_Long(x);
37551 if (unlikely(!v)) return (int) -1;
37552 assert(PyLong_CheckExact(v));
37553 }
37554 {
37555 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
37556 if (unlikely(result < 0)) {
37557 Py_DECREF(v);
37558 return (int) -1;
37559 }
37560 is_negative = result == 1;
37561 }
37562 if (is_unsigned && unlikely(is_negative)) {
37563 Py_DECREF(v);
37564 PyErr_SetString(PyExc_OverflowError,
37565 "can't convert negative value to int");
37566 return (int) -1;
37567 } else if (is_negative) {
37568 stepval = PyNumber_Invert(v);
37569 Py_DECREF(v);
37570 if (unlikely(!stepval))
37571 return (int) -1;
37572 } else {
37573 stepval = v;
37574 }
37575 v = NULL;
37576 val = (int) 0;
37577 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
37578 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
37579 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
37580 PyObject *tmp, *digit;
37581 long idigit;
37582 digit = PyNumber_And(stepval, mask);
37583 if (unlikely(!digit)) goto done;
37584 idigit = PyLong_AsLong(digit);
37585 Py_DECREF(digit);
37586 if (unlikely(idigit < 0)) goto done;
37587 val |= ((int) idigit) << bits;
37588 tmp = PyNumber_Rshift(stepval, shift);
37589 if (unlikely(!tmp)) goto done;
37590 Py_DECREF(stepval); stepval = tmp;
37591 }
37592 Py_DECREF(shift); shift = NULL;
37593 Py_DECREF(mask); mask = NULL;
37594 {
37595 long idigit = PyLong_AsLong(stepval);
37596 if (unlikely(idigit < 0)) goto done;
37597 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
37598 if (unlikely(idigit >= (1L << remaining_bits)))
37599 goto raise_overflow;
37600 val |= ((int) idigit) << bits;
37601 }
37602 if (!is_unsigned) {
37603 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
37604 goto raise_overflow;
37605 if (is_negative)
37606 val = ~val;
37607 }
37608 ret = 0;
37609done:
37610 Py_XDECREF(shift);
37611 Py_XDECREF(mask);
37612 Py_XDECREF(stepval);
37613#endif
37614 if (unlikely(ret))
37615 return (int) -1;
37616 return val;
37617raise_overflow:
37618 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37619}
37620static CYTHON_INLINE int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
37621#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37622#pragma GCC diagnostic push
37623#pragma GCC diagnostic ignored "-Wconversion"
37624#endif
37625 const int neg_one = (int) -1, const_zero = (int) 0;
37626#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37627#pragma GCC diagnostic pop
37628#endif
37629 const int is_unsigned = neg_one > const_zero;
37630 if (is_unsigned) {
37631 #if CYTHON_USE_PYLONG_INTERNALS
37632 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
37633 goto raise_neg_overflow;
37634 } else if (__Pyx_PyLong_IsCompact(x)) {
37635 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
37636 } else
37637 #endif
37638 {
37639 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
37640 }
37641 } else {
37642 #if CYTHON_USE_PYLONG_INTERNALS
37643 if (__Pyx_PyLong_IsCompact(x)) {
37644 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
37645 } else
37646 #endif
37647 {
37648 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
37649 }
37650 }
37651#if CYTHON_USE_PYLONG_INTERNALS
37652raise_neg_overflow:
37653 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37654raise_overflow:
37655 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37656#endif
37657}
37658static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
37659 int val;
37660 PyObject *tmp = __Pyx_PyNumber_Long(x);
37661 if (!tmp) return (int) -1;
37662 val = __Pyx_PyLong_As_int(tmp);
37663 Py_DECREF(tmp);
37664 return val;
37665}
37666static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
37667 if (likely(PyLong_Check(x))) {
37668 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
37669 } else {
37670 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
37671 }
37672}
37673
37674/* PyObjectCallMethod1 (used by UpdateUnpickledDict) */
37675static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
37676#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
37677 PyObject *args[2] = {obj, arg};
37678 return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
37679#elif CYTHON_COMPILING_IN_LIMITED_API
37680 return PyObject_CallMethodObjArgs(obj, method_name, arg, NULL);
37681#else
37682 return PyObject_CallMethodOneArg(obj, method_name, arg);
37683#endif
37684}
37685
37686/* UpdateUnpickledDict */
37687static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
37688 PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
37689 if (unlikely(!state_dict)) {
37690 return -1;
37691 }
37692 int non_empty = PyObject_IsTrue(state_dict);
37693 if (non_empty == 0) {
37694 Py_DECREF(state_dict);
37695 return 0;
37696 } else if (unlikely(non_empty == -1)) {
37697 return -1;
37698 }
37699 PyObject *dict;
37700 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
37701 dict = PyObject_GetAttrString(obj, "__dict__");
37702 #else
37703 dict = PyObject_GenericGetDict(obj, NULL);
37704 #endif
37705 if (unlikely(!dict)) {
37706 Py_DECREF(state_dict);
37707 return -1;
37708 }
37709 int result;
37710 if (likely(PyDict_CheckExact(dict))) {
37711 result = PyDict_Update(dict, state_dict);
37712 } else {
37713 PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
37714 if (likely(obj_result)) {
37715 Py_DECREF(obj_result);
37716 result = 0;
37717 } else {
37718 result = -1;
37719 }
37720 }
37721 Py_DECREF(state_dict);
37722 Py_DECREF(dict);
37723 return result;
37724}
37725static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
37726 Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
37727 #if !CYTHON_ASSUME_SAFE_SIZE
37728 if (unlikely(state_size == -1)) return -1;
37729 #endif
37730 if (state_size <= index) {
37731 return 0;
37732 }
37733 return __Pyx__UpdateUnpickledDict(obj, state, index);
37734}
37735
37736/* CheckUnpickleChecksumError (used by CheckUnpickleChecksum) */
37737static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
37738 PyObject *pickle_module = PyImport_ImportModule("pickle");
37739 if (unlikely(!pickle_module)) return;
37740 PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
37741 Py_DECREF(pickle_module);
37742 if (unlikely(!pickle_error)) return;
37743 if (checksum2 == checksum1) {
37744 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
37745 checksum, checksum1, members);
37746 } else if (checksum3 == checksum2) {
37747 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
37748 checksum, checksum1, checksum2, members);
37749 } else {
37750 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
37751 checksum, checksum1, checksum2, checksum3, members);
37752 }
37753 Py_DECREF(pickle_error);
37754}
37755
37756/* CheckUnpickleChecksum */
37757static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
37758 int found = 0;
37759 found |= checksum1 == checksum;
37760 found |= checksum2 == checksum;
37761 found |= checksum3 == checksum;
37762 if (likely(found))
37763 return 0;
37764 __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
37765 return -1;
37766}
37767
37768/* CIntFromPy */
37769static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
37770static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(void) {
37771 const char* type_name = "long";
37772 PyErr_Format(PyExc_OverflowError,
37773 "can't convert negative value to %.200s", type_name);
37774 return (long) -1;
37775}
37776static long __Pyx_raise_overflow___Pyx_PyLong_As_long(void) {
37777 const char* type_name = "long";
37778 PyErr_Format(PyExc_OverflowError,
37779 "value too large to convert to %.200s", type_name);
37780 return (long) -1;
37781}
37782static CYTHON_INLINE long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
37783 const int is_unsigned = 1;
37784#if CYTHON_USE_PYLONG_INTERNALS
37785 {
37786 const digit* digits = __Pyx_PyLong_Digits(x);
37787 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37788 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
37789 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
37790 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37791 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
37792 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37793 }
37794 } else
37795 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37796 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
37797 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37798 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
37799 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37800 }
37801 } else
37802 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37803 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
37804 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37805 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
37806 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37807 }
37808 } else
37809 {}
37810 }
37811#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
37812 if (unlikely(Py_SIZE(x) < 0)) {
37813 goto raise_neg_overflow;
37814 }
37815#else
37816 {
37817 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37818 if (unlikely(result < 0))
37819 return (long) -1;
37820 if (unlikely(result == 1))
37821 goto raise_neg_overflow;
37822 }
37823#endif
37824 if ((sizeof(long) <= sizeof(unsigned long))) {
37825 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
37826 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
37827 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37828 }
37829 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
37830raise_neg_overflow:
37831 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
37832raise_overflow:
37833 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
37834}
37835static CYTHON_INLINE long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
37836 const int is_unsigned = 0;
37837#if CYTHON_USE_PYLONG_INTERNALS
37838 if (__Pyx_PyLong_IsNeg(x)) {
37839 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37840 const digit* digits = __Pyx_PyLong_Digits(x);
37841 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
37842 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37843 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37844 __PYX_VERIFY_RETURN_INT(long, long, ival)
37845 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
37846 return (long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37847 }
37848 } else
37849 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37850 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37851 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37852 __PYX_VERIFY_RETURN_INT(long, long, ival)
37853 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
37854 return (long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37855 }
37856 } else
37857 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37858 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
37859 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37860 __PYX_VERIFY_RETURN_INT(long, long, ival)
37861 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
37862 return (long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37863 }
37864 } else
37865 {}
37866 } else {
37867 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37868 const digit* digits = __Pyx_PyLong_Digits(x);
37869 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
37870 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37871 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37872 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
37873 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37874 }
37875 } else
37876 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37877 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37878 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37879 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
37880 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37881 }
37882 } else
37883 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37884 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
37885 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37886 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
37887 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37888 }
37889 } else
37890 {}
37891 }
37892#endif
37893 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
37894 if ((sizeof(long) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
37895 __PYX_VERIFY_RETURN_INT_EXC(long, int, PyLong_AsInt(x))
37896 } else
37897 #endif
37898 if ((sizeof(long) <= sizeof(long))) {
37899 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
37900 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
37901 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
37902 }
37903 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
37904raise_neg_overflow:
37905 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
37906raise_overflow:
37907 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
37908}
37909static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
37910#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37911#pragma GCC diagnostic push
37912#pragma GCC diagnostic ignored "-Wconversion"
37913#endif
37914 const long neg_one = (long) -1, const_zero = (long) 0;
37915#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37916#pragma GCC diagnostic pop
37917#endif
37918 const int is_unsigned = neg_one > const_zero;
37919 long val;
37920 int ret = -1;
37921#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
37922 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
37923 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
37924 if (unlikely(bytes_copied == -1)) {
37925 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
37926 goto raise_overflow;
37927 } else {
37928 ret = 0;
37929 }
37930#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
37931 int one = 1; int is_little = (int)*(unsigned char *)&one;
37932 unsigned char *bytes = (unsigned char *)&val;
37933 ret = _PyLong_AsByteArray((PyLongObject *)x,
37934 bytes, sizeof(val),
37935 is_little, !is_unsigned);
37936 if ((0)) goto raise_overflow;
37937#else
37938 PyObject *v;
37939 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
37940 int bits, remaining_bits, is_negative = 0;
37941 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
37942 if (likely(PyLong_CheckExact(x))) {
37943 v = __Pyx_NewRef(x);
37944 } else {
37945 v = PyNumber_Long(x);
37946 if (unlikely(!v)) return (long) -1;
37947 assert(PyLong_CheckExact(v));
37948 }
37949 {
37950 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
37951 if (unlikely(result < 0)) {
37952 Py_DECREF(v);
37953 return (long) -1;
37954 }
37955 is_negative = result == 1;
37956 }
37957 if (is_unsigned && unlikely(is_negative)) {
37958 Py_DECREF(v);
37959 PyErr_SetString(PyExc_OverflowError,
37960 "can't convert negative value to long");
37961 return (long) -1;
37962 } else if (is_negative) {
37963 stepval = PyNumber_Invert(v);
37964 Py_DECREF(v);
37965 if (unlikely(!stepval))
37966 return (long) -1;
37967 } else {
37968 stepval = v;
37969 }
37970 v = NULL;
37971 val = (long) 0;
37972 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
37973 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
37974 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
37975 PyObject *tmp, *digit;
37976 long idigit;
37977 digit = PyNumber_And(stepval, mask);
37978 if (unlikely(!digit)) goto done;
37979 idigit = PyLong_AsLong(digit);
37980 Py_DECREF(digit);
37981 if (unlikely(idigit < 0)) goto done;
37982 val |= ((long) idigit) << bits;
37983 tmp = PyNumber_Rshift(stepval, shift);
37984 if (unlikely(!tmp)) goto done;
37985 Py_DECREF(stepval); stepval = tmp;
37986 }
37987 Py_DECREF(shift); shift = NULL;
37988 Py_DECREF(mask); mask = NULL;
37989 {
37990 long idigit = PyLong_AsLong(stepval);
37991 if (unlikely(idigit < 0)) goto done;
37992 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
37993 if (unlikely(idigit >= (1L << remaining_bits)))
37994 goto raise_overflow;
37995 val |= ((long) idigit) << bits;
37996 }
37997 if (!is_unsigned) {
37998 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
37999 goto raise_overflow;
38000 if (is_negative)
38001 val = ~val;
38002 }
38003 ret = 0;
38004done:
38005 Py_XDECREF(shift);
38006 Py_XDECREF(mask);
38007 Py_XDECREF(stepval);
38008#endif
38009 if (unlikely(ret))
38010 return (long) -1;
38011 return val;
38012raise_overflow:
38013 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
38014}
38015static CYTHON_INLINE long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
38016#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38017#pragma GCC diagnostic push
38018#pragma GCC diagnostic ignored "-Wconversion"
38019#endif
38020 const long neg_one = (long) -1, const_zero = (long) 0;
38021#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38022#pragma GCC diagnostic pop
38023#endif
38024 const int is_unsigned = neg_one > const_zero;
38025 if (is_unsigned) {
38026 #if CYTHON_USE_PYLONG_INTERNALS
38027 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
38028 goto raise_neg_overflow;
38029 } else if (__Pyx_PyLong_IsCompact(x)) {
38030 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
38031 } else
38032 #endif
38033 {
38034 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
38035 }
38036 } else {
38037 #if CYTHON_USE_PYLONG_INTERNALS
38038 if (__Pyx_PyLong_IsCompact(x)) {
38039 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
38040 } else
38041 #endif
38042 {
38043 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
38044 }
38045 }
38046#if CYTHON_USE_PYLONG_INTERNALS
38047raise_neg_overflow:
38048 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
38049raise_overflow:
38050 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
38051#endif
38052}
38053static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
38054 long val;
38055 PyObject *tmp = __Pyx_PyNumber_Long(x);
38056 if (!tmp) return (long) -1;
38057 val = __Pyx_PyLong_As_long(tmp);
38058 Py_DECREF(tmp);
38059 return val;
38060}
38061static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
38062 if (likely(PyLong_Check(x))) {
38063 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
38064 } else {
38065 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
38066 }
38067}
38068
38069/* PyObjectVectorcallKwds (used by PyObjectVectorcallMethodKwds) */
38070#if CYTHON_VECTORCALL
38071CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
38072 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
38073#if !CYTHON_ASSUME_SAFE_MACROS
38074 if (unlikely(!key)) return -1;
38075#endif
38076 if (unlikely(!PyUnicode_Check(key))) {
38077 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
38078 return -1;
38079 }
38080 return 0;
38081}
38082#else
38083CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n) {
38084 PyObject *out = PyDict_New();
38085 if (unlikely(!out)) return NULL;
38086 for (Py_ssize_t i=0; i<n; ++i) {
38087 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
38088 Py_DECREF(out);
38089 return NULL;
38090 }
38091 }
38092 return out;
38093}
38094CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
38095 PyObject *key = kwnames[i];
38096 if (unlikely(!PyUnicode_Check(key))) {
38097 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
38098 return -1;
38099 }
38100 return 0;
38101}
38102#endif
38103
38104/* PyObjectVectorcallMethodKwds (used by CIntToPy) */
38105#if !CYTHON_VECTORCALL
38106static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
38107 PyObject *result;
38108 PyObject *obj = PyObject_GetAttr(args[0], name);
38109 if (unlikely(!obj))
38110 return NULL;
38111 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
38112 Py_DECREF(obj);
38113 return result;
38114}
38115#endif
38116
38117/* CIntToPy */
38118static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
38119#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38120#pragma GCC diagnostic push
38121#pragma GCC diagnostic ignored "-Wconversion"
38122#endif
38123 const int neg_one = (int) -1, const_zero = (int) 0;
38124#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38125#pragma GCC diagnostic pop
38126#endif
38127 const int is_unsigned = neg_one > const_zero;
38128 if (is_unsigned) {
38129 if (sizeof(int) < sizeof(long)) {
38130 return PyLong_FromLong((long) value);
38131 } else if (sizeof(int) <= sizeof(unsigned long)) {
38132 return PyLong_FromUnsignedLong((unsigned long) value);
38133#if !CYTHON_COMPILING_IN_PYPY
38134 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
38135 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
38136#endif
38137 }
38138 } else {
38139 if (sizeof(int) <= sizeof(long)) {
38140 return PyLong_FromLong((long) value);
38141 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
38142 return PyLong_FromLongLong((PY_LONG_LONG) value);
38143 }
38144 }
38145 {
38146 unsigned char *bytes = (unsigned char *)&value;
38147#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
38148 if (is_unsigned) {
38149 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
38150 } else {
38151 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
38152 }
38153#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
38154 int one = 1; int little = (int)*(unsigned char *)&one;
38155 return _PyLong_FromByteArray(bytes, sizeof(int),
38156 little, !is_unsigned);
38157#else
38158 int one = 1; int little = (int)*(unsigned char *)&one;
38159 PyObject *result = NULL, *kwds = NULL;
38160 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
38161 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
38162 if (!py_bytes) goto limited_bad;
38163 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
38164 if (!from_bytes_str) goto limited_bad;
38165 order_str = PyUnicode_FromString(little ? "little" : "big");
38166 if (!order_str) goto limited_bad;
38167 {
38168 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
38169 if (!is_unsigned) {
38170 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
38171 if (!signed_str) goto limited_bad;
38172#if CYTHON_VECTORCALL
38173 kwds = PyTuple_Pack(1, signed_str);
38174#else
38175 {
38176 PyObject *keys[] = {signed_str};
38177 PyObject *values[] = {Py_True};
38178 kwds = __Pyx_MakeKwargDict(keys, values, 1);
38179 }
38180#endif
38181 Py_DECREF(signed_str);
38182 if (unlikely(!kwds)) goto limited_bad;
38183 }
38184 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
38185 }
38186 limited_bad:
38187 Py_XDECREF(kwds);
38188 Py_XDECREF(order_str);
38189 Py_XDECREF(py_bytes);
38190 Py_XDECREF(from_bytes_str);
38191 return result;
38192#endif
38193 }
38194}
38195
38196/* CIntToPy */
38197static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
38198#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38199#pragma GCC diagnostic push
38200#pragma GCC diagnostic ignored "-Wconversion"
38201#endif
38202 const long neg_one = (long) -1, const_zero = (long) 0;
38203#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38204#pragma GCC diagnostic pop
38205#endif
38206 const int is_unsigned = neg_one > const_zero;
38207 if (is_unsigned) {
38208 if (sizeof(long) < sizeof(long)) {
38209 return PyLong_FromLong((long) value);
38210 } else if (sizeof(long) <= sizeof(unsigned long)) {
38211 return PyLong_FromUnsignedLong((unsigned long) value);
38212#if !CYTHON_COMPILING_IN_PYPY
38213 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
38214 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
38215#endif
38216 }
38217 } else {
38218 if (sizeof(long) <= sizeof(long)) {
38219 return PyLong_FromLong((long) value);
38220 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
38221 return PyLong_FromLongLong((PY_LONG_LONG) value);
38222 }
38223 }
38224 {
38225 unsigned char *bytes = (unsigned char *)&value;
38226#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
38227 if (is_unsigned) {
38228 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
38229 } else {
38230 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
38231 }
38232#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
38233 int one = 1; int little = (int)*(unsigned char *)&one;
38234 return _PyLong_FromByteArray(bytes, sizeof(long),
38235 little, !is_unsigned);
38236#else
38237 int one = 1; int little = (int)*(unsigned char *)&one;
38238 PyObject *result = NULL, *kwds = NULL;
38239 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
38240 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
38241 if (!py_bytes) goto limited_bad;
38242 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
38243 if (!from_bytes_str) goto limited_bad;
38244 order_str = PyUnicode_FromString(little ? "little" : "big");
38245 if (!order_str) goto limited_bad;
38246 {
38247 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
38248 if (!is_unsigned) {
38249 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
38250 if (!signed_str) goto limited_bad;
38251#if CYTHON_VECTORCALL
38252 kwds = PyTuple_Pack(1, signed_str);
38253#else
38254 {
38255 PyObject *keys[] = {signed_str};
38256 PyObject *values[] = {Py_True};
38257 kwds = __Pyx_MakeKwargDict(keys, values, 1);
38258 }
38259#endif
38260 Py_DECREF(signed_str);
38261 if (unlikely(!kwds)) goto limited_bad;
38262 }
38263 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
38264 }
38265 limited_bad:
38266 Py_XDECREF(kwds);
38267 Py_XDECREF(order_str);
38268 Py_XDECREF(py_bytes);
38269 Py_XDECREF(from_bytes_str);
38270 return result;
38271#endif
38272 }
38273}
38274
38275/* CIntFromPy */
38276static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x);
38277static char __Pyx_raise_neg_overflow___Pyx_PyLong_As_char(void) {
38278 const char* type_name = "char";
38279 PyErr_Format(PyExc_OverflowError,
38280 "can't convert negative value to %.200s", type_name);
38281 return (char) -1;
38282}
38283static char __Pyx_raise_overflow___Pyx_PyLong_As_char(void) {
38284 const char* type_name = "char";
38285 PyErr_Format(PyExc_OverflowError,
38286 "value too large to convert to %.200s", type_name);
38287 return (char) -1;
38288}
38289static CYTHON_INLINE char __Pyx_PyULong___Pyx_PyLong_As_char(PyObject *x) {
38290 const int is_unsigned = 1;
38291#if CYTHON_USE_PYLONG_INTERNALS
38292 {
38293 const digit* digits = __Pyx_PyLong_Digits(x);
38294 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38295 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
38296 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
38297 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38298 } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
38299 return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38300 }
38301 } else
38302 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
38303 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
38304 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38305 } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
38306 return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38307 }
38308 } else
38309 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
38310 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
38311 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38312 } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
38313 return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38314 }
38315 } else
38316 {}
38317 }
38318#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
38319 if (unlikely(Py_SIZE(x) < 0)) {
38320 goto raise_neg_overflow;
38321 }
38322#else
38323 {
38324 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
38325 if (unlikely(result < 0))
38326 return (char) -1;
38327 if (unlikely(result == 1))
38328 goto raise_neg_overflow;
38329 }
38330#endif
38331 if ((sizeof(char) <= sizeof(unsigned long))) {
38332 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
38333 } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
38334 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
38335 }
38336 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
38337raise_neg_overflow:
38338 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
38339raise_overflow:
38340 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38341}
38342static CYTHON_INLINE char __Pyx_PySLong___Pyx_PyLong_As_char(PyObject *x) {
38343 const int is_unsigned = 0;
38344#if CYTHON_USE_PYLONG_INTERNALS
38345 if (__Pyx_PyLong_IsNeg(x)) {
38346 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38347 const digit* digits = __Pyx_PyLong_Digits(x);
38348 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
38349 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
38350 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38351 __PYX_VERIFY_RETURN_INT(char, long, ival)
38352 } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
38353 return (char) (((char) -1) * (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38354 }
38355 } else
38356 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
38357 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
38358 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38359 __PYX_VERIFY_RETURN_INT(char, long, ival)
38360 } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
38361 return (char) (((char) -1) * (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38362 }
38363 } else
38364 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
38365 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
38366 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38367 __PYX_VERIFY_RETURN_INT(char, long, ival)
38368 } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
38369 return (char) (((char) -1) * (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38370 }
38371 } else
38372 {}
38373 } else {
38374 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38375 const digit* digits = __Pyx_PyLong_Digits(x);
38376 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
38377 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
38378 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38379 } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
38380 return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38381 }
38382 } else
38383 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
38384 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
38385 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38386 } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
38387 return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38388 }
38389 } else
38390 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
38391 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
38392 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38393 } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
38394 return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38395 }
38396 } else
38397 {}
38398 }
38399#endif
38400 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
38401 if ((sizeof(char) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
38402 __PYX_VERIFY_RETURN_INT_EXC(char, int, PyLong_AsInt(x))
38403 } else
38404 #endif
38405 if ((sizeof(char) <= sizeof(long))) {
38406 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
38407 } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
38408 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
38409 }
38410 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
38411raise_neg_overflow:
38412 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
38413raise_overflow:
38414 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38415}
38416static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x) {
38417#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38418#pragma GCC diagnostic push
38419#pragma GCC diagnostic ignored "-Wconversion"
38420#endif
38421 const char neg_one = (char) -1, const_zero = (char) 0;
38422#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38423#pragma GCC diagnostic pop
38424#endif
38425 const int is_unsigned = neg_one > const_zero;
38426 char val;
38427 int ret = -1;
38428#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
38429 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
38430 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
38431 if (unlikely(bytes_copied == -1)) {
38432 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
38433 goto raise_overflow;
38434 } else {
38435 ret = 0;
38436 }
38437#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
38438 int one = 1; int is_little = (int)*(unsigned char *)&one;
38439 unsigned char *bytes = (unsigned char *)&val;
38440 ret = _PyLong_AsByteArray((PyLongObject *)x,
38441 bytes, sizeof(val),
38442 is_little, !is_unsigned);
38443 if ((0)) goto raise_overflow;
38444#else
38445 PyObject *v;
38446 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
38447 int bits, remaining_bits, is_negative = 0;
38448 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
38449 if (likely(PyLong_CheckExact(x))) {
38450 v = __Pyx_NewRef(x);
38451 } else {
38452 v = PyNumber_Long(x);
38453 if (unlikely(!v)) return (char) -1;
38454 assert(PyLong_CheckExact(v));
38455 }
38456 {
38457 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
38458 if (unlikely(result < 0)) {
38459 Py_DECREF(v);
38460 return (char) -1;
38461 }
38462 is_negative = result == 1;
38463 }
38464 if (is_unsigned && unlikely(is_negative)) {
38465 Py_DECREF(v);
38466 PyErr_SetString(PyExc_OverflowError,
38467 "can't convert negative value to char");
38468 return (char) -1;
38469 } else if (is_negative) {
38470 stepval = PyNumber_Invert(v);
38471 Py_DECREF(v);
38472 if (unlikely(!stepval))
38473 return (char) -1;
38474 } else {
38475 stepval = v;
38476 }
38477 v = NULL;
38478 val = (char) 0;
38479 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
38480 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
38481 for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
38482 PyObject *tmp, *digit;
38483 long idigit;
38484 digit = PyNumber_And(stepval, mask);
38485 if (unlikely(!digit)) goto done;
38486 idigit = PyLong_AsLong(digit);
38487 Py_DECREF(digit);
38488 if (unlikely(idigit < 0)) goto done;
38489 val |= ((char) idigit) << bits;
38490 tmp = PyNumber_Rshift(stepval, shift);
38491 if (unlikely(!tmp)) goto done;
38492 Py_DECREF(stepval); stepval = tmp;
38493 }
38494 Py_DECREF(shift); shift = NULL;
38495 Py_DECREF(mask); mask = NULL;
38496 {
38497 long idigit = PyLong_AsLong(stepval);
38498 if (unlikely(idigit < 0)) goto done;
38499 remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
38500 if (unlikely(idigit >= (1L << remaining_bits)))
38501 goto raise_overflow;
38502 val |= ((char) idigit) << bits;
38503 }
38504 if (!is_unsigned) {
38505 if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
38506 goto raise_overflow;
38507 if (is_negative)
38508 val = ~val;
38509 }
38510 ret = 0;
38511done:
38512 Py_XDECREF(shift);
38513 Py_XDECREF(mask);
38514 Py_XDECREF(stepval);
38515#endif
38516 if (unlikely(ret))
38517 return (char) -1;
38518 return val;
38519raise_overflow:
38520 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38521}
38522static CYTHON_INLINE char __Pyx_PyLong___Pyx_PyLong_As_char(PyObject *x) {
38523#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38524#pragma GCC diagnostic push
38525#pragma GCC diagnostic ignored "-Wconversion"
38526#endif
38527 const char neg_one = (char) -1, const_zero = (char) 0;
38528#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38529#pragma GCC diagnostic pop
38530#endif
38531 const int is_unsigned = neg_one > const_zero;
38532 if (is_unsigned) {
38533 #if CYTHON_USE_PYLONG_INTERNALS
38534 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
38535 goto raise_neg_overflow;
38536 } else if (__Pyx_PyLong_IsCompact(x)) {
38537 __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
38538 } else
38539 #endif
38540 {
38541 return __Pyx_PyULong___Pyx_PyLong_As_char(x);
38542 }
38543 } else {
38544 #if CYTHON_USE_PYLONG_INTERNALS
38545 if (__Pyx_PyLong_IsCompact(x)) {
38546 __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
38547 } else
38548 #endif
38549 {
38550 return __Pyx_PySLong___Pyx_PyLong_As_char(x);
38551 }
38552 }
38553#if CYTHON_USE_PYLONG_INTERNALS
38554raise_neg_overflow:
38555 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
38556raise_overflow:
38557 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38558#endif
38559}
38560static char __Pyx_NonPyLong___Pyx_PyLong_As_char(PyObject *x) {
38561 char val;
38562 PyObject *tmp = __Pyx_PyNumber_Long(x);
38563 if (!tmp) return (char) -1;
38564 val = __Pyx_PyLong_As_char(tmp);
38565 Py_DECREF(tmp);
38566 return val;
38567}
38568static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *x) {
38569 if (likely(PyLong_Check(x))) {
38570 return __Pyx_PyLong___Pyx_PyLong_As_char(x);
38571 } else {
38572 return __Pyx_NonPyLong___Pyx_PyLong_As_char(x);
38573 }
38574}
38575
38576/* GetRuntimeVersion */
38577#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
38578void __Pyx_init_runtime_version(void) {
38579 if (__Pyx_cached_runtime_version == 0) {
38580 const char* rt_version = Py_GetVersion();
38581 unsigned long version = 0;
38582 unsigned long factor = 0x01000000UL;
38583 unsigned int digit = 0;
38584 int i = 0;
38585 while (factor) {
38586 while ('0' <= rt_version[i] && rt_version[i] <= '9') {
38587 digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
38588 ++i;
38589 }
38590 version += factor * digit;
38591 if (rt_version[i] != '.')
38592 break;
38593 digit = 0;
38594 factor >>= 8;
38595 ++i;
38596 }
38597 __Pyx_cached_runtime_version = version;
38598 }
38599}
38600#endif
38601static unsigned long __Pyx_get_runtime_version(void) {
38602#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
38603 return Py_Version & ~0xFFUL;
38604#else
38605 return __Pyx_cached_runtime_version;
38606#endif
38607}
38608
38609/* CheckBinaryVersion */
38610static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
38611 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
38612 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
38613 return 0;
38614 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
38615 return 1;
38616 {
38617 char message[200];
38618 PyOS_snprintf(message, sizeof(message),
38619 "compile time Python version %d.%d "
38620 "of module '%.100s' "
38621 "%s "
38622 "runtime version %d.%d",
38623 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
38624 __Pyx_MODULE_NAME,
38625 (allow_newer) ? "was newer than" : "does not match",
38626 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
38627 );
38628 return PyErr_WarnEx(NULL, message, 1);
38629 }
38630}
38631
38632/* NewCodeObj */
38633#if CYTHON_COMPILING_IN_LIMITED_API
38634 static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
38635 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
38636 PyObject *fv, PyObject *cell, PyObject* fn,
38637 PyObject *name, int fline, PyObject *lnos) {
38638 PyObject *exception_table = NULL;
38639 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
38640 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
38641 PyObject *version_info;
38642 PyObject *py_minor_version = NULL;
38643 #endif
38644 long minor_version = 0;
38645 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
38646 minor_version = 11;
38647 #else
38648 if (!(version_info = PySys_GetObject("version_info"))) goto end;
38649 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
38650 minor_version = PyLong_AsLong(py_minor_version);
38651 Py_DECREF(py_minor_version);
38652 if (minor_version == -1 && PyErr_Occurred()) goto end;
38653 #endif
38654 if (!(types_module = PyImport_ImportModule("types"))) goto end;
38655 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
38656 if (minor_version <= 10) {
38657 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
38658 c, n, v, fn, name, fline, lnos, fv, cell);
38659 } else {
38660 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
38661 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
38662 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
38663 }
38664 end:
38665 Py_XDECREF(code_type);
38666 Py_XDECREF(exception_table);
38667 Py_XDECREF(types_module);
38668 if (!result) {
38669 PyObject *exc_type, *exc_value, *exc_tb;
38670 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
38671 if (PyErr_WarnFormat(
38672 PyExc_RuntimeWarning, 1,
38673 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
38674 exc_value ? exc_value : exc_type) == 0) {
38675 result = Py_None;
38676 Py_INCREF(result);
38677 }
38678 Py_DECREF(exc_type);
38679 Py_XDECREF(exc_value);
38680 Py_XDECREF(exc_tb);
38681 }
38682 return result;
38683 }
38684#elif PY_VERSION_HEX >= 0x030B0000
38685 static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
38686 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
38687 PyObject *fv, PyObject *cell, PyObject* fn,
38688 PyObject *name, int fline, PyObject *lnos) {
38689 PyCodeObject *result;
38690 result =
38691 #if PY_VERSION_HEX >= 0x030C0000
38692 PyUnstable_Code_NewWithPosOnlyArgs
38693 #else
38694 PyCode_NewWithPosOnlyArgs
38695 #endif
38696 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
38697 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
38698 if (likely(result))
38699 result->_co_firsttraceable = 0;
38700 #endif
38701 return result;
38702 }
38703#elif !CYTHON_COMPILING_IN_PYPY
38704 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
38705 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
38706#else
38707 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
38708 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
38709#endif
38710static PyObject* __Pyx_PyCode_New(
38711 const __Pyx_PyCode_New_function_description descr,
38712 PyObject * const *varnames,
38713 PyObject *filename,
38714 PyObject *funcname,
38715 PyObject *line_table,
38716 PyObject *tuple_dedup_map
38717) {
38718 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
38719 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
38720 PyObject *varnames_tuple = PyTuple_New(var_count);
38721 if (unlikely(!varnames_tuple)) return NULL;
38722 for (Py_ssize_t i=0; i < var_count; i++) {
38723 Py_INCREF(varnames[i]);
38724 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
38725 }
38726 #if CYTHON_COMPILING_IN_LIMITED_API
38727 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
38728 if (!varnames_tuple_dedup) {
38729 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
38730 varnames_tuple_dedup = varnames_tuple;
38731 }
38732 #else
38733 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
38734 if (unlikely(!varnames_tuple_dedup)) goto done;
38735 #endif
38736 #if CYTHON_AVOID_BORROWED_REFS
38737 Py_INCREF(varnames_tuple_dedup);
38738 #endif
38739 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
38740 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
38741 #if !CYTHON_ASSUME_SAFE_SIZE
38742 if (unlikely(line_table_length == -1)) goto done;
38743 #endif
38744 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
38745 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
38746 if (unlikely(!code_bytes)) goto done;
38747 char* c_code_bytes = PyBytes_AsString(code_bytes);
38748 if (unlikely(!c_code_bytes)) goto done;
38749 memset(c_code_bytes, 0, (size_t) code_len);
38750 }
38751 code_obj = (PyObject*) __Pyx__PyCode_New(
38752 (int) descr.argcount,
38753 (int) descr.num_posonly_args,
38754 (int) descr.num_kwonly_args,
38755 (int) descr.nlocals,
38756 0,
38757 (int) descr.flags,
38758 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
38759 __pyx_mstate_global->__pyx_empty_tuple,
38760 __pyx_mstate_global->__pyx_empty_tuple,
38761 varnames_tuple_dedup,
38762 __pyx_mstate_global->__pyx_empty_tuple,
38763 __pyx_mstate_global->__pyx_empty_tuple,
38764 filename,
38765 funcname,
38766 (int) descr.first_line,
38767 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
38768 );
38769done:
38770 Py_XDECREF(code_bytes);
38771 #if CYTHON_AVOID_BORROWED_REFS
38772 Py_XDECREF(varnames_tuple_dedup);
38773 #endif
38774 Py_DECREF(varnames_tuple);
38775 return code_obj;
38776}
38777
38778/* DecompressString */
38779CYTHON_UNUSED
38780static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
38781#ifdef __Pyx_DecompressString_UNUSED
38782 CYTHON_UNUSED_VAR(s);
38783 CYTHON_UNUSED_VAR(length);
38784 CYTHON_UNUSED_VAR(algo);
38785 return NULL;
38786#else
38787 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
38788 const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
38789 PyObject *methodname = PyUnicode_FromString("decompress");
38790 if (unlikely(!methodname)) return NULL;
38791 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
38792 if (algo == 3) {
38793 PyObject *fromlist = Py_BuildValue("[O]", methodname);
38794 if (unlikely(!fromlist)) goto bad;
38795 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
38796 Py_DECREF(fromlist);
38797 } else
38798 #endif
38799 module = PyImport_ImportModule(module_name);
38800 if (unlikely(!module)) goto import_failed;
38801 decompress = PyObject_GetAttr(module, methodname);
38802 if (unlikely(!decompress)) goto import_failed;
38803 {
38804 #ifdef __cplusplus
38805 char *memview_bytes = const_cast<char*>(s);
38806 #else
38807 #if defined(__clang__)
38808 #pragma clang diagnostic push
38809 #pragma clang diagnostic ignored "-Wcast-qual"
38810 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
38811 #pragma GCC diagnostic push
38812 #pragma GCC diagnostic ignored "-Wcast-qual"
38813 #endif
38814 char *memview_bytes = (char*) s;
38815 #if defined(__clang__)
38816 #pragma clang diagnostic pop
38817 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
38818 #pragma GCC diagnostic pop
38819 #endif
38820 #endif
38821 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
38822 int memview_flags = 0x100;
38823 #else
38824 int memview_flags = PyBUF_READ;
38825 #endif
38826 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
38827 }
38828 if (unlikely(!compressed_bytes)) {
38829 Py_DECREF(decompress);
38830 goto bad;
38831 }
38832 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
38833 Py_DECREF(compressed_bytes);
38834 Py_DECREF(decompress);
38835 Py_DECREF(module);
38836 Py_DECREF(methodname);
38837 return decompressed;
38838import_failed:
38839 PyErr_Format(PyExc_ImportError,
38840 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
38841 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
38842 module_name, algo);
38843bad:
38844 Py_XDECREF(module);
38845 Py_DECREF(methodname);
38846 return NULL;
38847#endif
38848}
38849
38850/* DecompressString_LZSS */
38851#ifndef __Pyx_DecompressString_LZSS_UNUSED
38852CYTHON_UNUSED
38853static CYTHON_SMALL_CODE size_t __pyx_lzss_decompress(const uint8_t* src, uint8_t* dst, size_t dst_len) {
38854 size_t pos = 0, out_pos = 0;
38855 while (1) {
38856 uint32_t flags = src[pos++] | 0xFF00;
38857 while (flags & 0x100) {
38858 if (flags & 1) {
38859 dst[out_pos++] = src[pos++];
38860 } else {
38861 uint32_t lo = src[pos++], hi = src[pos++];
38862 uint32_t end_offset_of_last_occurrence, match_length;
38863 if (!(lo & 0x80)) {
38864 end_offset_of_last_occurrence = lo;
38865 match_length = hi;
38866 } else if (!(hi & 0x80)) {
38867 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
38868 match_length = hi & 0x1F;
38869 } else {
38870 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
38871 match_length = src[pos++];
38872 }
38873 match_length += 3;
38874 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
38875 memcpy(dst + out_pos, dst + ref_pos, match_length);
38876 out_pos += match_length;
38877 }
38878 if (out_pos >= dst_len) return pos;
38879 flags >>= 1;
38880 }
38881 }
38882}
38883#endif
38884static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length) {
38885#ifdef __Pyx_DecompressString_LZSS_UNUSED
38886 CYTHON_UNUSED_VAR(s);
38887 CYTHON_UNUSED_VAR(compressed_length);
38888 CYTHON_UNUSED_VAR(uncompressed_length);
38889 return NULL;
38890#else
38891 PyObject *result;
38892 unsigned char *result_data;
38893 size_t src_length;
38894 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
38895 if (unlikely(!result)) return NULL;
38896 result_data = __Pyx_PyBytes_AsWritableUString(result);
38897 if (unlikely(!result_data)) goto bad;
38898 src_length = __pyx_lzss_decompress((const uint8_t*) s, result_data, uncompressed_length);
38899 if (unlikely(src_length != compressed_length)) goto decompression_failed;
38900 return result;
38901decompression_failed:
38902 PyErr_SetString(PyExc_RuntimeError, "LZSS string data decompression failed");
38903bad:
38904 Py_DECREF(result);
38905 return NULL;
38906#endif
38907}
38908
38909#include <string.h>
38910static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
38911 size_t len = strlen(s);
38912 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
38913 PyErr_SetString(PyExc_OverflowError, "byte string is too long");
38914 return -1;
38915 }
38916 return (Py_ssize_t) len;
38917}
38918static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
38919 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
38920 if (unlikely(len < 0)) return NULL;
38921 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
38922}
38923static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
38924 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
38925 if (unlikely(len < 0)) return NULL;
38926 return PyByteArray_FromStringAndSize(c_str, len);
38927}
38928static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
38929 Py_ssize_t ignore;
38930 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
38931}
38932#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
38933static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
38934 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
38935#if CYTHON_COMPILING_IN_LIMITED_API
38936 {
38937 const char* result;
38938 Py_ssize_t unicode_length;
38939 CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
38940 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
38941 if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
38942 #else
38943 result = PyUnicode_AsUTF8AndSize(o, length);
38944 #endif
38945 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
38946 unicode_length = PyUnicode_GetLength(o);
38947 if (unlikely(unicode_length < 0)) return NULL;
38948 if (unlikely(unicode_length != *length)) {
38949 PyUnicode_AsASCIIString(o);
38950 return NULL;
38951 }
38952 #endif
38953 return result;
38954 }
38955#else
38956#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
38957 if (likely(PyUnicode_IS_ASCII(o))) {
38958 *length = PyUnicode_GET_LENGTH(o);
38959 return PyUnicode_AsUTF8(o);
38960 } else {
38961 PyUnicode_AsASCIIString(o);
38962 return NULL;
38963 }
38964#else
38965 return PyUnicode_AsUTF8AndSize(o, length);
38966#endif
38967#endif
38968}
38969#endif
38970static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
38971#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
38972 if (PyUnicode_Check(o)) {
38973 return __Pyx_PyUnicode_AsStringAndSize(o, length);
38974 } else
38975#endif
38976 if (PyByteArray_Check(o)) {
38977#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
38978 *length = PyByteArray_GET_SIZE(o);
38979 return PyByteArray_AS_STRING(o);
38980#else
38981 *length = PyByteArray_Size(o);
38982 if (*length == -1) return NULL;
38983 return PyByteArray_AsString(o);
38984#endif
38985 } else
38986 {
38987 char* result;
38988 int r = PyBytes_AsStringAndSize(o, &result, length);
38989 if (unlikely(r < 0)) {
38990 return NULL;
38991 } else {
38992 return result;
38993 }
38994 }
38995}
38996static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
38997 int is_true = x == Py_True;
38998 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
38999 else return PyObject_IsTrue(x);
39000}
39001static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
39002 int retval;
39003 if (unlikely(!x)) return -1;
39004 retval = __Pyx_PyObject_IsTrue(x);
39005 Py_DECREF(x);
39006 return retval;
39007}
39008static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
39009 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
39010 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
39011 if (unlikely(!result_type_name)) goto bad;
39012 #endif
39013 if (PyLong_Check(result)) {
39014 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
39015 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
39016 "The ability to return an instance of a strict subclass of int is deprecated, "
39017 "and may be removed in a future version of Python.",
39018 result_type_name)) {
39019 __Pyx_DECREF_TypeName(result_type_name);
39020 goto bad;
39021 }
39022 __Pyx_DECREF_TypeName(result_type_name);
39023 return result;
39024 }
39025 PyErr_Format(PyExc_TypeError,
39026 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
39027 result_type_name);
39028 __Pyx_DECREF_TypeName(result_type_name);
39029bad:
39030 Py_DECREF(result);
39031 return NULL;
39032}
39033static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
39034#if CYTHON_USE_TYPE_SLOTS
39035 PyNumberMethods *m;
39036#endif
39037 PyObject *res = NULL;
39038 if (likely(PyLong_Check(x)))
39039 return __Pyx_NewRef(x);
39040#if CYTHON_USE_TYPE_SLOTS
39041 m = Py_TYPE(x)->tp_as_number;
39042 if (likely(m && m->nb_int)) {
39043 res = m->nb_int(x);
39044 }
39045#else
39046 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
39047 res = PyNumber_Long(x);
39048 }
39049#endif
39050 if (likely(res)) {
39051 if (unlikely(!PyLong_CheckExact(res))) {
39052 return __Pyx_PyNumber_LongWrongResultType(res);
39053 }
39054 }
39055 else if (!PyErr_Occurred()) {
39056 PyErr_SetString(PyExc_TypeError,
39057 "an integer is required");
39058 }
39059 return res;
39060}
39061static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
39062 #if CYTHON_USE_PYLONG_INTERNALS
39063 Py_ssize_t ival;
39064 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
39065 const int is_neg = __Pyx_PyLong_IsNeg(b);
39066 const digit* digits = __Pyx_PyLong_Digits(b);
39067 if (size == 0) return 0;
39068 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
39069 if (size == 1) {
39070 ival = (Py_ssize_t) (((size_t)digits[0]));
39071 } else
39072 #endif
39073 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
39074 if (size == 2) {
39075 ival = (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
39076 } else
39077 #endif
39078 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
39079 if (size == 3) {
39080 ival = (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
39081 } else
39082 #endif
39083 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
39084 if (size == 4) {
39085 ival = (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
39086 } else
39087 #endif
39088 return PyLong_AsSsize_t(b);
39089 return is_neg ? -ival : ival;
39090 #else
39091 return PyLong_AsSsize_t(b);
39092 #endif
39093}
39094static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
39095 if (likely(PyLong_Check(b))) {
39096 return __Pyx_PyLong_AsSsize_t(b);
39097 } else {
39098 Py_ssize_t ival;
39099 PyObject *x = PyNumber_Index(b);
39100 if (unlikely(!x)) return -1;
39101 ival = __Pyx_PyLong_AsSsize_t(x);
39102 Py_DECREF(x);
39103 return ival;
39104 }
39105}
39106static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
39107 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
39108 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
39109 } else {
39110 Py_ssize_t ival;
39111 PyObject *x;
39112 x = PyNumber_Index(o);
39113 if (!x) return -1;
39114 ival = PyLong_AsLong(x);
39115 Py_DECREF(x);
39116 return ival;
39117 }
39118}
39119static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
39120 CYTHON_UNUSED_VAR(b);
39121 return __Pyx_NewRef(Py_None);
39122}
39123static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
39124 return __Pyx_NewRef(b ? Py_True: Py_False);
39125}
39126static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
39127 return PyLong_FromSize_t(ival);
39128}
39129
39130
39131/* MultiPhaseInitModuleState */
39132#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
39133#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39134#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
39135 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
39136#else
39137 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
39138#endif
39139#endif
39140#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
39141#error "Module state with PEP489 requires atomics. Currently that's one of\
39142 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
39143#endif
39144#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39145#define __Pyx_ModuleStateLookup_Lock()
39146#define __Pyx_ModuleStateLookup_Unlock()
39147#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
39148static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
39149#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
39150#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
39151#elif defined(__cplusplus) && __cplusplus >= 201103L
39152#include <mutex>
39153static std::mutex __Pyx_ModuleStateLookup_mutex;
39154#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
39155#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
39156#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
39157#include <threads.h>
39158static mtx_t __Pyx_ModuleStateLookup_mutex;
39159static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
39160static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
39161 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
39162}
39163#define __Pyx_ModuleStateLookup_Lock()\
39164 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
39165 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
39166#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
39167#elif defined(HAVE_PTHREAD_H)
39168#include <pthread.h>
39169static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
39170#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
39171#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
39172#elif defined(_WIN32)
39173#include <Windows.h> // synchapi.h on its own doesn't work
39174static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
39175#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
39176#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
39177#else
39178#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
39179 Requires C standard >= C11, or C++ standard >= C++11,\
39180 or pthreads, or the Windows 32 API, or Python >= 3.13."
39181#endif
39182typedef struct {
39183 int64_t id;
39184 PyObject *module;
39185} __Pyx_InterpreterIdAndModule;
39186typedef struct {
39187 char interpreter_id_as_index;
39188 Py_ssize_t count;
39189 Py_ssize_t allocated;
39190 __Pyx_InterpreterIdAndModule table[1];
39191} __Pyx_ModuleStateLookupData;
39192#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
39193#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39194static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
39195#endif
39196#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39197static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
39198#else
39199static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
39200#endif
39201static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
39202 __Pyx_InterpreterIdAndModule* table,
39203 Py_ssize_t count,
39204 int64_t interpreterId) {
39205 __Pyx_InterpreterIdAndModule* begin = table;
39206 __Pyx_InterpreterIdAndModule* end = begin + count;
39207 if (begin->id == interpreterId) {
39208 return begin;
39209 }
39210 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
39211 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
39212 if (halfway->id == interpreterId) {
39213 return halfway;
39214 }
39215 if (halfway->id < interpreterId) {
39216 begin = halfway;
39217 } else {
39218 end = halfway;
39219 }
39220 }
39221 for (; begin < end; ++begin) {
39222 if (begin->id >= interpreterId) return begin;
39223 }
39224 return begin;
39225}
39226static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
39227 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
39228 if (interpreter_id == -1) return NULL;
39229#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39230 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
39231 {
39232 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
39233 if (likely(data)) {
39234 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
39235 if (likely(data == new_data)) {
39236 goto read_finished;
39237 }
39238 }
39239 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
39240 __Pyx_ModuleStateLookup_Lock();
39241 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
39242 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
39243 __Pyx_ModuleStateLookup_Unlock();
39244 }
39245 read_finished:;
39246#else
39247 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
39248#endif
39249 __Pyx_InterpreterIdAndModule* found = NULL;
39250 if (unlikely(!data)) goto end;
39251 if (data->interpreter_id_as_index) {
39252 if (interpreter_id < data->count) {
39253 found = data->table+interpreter_id;
39254 }
39255 } else {
39256 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
39257 data->table, data->count, interpreter_id);
39258 }
39259 end:
39260 {
39261 PyObject *result=NULL;
39262 if (found && found->id == interpreter_id) {
39263 result = found->module;
39264 }
39265#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39266 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
39267#endif
39268 return result;
39269 }
39270}
39271#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39272static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
39273 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
39274}
39275#else
39276#define __Pyx_ModuleStateLookup_wait_until_no_readers()
39277#endif
39278static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
39279 Py_ssize_t to_allocate = (*old_data)->allocated;
39280 while (to_allocate <= interpreter_id) {
39281 if (to_allocate == 0) to_allocate = 1;
39282 else to_allocate *= 2;
39283 }
39284 __Pyx_ModuleStateLookupData *new_data = *old_data;
39285 if (to_allocate != (*old_data)->allocated) {
39286 new_data = (__Pyx_ModuleStateLookupData *)realloc(
39287 *old_data,
39288 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
39289 if (!new_data) {
39290 PyErr_NoMemory();
39291 return -1;
39292 }
39293 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
39294 new_data->table[i].id = i;
39295 new_data->table[i].module = NULL;
39296 }
39297 new_data->allocated = to_allocate;
39298 }
39299 new_data->table[interpreter_id].module = module;
39300 if (new_data->count < interpreter_id+1) {
39301 new_data->count = interpreter_id+1;
39302 }
39303 *old_data = new_data;
39304 return 0;
39305}
39306static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
39307 __Pyx_InterpreterIdAndModule *read = data->table;
39308 __Pyx_InterpreterIdAndModule *write = data->table;
39309 __Pyx_InterpreterIdAndModule *end = read + data->count;
39310 for (; read<end; ++read) {
39311 if (read->module) {
39312 write->id = read->id;
39313 write->module = read->module;
39314 ++write;
39315 }
39316 }
39317 data->count = write - data->table;
39318 for (; write<end; ++write) {
39319 write->id = 0;
39320 write->module = NULL;
39321 }
39322 data->interpreter_id_as_index = 0;
39323}
39324static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
39325 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
39326 if (interpreter_id == -1) return -1;
39327 int result = 0;
39328 __Pyx_ModuleStateLookup_Lock();
39329#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39330 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
39331 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
39332#else
39333 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
39334#endif
39335 __Pyx_ModuleStateLookupData *new_data = old_data;
39336 if (!new_data) {
39337 new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
39338 if (!new_data) {
39339 result = -1;
39340 PyErr_NoMemory();
39341 goto end;
39342 }
39343 new_data->allocated = 1;
39344 new_data->interpreter_id_as_index = 1;
39345 }
39346 __Pyx_ModuleStateLookup_wait_until_no_readers();
39347 if (new_data->interpreter_id_as_index) {
39348 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
39349 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
39350 goto end;
39351 }
39352 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
39353 }
39354 {
39355 Py_ssize_t insert_at = 0;
39356 {
39357 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
39358 new_data->table, new_data->count, interpreter_id);
39359 assert(lower_bound);
39360 insert_at = lower_bound - new_data->table;
39361 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
39362 lower_bound->module = module;
39363 goto end; // already in table, nothing more to do
39364 }
39365 }
39366 if (new_data->count+1 >= new_data->allocated) {
39367 Py_ssize_t to_allocate = (new_data->count+1)*2;
39368 new_data =
39369 (__Pyx_ModuleStateLookupData*)realloc(
39370 new_data,
39371 sizeof(__Pyx_ModuleStateLookupData) +
39372 (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
39373 if (!new_data) {
39374 result = -1;
39375 new_data = old_data;
39376 PyErr_NoMemory();
39377 goto end;
39378 }
39379 new_data->allocated = to_allocate;
39380 }
39381 ++new_data->count;
39382 int64_t last_id = interpreter_id;
39383 PyObject *last_module = module;
39384 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
39385 int64_t current_id = new_data->table[i].id;
39386 new_data->table[i].id = last_id;
39387 last_id = current_id;
39388 PyObject *current_module = new_data->table[i].module;
39389 new_data->table[i].module = last_module;
39390 last_module = current_module;
39391 }
39392 }
39393 end:
39394#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39395 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
39396#else
39397 __Pyx_ModuleStateLookup_data = new_data;
39398#endif
39399 __Pyx_ModuleStateLookup_Unlock();
39400 return result;
39401}
39402static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
39403 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
39404 if (interpreter_id == -1) return -1;
39405 __Pyx_ModuleStateLookup_Lock();
39406#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39407 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
39408 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
39409#else
39410 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
39411#endif
39412 if (data->interpreter_id_as_index) {
39413 if (interpreter_id < data->count) {
39414 data->table[interpreter_id].module = NULL;
39415 }
39416 goto done;
39417 }
39418 {
39419 __Pyx_ModuleStateLookup_wait_until_no_readers();
39420 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
39421 data->table, data->count, interpreter_id);
39422 if (!lower_bound) goto done;
39423 if (lower_bound->id != interpreter_id) goto done;
39424 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
39425 for (;lower_bound<end-1; ++lower_bound) {
39426 lower_bound->id = (lower_bound+1)->id;
39427 lower_bound->module = (lower_bound+1)->module;
39428 }
39429 }
39430 --data->count;
39431 if (data->count == 0) {
39432 free(data);
39433 data = NULL;
39434 }
39435 done:
39436#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39437 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
39438#else
39439 __Pyx_ModuleStateLookup_data = data;
39440#endif
39441 __Pyx_ModuleStateLookup_Unlock();
39442 return 0;
39443}
39444#endif
39445
39446/* #### Code section: utility_code_pragmas_end ### */
39447#ifdef _MSC_VER
39448#pragma warning( pop )
39449#endif
39450
39451
39452
39453/* #### Code section: end ### */
39454#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
Int number
Definition Headers.h:33
Double f
Definition Headers.h:64
Double s
Definition Headers.h:84
Int ns
Definition Headers.h:30
Double * z
Definition Headers.h:49
Double v
Definition Headers.h:95
void asm_NR_prepare(SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots)
Definition smoothers.c:293
void gauss_seidel_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
Definition smoothers.c:71
void asm_NR_solve(SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots)
Definition smoothers.c:324
void nl_gauss_seidel_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
Definition smoothers.c:142
void gauss_seidel_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
Definition smoothers.c:114
void basm_NR_prepare(int rowBlocks, int N, SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
Definition smoothers.c:602
void basm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots, PROTEUS_LAPACK_INTEGER **subdomain_col_pivots)
Definition smoothers.c:574
void nl_jacobi_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
Definition smoothers.c:26
void basm_NR_solve(int rowBlocks, int N, SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
Definition smoothers.c:668
void jacobi_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
Definition smoothers.c:10
void asm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots)
Definition smoothers.c:268
int basm_NR_init(int rowBlocks, SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p, PROTEUS_LAPACK_INTEGER ***subdomain_col_pivots_p)
Definition smoothers.c:391
int asm_NR_init(SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p)
Definition smoothers.c:189
void jacobi_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
Definition smoothers.c:15
#define sign(x, y)
Definition jf.h:44
#define c(i)
Definition jf.h:21
#define nnz
Definition m_comp_co2.h:19
C implementations of multilevel smoother algorithms.